diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b4cf36bc9b0..bf90ecb15339 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,86 @@ # CHANGELOG +## `v34.0.0` + +### New Packages +| Package Name | API Version | +| -----------: | :---------: | +| databox | 2019-09-01 | +| databoxedge | 2019-03-01
2019-07-01 | +| frontdoor | 2019-04-01
2019-05-01 | +| healthcareapis | 2019-09-16 | +| kusto | 2019-09-07 | +| logic | 2019-05-01 | +| maintenance | 2018-06-01-preview | +| storagedatalake | 2019-10-31 | +| subscriptions | 2019-06-01 | + +### Updated Packages + +| Package Name | API Version | +| -----------: | :---------: | +| appconfiguration | 2019-02-01-preview | +| datashare | 2018-11-01-preview | +| eventgrid | 2018-01-01 | +| eventhub | 2017-04-01 | +| kusto | 2019-05-15 | +| network | 2018-07-01
2018-08-01
2018-10-01
2018-11-01
2018-12-01
2019-02-01 | +| servicebus | 2017-04-01 | +| sql | 2015-05-01-preview
2017-03-01-preview | + +### BreakingChanges + +| Package Name | API Version | +| -----------: | :---------: | +| apimanagement | 2019-01-01 | +| compute | 2016-03-30
2017-03-30
2017-12-01
2018-04-01
2018-06-01
2018-10-01
2019-03-01
2019-07-01 | +| containerregistry | 2019-05-01-preview
2019-06-01-preview | +| containerservice | 2019-06-01
2019-08-01 | +| datafactory | 2018-06-01 | +| datamigration | 2018-03-31-preview
2018-04-19
2018-07-15-preview | +| documentdb | 2015-04-08 | +| frontdoor | 2018-08-01-preview | +| machinelearningservices | 2019-06-01 | +| managednetwork | 2019-06-01-preview | +| network | 2019-04-01 | +| reservations | 2019-04-01 | +| security | v1.0
v2.0
v3.0 | +| securityinsight | 2017-08-01-preview | +| storage | 2019-04-01 | + +### Removed Packages + +| Package Name | API Version | +| -----------: | :---------: | +| affinitygroup | management | +| anomalyfinder | v2.0 | +| auth | keyvault | +| batch | 2015-12-01.2.2
2016-02-01.3.0
2016-07-01.3.1
2017-01-01.4.0
2017-06-01.5.1
2017-09-01.6.0 | +| computervision | v1.0 | +| devspaces | 2018-06-01-preview
2019-01-01-preview | +| edgegateway | 2019-03-01 | +| frontdoor | preview/2019-04-01
preview/2019-05-01 | +| hostedservice | management | +| insights | v1 | +| location | management | +| mobileengagement | 2014-12-01 | +| mongodb | cosmos-db | +| networksecuritygroup | management | +| osimage | management | +| peering | 2019-03-01-preview | +| portal | 2015-11-01-preview | +| programmatic | luis | +| servicefabric | 2019-03-01 | +| services | 2018-03-01-preview | +| sql | management | +| storageservice | management | +| testutils | management | +| virtualmachine | management | +| virtualmachinedisk | management | +| virtualmachineimage | management | +| virtualnetwork | management | +| vmutils | management | + ## `v33.4.0` ### New Packages diff --git a/Gopkg.lock b/Gopkg.lock index 35f84af43876..e41cfb92d3a2 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,14 +2,12 @@ [[projects]] - digest = "1:c39603b93cda6859fa04dc23bffee64dc5db6f6f4fec93539ddef9d7e628a5da" + digest = "1:78df7dcd6d2a3e38b9fc52a47129135bdfaf1f89e8dd07001968455459666b11" name = "github.com/Azure/go-autorest" packages = [ "autorest", "autorest/adal", "autorest/azure", - "autorest/azure/auth", - "autorest/azure/cli", "autorest/date", "autorest/to", "autorest/validation", @@ -17,16 +15,16 @@ "tracing", ] pruneopts = "UT" - revision = "5e7a399d8bbf4953ab0c8e3167d7fd535fd74ce1" - version = "v13.0.0" + revision = "69b4126ece6b5257e2f9b0017007d2334153655f" + version = "v13.0.1" [[projects]] - digest = "1:55388fd080150b9a072912f97b1f5891eb0b50df43401f8b75fb4273d3fec9fc" + digest = "1:d37f34e1e231ee4b8657d1b6153e2696b1d7341850f648f5d78151d3bc1f677b" name = "github.com/Masterminds/semver" packages = ["."] pruneopts = "UT" - revision = "c7af12943936e8c39859482e61f0574c2fd7fc75" - version = "v1.4.2" + revision = "fe7c21038085e01e67044ec1efe3afb1eaa59f75" + version = "v3.0.1" [[projects]] digest = "1:76dc72490af7174349349838f2fe118996381b31ea83243812a97e5a0fd5ed55" @@ -36,14 +34,6 @@ revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e" version = "v3.2.0" -[[projects]] - digest = "1:cf0d2e435fd4ce45b789e93ef24b5f08e86be0e9807a16beb3694e2d8c9af965" - name = "github.com/dimchansky/utfbom" - packages = ["."] - pruneopts = "UT" - revision = "d2133a1ce379ef6fa992b0514a77146c60db9d1c" - version = "v1.1.0" - [[projects]] branch = "master" digest = "1:052aa482c25b2d76f432c16c4b404a6a3cb9cc205a95818c7680fcec501a43b7" @@ -55,20 +45,6 @@ pruneopts = "UT" revision = "ac8906116758e03208f043a52754f16f2982f26d" -[[projects]] - branch = "master" - digest = "1:78102ee4d536347316bc42e818340cc50902e45dbd7fdd524c5a1fc0cb07b588" - name = "github.com/globalsign/mgo" - packages = [ - ".", - "bson", - "internal/json", - "internal/sasl", - "internal/scram", - ] - pruneopts = "UT" - revision = "eeefdecb41b842af6dc652aaea4026e8403e62df" - [[projects]] digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be" name = "github.com/inconshreveable/mousetrap" @@ -93,14 +69,6 @@ revision = "e2ffdb16a802fe2bb95e2e35ff34f0e53aeef34f" version = "v0.1.0" -[[projects]] - digest = "1:5d231480e1c64a726869bc4142d270184c419749d34f167646baa21008eb0a79" - name = "github.com/mitchellh/go-homedir" - packages = ["."] - pruneopts = "UT" - revision = "af06845cf3004701891bf4fdb884bfe4920b3727" - version = "v1.1.0" - [[projects]] digest = "1:cf31692c14422fa27c83a05292eb5cbe0fb2775972e8f1f8446a71549bd8980b" name = "github.com/pkg/errors" @@ -134,27 +102,16 @@ version = "v0.0.5" [[projects]] - digest = "1:c1b1102241e7f645bc8e0c22ae352e8f0dc6484b6cb4d132fa9f24174e0119e2" + digest = "1:524b71991fc7d9246cc7dc2d9e0886ccb97648091c63e30eef619e6862c955dd" name = "github.com/spf13/pflag" packages = ["."] pruneopts = "UT" - revision = "298182f68c66c05229eb03ac171abe6e309ee79a" - version = "v1.0.3" - -[[projects]] - branch = "master" - digest = "1:994c4915a59f821705d08ea77b117ec7a3e6a46cc867fd194d887500dac1c3c2" - name = "golang.org/x/crypto" - packages = [ - "pkcs12", - "pkcs12/internal/rc2", - ] - pruneopts = "UT" - revision = "9756ffdc24725223350eb3266ffb92590d28f278" + revision = "2e9d26c8c37aae03e3f9d4e90b7116f5accb7cab" + version = "v1.0.5" [[projects]] branch = "master" - digest = "1:5929f6d40b149acf2a65717d276ff4a2735e5b1ce13d2c68878b4a834625228e" + digest = "1:18c7b936326b4919be6de0a20be857fdd3112036cdb3febfa9a5b332a4f54e27" name = "golang.org/x/tools" packages = [ "go/ast/astutil", @@ -171,15 +128,15 @@ "internal/semver", ] pruneopts = "UT" - revision = "42f498d34c4d67145e3950193a8f23db9328e7f3" + revision = "e461004dd03ddc1b89596568ce4119c0e8152ce6" [[projects]] branch = "v1" - digest = "1:af715ae33cc1f5695c4b2a4e4b21d008add8802a99e15bb467ac7c32edb5000d" + digest = "1:bc88591477b5fee4520dcd3d8fa8fd26f5d78b83193ed0102a7e83552652daa4" name = "gopkg.in/check.v1" packages = ["."] pruneopts = "UT" - revision = "788fd78401277ebd861206a03c884797c6ec5541" + revision = "41f04d3bba152ddec2103e299fed053415705330" [[projects]] digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96" @@ -194,9 +151,7 @@ analyzer-version = 1 input-imports = [ "github.com/Azure/go-autorest/autorest", - "github.com/Azure/go-autorest/autorest/adal", "github.com/Azure/go-autorest/autorest/azure", - "github.com/Azure/go-autorest/autorest/azure/auth", "github.com/Azure/go-autorest/autorest/date", "github.com/Azure/go-autorest/autorest/to", "github.com/Azure/go-autorest/autorest/validation", @@ -204,12 +159,10 @@ "github.com/Masterminds/semver", "github.com/dnaeon/go-vcr/cassette", "github.com/dnaeon/go-vcr/recorder", - "github.com/globalsign/mgo", "github.com/pkg/errors", "github.com/satori/go.uuid", "github.com/shopspring/decimal", "github.com/spf13/cobra", - "golang.org/x/crypto/pkcs12", "golang.org/x/tools/imports", "gopkg.in/check.v1", ] diff --git a/README.md b/README.md index 3e6836c6b859..c320ac68e5c2 100644 --- a/README.md +++ b/README.md @@ -89,12 +89,12 @@ Apply the following general steps to use packages in this repo. For more on authentication and the `Authorizer` interface see [the next section](#authentication). -1. Import a package from the [services][services_dir] directory. -2. Create and authenticate a client with a `New*Client` func, e.g. - `c := compute.NewVirtualMachinesClient(...)`. -3. Invoke API methods using the client, e.g. - `res, err := c.CreateOrUpdate(...)`. -4. Handle responses and errors. +1. Import a package from the [services][services_dir] directory. +2. Create and authenticate a client with a `New*Client` func, e.g. + `c := compute.NewVirtualMachinesClient(...)`. +3. Invoke API methods using the client, e.g. + `res, err := c.CreateOrUpdate(...)`. +4. Handle responses and errors. [services_dir]: https://github.com/Azure/azure-sdk-for-go/tree/master/services @@ -514,14 +514,25 @@ Changing one or more values will affect all subsequet API calls. The default policy is to call `autorest.DoRetryForStatusCodes()` from an API's `Sender` method. Example: ```go func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) } ``` Details on how `autorest.DoRetryforStatusCodes()` works can be found in the [documentation](https://godoc.org/github.com/Azure/go-autorest/autorest#DoRetryForStatusCodes). -It is not possible to change the invoked retry policy without writing a custom `Sender` and its calling code. +The slice of `SendDecorators` used in a `Sender` method can be customized per API call by smuggling them in the context. Here's an example. + +```go +ctx := context.Background() +autorest.WithSendDecorators(ctx, []autorest.SendDecorator{ + autorest.DoRetryForStatusCodesWithCap(client.RetryAttempts, + client.RetryDuration, time.Duration(0), + autorest.StatusCodesForRetry...)}) +client.List(ctx) +``` + +This will replace the default slice of `SendDecorators` with the provided slice. The `PollingDelay` and `PollingDuration` values are used exclusively by [WaitForCompletionRef()](https://godoc.org/github.com/Azure/go-autorest/autorest/azure#Future.WaitForCompletionRef) when blocking on an async call until it completes. diff --git a/profiles/latest/appinsights/insights/models.go b/profiles/latest/appinsights/insights/models.go deleted file mode 100644 index af0714dbc2bb..000000000000 --- a/profiles/latest/appinsights/insights/models.go +++ /dev/null @@ -1,229 +0,0 @@ -// +build go1.9 - -// Copyright 2019 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 insights - -import original "github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights" - -const ( - DefaultBaseURI = original.DefaultBaseURI -) - -type EventType = original.EventType - -const ( - All EventType = original.All - AvailabilityResults EventType = original.AvailabilityResults - BrowserTimings EventType = original.BrowserTimings - CustomEvents EventType = original.CustomEvents - CustomMetrics EventType = original.CustomMetrics - Dependencies EventType = original.Dependencies - Exceptions EventType = original.Exceptions - PageViews EventType = original.PageViews - PerformanceCounters EventType = original.PerformanceCounters - Requests EventType = original.Requests - Traces EventType = original.Traces -) - -type MetricID = original.MetricID - -const ( - AvailabilityResultsavailabilityPercentage MetricID = original.AvailabilityResultsavailabilityPercentage - AvailabilityResultsduration MetricID = original.AvailabilityResultsduration - BillingtelemetryCount MetricID = original.BillingtelemetryCount - ClientnetworkDuration MetricID = original.ClientnetworkDuration - ClientprocessingDuration MetricID = original.ClientprocessingDuration - ClientreceiveDuration MetricID = original.ClientreceiveDuration - ClientsendDuration MetricID = original.ClientsendDuration - ClienttotalDuration MetricID = original.ClienttotalDuration - CustomEventscount MetricID = original.CustomEventscount - Dependenciescount MetricID = original.Dependenciescount - Dependenciesduration MetricID = original.Dependenciesduration - Dependenciesfailed MetricID = original.Dependenciesfailed - Exceptionsbrowser MetricID = original.Exceptionsbrowser - Exceptionscount MetricID = original.Exceptionscount - Exceptionsserver MetricID = original.Exceptionsserver - PageViewscount MetricID = original.PageViewscount - PageViewsduration MetricID = original.PageViewsduration - PerformanceCountersexceptionsPerSecond MetricID = original.PerformanceCountersexceptionsPerSecond - PerformanceCountersmemoryAvailableBytes MetricID = original.PerformanceCountersmemoryAvailableBytes - PerformanceCountersprocessCPUPercentage MetricID = original.PerformanceCountersprocessCPUPercentage - PerformanceCountersprocessIOBytesPerSecond MetricID = original.PerformanceCountersprocessIOBytesPerSecond - PerformanceCountersprocessorCPUPercentage MetricID = original.PerformanceCountersprocessorCPUPercentage - PerformanceCountersprocessPrivateBytes MetricID = original.PerformanceCountersprocessPrivateBytes - PerformanceCountersrequestExecutionTime MetricID = original.PerformanceCountersrequestExecutionTime - PerformanceCountersrequestsInQueue MetricID = original.PerformanceCountersrequestsInQueue - PerformanceCountersrequestsPerSecond MetricID = original.PerformanceCountersrequestsPerSecond - Requestscount MetricID = original.Requestscount - Requestsduration MetricID = original.Requestsduration - Requestsfailed MetricID = original.Requestsfailed - Sessionscount MetricID = original.Sessionscount - Usersauthenticated MetricID = original.Usersauthenticated - Userscount MetricID = original.Userscount -) - -type MetricsAggregation = original.MetricsAggregation - -const ( - Avg MetricsAggregation = original.Avg - Count MetricsAggregation = original.Count - Max MetricsAggregation = original.Max - Min MetricsAggregation = original.Min - Sum MetricsAggregation = original.Sum - Unique MetricsAggregation = original.Unique -) - -type MetricsSegment = original.MetricsSegment - -const ( - ApplicationBuild MetricsSegment = original.ApplicationBuild - ApplicationVersion MetricsSegment = original.ApplicationVersion - AuthenticatedOrAnonymousTraffic MetricsSegment = original.AuthenticatedOrAnonymousTraffic - Browser MetricsSegment = original.Browser - BrowserVersion MetricsSegment = original.BrowserVersion - City MetricsSegment = original.City - CloudRoleName MetricsSegment = original.CloudRoleName - CloudServiceName MetricsSegment = original.CloudServiceName - Continent MetricsSegment = original.Continent - CountryOrRegion MetricsSegment = original.CountryOrRegion - DeploymentID MetricsSegment = original.DeploymentID - DeploymentUnit MetricsSegment = original.DeploymentUnit - DeviceType MetricsSegment = original.DeviceType - Environment MetricsSegment = original.Environment - HostingLocation MetricsSegment = original.HostingLocation - InstanceName MetricsSegment = original.InstanceName -) - -type Type = original.Type - -const ( - TypeAvailabilityResult Type = original.TypeAvailabilityResult - TypeBrowserTiming Type = original.TypeBrowserTiming - TypeCustomEvent Type = original.TypeCustomEvent - TypeCustomMetric Type = original.TypeCustomMetric - TypeDependency Type = original.TypeDependency - TypeEventsResultData Type = original.TypeEventsResultData - TypeException Type = original.TypeException - TypePageView Type = original.TypePageView - TypePerformanceCounter Type = original.TypePerformanceCounter - TypeRequest Type = original.TypeRequest - TypeTrace Type = original.TypeTrace -) - -type BaseClient = original.BaseClient -type BasicEventsResultData = original.BasicEventsResultData -type Column = original.Column -type ErrorDetail = original.ErrorDetail -type ErrorInfo = original.ErrorInfo -type ErrorResponse = original.ErrorResponse -type EventsAiInfo = original.EventsAiInfo -type EventsApplicationInfo = original.EventsApplicationInfo -type EventsAvailabilityResultInfo = original.EventsAvailabilityResultInfo -type EventsAvailabilityResultResult = original.EventsAvailabilityResultResult -type EventsBrowserTimingInfo = original.EventsBrowserTimingInfo -type EventsBrowserTimingResult = original.EventsBrowserTimingResult -type EventsClient = original.EventsClient -type EventsClientInfo = original.EventsClientInfo -type EventsClientPerformanceInfo = original.EventsClientPerformanceInfo -type EventsCloudInfo = original.EventsCloudInfo -type EventsCustomEventInfo = original.EventsCustomEventInfo -type EventsCustomEventResult = original.EventsCustomEventResult -type EventsCustomMetricInfo = original.EventsCustomMetricInfo -type EventsCustomMetricResult = original.EventsCustomMetricResult -type EventsDependencyInfo = original.EventsDependencyInfo -type EventsDependencyResult = original.EventsDependencyResult -type EventsExceptionDetail = original.EventsExceptionDetail -type EventsExceptionDetailsParsedStack = original.EventsExceptionDetailsParsedStack -type EventsExceptionInfo = original.EventsExceptionInfo -type EventsExceptionResult = original.EventsExceptionResult -type EventsOperationInfo = original.EventsOperationInfo -type EventsPageViewInfo = original.EventsPageViewInfo -type EventsPageViewResult = original.EventsPageViewResult -type EventsPerformanceCounterInfo = original.EventsPerformanceCounterInfo -type EventsPerformanceCounterResult = original.EventsPerformanceCounterResult -type EventsRequestInfo = original.EventsRequestInfo -type EventsRequestResult = original.EventsRequestResult -type EventsResult = original.EventsResult -type EventsResultData = original.EventsResultData -type EventsResultDataCustomDimensions = original.EventsResultDataCustomDimensions -type EventsResultDataCustomMeasurements = original.EventsResultDataCustomMeasurements -type EventsResults = original.EventsResults -type EventsSessionInfo = original.EventsSessionInfo -type EventsTraceInfo = original.EventsTraceInfo -type EventsTraceResult = original.EventsTraceResult -type EventsUserInfo = original.EventsUserInfo -type ListMetricsResultsItem = original.ListMetricsResultsItem -type MetricsClient = original.MetricsClient -type MetricsPostBodySchema = original.MetricsPostBodySchema -type MetricsPostBodySchemaParameters = original.MetricsPostBodySchemaParameters -type MetricsResult = original.MetricsResult -type MetricsResultInfo = original.MetricsResultInfo -type MetricsResultsItem = original.MetricsResultsItem -type MetricsSegmentInfo = original.MetricsSegmentInfo -type QueryBody = original.QueryBody -type QueryClient = original.QueryClient -type QueryResults = original.QueryResults -type SetObject = original.SetObject -type Table = original.Table - -func New() BaseClient { - return original.New() -} -func NewEventsClient() EventsClient { - return original.NewEventsClient() -} -func NewEventsClientWithBaseURI(baseURI string) EventsClient { - return original.NewEventsClientWithBaseURI(baseURI) -} -func NewMetricsClient() MetricsClient { - return original.NewMetricsClient() -} -func NewMetricsClientWithBaseURI(baseURI string) MetricsClient { - return original.NewMetricsClientWithBaseURI(baseURI) -} -func NewQueryClient() QueryClient { - return original.NewQueryClient() -} -func NewQueryClientWithBaseURI(baseURI string) QueryClient { - return original.NewQueryClientWithBaseURI(baseURI) -} -func NewWithBaseURI(baseURI string) BaseClient { - return original.NewWithBaseURI(baseURI) -} -func PossibleEventTypeValues() []EventType { - return original.PossibleEventTypeValues() -} -func PossibleMetricIDValues() []MetricID { - return original.PossibleMetricIDValues() -} -func PossibleMetricsAggregationValues() []MetricsAggregation { - return original.PossibleMetricsAggregationValues() -} -func PossibleMetricsSegmentValues() []MetricsSegment { - return original.PossibleMetricsSegmentValues() -} -func PossibleTypeValues() []Type { - return original.PossibleTypeValues() -} -func UserAgent() string { - return original.UserAgent() + " profiles/latest" -} -func Version() string { - return original.Version() -} diff --git a/profiles/latest/cognitiveservices/anomalyfinder/models.go b/profiles/latest/cognitiveservices/anomalyfinder/models.go deleted file mode 100644 index 13cea3644e49..000000000000 --- a/profiles/latest/cognitiveservices/anomalyfinder/models.go +++ /dev/null @@ -1,56 +0,0 @@ -// +build go1.9 - -// Copyright 2019 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 anomalyfinder - -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder" - -type Granularity = original.Granularity - -const ( - Daily Granularity = original.Daily - Hourly Granularity = original.Hourly - Minutely Granularity = original.Minutely - Monthly Granularity = original.Monthly - Weekly Granularity = original.Weekly - Yearly Granularity = original.Yearly -) - -type APIError = original.APIError -type BaseClient = original.BaseClient -type EntireDetectResponse = original.EntireDetectResponse -type LastDetectResponse = original.LastDetectResponse -type Point = original.Point -type Request = original.Request - -func New(endpoint string) BaseClient { - return original.New(endpoint) -} -func NewWithoutDefaults(endpoint string) BaseClient { - return original.NewWithoutDefaults(endpoint) -} -func PossibleGranularityValues() []Granularity { - return original.PossibleGranularityValues() -} -func UserAgent() string { - return original.UserAgent() + " profiles/latest" -} -func Version() string { - return original.Version() -} diff --git a/profiles/latest/cognitiveservices/luis/programmatic/models.go b/profiles/latest/cognitiveservices/luis/programmatic/models.go deleted file mode 100644 index 7cb4f4e642ef..000000000000 --- a/profiles/latest/cognitiveservices/luis/programmatic/models.go +++ /dev/null @@ -1,453 +0,0 @@ -// +build go1.9 - -// Copyright 2019 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 programmatic - -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/programmatic" - -type AzureRegions = original.AzureRegions - -const ( - Australiaeast AzureRegions = original.Australiaeast - Brazilsouth AzureRegions = original.Brazilsouth - Eastasia AzureRegions = original.Eastasia - Eastus AzureRegions = original.Eastus - Eastus2 AzureRegions = original.Eastus2 - Northeurope AzureRegions = original.Northeurope - Southcentralus AzureRegions = original.Southcentralus - Southeastasia AzureRegions = original.Southeastasia - Westcentralus AzureRegions = original.Westcentralus - Westeurope AzureRegions = original.Westeurope - Westus AzureRegions = original.Westus - Westus2 AzureRegions = original.Westus2 -) - -type OperationStatusType = original.OperationStatusType - -const ( - Failed OperationStatusType = original.Failed - FAILED OperationStatusType = original.FAILED - Success OperationStatusType = original.Success -) - -type ReadableType = original.ReadableType - -const ( - ReadableTypeClosedListEntityExtractor ReadableType = original.ReadableTypeClosedListEntityExtractor - ReadableTypeCompositeEntityExtractor ReadableType = original.ReadableTypeCompositeEntityExtractor - ReadableTypeEntityExtractor ReadableType = original.ReadableTypeEntityExtractor - ReadableTypeHierarchicalChildEntityExtractor ReadableType = original.ReadableTypeHierarchicalChildEntityExtractor - ReadableTypeHierarchicalEntityExtractor ReadableType = original.ReadableTypeHierarchicalEntityExtractor - ReadableTypeIntentClassifier ReadableType = original.ReadableTypeIntentClassifier - ReadableTypePatternAnyEntityExtractor ReadableType = original.ReadableTypePatternAnyEntityExtractor - ReadableTypePrebuiltEntityExtractor ReadableType = original.ReadableTypePrebuiltEntityExtractor - ReadableTypeRegexEntityExtractor ReadableType = original.ReadableTypeRegexEntityExtractor -) - -type ReadableType1 = original.ReadableType1 - -const ( - ReadableType1ClosedListEntityExtractor ReadableType1 = original.ReadableType1ClosedListEntityExtractor - ReadableType1CompositeEntityExtractor ReadableType1 = original.ReadableType1CompositeEntityExtractor - ReadableType1EntityExtractor ReadableType1 = original.ReadableType1EntityExtractor - ReadableType1HierarchicalChildEntityExtractor ReadableType1 = original.ReadableType1HierarchicalChildEntityExtractor - ReadableType1HierarchicalEntityExtractor ReadableType1 = original.ReadableType1HierarchicalEntityExtractor - ReadableType1IntentClassifier ReadableType1 = original.ReadableType1IntentClassifier - ReadableType1PatternAnyEntityExtractor ReadableType1 = original.ReadableType1PatternAnyEntityExtractor - ReadableType1PrebuiltEntityExtractor ReadableType1 = original.ReadableType1PrebuiltEntityExtractor - ReadableType1RegexEntityExtractor ReadableType1 = original.ReadableType1RegexEntityExtractor -) - -type ReadableType10 = original.ReadableType10 - -const ( - ReadableType10ClosedListEntityExtractor ReadableType10 = original.ReadableType10ClosedListEntityExtractor - ReadableType10CompositeEntityExtractor ReadableType10 = original.ReadableType10CompositeEntityExtractor - ReadableType10EntityExtractor ReadableType10 = original.ReadableType10EntityExtractor - ReadableType10HierarchicalChildEntityExtractor ReadableType10 = original.ReadableType10HierarchicalChildEntityExtractor - ReadableType10HierarchicalEntityExtractor ReadableType10 = original.ReadableType10HierarchicalEntityExtractor - ReadableType10IntentClassifier ReadableType10 = original.ReadableType10IntentClassifier - ReadableType10PatternAnyEntityExtractor ReadableType10 = original.ReadableType10PatternAnyEntityExtractor - ReadableType10PrebuiltEntityExtractor ReadableType10 = original.ReadableType10PrebuiltEntityExtractor - ReadableType10RegexEntityExtractor ReadableType10 = original.ReadableType10RegexEntityExtractor -) - -type ReadableType2 = original.ReadableType2 - -const ( - ReadableType2ClosedListEntityExtractor ReadableType2 = original.ReadableType2ClosedListEntityExtractor - ReadableType2CompositeEntityExtractor ReadableType2 = original.ReadableType2CompositeEntityExtractor - ReadableType2EntityExtractor ReadableType2 = original.ReadableType2EntityExtractor - ReadableType2HierarchicalChildEntityExtractor ReadableType2 = original.ReadableType2HierarchicalChildEntityExtractor - ReadableType2HierarchicalEntityExtractor ReadableType2 = original.ReadableType2HierarchicalEntityExtractor - ReadableType2IntentClassifier ReadableType2 = original.ReadableType2IntentClassifier - ReadableType2PatternAnyEntityExtractor ReadableType2 = original.ReadableType2PatternAnyEntityExtractor - ReadableType2PrebuiltEntityExtractor ReadableType2 = original.ReadableType2PrebuiltEntityExtractor - ReadableType2RegexEntityExtractor ReadableType2 = original.ReadableType2RegexEntityExtractor -) - -type ReadableType3 = original.ReadableType3 - -const ( - ReadableType3ClosedListEntityExtractor ReadableType3 = original.ReadableType3ClosedListEntityExtractor - ReadableType3CompositeEntityExtractor ReadableType3 = original.ReadableType3CompositeEntityExtractor - ReadableType3EntityExtractor ReadableType3 = original.ReadableType3EntityExtractor - ReadableType3HierarchicalChildEntityExtractor ReadableType3 = original.ReadableType3HierarchicalChildEntityExtractor - ReadableType3HierarchicalEntityExtractor ReadableType3 = original.ReadableType3HierarchicalEntityExtractor - ReadableType3IntentClassifier ReadableType3 = original.ReadableType3IntentClassifier - ReadableType3PatternAnyEntityExtractor ReadableType3 = original.ReadableType3PatternAnyEntityExtractor - ReadableType3PrebuiltEntityExtractor ReadableType3 = original.ReadableType3PrebuiltEntityExtractor - ReadableType3RegexEntityExtractor ReadableType3 = original.ReadableType3RegexEntityExtractor -) - -type ReadableType4 = original.ReadableType4 - -const ( - ReadableType4ClosedListEntityExtractor ReadableType4 = original.ReadableType4ClosedListEntityExtractor - ReadableType4CompositeEntityExtractor ReadableType4 = original.ReadableType4CompositeEntityExtractor - ReadableType4EntityExtractor ReadableType4 = original.ReadableType4EntityExtractor - ReadableType4HierarchicalChildEntityExtractor ReadableType4 = original.ReadableType4HierarchicalChildEntityExtractor - ReadableType4HierarchicalEntityExtractor ReadableType4 = original.ReadableType4HierarchicalEntityExtractor - ReadableType4IntentClassifier ReadableType4 = original.ReadableType4IntentClassifier - ReadableType4PatternAnyEntityExtractor ReadableType4 = original.ReadableType4PatternAnyEntityExtractor - ReadableType4PrebuiltEntityExtractor ReadableType4 = original.ReadableType4PrebuiltEntityExtractor - ReadableType4RegexEntityExtractor ReadableType4 = original.ReadableType4RegexEntityExtractor -) - -type ReadableType5 = original.ReadableType5 - -const ( - ReadableType5ClosedListEntityExtractor ReadableType5 = original.ReadableType5ClosedListEntityExtractor - ReadableType5CompositeEntityExtractor ReadableType5 = original.ReadableType5CompositeEntityExtractor - ReadableType5EntityExtractor ReadableType5 = original.ReadableType5EntityExtractor - ReadableType5HierarchicalChildEntityExtractor ReadableType5 = original.ReadableType5HierarchicalChildEntityExtractor - ReadableType5HierarchicalEntityExtractor ReadableType5 = original.ReadableType5HierarchicalEntityExtractor - ReadableType5IntentClassifier ReadableType5 = original.ReadableType5IntentClassifier - ReadableType5PatternAnyEntityExtractor ReadableType5 = original.ReadableType5PatternAnyEntityExtractor - ReadableType5PrebuiltEntityExtractor ReadableType5 = original.ReadableType5PrebuiltEntityExtractor - ReadableType5RegexEntityExtractor ReadableType5 = original.ReadableType5RegexEntityExtractor -) - -type ReadableType6 = original.ReadableType6 - -const ( - ReadableType6ClosedListEntityExtractor ReadableType6 = original.ReadableType6ClosedListEntityExtractor - ReadableType6CompositeEntityExtractor ReadableType6 = original.ReadableType6CompositeEntityExtractor - ReadableType6EntityExtractor ReadableType6 = original.ReadableType6EntityExtractor - ReadableType6HierarchicalChildEntityExtractor ReadableType6 = original.ReadableType6HierarchicalChildEntityExtractor - ReadableType6HierarchicalEntityExtractor ReadableType6 = original.ReadableType6HierarchicalEntityExtractor - ReadableType6IntentClassifier ReadableType6 = original.ReadableType6IntentClassifier - ReadableType6PatternAnyEntityExtractor ReadableType6 = original.ReadableType6PatternAnyEntityExtractor - ReadableType6PrebuiltEntityExtractor ReadableType6 = original.ReadableType6PrebuiltEntityExtractor - ReadableType6RegexEntityExtractor ReadableType6 = original.ReadableType6RegexEntityExtractor -) - -type ReadableType7 = original.ReadableType7 - -const ( - ReadableType7ClosedListEntityExtractor ReadableType7 = original.ReadableType7ClosedListEntityExtractor - ReadableType7CompositeEntityExtractor ReadableType7 = original.ReadableType7CompositeEntityExtractor - ReadableType7EntityExtractor ReadableType7 = original.ReadableType7EntityExtractor - ReadableType7HierarchicalChildEntityExtractor ReadableType7 = original.ReadableType7HierarchicalChildEntityExtractor - ReadableType7HierarchicalEntityExtractor ReadableType7 = original.ReadableType7HierarchicalEntityExtractor - ReadableType7IntentClassifier ReadableType7 = original.ReadableType7IntentClassifier - ReadableType7PatternAnyEntityExtractor ReadableType7 = original.ReadableType7PatternAnyEntityExtractor - ReadableType7PrebuiltEntityExtractor ReadableType7 = original.ReadableType7PrebuiltEntityExtractor - ReadableType7RegexEntityExtractor ReadableType7 = original.ReadableType7RegexEntityExtractor -) - -type ReadableType8 = original.ReadableType8 - -const ( - ReadableType8ClosedListEntityExtractor ReadableType8 = original.ReadableType8ClosedListEntityExtractor - ReadableType8CompositeEntityExtractor ReadableType8 = original.ReadableType8CompositeEntityExtractor - ReadableType8EntityExtractor ReadableType8 = original.ReadableType8EntityExtractor - ReadableType8HierarchicalChildEntityExtractor ReadableType8 = original.ReadableType8HierarchicalChildEntityExtractor - ReadableType8HierarchicalEntityExtractor ReadableType8 = original.ReadableType8HierarchicalEntityExtractor - ReadableType8IntentClassifier ReadableType8 = original.ReadableType8IntentClassifier - ReadableType8PatternAnyEntityExtractor ReadableType8 = original.ReadableType8PatternAnyEntityExtractor - ReadableType8PrebuiltEntityExtractor ReadableType8 = original.ReadableType8PrebuiltEntityExtractor - ReadableType8RegexEntityExtractor ReadableType8 = original.ReadableType8RegexEntityExtractor -) - -type ReadableType9 = original.ReadableType9 - -const ( - ReadableType9ClosedListEntityExtractor ReadableType9 = original.ReadableType9ClosedListEntityExtractor - ReadableType9CompositeEntityExtractor ReadableType9 = original.ReadableType9CompositeEntityExtractor - ReadableType9EntityExtractor ReadableType9 = original.ReadableType9EntityExtractor - ReadableType9HierarchicalChildEntityExtractor ReadableType9 = original.ReadableType9HierarchicalChildEntityExtractor - ReadableType9HierarchicalEntityExtractor ReadableType9 = original.ReadableType9HierarchicalEntityExtractor - ReadableType9IntentClassifier ReadableType9 = original.ReadableType9IntentClassifier - ReadableType9PatternAnyEntityExtractor ReadableType9 = original.ReadableType9PatternAnyEntityExtractor - ReadableType9PrebuiltEntityExtractor ReadableType9 = original.ReadableType9PrebuiltEntityExtractor - ReadableType9RegexEntityExtractor ReadableType9 = original.ReadableType9RegexEntityExtractor -) - -type Status = original.Status - -const ( - StatusFail Status = original.StatusFail - StatusInProgress Status = original.StatusInProgress - StatusQueued Status = original.StatusQueued - StatusSuccess Status = original.StatusSuccess - StatusUpToDate Status = original.StatusUpToDate -) - -type Status1 = original.Status1 - -const ( - Status1Fail Status1 = original.Status1Fail - Status1InProgress Status1 = original.Status1InProgress - Status1Queued Status1 = original.Status1Queued - Status1Success Status1 = original.Status1Success - Status1UpToDate Status1 = original.Status1UpToDate -) - -type TrainingStatus = original.TrainingStatus - -const ( - InProgress TrainingStatus = original.InProgress - NeedsTraining TrainingStatus = original.NeedsTraining - Trained TrainingStatus = original.Trained -) - -type ApplicationCreateObject = original.ApplicationCreateObject -type ApplicationInfoResponse = original.ApplicationInfoResponse -type ApplicationPublishObject = original.ApplicationPublishObject -type ApplicationSettingUpdateObject = original.ApplicationSettingUpdateObject -type ApplicationSettings = original.ApplicationSettings -type ApplicationUpdateObject = original.ApplicationUpdateObject -type AppsClient = original.AppsClient -type AvailableCulture = original.AvailableCulture -type AvailablePrebuiltEntityModel = original.AvailablePrebuiltEntityModel -type BaseClient = original.BaseClient -type BatchLabelExample = original.BatchLabelExample -type ChildEntity = original.ChildEntity -type ClosedList = original.ClosedList -type ClosedListEntityExtractor = original.ClosedListEntityExtractor -type ClosedListModelCreateObject = original.ClosedListModelCreateObject -type ClosedListModelPatchObject = original.ClosedListModelPatchObject -type ClosedListModelUpdateObject = original.ClosedListModelUpdateObject -type CollaboratorsArray = original.CollaboratorsArray -type CompositeChildModelCreateObject = original.CompositeChildModelCreateObject -type CompositeEntityExtractor = original.CompositeEntityExtractor -type CompositeEntityModel = original.CompositeEntityModel -type CustomPrebuiltModel = original.CustomPrebuiltModel -type EndpointInfo = original.EndpointInfo -type EnqueueTrainingResponse = original.EnqueueTrainingResponse -type EntitiesSuggestionExample = original.EntitiesSuggestionExample -type EntityExtractor = original.EntityExtractor -type EntityLabel = original.EntityLabel -type EntityLabelObject = original.EntityLabelObject -type EntityModelInfo = original.EntityModelInfo -type EntityPrediction = original.EntityPrediction -type EntityRole = original.EntityRole -type EntityRoleCreateObject = original.EntityRoleCreateObject -type EntityRoleUpdateObject = original.EntityRoleUpdateObject -type ErrorResponse = original.ErrorResponse -type ExampleLabelObject = original.ExampleLabelObject -type ExamplesClient = original.ExamplesClient -type ExplicitListItem = original.ExplicitListItem -type ExplicitListItemCreateObject = original.ExplicitListItemCreateObject -type ExplicitListItemUpdateObject = original.ExplicitListItemUpdateObject -type FeatureInfoObject = original.FeatureInfoObject -type FeaturesClient = original.FeaturesClient -type FeaturesResponseObject = original.FeaturesResponseObject -type HierarchicalChildEntity = original.HierarchicalChildEntity -type HierarchicalChildModelCreateObject = original.HierarchicalChildModelCreateObject -type HierarchicalChildModelUpdateObject = original.HierarchicalChildModelUpdateObject -type HierarchicalEntityExtractor = original.HierarchicalEntityExtractor -type HierarchicalEntityModel = original.HierarchicalEntityModel -type HierarchicalModel = original.HierarchicalModel -type Int32 = original.Int32 -type IntentClassifier = original.IntentClassifier -type IntentPrediction = original.IntentPrediction -type IntentsSuggestionExample = original.IntentsSuggestionExample -type JSONEntity = original.JSONEntity -type JSONModelFeature = original.JSONModelFeature -type JSONRegexFeature = original.JSONRegexFeature -type JSONUtterance = original.JSONUtterance -type LabelExampleResponse = original.LabelExampleResponse -type LabeledUtterance = original.LabeledUtterance -type ListApplicationInfoResponse = original.ListApplicationInfoResponse -type ListAvailableCulture = original.ListAvailableCulture -type ListAvailablePrebuiltEntityModel = original.ListAvailablePrebuiltEntityModel -type ListBatchLabelExample = original.ListBatchLabelExample -type ListClosedListEntityExtractor = original.ListClosedListEntityExtractor -type ListCompositeEntityExtractor = original.ListCompositeEntityExtractor -type ListCustomPrebuiltModel = original.ListCustomPrebuiltModel -type ListEntitiesSuggestionExample = original.ListEntitiesSuggestionExample -type ListEntityExtractor = original.ListEntityExtractor -type ListEntityRole = original.ListEntityRole -type ListExplicitListItem = original.ListExplicitListItem -type ListHierarchicalEntityExtractor = original.ListHierarchicalEntityExtractor -type ListIntentClassifier = original.ListIntentClassifier -type ListIntentsSuggestionExample = original.ListIntentsSuggestionExample -type ListLabeledUtterance = original.ListLabeledUtterance -type ListModelInfoResponse = original.ListModelInfoResponse -type ListModelTrainingInfo = original.ListModelTrainingInfo -type ListPatternAnyEntityExtractor = original.ListPatternAnyEntityExtractor -type ListPatternRuleInfo = original.ListPatternRuleInfo -type ListPhraseListFeatureInfo = original.ListPhraseListFeatureInfo -type ListPrebuiltDomain = original.ListPrebuiltDomain -type ListPrebuiltEntityExtractor = original.ListPrebuiltEntityExtractor -type ListRegexEntityExtractor = original.ListRegexEntityExtractor -type ListString = original.ListString -type ListUUID = original.ListUUID -type ListVersionInfo = original.ListVersionInfo -type LuisApp = original.LuisApp -type ModelClient = original.ModelClient -type ModelCreateObject = original.ModelCreateObject -type ModelInfo = original.ModelInfo -type ModelInfoResponse = original.ModelInfoResponse -type ModelTrainingDetails = original.ModelTrainingDetails -type ModelTrainingInfo = original.ModelTrainingInfo -type ModelUpdateObject = original.ModelUpdateObject -type OperationError = original.OperationError -type OperationStatus = original.OperationStatus -type PatternAny = original.PatternAny -type PatternAnyEntityExtractor = original.PatternAnyEntityExtractor -type PatternAnyModelCreateObject = original.PatternAnyModelCreateObject -type PatternAnyModelUpdateObject = original.PatternAnyModelUpdateObject -type PatternClient = original.PatternClient -type PatternCreateObject = original.PatternCreateObject -type PatternFeatureInfo = original.PatternFeatureInfo -type PatternRule = original.PatternRule -type PatternRuleCreateObject = original.PatternRuleCreateObject -type PatternRuleInfo = original.PatternRuleInfo -type PatternRuleUpdateObject = original.PatternRuleUpdateObject -type PatternUpdateObject = original.PatternUpdateObject -type PermissionsClient = original.PermissionsClient -type PersonalAssistantsResponse = original.PersonalAssistantsResponse -type PhraseListFeatureInfo = original.PhraseListFeatureInfo -type PhraselistCreateObject = original.PhraselistCreateObject -type PhraselistUpdateObject = original.PhraselistUpdateObject -type PrebuiltDomain = original.PrebuiltDomain -type PrebuiltDomainCreateBaseObject = original.PrebuiltDomainCreateBaseObject -type PrebuiltDomainCreateObject = original.PrebuiltDomainCreateObject -type PrebuiltDomainItem = original.PrebuiltDomainItem -type PrebuiltDomainModelCreateObject = original.PrebuiltDomainModelCreateObject -type PrebuiltDomainObject = original.PrebuiltDomainObject -type PrebuiltEntity = original.PrebuiltEntity -type PrebuiltEntityExtractor = original.PrebuiltEntityExtractor -type ProductionOrStagingEndpointInfo = original.ProductionOrStagingEndpointInfo -type ReadCloser = original.ReadCloser -type RegexEntity = original.RegexEntity -type RegexEntityExtractor = original.RegexEntityExtractor -type RegexModelCreateObject = original.RegexModelCreateObject -type RegexModelUpdateObject = original.RegexModelUpdateObject -type SetString = original.SetString -type String = original.String -type SubClosedList = original.SubClosedList -type SubClosedListResponse = original.SubClosedListResponse -type TaskUpdateObject = original.TaskUpdateObject -type TrainClient = original.TrainClient -type UUID = original.UUID -type UserAccessList = original.UserAccessList -type UserCollaborator = original.UserCollaborator -type VersionInfo = original.VersionInfo -type VersionsClient = original.VersionsClient -type WordListBaseUpdateObject = original.WordListBaseUpdateObject -type WordListObject = original.WordListObject - -func New(azureRegion AzureRegions) BaseClient { - return original.New(azureRegion) -} -func NewAppsClient(azureRegion AzureRegions) AppsClient { - return original.NewAppsClient(azureRegion) -} -func NewExamplesClient(azureRegion AzureRegions) ExamplesClient { - return original.NewExamplesClient(azureRegion) -} -func NewFeaturesClient(azureRegion AzureRegions) FeaturesClient { - return original.NewFeaturesClient(azureRegion) -} -func NewModelClient(azureRegion AzureRegions) ModelClient { - return original.NewModelClient(azureRegion) -} -func NewPatternClient(azureRegion AzureRegions) PatternClient { - return original.NewPatternClient(azureRegion) -} -func NewPermissionsClient(azureRegion AzureRegions) PermissionsClient { - return original.NewPermissionsClient(azureRegion) -} -func NewTrainClient(azureRegion AzureRegions) TrainClient { - return original.NewTrainClient(azureRegion) -} -func NewVersionsClient(azureRegion AzureRegions) VersionsClient { - return original.NewVersionsClient(azureRegion) -} -func NewWithoutDefaults(azureRegion AzureRegions) BaseClient { - return original.NewWithoutDefaults(azureRegion) -} -func PossibleAzureRegionsValues() []AzureRegions { - return original.PossibleAzureRegionsValues() -} -func PossibleOperationStatusTypeValues() []OperationStatusType { - return original.PossibleOperationStatusTypeValues() -} -func PossibleReadableType10Values() []ReadableType10 { - return original.PossibleReadableType10Values() -} -func PossibleReadableType1Values() []ReadableType1 { - return original.PossibleReadableType1Values() -} -func PossibleReadableType2Values() []ReadableType2 { - return original.PossibleReadableType2Values() -} -func PossibleReadableType3Values() []ReadableType3 { - return original.PossibleReadableType3Values() -} -func PossibleReadableType4Values() []ReadableType4 { - return original.PossibleReadableType4Values() -} -func PossibleReadableType5Values() []ReadableType5 { - return original.PossibleReadableType5Values() -} -func PossibleReadableType6Values() []ReadableType6 { - return original.PossibleReadableType6Values() -} -func PossibleReadableType7Values() []ReadableType7 { - return original.PossibleReadableType7Values() -} -func PossibleReadableType8Values() []ReadableType8 { - return original.PossibleReadableType8Values() -} -func PossibleReadableType9Values() []ReadableType9 { - return original.PossibleReadableType9Values() -} -func PossibleReadableTypeValues() []ReadableType { - return original.PossibleReadableTypeValues() -} -func PossibleStatus1Values() []Status1 { - return original.PossibleStatus1Values() -} -func PossibleStatusValues() []Status { - return original.PossibleStatusValues() -} -func PossibleTrainingStatusValues() []TrainingStatus { - return original.PossibleTrainingStatusValues() -} -func UserAgent() string { - return original.UserAgent() + " profiles/latest" -} -func Version() string { - return original.Version() -} diff --git a/profiles/latest/compute/mgmt/compute/models.go b/profiles/latest/compute/mgmt/compute/models.go index 8bafe939394d..c0d6c7644bad 100644 --- a/profiles/latest/compute/mgmt/compute/models.go +++ b/profiles/latest/compute/mgmt/compute/models.go @@ -460,6 +460,14 @@ const ( Regular VirtualMachinePriorityTypes = original.Regular ) +type VirtualMachineScaleSetScaleInRules = original.VirtualMachineScaleSetScaleInRules + +const ( + Default VirtualMachineScaleSetScaleInRules = original.Default + NewestVM VirtualMachineScaleSetScaleInRules = original.NewestVM + OldestVM VirtualMachineScaleSetScaleInRules = original.OldestVM +) + type VirtualMachineScaleSetSkuScaleType = original.VirtualMachineScaleSetSkuScaleType const ( @@ -866,6 +874,7 @@ type RunCommandParameterDefinition = original.RunCommandParameterDefinition type RunCommandResult = original.RunCommandResult type SSHConfiguration = original.SSHConfiguration type SSHPublicKey = original.SSHPublicKey +type ScaleInPolicy = original.ScaleInPolicy type ScheduledEventsProfile = original.ScheduledEventsProfile type Sku = original.Sku type Snapshot = original.Snapshot @@ -1508,6 +1517,9 @@ func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionP func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { return original.PossibleVirtualMachinePriorityTypesValues() } +func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { + return original.PossibleVirtualMachineScaleSetScaleInRulesValues() +} func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType { return original.PossibleVirtualMachineScaleSetSkuScaleTypeValues() } diff --git a/profiles/latest/cosmos-db/mgmt/documentdb/models.go b/profiles/latest/cosmos-db/mgmt/documentdb/models.go index c2dd112fa7dd..dfc17a427c56 100644 --- a/profiles/latest/cosmos-db/mgmt/documentdb/models.go +++ b/profiles/latest/cosmos-db/mgmt/documentdb/models.go @@ -112,12 +112,12 @@ const ( type PrimaryAggregationType = original.PrimaryAggregationType const ( - PrimaryAggregationTypeAverage PrimaryAggregationType = original.PrimaryAggregationTypeAverage - PrimaryAggregationTypeLast PrimaryAggregationType = original.PrimaryAggregationTypeLast - PrimaryAggregationTypeMaximum PrimaryAggregationType = original.PrimaryAggregationTypeMaximum - PrimaryAggregationTypeMinimimum PrimaryAggregationType = original.PrimaryAggregationTypeMinimimum - PrimaryAggregationTypeNone PrimaryAggregationType = original.PrimaryAggregationTypeNone - PrimaryAggregationTypeTotal PrimaryAggregationType = original.PrimaryAggregationTypeTotal + PrimaryAggregationTypeAverage PrimaryAggregationType = original.PrimaryAggregationTypeAverage + PrimaryAggregationTypeLast PrimaryAggregationType = original.PrimaryAggregationTypeLast + PrimaryAggregationTypeMaximum PrimaryAggregationType = original.PrimaryAggregationTypeMaximum + PrimaryAggregationTypeMinimum PrimaryAggregationType = original.PrimaryAggregationTypeMinimum + PrimaryAggregationTypeNone PrimaryAggregationType = original.PrimaryAggregationTypeNone + PrimaryAggregationTypeTotal PrimaryAggregationType = original.PrimaryAggregationTypeTotal ) type UnitType = original.UnitType diff --git a/profiles/latest/databox/mgmt/databox/databoxapi/models.go b/profiles/latest/databox/mgmt/databox/databoxapi/models.go index 4cbd950b6a9b..d1f0705c3f4b 100644 --- a/profiles/latest/databox/mgmt/databox/databoxapi/models.go +++ b/profiles/latest/databox/mgmt/databox/databoxapi/models.go @@ -19,7 +19,7 @@ package databoxapi -import original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2018-01-01/databox/databoxapi" +import original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2019-09-01/databox/databoxapi" type JobsClientAPI = original.JobsClientAPI type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/latest/databox/mgmt/databox/models.go b/profiles/latest/databox/mgmt/databox/models.go index aaee28b88012..cfd5f24d7b2b 100644 --- a/profiles/latest/databox/mgmt/databox/models.go +++ b/profiles/latest/databox/mgmt/databox/models.go @@ -22,7 +22,7 @@ package databox import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2018-01-01/databox" + original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2019-09-01/databox" ) const ( @@ -64,20 +64,39 @@ const ( type CopyStatus = original.CopyStatus const ( - Completed CopyStatus = original.Completed - CompletedWithErrors CopyStatus = original.CompletedWithErrors - Failed CopyStatus = original.Failed - InProgress CopyStatus = original.InProgress - NotReturned CopyStatus = original.NotReturned - NotStarted CopyStatus = original.NotStarted + Completed CopyStatus = original.Completed + CompletedWithErrors CopyStatus = original.CompletedWithErrors + DeviceFormatted CopyStatus = original.DeviceFormatted + DeviceMetadataModified CopyStatus = original.DeviceMetadataModified + Failed CopyStatus = original.Failed + HardwareError CopyStatus = original.HardwareError + InProgress CopyStatus = original.InProgress + NotReturned CopyStatus = original.NotReturned + NotStarted CopyStatus = original.NotStarted + StorageAccountNotAccessible CopyStatus = original.StorageAccountNotAccessible + UnsupportedData CopyStatus = original.UnsupportedData ) type DataDestinationType = original.DataDestinationType const ( - DataDestinationTypeDestinationAccountDetails DataDestinationType = original.DataDestinationTypeDestinationAccountDetails - DataDestinationTypeManagedDisk DataDestinationType = original.DataDestinationTypeManagedDisk - DataDestinationTypeStorageAccount DataDestinationType = original.DataDestinationTypeStorageAccount + ManagedDisk DataDestinationType = original.ManagedDisk + StorageAccount DataDestinationType = original.StorageAccount +) + +type DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeBasicDestinationAccountDetails + +const ( + DataDestinationTypeDestinationAccountDetails DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeDestinationAccountDetails + DataDestinationTypeManagedDisk DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeManagedDisk + DataDestinationTypeStorageAccount DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeStorageAccount +) + +type JobDeliveryType = original.JobDeliveryType + +const ( + NonScheduled JobDeliveryType = original.NonScheduled + Scheduled JobDeliveryType = original.Scheduled ) type JobDetailsTypeEnum = original.JobDetailsTypeEnum @@ -109,15 +128,23 @@ const ( PickedUp NotificationStageName = original.PickedUp ) +type OverallValidationStatus = original.OverallValidationStatus + +const ( + AllValidToProceed OverallValidationStatus = original.AllValidToProceed + CertainInputValidationsSkipped OverallValidationStatus = original.CertainInputValidationsSkipped + InputsRevisitRequired OverallValidationStatus = original.InputsRevisitRequired +) + type ShareDestinationFormatType = original.ShareDestinationFormatType const ( - AzureFile ShareDestinationFormatType = original.AzureFile - BlockBlob ShareDestinationFormatType = original.BlockBlob - HCS ShareDestinationFormatType = original.HCS - ManagedDisk ShareDestinationFormatType = original.ManagedDisk - PageBlob ShareDestinationFormatType = original.PageBlob - UnknownType ShareDestinationFormatType = original.UnknownType + ShareDestinationFormatTypeAzureFile ShareDestinationFormatType = original.ShareDestinationFormatTypeAzureFile + ShareDestinationFormatTypeBlockBlob ShareDestinationFormatType = original.ShareDestinationFormatTypeBlockBlob + ShareDestinationFormatTypeHCS ShareDestinationFormatType = original.ShareDestinationFormatTypeHCS + ShareDestinationFormatTypeManagedDisk ShareDestinationFormatType = original.ShareDestinationFormatTypeManagedDisk + ShareDestinationFormatTypePageBlob ShareDestinationFormatType = original.ShareDestinationFormatTypePageBlob + ShareDestinationFormatTypeUnknownType ShareDestinationFormatType = original.ShareDestinationFormatTypeUnknownType ) type SkuDisabledReason = original.SkuDisabledReason @@ -139,6 +166,15 @@ const ( DataBoxHeavy SkuName = original.DataBoxHeavy ) +type SkuNameBasicScheduleAvailabilityRequest = original.SkuNameBasicScheduleAvailabilityRequest + +const ( + SkuNameDataBox SkuNameBasicScheduleAvailabilityRequest = original.SkuNameDataBox + SkuNameDataBoxDisk SkuNameBasicScheduleAvailabilityRequest = original.SkuNameDataBoxDisk + SkuNameDataBoxHeavy SkuNameBasicScheduleAvailabilityRequest = original.SkuNameDataBoxHeavy + SkuNameScheduleAvailabilityRequest SkuNameBasicScheduleAvailabilityRequest = original.SkuNameScheduleAvailabilityRequest +) + type StageName = original.StageName const ( @@ -147,6 +183,7 @@ const ( StageNameCancelled StageName = original.StageNameCancelled StageNameCompleted StageName = original.StageNameCompleted StageNameCompletedWithErrors StageName = original.StageNameCompletedWithErrors + StageNameCompletedWithWarnings StageName = original.StageNameCompletedWithWarnings StageNameDataCopy StageName = original.StageNameDataCopy StageNameDelivered StageName = original.StageNameDelivered StageNameDeviceOrdered StageName = original.StageNameDeviceOrdered @@ -155,6 +192,8 @@ const ( StageNameFailedIssueDetectedAtAzureDC StageName = original.StageNameFailedIssueDetectedAtAzureDC StageNameFailedIssueReportedAtCustomer StageName = original.StageNameFailedIssueReportedAtCustomer StageNamePickedUp StageName = original.StageNamePickedUp + StageNameReadyToDispatchFromAzureDC StageName = original.StageNameReadyToDispatchFromAzureDC + StageNameReadyToReceiveAtAzureDC StageName = original.StageNameReadyToReceiveAtAzureDC ) type StageStatus = original.StageStatus @@ -169,6 +208,52 @@ const ( StageStatusSucceededWithErrors StageStatus = original.StageStatusSucceededWithErrors ) +type TransportShipmentTypes = original.TransportShipmentTypes + +const ( + CustomerManaged TransportShipmentTypes = original.CustomerManaged + MicrosoftManaged TransportShipmentTypes = original.MicrosoftManaged +) + +type ValidationCategory = original.ValidationCategory + +const ( + ValidationCategoryJobCreationValidation ValidationCategory = original.ValidationCategoryJobCreationValidation + ValidationCategoryValidationRequest ValidationCategory = original.ValidationCategoryValidationRequest +) + +type ValidationStatus = original.ValidationStatus + +const ( + ValidationStatusInvalid ValidationStatus = original.ValidationStatusInvalid + ValidationStatusSkipped ValidationStatus = original.ValidationStatusSkipped + ValidationStatusValid ValidationStatus = original.ValidationStatusValid +) + +type ValidationType = original.ValidationType + +const ( + ValidationTypeValidateAddress ValidationType = original.ValidationTypeValidateAddress + ValidationTypeValidateCreateOrderLimit ValidationType = original.ValidationTypeValidateCreateOrderLimit + ValidationTypeValidateDataDestinationDetails ValidationType = original.ValidationTypeValidateDataDestinationDetails + ValidationTypeValidatePreferences ValidationType = original.ValidationTypeValidatePreferences + ValidationTypeValidateSkuAvailability ValidationType = original.ValidationTypeValidateSkuAvailability + ValidationTypeValidateSubscriptionIsAllowedToCreateJob ValidationType = original.ValidationTypeValidateSubscriptionIsAllowedToCreateJob + ValidationTypeValidationInputRequest ValidationType = original.ValidationTypeValidationInputRequest +) + +type ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponse + +const ( + ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress + ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit + ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails + ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences + ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability + ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob + ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse +) + type AccountCopyLogDetails = original.AccountCopyLogDetails type AccountCredentialDetails = original.AccountCredentialDetails type AddressValidationOutput = original.AddressValidationOutput @@ -184,10 +269,21 @@ type BasicCopyLogDetails = original.BasicCopyLogDetails type BasicDestinationAccountDetails = original.BasicDestinationAccountDetails type BasicJobDetails = original.BasicJobDetails type BasicJobSecrets = original.BasicJobSecrets +type BasicScheduleAvailabilityRequest = original.BasicScheduleAvailabilityRequest +type BasicValidationInputRequest = original.BasicValidationInputRequest +type BasicValidationInputResponse = original.BasicValidationInputResponse +type BasicValidationRequest = original.BasicValidationRequest type CancellationReason = original.CancellationReason +type CloudError = original.CloudError type ContactDetails = original.ContactDetails type CopyLogDetails = original.CopyLogDetails type CopyProgress = original.CopyProgress +type CreateJobValidations = original.CreateJobValidations +type CreateOrderLimitForSubscriptionValidationRequest = original.CreateOrderLimitForSubscriptionValidationRequest +type CreateOrderLimitForSubscriptionValidationResponseProperties = original.CreateOrderLimitForSubscriptionValidationResponseProperties +type DataDestinationDetailsValidationRequest = original.DataDestinationDetailsValidationRequest +type DataDestinationDetailsValidationResponseProperties = original.DataDestinationDetailsValidationResponseProperties +type DcAccessSecurityCode = original.DcAccessSecurityCode type DestinationAccountDetails = original.DestinationAccountDetails type DestinationManagedDiskDetails = original.DestinationManagedDiskDetails type DestinationStorageAccountDetails = original.DestinationStorageAccountDetails @@ -196,12 +292,15 @@ type DiskCopyLogDetails = original.DiskCopyLogDetails type DiskCopyProgress = original.DiskCopyProgress type DiskJobDetails = original.DiskJobDetails type DiskJobSecrets = original.DiskJobSecrets +type DiskScheduleAvailabilityRequest = original.DiskScheduleAvailabilityRequest type DiskSecret = original.DiskSecret type Error = original.Error type HeavyAccountCopyLogDetails = original.HeavyAccountCopyLogDetails type HeavyJobDetails = original.HeavyJobDetails type HeavyJobSecrets = original.HeavyJobSecrets +type HeavyScheduleAvailabilityRequest = original.HeavyScheduleAvailabilityRequest type HeavySecret = original.HeavySecret +type JobDeliveryInfo = original.JobDeliveryInfo type JobDetails = original.JobDetails type JobDetailsType = original.JobDetailsType type JobErrorDetails = original.JobErrorDetails @@ -227,7 +326,14 @@ type OperationListPage = original.OperationListPage type OperationsClient = original.OperationsClient type PackageShippingDetails = original.PackageShippingDetails type Preferences = original.Preferences +type PreferencesValidationRequest = original.PreferencesValidationRequest +type PreferencesValidationResponseProperties = original.PreferencesValidationResponseProperties +type RegionConfigurationRequest = original.RegionConfigurationRequest +type RegionConfigurationResponse = original.RegionConfigurationResponse type Resource = original.Resource +type ScheduleAvailabilityRequest = original.ScheduleAvailabilityRequest +type ScheduleAvailabilityRequestType = original.ScheduleAvailabilityRequestType +type ScheduleAvailabilityResponse = original.ScheduleAvailabilityResponse type Secret = original.Secret type ServiceClient = original.ServiceClient type ShareCredentialDetails = original.ShareCredentialDetails @@ -235,15 +341,28 @@ type ShipmentPickUpRequest = original.ShipmentPickUpRequest type ShipmentPickUpResponse = original.ShipmentPickUpResponse type ShippingAddress = original.ShippingAddress type Sku = original.Sku +type SkuAvailabilityValidationRequest = original.SkuAvailabilityValidationRequest +type SkuAvailabilityValidationResponseProperties = original.SkuAvailabilityValidationResponseProperties type SkuCapacity = original.SkuCapacity type SkuCost = original.SkuCost type SkuInformation = original.SkuInformation type SkuProperties = original.SkuProperties +type SubscriptionIsAllowedToCreateJobValidationRequest = original.SubscriptionIsAllowedToCreateJobValidationRequest +type SubscriptionIsAllowedToCreateJobValidationResponseProperties = original.SubscriptionIsAllowedToCreateJobValidationResponseProperties +type TransportAvailabilityDetails = original.TransportAvailabilityDetails +type TransportAvailabilityRequest = original.TransportAvailabilityRequest +type TransportAvailabilityResponse = original.TransportAvailabilityResponse +type TransportPreferences = original.TransportPreferences type UnencryptedCredentials = original.UnencryptedCredentials type UnencryptedCredentialsList = original.UnencryptedCredentialsList type UpdateJobDetails = original.UpdateJobDetails type UpdateJobProperties = original.UpdateJobProperties type ValidateAddress = original.ValidateAddress +type ValidationInputRequest = original.ValidationInputRequest +type ValidationInputResponse = original.ValidationInputResponse +type ValidationRequest = original.ValidationRequest +type ValidationResponse = original.ValidationResponse +type ValidationResponseProperties = original.ValidationResponseProperties func New(subscriptionID string) BaseClient { return original.New(subscriptionID) @@ -302,9 +421,15 @@ func PossibleCopyLogDetailsTypeValues() []CopyLogDetailsType { func PossibleCopyStatusValues() []CopyStatus { return original.PossibleCopyStatusValues() } +func PossibleDataDestinationTypeBasicDestinationAccountDetailsValues() []DataDestinationTypeBasicDestinationAccountDetails { + return original.PossibleDataDestinationTypeBasicDestinationAccountDetailsValues() +} func PossibleDataDestinationTypeValues() []DataDestinationType { return original.PossibleDataDestinationTypeValues() } +func PossibleJobDeliveryTypeValues() []JobDeliveryType { + return original.PossibleJobDeliveryTypeValues() +} func PossibleJobDetailsTypeEnumValues() []JobDetailsTypeEnum { return original.PossibleJobDetailsTypeEnumValues() } @@ -314,12 +439,18 @@ func PossibleJobSecretsTypeEnumValues() []JobSecretsTypeEnum { func PossibleNotificationStageNameValues() []NotificationStageName { return original.PossibleNotificationStageNameValues() } +func PossibleOverallValidationStatusValues() []OverallValidationStatus { + return original.PossibleOverallValidationStatusValues() +} func PossibleShareDestinationFormatTypeValues() []ShareDestinationFormatType { return original.PossibleShareDestinationFormatTypeValues() } func PossibleSkuDisabledReasonValues() []SkuDisabledReason { return original.PossibleSkuDisabledReasonValues() } +func PossibleSkuNameBasicScheduleAvailabilityRequestValues() []SkuNameBasicScheduleAvailabilityRequest { + return original.PossibleSkuNameBasicScheduleAvailabilityRequestValues() +} func PossibleSkuNameValues() []SkuName { return original.PossibleSkuNameValues() } @@ -329,6 +460,21 @@ func PossibleStageNameValues() []StageName { func PossibleStageStatusValues() []StageStatus { return original.PossibleStageStatusValues() } +func PossibleTransportShipmentTypesValues() []TransportShipmentTypes { + return original.PossibleTransportShipmentTypesValues() +} +func PossibleValidationCategoryValues() []ValidationCategory { + return original.PossibleValidationCategoryValues() +} +func PossibleValidationStatusValues() []ValidationStatus { + return original.PossibleValidationStatusValues() +} +func PossibleValidationTypeBasicValidationInputResponseValues() []ValidationTypeBasicValidationInputResponse { + return original.PossibleValidationTypeBasicValidationInputResponseValues() +} +func PossibleValidationTypeValues() []ValidationType { + return original.PossibleValidationTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/latest" } diff --git a/profiles/latest/edgegateway/mgmt/edgegateway/edgegatewayapi/models.go b/profiles/latest/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go similarity index 88% rename from profiles/latest/edgegateway/mgmt/edgegateway/edgegatewayapi/models.go rename to profiles/latest/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go index c73455d1c53f..fa769db5d05e 100644 --- a/profiles/latest/edgegateway/mgmt/edgegateway/edgegatewayapi/models.go +++ b/profiles/latest/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go @@ -17,14 +17,15 @@ // This code was auto-generated by: // github.com/Azure/azure-sdk-for-go/tools/profileBuilder -package edgegatewayapi +package databoxedgeapi -import original "github.com/Azure/azure-sdk-for-go/services/edgegateway/mgmt/2019-03-01/edgegateway/edgegatewayapi" +import original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-07-01/databoxedge/databoxedgeapi" type AlertsClientAPI = original.AlertsClientAPI type BandwidthSchedulesClientAPI = original.BandwidthSchedulesClientAPI type DevicesClientAPI = original.DevicesClientAPI type JobsClientAPI = original.JobsClientAPI +type NodesClientAPI = original.NodesClientAPI type OperationsClientAPI = original.OperationsClientAPI type OperationsStatusClientAPI = original.OperationsStatusClientAPI type OrdersClientAPI = original.OrdersClientAPI diff --git a/profiles/latest/edgegateway/mgmt/edgegateway/models.go b/profiles/latest/databoxedge/mgmt/databoxedge/models.go similarity index 91% rename from profiles/latest/edgegateway/mgmt/edgegateway/models.go rename to profiles/latest/databoxedge/mgmt/databoxedge/models.go index 24f2b3763998..3f9c78273acc 100644 --- a/profiles/latest/edgegateway/mgmt/edgegateway/models.go +++ b/profiles/latest/databoxedge/mgmt/databoxedge/models.go @@ -17,12 +17,12 @@ // This code was auto-generated by: // github.com/Azure/azure-sdk-for-go/tools/profileBuilder -package edgegateway +package databoxedge import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/edgegateway/mgmt/2019-03-01/edgegateway" + original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-07-01/databoxedge" ) const ( @@ -67,17 +67,6 @@ const ( ReadWrite ClientPermissionType = original.ReadWrite ) -type DataBoxEdgeDeviceStatus = original.DataBoxEdgeDeviceStatus - -const ( - Disconnected DataBoxEdgeDeviceStatus = original.Disconnected - NeedsAttention DataBoxEdgeDeviceStatus = original.NeedsAttention - Offline DataBoxEdgeDeviceStatus = original.Offline - Online DataBoxEdgeDeviceStatus = original.Online - PartiallyDisconnected DataBoxEdgeDeviceStatus = original.PartiallyDisconnected - ReadyToSetup DataBoxEdgeDeviceStatus = original.ReadyToSetup -) - type DataPolicy = original.DataPolicy const ( @@ -97,10 +86,22 @@ const ( Wednesday DayOfWeek = original.Wednesday ) +type DeviceStatus = original.DeviceStatus + +const ( + Disconnected DeviceStatus = original.Disconnected + Maintenance DeviceStatus = original.Maintenance + NeedsAttention DeviceStatus = original.NeedsAttention + Offline DeviceStatus = original.Offline + Online DeviceStatus = original.Online + PartiallyDisconnected DeviceStatus = original.PartiallyDisconnected + ReadyToSetup DeviceStatus = original.ReadyToSetup +) + type DeviceType = original.DeviceType const ( - DeviceTypeDataBoxEdgeDevice DeviceType = original.DeviceTypeDataBoxEdgeDevice + DataBoxEdgeDevice DeviceType = original.DataBoxEdgeDevice ) type DownloadPhase = original.DownloadPhase @@ -233,6 +234,16 @@ const ( NetworkGroupRDMA NetworkGroup = original.NetworkGroupRDMA ) +type NodeStatus = original.NodeStatus + +const ( + NodeStatusDown NodeStatus = original.NodeStatusDown + NodeStatusRebooting NodeStatus = original.NodeStatusRebooting + NodeStatusShuttingDown NodeStatus = original.NodeStatusShuttingDown + NodeStatusUnknown NodeStatus = original.NodeStatusUnknown + NodeStatusUp NodeStatus = original.NodeStatusUp +) + type OrderState = original.OrderState const ( @@ -300,8 +311,11 @@ const ( type ShareStatus = original.ShareStatus const ( - ShareStatusOffline ShareStatus = original.ShareStatusOffline - ShareStatusOnline ShareStatus = original.ShareStatusOnline + ShareStatusNeedsAttention ShareStatus = original.ShareStatusNeedsAttention + ShareStatusOffline ShareStatus = original.ShareStatusOffline + ShareStatusOK ShareStatus = original.ShareStatusOK + ShareStatusUnknown ShareStatus = original.ShareStatusUnknown + ShareStatusUpdating ShareStatus = original.ShareStatusUpdating ) type SkuName = original.SkuName @@ -388,14 +402,14 @@ type ClientAccessRight = original.ClientAccessRight type CloudError = original.CloudError type CloudErrorBody = original.CloudErrorBody type ContactDetails = original.ContactDetails -type DataBoxEdgeDevice = original.DataBoxEdgeDevice -type DataBoxEdgeDeviceExtendedInfo = original.DataBoxEdgeDeviceExtendedInfo -type DataBoxEdgeDeviceExtendedInfoProperties = original.DataBoxEdgeDeviceExtendedInfoProperties -type DataBoxEdgeDeviceList = original.DataBoxEdgeDeviceList -type DataBoxEdgeDeviceListIterator = original.DataBoxEdgeDeviceListIterator -type DataBoxEdgeDeviceListPage = original.DataBoxEdgeDeviceListPage -type DataBoxEdgeDevicePatch = original.DataBoxEdgeDevicePatch -type DataBoxEdgeDeviceProperties = original.DataBoxEdgeDeviceProperties +type Device = original.Device +type DeviceExtendedInfo = original.DeviceExtendedInfo +type DeviceExtendedInfoProperties = original.DeviceExtendedInfoProperties +type DeviceList = original.DeviceList +type DeviceListIterator = original.DeviceListIterator +type DeviceListPage = original.DeviceListPage +type DevicePatch = original.DevicePatch +type DeviceProperties = original.DeviceProperties type DevicesClient = original.DevicesClient type DevicesCreateOrUpdateFuture = original.DevicesCreateOrUpdateFuture type DevicesCreateOrUpdateSecuritySettingsFuture = original.DevicesCreateOrUpdateSecuritySettingsFuture @@ -423,6 +437,10 @@ type NetworkAdapter = original.NetworkAdapter type NetworkAdapterPosition = original.NetworkAdapterPosition type NetworkSettings = original.NetworkSettings type NetworkSettingsProperties = original.NetworkSettingsProperties +type Node = original.Node +type NodeList = original.NodeList +type NodeProperties = original.NodeProperties +type NodesClient = original.NodesClient type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationProperties = original.OperationProperties @@ -529,11 +547,11 @@ func NewBandwidthSchedulesListIterator(page BandwidthSchedulesListPage) Bandwidt func NewBandwidthSchedulesListPage(getNextPage func(context.Context, BandwidthSchedulesList) (BandwidthSchedulesList, error)) BandwidthSchedulesListPage { return original.NewBandwidthSchedulesListPage(getNextPage) } -func NewDataBoxEdgeDeviceListIterator(page DataBoxEdgeDeviceListPage) DataBoxEdgeDeviceListIterator { - return original.NewDataBoxEdgeDeviceListIterator(page) +func NewDeviceListIterator(page DeviceListPage) DeviceListIterator { + return original.NewDeviceListIterator(page) } -func NewDataBoxEdgeDeviceListPage(getNextPage func(context.Context, DataBoxEdgeDeviceList) (DataBoxEdgeDeviceList, error)) DataBoxEdgeDeviceListPage { - return original.NewDataBoxEdgeDeviceListPage(getNextPage) +func NewDeviceListPage(getNextPage func(context.Context, DeviceList) (DeviceList, error)) DeviceListPage { + return original.NewDeviceListPage(getNextPage) } func NewDevicesClient(subscriptionID string) DevicesClient { return original.NewDevicesClient(subscriptionID) @@ -547,6 +565,12 @@ func NewJobsClient(subscriptionID string) JobsClient { func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient { return original.NewJobsClientWithBaseURI(baseURI, subscriptionID) } +func NewNodesClient(subscriptionID string) NodesClient { + return original.NewNodesClient(subscriptionID) +} +func NewNodesClientWithBaseURI(baseURI string, subscriptionID string) NodesClient { + return original.NewNodesClientWithBaseURI(baseURI, subscriptionID) +} func NewOperationsClient(subscriptionID string) OperationsClient { return original.NewOperationsClient(subscriptionID) } @@ -655,15 +679,15 @@ func PossibleAzureContainerDataFormatValues() []AzureContainerDataFormat { func PossibleClientPermissionTypeValues() []ClientPermissionType { return original.PossibleClientPermissionTypeValues() } -func PossibleDataBoxEdgeDeviceStatusValues() []DataBoxEdgeDeviceStatus { - return original.PossibleDataBoxEdgeDeviceStatusValues() -} func PossibleDataPolicyValues() []DataPolicy { return original.PossibleDataPolicyValues() } func PossibleDayOfWeekValues() []DayOfWeek { return original.PossibleDayOfWeekValues() } +func PossibleDeviceStatusValues() []DeviceStatus { + return original.PossibleDeviceStatusValues() +} func PossibleDeviceTypeValues() []DeviceType { return original.PossibleDeviceTypeValues() } @@ -712,6 +736,9 @@ func PossibleNetworkAdapterStatusValues() []NetworkAdapterStatus { func PossibleNetworkGroupValues() []NetworkGroup { return original.PossibleNetworkGroupValues() } +func PossibleNodeStatusValues() []NodeStatus { + return original.PossibleNodeStatusValues() +} func PossibleOrderStateValues() []OrderState { return original.PossibleOrderStateValues() } diff --git a/profiles/latest/datafactory/mgmt/datafactory/datafactoryapi/models.go b/profiles/latest/datafactory/mgmt/datafactory/datafactoryapi/models.go index 2a039a860394..28f064af3a1b 100644 --- a/profiles/latest/datafactory/mgmt/datafactory/datafactoryapi/models.go +++ b/profiles/latest/datafactory/mgmt/datafactory/datafactoryapi/models.go @@ -22,6 +22,8 @@ package datafactoryapi import original "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/datafactoryapi" type ActivityRunsClientAPI = original.ActivityRunsClientAPI +type DataFlowDebugSessionClientAPI = original.DataFlowDebugSessionClientAPI +type DataFlowsClientAPI = original.DataFlowsClientAPI type DatasetsClientAPI = original.DatasetsClientAPI type ExposureControlClientAPI = original.ExposureControlClientAPI type FactoriesClientAPI = original.FactoriesClientAPI diff --git a/profiles/latest/datafactory/mgmt/datafactory/models.go b/profiles/latest/datafactory/mgmt/datafactory/models.go index 6a2a948586a1..9f2331a40b3f 100644 --- a/profiles/latest/datafactory/mgmt/datafactory/models.go +++ b/profiles/latest/datafactory/mgmt/datafactory/models.go @@ -97,6 +97,22 @@ const ( TWO CassandraSourceReadConsistencyLevels = original.TWO ) +type DataFlowComputeType = original.DataFlowComputeType + +const ( + ComputeOptimized DataFlowComputeType = original.ComputeOptimized + General DataFlowComputeType = original.General + MemoryOptimized DataFlowComputeType = original.MemoryOptimized +) + +type DataFlowDebugCommandType = original.DataFlowDebugCommandType + +const ( + ExecuteExpressionQuery DataFlowDebugCommandType = original.ExecuteExpressionQuery + ExecutePreviewQuery DataFlowDebugCommandType = original.ExecutePreviewQuery + ExecuteStatisticsQuery DataFlowDebugCommandType = original.ExecuteStatisticsQuery +) + type DayOfWeek = original.DayOfWeek const ( @@ -667,6 +683,7 @@ const ( TypeDatabricksSparkPython TypeBasicActivity = original.TypeDatabricksSparkPython TypeDataLakeAnalyticsUSQL TypeBasicActivity = original.TypeDataLakeAnalyticsUSQL TypeDelete TypeBasicActivity = original.TypeDelete + TypeExecuteDataFlow TypeBasicActivity = original.TypeExecuteDataFlow TypeExecutePipeline TypeBasicActivity = original.TypeExecutePipeline TypeExecuteSSISPackage TypeBasicActivity = original.TypeExecuteSSISPackage TypeExecution TypeBasicActivity = original.TypeExecution @@ -707,6 +724,7 @@ const ( TypeCommonDataServiceForAppsSink TypeBasicCopySink = original.TypeCommonDataServiceForAppsSink TypeCopySink TypeBasicCopySink = original.TypeCopySink TypeCosmosDbMongoDbAPISink TypeBasicCopySink = original.TypeCosmosDbMongoDbAPISink + TypeCosmosDbSQLAPISink TypeBasicCopySink = original.TypeCosmosDbSQLAPISink TypeDelimitedTextSink TypeBasicCopySink = original.TypeDelimitedTextSink TypeDocumentDbCollectionSink TypeBasicCopySink = original.TypeDocumentDbCollectionSink TypeDynamicsCrmSink TypeBasicCopySink = original.TypeDynamicsCrmSink @@ -717,6 +735,7 @@ const ( TypeMicrosoftAccessSink TypeBasicCopySink = original.TypeMicrosoftAccessSink TypeOdbcSink TypeBasicCopySink = original.TypeOdbcSink TypeOracleSink TypeBasicCopySink = original.TypeOracleSink + TypeOrcSink TypeBasicCopySink = original.TypeOrcSink TypeParquetSink TypeBasicCopySink = original.TypeParquetSink TypeSalesforceServiceCloudSink TypeBasicCopySink = original.TypeSalesforceServiceCloudSink TypeSalesforceSink TypeBasicCopySink = original.TypeSalesforceSink @@ -748,6 +767,7 @@ const ( TypeConcurSource TypeBasicCopySource = original.TypeConcurSource TypeCopySource TypeBasicCopySource = original.TypeCopySource TypeCosmosDbMongoDbAPISource TypeBasicCopySource = original.TypeCosmosDbMongoDbAPISource + TypeCosmosDbSQLAPISource TypeBasicCopySource = original.TypeCosmosDbSQLAPISource TypeCouchbaseSource TypeBasicCopySource = original.TypeCouchbaseSource TypeDb2Source TypeBasicCopySource = original.TypeDb2Source TypeDelimitedTextSource TypeBasicCopySource = original.TypeDelimitedTextSource @@ -783,6 +803,7 @@ const ( TypeOffice365Source TypeBasicCopySource = original.TypeOffice365Source TypeOracleServiceCloudSource TypeBasicCopySource = original.TypeOracleServiceCloudSource TypeOracleSource TypeBasicCopySource = original.TypeOracleSource + TypeOrcSource TypeBasicCopySource = original.TypeOrcSource TypeParquetSource TypeBasicCopySource = original.TypeParquetSource TypePaypalSource TypeBasicCopySource = original.TypePaypalSource TypePhoenixSource TypeBasicCopySource = original.TypePhoenixSource @@ -810,6 +831,7 @@ const ( TypeSQLSource TypeBasicCopySource = original.TypeSQLSource TypeSquareSource TypeBasicCopySource = original.TypeSquareSource TypeSybaseSource TypeBasicCopySource = original.TypeSybaseSource + TypeTabularSource TypeBasicCopySource = original.TypeTabularSource TypeTeradataSource TypeBasicCopySource = original.TypeTeradataSource TypeVerticaSource TypeBasicCopySource = original.TypeVerticaSource TypeWebSource TypeBasicCopySource = original.TypeWebSource @@ -817,6 +839,22 @@ const ( TypeZohoSource TypeBasicCopySource = original.TypeZohoSource ) +type TypeBasicCustomSetupBase = original.TypeBasicCustomSetupBase + +const ( + TypeCmdkeySetup TypeBasicCustomSetupBase = original.TypeCmdkeySetup + TypeComponentSetup TypeBasicCustomSetupBase = original.TypeComponentSetup + TypeCustomSetupBase TypeBasicCustomSetupBase = original.TypeCustomSetupBase + TypeEnvironmentVariableSetup TypeBasicCustomSetupBase = original.TypeEnvironmentVariableSetup +) + +type TypeBasicDataFlow = original.TypeBasicDataFlow + +const ( + TypeDataFlow TypeBasicDataFlow = original.TypeDataFlow + TypeMappingDataFlow TypeBasicDataFlow = original.TypeMappingDataFlow +) + type TypeBasicDataset = original.TypeBasicDataset const ( @@ -841,6 +879,7 @@ const ( TypeCommonDataServiceForAppsEntity TypeBasicDataset = original.TypeCommonDataServiceForAppsEntity TypeConcurObject TypeBasicDataset = original.TypeConcurObject TypeCosmosDbMongoDbAPICollection TypeBasicDataset = original.TypeCosmosDbMongoDbAPICollection + TypeCosmosDbSQLAPICollection TypeBasicDataset = original.TypeCosmosDbSQLAPICollection TypeCouchbaseTable TypeBasicDataset = original.TypeCouchbaseTable TypeCustomDataset TypeBasicDataset = original.TypeCustomDataset TypeDataset TypeBasicDataset = original.TypeDataset @@ -877,6 +916,7 @@ const ( TypeOffice365Table TypeBasicDataset = original.TypeOffice365Table TypeOracleServiceCloudObject TypeBasicDataset = original.TypeOracleServiceCloudObject TypeOracleTable TypeBasicDataset = original.TypeOracleTable + TypeOrc TypeBasicDataset = original.TypeOrc TypeParquet TypeBasicDataset = original.TypeParquet TypePaypalObject TypeBasicDataset = original.TypePaypalObject TypePhoenixObject TypeBasicDataset = original.TypePhoenixObject @@ -1084,6 +1124,7 @@ type TypeBasicTrigger = original.TypeBasicTrigger const ( TypeBlobEventsTrigger TypeBasicTrigger = original.TypeBlobEventsTrigger TypeBlobTrigger TypeBasicTrigger = original.TypeBlobTrigger + TypeChainingTrigger TypeBasicTrigger = original.TypeChainingTrigger TypeMultiplePipelineTrigger TypeBasicTrigger = original.TypeMultiplePipelineTrigger TypeRerunTumblingWindowTrigger TypeBasicTrigger = original.TypeRerunTumblingWindowTrigger TypeScheduleTrigger TypeBasicTrigger = original.TypeScheduleTrigger @@ -1121,6 +1162,7 @@ type ActivityPolicy = original.ActivityPolicy type ActivityRun = original.ActivityRun type ActivityRunsClient = original.ActivityRunsClient type ActivityRunsQueryResponse = original.ActivityRunsQueryResponse +type AddDataFlowToDebugSessionResponse = original.AddDataFlowToDebugSessionResponse type AmazonMWSLinkedService = original.AmazonMWSLinkedService type AmazonMWSLinkedServiceTypeProperties = original.AmazonMWSLinkedServiceTypeProperties type AmazonMWSObjectDataset = original.AmazonMWSObjectDataset @@ -1245,6 +1287,8 @@ type BasicActivity = original.BasicActivity type BasicControlActivity = original.BasicControlActivity type BasicCopySink = original.BasicCopySink type BasicCopySource = original.BasicCopySource +type BasicCustomSetupBase = original.BasicCustomSetupBase +type BasicDataFlow = original.BasicDataFlow type BasicDataset = original.BasicDataset type BasicDatasetCompression = original.BasicDatasetCompression type BasicDatasetStorageFormat = original.BasicDatasetStorageFormat @@ -1259,6 +1303,7 @@ type BasicMultiplePipelineTrigger = original.BasicMultiplePipelineTrigger type BasicSecretBase = original.BasicSecretBase type BasicSsisObjectMetadata = original.BasicSsisObjectMetadata type BasicStoreWriteSettings = original.BasicStoreWriteSettings +type BasicTabularSource = original.BasicTabularSource type BasicTrigger = original.BasicTrigger type BasicTriggerDependencyReference = original.BasicTriggerDependencyReference type BasicWebLinkedServiceTypeProperties = original.BasicWebLinkedServiceTypeProperties @@ -1277,14 +1322,19 @@ type CassandraLinkedServiceTypeProperties = original.CassandraLinkedServiceTypeP type CassandraSource = original.CassandraSource type CassandraTableDataset = original.CassandraTableDataset type CassandraTableDatasetTypeProperties = original.CassandraTableDatasetTypeProperties +type ChainingTrigger = original.ChainingTrigger +type ChainingTriggerTypeProperties = original.ChainingTriggerTypeProperties type CloudError = original.CloudError type CloudErrorBody = original.CloudErrorBody +type CmdkeySetup = original.CmdkeySetup +type CmdkeySetupTypeProperties = original.CmdkeySetupTypeProperties type CommonDataServiceForAppsEntityDataset = original.CommonDataServiceForAppsEntityDataset type CommonDataServiceForAppsEntityDatasetTypeProperties = original.CommonDataServiceForAppsEntityDatasetTypeProperties type CommonDataServiceForAppsLinkedService = original.CommonDataServiceForAppsLinkedService type CommonDataServiceForAppsLinkedServiceTypeProperties = original.CommonDataServiceForAppsLinkedServiceTypeProperties type CommonDataServiceForAppsSink = original.CommonDataServiceForAppsSink type CommonDataServiceForAppsSource = original.CommonDataServiceForAppsSource +type ComponentSetup = original.ComponentSetup type ConcurLinkedService = original.ConcurLinkedService type ConcurLinkedServiceTypeProperties = original.ConcurLinkedServiceTypeProperties type ConcurObjectDataset = original.ConcurObjectDataset @@ -1302,10 +1352,16 @@ type CosmosDbMongoDbAPILinkedService = original.CosmosDbMongoDbAPILinkedService type CosmosDbMongoDbAPILinkedServiceTypeProperties = original.CosmosDbMongoDbAPILinkedServiceTypeProperties type CosmosDbMongoDbAPISink = original.CosmosDbMongoDbAPISink type CosmosDbMongoDbAPISource = original.CosmosDbMongoDbAPISource +type CosmosDbSQLAPICollectionDataset = original.CosmosDbSQLAPICollectionDataset +type CosmosDbSQLAPICollectionDatasetTypeProperties = original.CosmosDbSQLAPICollectionDatasetTypeProperties +type CosmosDbSQLAPISink = original.CosmosDbSQLAPISink +type CosmosDbSQLAPISource = original.CosmosDbSQLAPISource type CouchbaseLinkedService = original.CouchbaseLinkedService type CouchbaseLinkedServiceTypeProperties = original.CouchbaseLinkedServiceTypeProperties type CouchbaseSource = original.CouchbaseSource type CouchbaseTableDataset = original.CouchbaseTableDataset +type CreateDataFlowDebugSessionRequest = original.CreateDataFlowDebugSessionRequest +type CreateDataFlowDebugSessionResponse = original.CreateDataFlowDebugSessionResponse type CreateLinkedIntegrationRuntimeRequest = original.CreateLinkedIntegrationRuntimeRequest type CreateRunResponse = original.CreateRunResponse type CustomActivity = original.CustomActivity @@ -1313,6 +1369,28 @@ type CustomActivityReferenceObject = original.CustomActivityReferenceObject type CustomActivityTypeProperties = original.CustomActivityTypeProperties type CustomDataSourceLinkedService = original.CustomDataSourceLinkedService type CustomDataset = original.CustomDataset +type CustomSetupBase = original.CustomSetupBase +type DataFlow = original.DataFlow +type DataFlowDebugCommandPayload = original.DataFlowDebugCommandPayload +type DataFlowDebugCommandRequest = original.DataFlowDebugCommandRequest +type DataFlowDebugCommandResponse = original.DataFlowDebugCommandResponse +type DataFlowDebugPackage = original.DataFlowDebugPackage +type DataFlowDebugPackageDebugSettings = original.DataFlowDebugPackageDebugSettings +type DataFlowDebugSessionClient = original.DataFlowDebugSessionClient +type DataFlowDebugSessionCreateFuture = original.DataFlowDebugSessionCreateFuture +type DataFlowDebugSessionExecuteCommandFuture = original.DataFlowDebugSessionExecuteCommandFuture +type DataFlowDebugSessionInfo = original.DataFlowDebugSessionInfo +type DataFlowFolder = original.DataFlowFolder +type DataFlowListResponse = original.DataFlowListResponse +type DataFlowListResponseIterator = original.DataFlowListResponseIterator +type DataFlowListResponsePage = original.DataFlowListResponsePage +type DataFlowReference = original.DataFlowReference +type DataFlowResource = original.DataFlowResource +type DataFlowSink = original.DataFlowSink +type DataFlowSource = original.DataFlowSource +type DataFlowSourceSetting = original.DataFlowSourceSetting +type DataFlowStagingInfo = original.DataFlowStagingInfo +type DataFlowsClient = original.DataFlowsClient type DataLakeAnalyticsUSQLActivity = original.DataLakeAnalyticsUSQLActivity type DataLakeAnalyticsUSQLActivityTypeProperties = original.DataLakeAnalyticsUSQLActivityTypeProperties type DatabricksNotebookActivity = original.DatabricksNotebookActivity @@ -1343,6 +1421,7 @@ type Db2TableDataset = original.Db2TableDataset type Db2TableDatasetTypeProperties = original.Db2TableDatasetTypeProperties type DeleteActivity = original.DeleteActivity type DeleteActivityTypeProperties = original.DeleteActivityTypeProperties +type DeleteDataFlowDebugSessionRequest = original.DeleteDataFlowDebugSessionRequest type DelimitedTextDataset = original.DelimitedTextDataset type DelimitedTextDatasetTypeProperties = original.DelimitedTextDatasetTypeProperties type DelimitedTextReadSettings = original.DelimitedTextReadSettings @@ -1382,6 +1461,10 @@ type EloquaLinkedServiceTypeProperties = original.EloquaLinkedServiceTypePropert type EloquaObjectDataset = original.EloquaObjectDataset type EloquaSource = original.EloquaSource type EntityReference = original.EntityReference +type EnvironmentVariableSetup = original.EnvironmentVariableSetup +type EnvironmentVariableSetupTypeProperties = original.EnvironmentVariableSetupTypeProperties +type ExecuteDataFlowActivity = original.ExecuteDataFlowActivity +type ExecuteDataFlowActivityTypeProperties = original.ExecuteDataFlowActivityTypeProperties type ExecutePipelineActivity = original.ExecutePipelineActivity type ExecutePipelineActivityTypeProperties = original.ExecutePipelineActivityTypeProperties type ExecuteSSISPackageActivity = original.ExecuteSSISPackageActivity @@ -1423,6 +1506,7 @@ type FtpServerLinkedService = original.FtpServerLinkedService type FtpServerLinkedServiceTypeProperties = original.FtpServerLinkedServiceTypeProperties type FtpServerLocation = original.FtpServerLocation type GenericDatasetTypeProperties = original.GenericDatasetTypeProperties +type GetDataFactoryOperationStatusResponse = original.GetDataFactoryOperationStatusResponse type GetMetadataActivity = original.GetMetadataActivity type GetMetadataActivityTypeProperties = original.GetMetadataActivityTypeProperties type GetSsisObjectMetadataRequest = original.GetSsisObjectMetadataRequest @@ -1499,6 +1583,7 @@ type IntegrationRuntimeAuthKeys = original.IntegrationRuntimeAuthKeys type IntegrationRuntimeComputeProperties = original.IntegrationRuntimeComputeProperties type IntegrationRuntimeConnectionInfo = original.IntegrationRuntimeConnectionInfo type IntegrationRuntimeCustomSetupScriptProperties = original.IntegrationRuntimeCustomSetupScriptProperties +type IntegrationRuntimeDataFlowProperties = original.IntegrationRuntimeDataFlowProperties type IntegrationRuntimeDataProxyProperties = original.IntegrationRuntimeDataProxyProperties type IntegrationRuntimeListResponse = original.IntegrationRuntimeListResponse type IntegrationRuntimeListResponseIterator = original.IntegrationRuntimeListResponseIterator @@ -1531,6 +1616,7 @@ type JiraLinkedService = original.JiraLinkedService type JiraLinkedServiceTypeProperties = original.JiraLinkedServiceTypeProperties type JiraObjectDataset = original.JiraObjectDataset type JiraSource = original.JiraSource +type LicensedComponentSetupTypeProperties = original.LicensedComponentSetupTypeProperties type LinkedIntegrationRuntime = original.LinkedIntegrationRuntime type LinkedIntegrationRuntimeKeyAuthorization = original.LinkedIntegrationRuntimeKeyAuthorization type LinkedIntegrationRuntimeRbacAuthorization = original.LinkedIntegrationRuntimeRbacAuthorization @@ -1557,6 +1643,8 @@ type ManagedIntegrationRuntimeOperationResult = original.ManagedIntegrationRunti type ManagedIntegrationRuntimeStatus = original.ManagedIntegrationRuntimeStatus type ManagedIntegrationRuntimeStatusTypeProperties = original.ManagedIntegrationRuntimeStatusTypeProperties type ManagedIntegrationRuntimeTypeProperties = original.ManagedIntegrationRuntimeTypeProperties +type MappingDataFlow = original.MappingDataFlow +type MappingDataFlowTypeProperties = original.MappingDataFlowTypeProperties type MariaDBLinkedService = original.MariaDBLinkedService type MariaDBLinkedServiceTypeProperties = original.MariaDBLinkedServiceTypeProperties type MariaDBSource = original.MariaDBSource @@ -1633,7 +1721,11 @@ type OracleSink = original.OracleSink type OracleSource = original.OracleSource type OracleTableDataset = original.OracleTableDataset type OracleTableDatasetTypeProperties = original.OracleTableDatasetTypeProperties +type OrcDataset = original.OrcDataset +type OrcDatasetTypeProperties = original.OrcDatasetTypeProperties type OrcFormat = original.OrcFormat +type OrcSink = original.OrcSink +type OrcSource = original.OrcSource type ParameterSpecification = original.ParameterSpecification type ParquetDataset = original.ParquetDataset type ParquetDatasetTypeProperties = original.ParquetDatasetTypeProperties @@ -1672,6 +1764,9 @@ type PrestoLinkedService = original.PrestoLinkedService type PrestoLinkedServiceTypeProperties = original.PrestoLinkedServiceTypeProperties type PrestoObjectDataset = original.PrestoObjectDataset type PrestoSource = original.PrestoSource +type QueryDataFlowDebugSessionsResponse = original.QueryDataFlowDebugSessionsResponse +type QueryDataFlowDebugSessionsResponseIterator = original.QueryDataFlowDebugSessionsResponseIterator +type QueryDataFlowDebugSessionsResponsePage = original.QueryDataFlowDebugSessionsResponsePage type QuickBooksLinkedService = original.QuickBooksLinkedService type QuickBooksLinkedServiceTypeProperties = original.QuickBooksLinkedServiceTypeProperties type QuickBooksObjectDataset = original.QuickBooksObjectDataset @@ -1832,6 +1927,7 @@ type SybaseLinkedServiceTypeProperties = original.SybaseLinkedServiceTypePropert type SybaseSource = original.SybaseSource type SybaseTableDataset = original.SybaseTableDataset type SybaseTableDatasetTypeProperties = original.SybaseTableDatasetTypeProperties +type TabularSource = original.TabularSource type TeradataLinkedService = original.TeradataLinkedService type TeradataLinkedServiceTypeProperties = original.TeradataLinkedServiceTypeProperties type TeradataPartitionSettings = original.TeradataPartitionSettings @@ -1839,6 +1935,7 @@ type TeradataSource = original.TeradataSource type TeradataTableDataset = original.TeradataTableDataset type TeradataTableDatasetTypeProperties = original.TeradataTableDatasetTypeProperties type TextFormat = original.TextFormat +type Transformation = original.Transformation type Trigger = original.Trigger type TriggerDependencyReference = original.TriggerDependencyReference type TriggerListResponse = original.TriggerListResponse @@ -1906,6 +2003,24 @@ func NewActivityRunsClient(subscriptionID string) ActivityRunsClient { func NewActivityRunsClientWithBaseURI(baseURI string, subscriptionID string) ActivityRunsClient { return original.NewActivityRunsClientWithBaseURI(baseURI, subscriptionID) } +func NewDataFlowDebugSessionClient(subscriptionID string) DataFlowDebugSessionClient { + return original.NewDataFlowDebugSessionClient(subscriptionID) +} +func NewDataFlowDebugSessionClientWithBaseURI(baseURI string, subscriptionID string) DataFlowDebugSessionClient { + return original.NewDataFlowDebugSessionClientWithBaseURI(baseURI, subscriptionID) +} +func NewDataFlowListResponseIterator(page DataFlowListResponsePage) DataFlowListResponseIterator { + return original.NewDataFlowListResponseIterator(page) +} +func NewDataFlowListResponsePage(getNextPage func(context.Context, DataFlowListResponse) (DataFlowListResponse, error)) DataFlowListResponsePage { + return original.NewDataFlowListResponsePage(getNextPage) +} +func NewDataFlowsClient(subscriptionID string) DataFlowsClient { + return original.NewDataFlowsClient(subscriptionID) +} +func NewDataFlowsClientWithBaseURI(baseURI string, subscriptionID string) DataFlowsClient { + return original.NewDataFlowsClientWithBaseURI(baseURI, subscriptionID) +} func NewDatasetListResponseIterator(page DatasetListResponsePage) DatasetListResponseIterator { return original.NewDatasetListResponseIterator(page) } @@ -2002,6 +2117,12 @@ func NewPipelinesClient(subscriptionID string) PipelinesClient { func NewPipelinesClientWithBaseURI(baseURI string, subscriptionID string) PipelinesClient { return original.NewPipelinesClientWithBaseURI(baseURI, subscriptionID) } +func NewQueryDataFlowDebugSessionsResponseIterator(page QueryDataFlowDebugSessionsResponsePage) QueryDataFlowDebugSessionsResponseIterator { + return original.NewQueryDataFlowDebugSessionsResponseIterator(page) +} +func NewQueryDataFlowDebugSessionsResponsePage(getNextPage func(context.Context, QueryDataFlowDebugSessionsResponse) (QueryDataFlowDebugSessionsResponse, error)) QueryDataFlowDebugSessionsResponsePage { + return original.NewQueryDataFlowDebugSessionsResponsePage(getNextPage) +} func NewRerunTriggerListResponseIterator(page RerunTriggerListResponsePage) RerunTriggerListResponseIterator { return original.NewRerunTriggerListResponseIterator(page) } @@ -2056,6 +2177,12 @@ func PossibleBlobEventTypesValues() []BlobEventTypes { func PossibleCassandraSourceReadConsistencyLevelsValues() []CassandraSourceReadConsistencyLevels { return original.PossibleCassandraSourceReadConsistencyLevelsValues() } +func PossibleDataFlowComputeTypeValues() []DataFlowComputeType { + return original.PossibleDataFlowComputeTypeValues() +} +func PossibleDataFlowDebugCommandTypeValues() []DataFlowDebugCommandType { + return original.PossibleDataFlowDebugCommandTypeValues() +} func PossibleDayOfWeekValues() []DayOfWeek { return original.PossibleDayOfWeekValues() } @@ -2257,6 +2384,12 @@ func PossibleTypeBasicCopySinkValues() []TypeBasicCopySink { func PossibleTypeBasicCopySourceValues() []TypeBasicCopySource { return original.PossibleTypeBasicCopySourceValues() } +func PossibleTypeBasicCustomSetupBaseValues() []TypeBasicCustomSetupBase { + return original.PossibleTypeBasicCustomSetupBaseValues() +} +func PossibleTypeBasicDataFlowValues() []TypeBasicDataFlow { + return original.PossibleTypeBasicDataFlowValues() +} func PossibleTypeBasicDatasetCompressionValues() []TypeBasicDatasetCompression { return original.PossibleTypeBasicDatasetCompressionValues() } diff --git a/profiles/latest/eventgrid/eventgrid/models.go b/profiles/latest/eventgrid/eventgrid/models.go index 48676620e3d3..bbc94e13941c 100644 --- a/profiles/latest/eventgrid/eventgrid/models.go +++ b/profiles/latest/eventgrid/eventgrid/models.go @@ -102,6 +102,15 @@ type IotHubDeviceCreatedEventData = original.IotHubDeviceCreatedEventData type IotHubDeviceDeletedEventData = original.IotHubDeviceDeletedEventData type IotHubDeviceDisconnectedEventData = original.IotHubDeviceDisconnectedEventData type IotHubDeviceTelemetryEventData = original.IotHubDeviceTelemetryEventData +type KeyVaultCertificateExpiredEventData = original.KeyVaultCertificateExpiredEventData +type KeyVaultCertificateNearExpiryEventData = original.KeyVaultCertificateNearExpiryEventData +type KeyVaultCertificateNewVersionCreatedEventData = original.KeyVaultCertificateNewVersionCreatedEventData +type KeyVaultKeyExpiredEventData = original.KeyVaultKeyExpiredEventData +type KeyVaultKeyNearExpiryEventData = original.KeyVaultKeyNearExpiryEventData +type KeyVaultKeyNewVersionCreatedEventData = original.KeyVaultKeyNewVersionCreatedEventData +type KeyVaultSecretExpiredEventData = original.KeyVaultSecretExpiredEventData +type KeyVaultSecretNearExpiryEventData = original.KeyVaultSecretNearExpiryEventData +type KeyVaultSecretNewVersionCreatedEventData = original.KeyVaultSecretNewVersionCreatedEventData type MapsGeofenceEnteredEventData = original.MapsGeofenceEnteredEventData type MapsGeofenceEventProperties = original.MapsGeofenceEventProperties type MapsGeofenceExitedEventData = original.MapsGeofenceExitedEventData diff --git a/profiles/latest/eventhub/mgmt/eventhub/models.go b/profiles/latest/eventhub/mgmt/eventhub/models.go index 4150c90a89e2..678b8dbc2774 100644 --- a/profiles/latest/eventhub/mgmt/eventhub/models.go +++ b/profiles/latest/eventhub/mgmt/eventhub/models.go @@ -167,6 +167,9 @@ type NamespacesClient = original.NamespacesClient type NamespacesCreateOrUpdateFuture = original.NamespacesCreateOrUpdateFuture type NamespacesDeleteFuture = original.NamespacesDeleteFuture type NetworkRuleSet = original.NetworkRuleSet +type NetworkRuleSetListResult = original.NetworkRuleSetListResult +type NetworkRuleSetListResultIterator = original.NetworkRuleSetListResultIterator +type NetworkRuleSetListResultPage = original.NetworkRuleSetListResultPage type NetworkRuleSetProperties = original.NetworkRuleSetProperties type Operation = original.Operation type OperationDisplay = original.OperationDisplay @@ -245,6 +248,12 @@ func NewNamespacesClient(subscriptionID string) NamespacesClient { func NewNamespacesClientWithBaseURI(baseURI string, subscriptionID string) NamespacesClient { return original.NewNamespacesClientWithBaseURI(baseURI, subscriptionID) } +func NewNetworkRuleSetListResultIterator(page NetworkRuleSetListResultPage) NetworkRuleSetListResultIterator { + return original.NewNetworkRuleSetListResultIterator(page) +} +func NewNetworkRuleSetListResultPage(getNextPage func(context.Context, NetworkRuleSetListResult) (NetworkRuleSetListResult, error)) NetworkRuleSetListResultPage { + return original.NewNetworkRuleSetListResultPage(getNextPage) +} func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return original.NewOperationListResultIterator(page) } diff --git a/profiles/latest/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go b/profiles/latest/frontdoor/mgmt/frontdoor/frontdoorapi/models.go similarity index 63% rename from profiles/latest/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go rename to profiles/latest/frontdoor/mgmt/frontdoor/frontdoorapi/models.go index 497b8771a7f0..08954a3ee34d 100644 --- a/profiles/latest/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go +++ b/profiles/latest/frontdoor/mgmt/frontdoor/frontdoorapi/models.go @@ -17,8 +17,13 @@ // This code was auto-generated by: // github.com/Azure/azure-sdk-for-go/tools/profileBuilder -package anomalyfinderapi +package frontdoorapi -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi" +import original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-05-01/frontdoor/frontdoorapi" type BaseClientAPI = original.BaseClientAPI +type EndpointsClientAPI = original.EndpointsClientAPI +type FrontDoorsClientAPI = original.FrontDoorsClientAPI +type FrontendEndpointsClientAPI = original.FrontendEndpointsClientAPI +type ManagedRuleSetsClientAPI = original.ManagedRuleSetsClientAPI +type PoliciesClientAPI = original.PoliciesClientAPI diff --git a/profiles/latest/frontdoor/mgmt/frontdoor/models.go b/profiles/latest/frontdoor/mgmt/frontdoor/models.go new file mode 100644 index 000000000000..501bee6917c7 --- /dev/null +++ b/profiles/latest/frontdoor/mgmt/frontdoor/models.go @@ -0,0 +1,561 @@ +// +build go1.9 + +// Copyright 2019 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 frontdoor + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-05-01/frontdoor" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type ActionType = original.ActionType + +const ( + Allow ActionType = original.Allow + Block ActionType = original.Block + Log ActionType = original.Log + Redirect ActionType = original.Redirect +) + +type Availability = original.Availability + +const ( + Available Availability = original.Available + Unavailable Availability = original.Unavailable +) + +type BackendEnabledState = original.BackendEnabledState + +const ( + Disabled BackendEnabledState = original.Disabled + Enabled BackendEnabledState = original.Enabled +) + +type CertificateSource = original.CertificateSource + +const ( + CertificateSourceAzureKeyVault CertificateSource = original.CertificateSourceAzureKeyVault + CertificateSourceFrontDoor CertificateSource = original.CertificateSourceFrontDoor +) + +type CertificateType = original.CertificateType + +const ( + Dedicated CertificateType = original.Dedicated +) + +type CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningState + +const ( + CustomHTTPSProvisioningStateDisabled CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateDisabled + CustomHTTPSProvisioningStateDisabling CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateDisabling + CustomHTTPSProvisioningStateEnabled CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateEnabled + CustomHTTPSProvisioningStateEnabling CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateEnabling + CustomHTTPSProvisioningStateFailed CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateFailed +) + +type CustomHTTPSProvisioningSubstate = original.CustomHTTPSProvisioningSubstate + +const ( + CertificateDeleted CustomHTTPSProvisioningSubstate = original.CertificateDeleted + CertificateDeployed CustomHTTPSProvisioningSubstate = original.CertificateDeployed + DeletingCertificate CustomHTTPSProvisioningSubstate = original.DeletingCertificate + DeployingCertificate CustomHTTPSProvisioningSubstate = original.DeployingCertificate + DomainControlValidationRequestApproved CustomHTTPSProvisioningSubstate = original.DomainControlValidationRequestApproved + DomainControlValidationRequestRejected CustomHTTPSProvisioningSubstate = original.DomainControlValidationRequestRejected + DomainControlValidationRequestTimedOut CustomHTTPSProvisioningSubstate = original.DomainControlValidationRequestTimedOut + IssuingCertificate CustomHTTPSProvisioningSubstate = original.IssuingCertificate + PendingDomainControlValidationREquestApproval CustomHTTPSProvisioningSubstate = original.PendingDomainControlValidationREquestApproval + SubmittingDomainControlValidationRequest CustomHTTPSProvisioningSubstate = original.SubmittingDomainControlValidationRequest +) + +type CustomRuleEnabledState = original.CustomRuleEnabledState + +const ( + CustomRuleEnabledStateDisabled CustomRuleEnabledState = original.CustomRuleEnabledStateDisabled + CustomRuleEnabledStateEnabled CustomRuleEnabledState = original.CustomRuleEnabledStateEnabled +) + +type DynamicCompressionEnabled = original.DynamicCompressionEnabled + +const ( + DynamicCompressionEnabledDisabled DynamicCompressionEnabled = original.DynamicCompressionEnabledDisabled + DynamicCompressionEnabledEnabled DynamicCompressionEnabled = original.DynamicCompressionEnabledEnabled +) + +type EnabledState = original.EnabledState + +const ( + EnabledStateDisabled EnabledState = original.EnabledStateDisabled + EnabledStateEnabled EnabledState = original.EnabledStateEnabled +) + +type EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledState + +const ( + EnforceCertificateNameCheckEnabledStateDisabled EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledStateDisabled + EnforceCertificateNameCheckEnabledStateEnabled EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledStateEnabled +) + +type ForwardingProtocol = original.ForwardingProtocol + +const ( + HTTPOnly ForwardingProtocol = original.HTTPOnly + HTTPSOnly ForwardingProtocol = original.HTTPSOnly + MatchRequest ForwardingProtocol = original.MatchRequest +) + +type HealthProbeEnabled = original.HealthProbeEnabled + +const ( + HealthProbeEnabledDisabled HealthProbeEnabled = original.HealthProbeEnabledDisabled + HealthProbeEnabledEnabled HealthProbeEnabled = original.HealthProbeEnabledEnabled +) + +type HealthProbeMethod = original.HealthProbeMethod + +const ( + GET HealthProbeMethod = original.GET + HEAD HealthProbeMethod = original.HEAD +) + +type ManagedRuleEnabledState = original.ManagedRuleEnabledState + +const ( + ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = original.ManagedRuleEnabledStateDisabled + ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = original.ManagedRuleEnabledStateEnabled +) + +type MatchVariable = original.MatchVariable + +const ( + Cookies MatchVariable = original.Cookies + PostArgs MatchVariable = original.PostArgs + QueryString MatchVariable = original.QueryString + RemoteAddr MatchVariable = original.RemoteAddr + RequestBody MatchVariable = original.RequestBody + RequestHeader MatchVariable = original.RequestHeader + RequestMethod MatchVariable = original.RequestMethod + RequestURI MatchVariable = original.RequestURI + SocketAddr MatchVariable = original.SocketAddr +) + +type MinimumTLSVersion = original.MinimumTLSVersion + +const ( + OneFullStopTwo MinimumTLSVersion = original.OneFullStopTwo + OneFullStopZero MinimumTLSVersion = original.OneFullStopZero +) + +type NetworkOperationStatus = original.NetworkOperationStatus + +const ( + Failed NetworkOperationStatus = original.Failed + InProgress NetworkOperationStatus = original.InProgress + Succeeded NetworkOperationStatus = original.Succeeded +) + +type OdataType = original.OdataType + +const ( + OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration OdataType = original.OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration + OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration OdataType = original.OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration + OdataTypeRouteConfiguration OdataType = original.OdataTypeRouteConfiguration +) + +type Operator = original.Operator + +const ( + Any Operator = original.Any + BeginsWith Operator = original.BeginsWith + Contains Operator = original.Contains + EndsWith Operator = original.EndsWith + Equal Operator = original.Equal + GeoMatch Operator = original.GeoMatch + GreaterThan Operator = original.GreaterThan + GreaterThanOrEqual Operator = original.GreaterThanOrEqual + IPMatch Operator = original.IPMatch + LessThan Operator = original.LessThan + LessThanOrEqual Operator = original.LessThanOrEqual + RegEx Operator = original.RegEx +) + +type PolicyEnabledState = original.PolicyEnabledState + +const ( + PolicyEnabledStateDisabled PolicyEnabledState = original.PolicyEnabledStateDisabled + PolicyEnabledStateEnabled PolicyEnabledState = original.PolicyEnabledStateEnabled +) + +type PolicyMode = original.PolicyMode + +const ( + Detection PolicyMode = original.Detection + Prevention PolicyMode = original.Prevention +) + +type PolicyResourceState = original.PolicyResourceState + +const ( + PolicyResourceStateCreating PolicyResourceState = original.PolicyResourceStateCreating + PolicyResourceStateDeleting PolicyResourceState = original.PolicyResourceStateDeleting + PolicyResourceStateDisabled PolicyResourceState = original.PolicyResourceStateDisabled + PolicyResourceStateDisabling PolicyResourceState = original.PolicyResourceStateDisabling + PolicyResourceStateEnabled PolicyResourceState = original.PolicyResourceStateEnabled + PolicyResourceStateEnabling PolicyResourceState = original.PolicyResourceStateEnabling +) + +type Protocol = original.Protocol + +const ( + HTTP Protocol = original.HTTP + HTTPS Protocol = original.HTTPS +) + +type Query = original.Query + +const ( + StripAll Query = original.StripAll + StripNone Query = original.StripNone +) + +type RedirectProtocol = original.RedirectProtocol + +const ( + RedirectProtocolHTTPOnly RedirectProtocol = original.RedirectProtocolHTTPOnly + RedirectProtocolHTTPSOnly RedirectProtocol = original.RedirectProtocolHTTPSOnly + RedirectProtocolMatchRequest RedirectProtocol = original.RedirectProtocolMatchRequest +) + +type RedirectType = original.RedirectType + +const ( + Found RedirectType = original.Found + Moved RedirectType = original.Moved + PermanentRedirect RedirectType = original.PermanentRedirect + TemporaryRedirect RedirectType = original.TemporaryRedirect +) + +type ResourceState = original.ResourceState + +const ( + ResourceStateCreating ResourceState = original.ResourceStateCreating + ResourceStateDeleting ResourceState = original.ResourceStateDeleting + ResourceStateDisabled ResourceState = original.ResourceStateDisabled + ResourceStateDisabling ResourceState = original.ResourceStateDisabling + ResourceStateEnabled ResourceState = original.ResourceStateEnabled + ResourceStateEnabling ResourceState = original.ResourceStateEnabling +) + +type ResourceType = original.ResourceType + +const ( + MicrosoftNetworkfrontDoors ResourceType = original.MicrosoftNetworkfrontDoors + MicrosoftNetworkfrontDoorsfrontendEndpoints ResourceType = original.MicrosoftNetworkfrontDoorsfrontendEndpoints +) + +type RoutingRuleEnabledState = original.RoutingRuleEnabledState + +const ( + RoutingRuleEnabledStateDisabled RoutingRuleEnabledState = original.RoutingRuleEnabledStateDisabled + RoutingRuleEnabledStateEnabled RoutingRuleEnabledState = original.RoutingRuleEnabledStateEnabled +) + +type RuleType = original.RuleType + +const ( + MatchRule RuleType = original.MatchRule + RateLimitRule RuleType = original.RateLimitRule +) + +type SessionAffinityEnabledState = original.SessionAffinityEnabledState + +const ( + SessionAffinityEnabledStateDisabled SessionAffinityEnabledState = original.SessionAffinityEnabledStateDisabled + SessionAffinityEnabledStateEnabled SessionAffinityEnabledState = original.SessionAffinityEnabledStateEnabled +) + +type TransformType = original.TransformType + +const ( + Lowercase TransformType = original.Lowercase + RemoveNulls TransformType = original.RemoveNulls + Trim TransformType = original.Trim + Uppercase TransformType = original.Uppercase + URLDecode TransformType = original.URLDecode + URLEncode TransformType = original.URLEncode +) + +type AzureAsyncOperationResult = original.AzureAsyncOperationResult +type Backend = original.Backend +type BackendPool = original.BackendPool +type BackendPoolListResult = original.BackendPoolListResult +type BackendPoolProperties = original.BackendPoolProperties +type BackendPoolUpdateParameters = original.BackendPoolUpdateParameters +type BackendPoolsSettings = original.BackendPoolsSettings +type BaseClient = original.BaseClient +type BasicRouteConfiguration = original.BasicRouteConfiguration +type CacheConfiguration = original.CacheConfiguration +type CertificateSourceParameters = original.CertificateSourceParameters +type CheckNameAvailabilityInput = original.CheckNameAvailabilityInput +type CheckNameAvailabilityOutput = original.CheckNameAvailabilityOutput +type CustomHTTPSConfiguration = original.CustomHTTPSConfiguration +type CustomRule = original.CustomRule +type CustomRuleList = original.CustomRuleList +type EndpointsClient = original.EndpointsClient +type EndpointsPurgeContentFuture = original.EndpointsPurgeContentFuture +type Error = original.Error +type ErrorDetails = original.ErrorDetails +type ErrorResponse = original.ErrorResponse +type ForwardingConfiguration = original.ForwardingConfiguration +type FrontDoor = original.FrontDoor +type FrontDoorsClient = original.FrontDoorsClient +type FrontDoorsCreateOrUpdateFutureType = original.FrontDoorsCreateOrUpdateFutureType +type FrontDoorsDeleteFutureType = original.FrontDoorsDeleteFutureType +type FrontendEndpoint = original.FrontendEndpoint +type FrontendEndpointLink = original.FrontendEndpointLink +type FrontendEndpointProperties = original.FrontendEndpointProperties +type FrontendEndpointUpdateParameters = original.FrontendEndpointUpdateParameters +type FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink = original.FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink +type FrontendEndpointsClient = original.FrontendEndpointsClient +type FrontendEndpointsDisableHTTPSFuture = original.FrontendEndpointsDisableHTTPSFuture +type FrontendEndpointsEnableHTTPSFuture = original.FrontendEndpointsEnableHTTPSFuture +type FrontendEndpointsListResult = original.FrontendEndpointsListResult +type FrontendEndpointsListResultIterator = original.FrontendEndpointsListResultIterator +type FrontendEndpointsListResultPage = original.FrontendEndpointsListResultPage +type HealthProbeSettingsListResult = original.HealthProbeSettingsListResult +type HealthProbeSettingsModel = original.HealthProbeSettingsModel +type HealthProbeSettingsProperties = original.HealthProbeSettingsProperties +type HealthProbeSettingsUpdateParameters = original.HealthProbeSettingsUpdateParameters +type KeyVaultCertificateSourceParameters = original.KeyVaultCertificateSourceParameters +type KeyVaultCertificateSourceParametersVault = original.KeyVaultCertificateSourceParametersVault +type ListResult = original.ListResult +type ListResultIterator = original.ListResultIterator +type ListResultPage = original.ListResultPage +type LoadBalancingSettingsListResult = original.LoadBalancingSettingsListResult +type LoadBalancingSettingsModel = original.LoadBalancingSettingsModel +type LoadBalancingSettingsProperties = original.LoadBalancingSettingsProperties +type LoadBalancingSettingsUpdateParameters = original.LoadBalancingSettingsUpdateParameters +type ManagedRuleDefinition = original.ManagedRuleDefinition +type ManagedRuleGroupDefinition = original.ManagedRuleGroupDefinition +type ManagedRuleGroupOverride = original.ManagedRuleGroupOverride +type ManagedRuleOverride = original.ManagedRuleOverride +type ManagedRuleSet = original.ManagedRuleSet +type ManagedRuleSetDefinition = original.ManagedRuleSetDefinition +type ManagedRuleSetDefinitionList = original.ManagedRuleSetDefinitionList +type ManagedRuleSetDefinitionListIterator = original.ManagedRuleSetDefinitionListIterator +type ManagedRuleSetDefinitionListPage = original.ManagedRuleSetDefinitionListPage +type ManagedRuleSetDefinitionProperties = original.ManagedRuleSetDefinitionProperties +type ManagedRuleSetList = original.ManagedRuleSetList +type ManagedRuleSetsClient = original.ManagedRuleSetsClient +type MatchCondition = original.MatchCondition +type PoliciesClient = original.PoliciesClient +type PoliciesCreateOrUpdateFuture = original.PoliciesCreateOrUpdateFuture +type PoliciesDeleteFuture = original.PoliciesDeleteFuture +type PolicySettings = original.PolicySettings +type Properties = original.Properties +type PurgeParameters = original.PurgeParameters +type RedirectConfiguration = original.RedirectConfiguration +type Resource = original.Resource +type RouteConfiguration = original.RouteConfiguration +type RoutingRule = original.RoutingRule +type RoutingRuleListResult = original.RoutingRuleListResult +type RoutingRuleProperties = original.RoutingRuleProperties +type RoutingRuleUpdateParameters = original.RoutingRuleUpdateParameters +type SubResource = original.SubResource +type TagsObject = original.TagsObject +type UpdateParameters = original.UpdateParameters +type ValidateCustomDomainInput = original.ValidateCustomDomainInput +type ValidateCustomDomainOutput = original.ValidateCustomDomainOutput +type WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicy +type WebApplicationFirewallPolicyList = original.WebApplicationFirewallPolicyList +type WebApplicationFirewallPolicyListIterator = original.WebApplicationFirewallPolicyListIterator +type WebApplicationFirewallPolicyListPage = original.WebApplicationFirewallPolicyListPage +type WebApplicationFirewallPolicyProperties = original.WebApplicationFirewallPolicyProperties + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewEndpointsClient(subscriptionID string) EndpointsClient { + return original.NewEndpointsClient(subscriptionID) +} +func NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string) EndpointsClient { + return original.NewEndpointsClientWithBaseURI(baseURI, subscriptionID) +} +func NewFrontDoorsClient(subscriptionID string) FrontDoorsClient { + return original.NewFrontDoorsClient(subscriptionID) +} +func NewFrontDoorsClientWithBaseURI(baseURI string, subscriptionID string) FrontDoorsClient { + return original.NewFrontDoorsClientWithBaseURI(baseURI, subscriptionID) +} +func NewFrontendEndpointsClient(subscriptionID string) FrontendEndpointsClient { + return original.NewFrontendEndpointsClient(subscriptionID) +} +func NewFrontendEndpointsClientWithBaseURI(baseURI string, subscriptionID string) FrontendEndpointsClient { + return original.NewFrontendEndpointsClientWithBaseURI(baseURI, subscriptionID) +} +func NewFrontendEndpointsListResultIterator(page FrontendEndpointsListResultPage) FrontendEndpointsListResultIterator { + return original.NewFrontendEndpointsListResultIterator(page) +} +func NewFrontendEndpointsListResultPage(getNextPage func(context.Context, FrontendEndpointsListResult) (FrontendEndpointsListResult, error)) FrontendEndpointsListResultPage { + return original.NewFrontendEndpointsListResultPage(getNextPage) +} +func NewListResultIterator(page ListResultPage) ListResultIterator { + return original.NewListResultIterator(page) +} +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return original.NewListResultPage(getNextPage) +} +func NewManagedRuleSetDefinitionListIterator(page ManagedRuleSetDefinitionListPage) ManagedRuleSetDefinitionListIterator { + return original.NewManagedRuleSetDefinitionListIterator(page) +} +func NewManagedRuleSetDefinitionListPage(getNextPage func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error)) ManagedRuleSetDefinitionListPage { + return original.NewManagedRuleSetDefinitionListPage(getNextPage) +} +func NewManagedRuleSetsClient(subscriptionID string) ManagedRuleSetsClient { + return original.NewManagedRuleSetsClient(subscriptionID) +} +func NewManagedRuleSetsClientWithBaseURI(baseURI string, subscriptionID string) ManagedRuleSetsClient { + return original.NewManagedRuleSetsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPoliciesClient(subscriptionID string) PoliciesClient { + return original.NewPoliciesClient(subscriptionID) +} +func NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string) PoliciesClient { + return original.NewPoliciesClientWithBaseURI(baseURI, subscriptionID) +} +func NewWebApplicationFirewallPolicyListIterator(page WebApplicationFirewallPolicyListPage) WebApplicationFirewallPolicyListIterator { + return original.NewWebApplicationFirewallPolicyListIterator(page) +} +func NewWebApplicationFirewallPolicyListPage(getNextPage func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error)) WebApplicationFirewallPolicyListPage { + return original.NewWebApplicationFirewallPolicyListPage(getNextPage) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleActionTypeValues() []ActionType { + return original.PossibleActionTypeValues() +} +func PossibleAvailabilityValues() []Availability { + return original.PossibleAvailabilityValues() +} +func PossibleBackendEnabledStateValues() []BackendEnabledState { + return original.PossibleBackendEnabledStateValues() +} +func PossibleCertificateSourceValues() []CertificateSource { + return original.PossibleCertificateSourceValues() +} +func PossibleCertificateTypeValues() []CertificateType { + return original.PossibleCertificateTypeValues() +} +func PossibleCustomHTTPSProvisioningStateValues() []CustomHTTPSProvisioningState { + return original.PossibleCustomHTTPSProvisioningStateValues() +} +func PossibleCustomHTTPSProvisioningSubstateValues() []CustomHTTPSProvisioningSubstate { + return original.PossibleCustomHTTPSProvisioningSubstateValues() +} +func PossibleCustomRuleEnabledStateValues() []CustomRuleEnabledState { + return original.PossibleCustomRuleEnabledStateValues() +} +func PossibleDynamicCompressionEnabledValues() []DynamicCompressionEnabled { + return original.PossibleDynamicCompressionEnabledValues() +} +func PossibleEnabledStateValues() []EnabledState { + return original.PossibleEnabledStateValues() +} +func PossibleEnforceCertificateNameCheckEnabledStateValues() []EnforceCertificateNameCheckEnabledState { + return original.PossibleEnforceCertificateNameCheckEnabledStateValues() +} +func PossibleForwardingProtocolValues() []ForwardingProtocol { + return original.PossibleForwardingProtocolValues() +} +func PossibleHealthProbeEnabledValues() []HealthProbeEnabled { + return original.PossibleHealthProbeEnabledValues() +} +func PossibleHealthProbeMethodValues() []HealthProbeMethod { + return original.PossibleHealthProbeMethodValues() +} +func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { + return original.PossibleManagedRuleEnabledStateValues() +} +func PossibleMatchVariableValues() []MatchVariable { + return original.PossibleMatchVariableValues() +} +func PossibleMinimumTLSVersionValues() []MinimumTLSVersion { + return original.PossibleMinimumTLSVersionValues() +} +func PossibleNetworkOperationStatusValues() []NetworkOperationStatus { + return original.PossibleNetworkOperationStatusValues() +} +func PossibleOdataTypeValues() []OdataType { + return original.PossibleOdataTypeValues() +} +func PossibleOperatorValues() []Operator { + return original.PossibleOperatorValues() +} +func PossiblePolicyEnabledStateValues() []PolicyEnabledState { + return original.PossiblePolicyEnabledStateValues() +} +func PossiblePolicyModeValues() []PolicyMode { + return original.PossiblePolicyModeValues() +} +func PossiblePolicyResourceStateValues() []PolicyResourceState { + return original.PossiblePolicyResourceStateValues() +} +func PossibleProtocolValues() []Protocol { + return original.PossibleProtocolValues() +} +func PossibleQueryValues() []Query { + return original.PossibleQueryValues() +} +func PossibleRedirectProtocolValues() []RedirectProtocol { + return original.PossibleRedirectProtocolValues() +} +func PossibleRedirectTypeValues() []RedirectType { + return original.PossibleRedirectTypeValues() +} +func PossibleResourceStateValues() []ResourceState { + return original.PossibleResourceStateValues() +} +func PossibleResourceTypeValues() []ResourceType { + return original.PossibleResourceTypeValues() +} +func PossibleRoutingRuleEnabledStateValues() []RoutingRuleEnabledState { + return original.PossibleRoutingRuleEnabledStateValues() +} +func PossibleRuleTypeValues() []RuleType { + return original.PossibleRuleTypeValues() +} +func PossibleSessionAffinityEnabledStateValues() []SessionAffinityEnabledState { + return original.PossibleSessionAffinityEnabledStateValues() +} +func PossibleTransformTypeValues() []TransformType { + return original.PossibleTransformTypeValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/latest" +} +func Version() string { + return original.Version() +} diff --git a/profiles/preview/preview/devspaces/mgmt/devspaces/devspacesapi/models.go b/profiles/latest/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go similarity index 73% rename from profiles/preview/preview/devspaces/mgmt/devspaces/devspacesapi/models.go rename to profiles/latest/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go index 4950c9f77c2b..ebd9615bd1ab 100644 --- a/profiles/preview/preview/devspaces/mgmt/devspaces/devspacesapi/models.go +++ b/profiles/latest/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go @@ -17,10 +17,10 @@ // This code was auto-generated by: // github.com/Azure/azure-sdk-for-go/tools/profileBuilder -package devspacesapi +package healthcareapisapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/devspacesapi" +import original "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis/healthcareapisapi" -type ContainerHostMappingsClientAPI = original.ContainerHostMappingsClientAPI -type ControllersClientAPI = original.ControllersClientAPI +type OperationResultsClientAPI = original.OperationResultsClientAPI type OperationsClientAPI = original.OperationsClientAPI +type ServicesClientAPI = original.ServicesClientAPI diff --git a/profiles/latest/healthcareapis/mgmt/healthcareapis/models.go b/profiles/latest/healthcareapis/mgmt/healthcareapis/models.go new file mode 100644 index 000000000000..0018a473de12 --- /dev/null +++ b/profiles/latest/healthcareapis/mgmt/healthcareapis/models.go @@ -0,0 +1,154 @@ +// +build go1.9 + +// Copyright 2019 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 healthcareapis + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type Kind = original.Kind + +const ( + Fhir Kind = original.Fhir + FhirR4 Kind = original.FhirR4 + FhirStu3 Kind = original.FhirStu3 +) + +type OperationResultStatus = original.OperationResultStatus + +const ( + Canceled OperationResultStatus = original.Canceled + Failed OperationResultStatus = original.Failed + Requested OperationResultStatus = original.Requested + Running OperationResultStatus = original.Running + Succeeded OperationResultStatus = original.Succeeded +) + +type ProvisioningState = original.ProvisioningState + +const ( + ProvisioningStateAccepted ProvisioningState = original.ProvisioningStateAccepted + ProvisioningStateCanceled ProvisioningState = original.ProvisioningStateCanceled + ProvisioningStateCreating ProvisioningState = original.ProvisioningStateCreating + ProvisioningStateDeleting ProvisioningState = original.ProvisioningStateDeleting + ProvisioningStateDeprovisioned ProvisioningState = original.ProvisioningStateDeprovisioned + ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed + ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded + ProvisioningStateUpdating ProvisioningState = original.ProvisioningStateUpdating + ProvisioningStateVerifying ProvisioningState = original.ProvisioningStateVerifying +) + +type ServiceNameUnavailabilityReason = original.ServiceNameUnavailabilityReason + +const ( + AlreadyExists ServiceNameUnavailabilityReason = original.AlreadyExists + Invalid ServiceNameUnavailabilityReason = original.Invalid +) + +type BaseClient = original.BaseClient +type CheckNameAvailabilityParameters = original.CheckNameAvailabilityParameters +type ErrorDetails = original.ErrorDetails +type ErrorDetailsInternal = original.ErrorDetailsInternal +type Operation = original.Operation +type OperationDisplay = original.OperationDisplay +type OperationListResult = original.OperationListResult +type OperationListResultIterator = original.OperationListResultIterator +type OperationListResultPage = original.OperationListResultPage +type OperationResultsClient = original.OperationResultsClient +type OperationResultsDescription = original.OperationResultsDescription +type OperationsClient = original.OperationsClient +type Resource = original.Resource +type ServiceAccessPolicyEntry = original.ServiceAccessPolicyEntry +type ServiceAuthenticationConfigurationInfo = original.ServiceAuthenticationConfigurationInfo +type ServiceCorsConfigurationInfo = original.ServiceCorsConfigurationInfo +type ServiceCosmosDbConfigurationInfo = original.ServiceCosmosDbConfigurationInfo +type ServicesClient = original.ServicesClient +type ServicesCreateOrUpdateFuture = original.ServicesCreateOrUpdateFuture +type ServicesDeleteFuture = original.ServicesDeleteFuture +type ServicesDescription = original.ServicesDescription +type ServicesDescriptionListResult = original.ServicesDescriptionListResult +type ServicesDescriptionListResultIterator = original.ServicesDescriptionListResultIterator +type ServicesDescriptionListResultPage = original.ServicesDescriptionListResultPage +type ServicesNameAvailabilityInfo = original.ServicesNameAvailabilityInfo +type ServicesPatchDescription = original.ServicesPatchDescription +type ServicesProperties = original.ServicesProperties +type ServicesUpdateFuture = original.ServicesUpdateFuture +type SetObject = original.SetObject + +func New(subscriptionID string) BaseClient { + return original.New(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 NewOperationResultsClient(subscriptionID string) OperationResultsClient { + return original.NewOperationResultsClient(subscriptionID) +} +func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationResultsClient { + return original.NewOperationResultsClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewServicesClient(subscriptionID string) ServicesClient { + return original.NewServicesClient(subscriptionID) +} +func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { + return original.NewServicesClientWithBaseURI(baseURI, subscriptionID) +} +func NewServicesDescriptionListResultIterator(page ServicesDescriptionListResultPage) ServicesDescriptionListResultIterator { + return original.NewServicesDescriptionListResultIterator(page) +} +func NewServicesDescriptionListResultPage(getNextPage func(context.Context, ServicesDescriptionListResult) (ServicesDescriptionListResult, error)) ServicesDescriptionListResultPage { + return original.NewServicesDescriptionListResultPage(getNextPage) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleKindValues() []Kind { + return original.PossibleKindValues() +} +func PossibleOperationResultStatusValues() []OperationResultStatus { + return original.PossibleOperationResultStatusValues() +} +func PossibleProvisioningStateValues() []ProvisioningState { + return original.PossibleProvisioningStateValues() +} +func PossibleServiceNameUnavailabilityReasonValues() []ServiceNameUnavailabilityReason { + return original.PossibleServiceNameUnavailabilityReasonValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/latest" +} +func Version() string { + return original.Version() +} diff --git a/profiles/latest/kusto/mgmt/kusto/kustoapi/models.go b/profiles/latest/kusto/mgmt/kusto/kustoapi/models.go index 07c81eaf8dab..25b871538b2d 100644 --- a/profiles/latest/kusto/mgmt/kusto/kustoapi/models.go +++ b/profiles/latest/kusto/mgmt/kusto/kustoapi/models.go @@ -19,8 +19,9 @@ package kustoapi -import original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-05-15/kusto/kustoapi" +import original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-09-07/kusto/kustoapi" +type AttachedDatabaseConfigurationsClientAPI = original.AttachedDatabaseConfigurationsClientAPI type ClustersClientAPI = original.ClustersClientAPI type DataConnectionsClientAPI = original.DataConnectionsClientAPI type DatabasesClientAPI = original.DatabasesClientAPI diff --git a/profiles/latest/kusto/mgmt/kusto/models.go b/profiles/latest/kusto/mgmt/kusto/models.go index fa4db8764073..917855cd280e 100644 --- a/profiles/latest/kusto/mgmt/kusto/models.go +++ b/profiles/latest/kusto/mgmt/kusto/models.go @@ -22,7 +22,7 @@ package kusto import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-05-15/kusto" + original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-09-07/kusto" ) const ( @@ -74,6 +74,7 @@ const ( SINGLEJSON DataFormat = original.SINGLEJSON SOHSV DataFormat = original.SOHSV TSV DataFormat = original.TSV + TSVE DataFormat = original.TSVE TXT DataFormat = original.TXT ) @@ -96,13 +97,44 @@ const ( DatabasePrincipalTypeUser DatabasePrincipalType = original.DatabasePrincipalTypeUser ) +type DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKind + +const ( + DefaultPrincipalsModificationKindNone DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKindNone + DefaultPrincipalsModificationKindReplace DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKindReplace + DefaultPrincipalsModificationKindUnion DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKindUnion +) + +type IdentityType = original.IdentityType + +const ( + IdentityTypeNone IdentityType = original.IdentityTypeNone + IdentityTypeSystemAssigned IdentityType = original.IdentityTypeSystemAssigned +) + type Kind = original.Kind const ( - KindDataConnection Kind = original.KindDataConnection - KindEventGrid Kind = original.KindEventGrid - KindEventHub Kind = original.KindEventHub - KindIotHub Kind = original.KindIotHub + KindDatabase Kind = original.KindDatabase + KindReadOnlyFollowing Kind = original.KindReadOnlyFollowing + KindReadWrite Kind = original.KindReadWrite +) + +type KindBasicDataConnection = original.KindBasicDataConnection + +const ( + KindDataConnection KindBasicDataConnection = original.KindDataConnection + KindEventGrid KindBasicDataConnection = original.KindEventGrid + KindEventHub KindBasicDataConnection = original.KindEventHub + KindIotHub KindBasicDataConnection = original.KindIotHub +) + +type PrincipalsModificationKind = original.PrincipalsModificationKind + +const ( + PrincipalsModificationKindNone PrincipalsModificationKind = original.PrincipalsModificationKindNone + PrincipalsModificationKindReplace PrincipalsModificationKind = original.PrincipalsModificationKindReplace + PrincipalsModificationKindUnion PrincipalsModificationKind = original.PrincipalsModificationKindUnion ) type ProvisioningState = original.ProvisioningState @@ -137,12 +169,27 @@ const ( StateUpdating State = original.StateUpdating ) +type Type = original.Type + +const ( + MicrosoftKustoclustersattachedDatabaseConfigurations Type = original.MicrosoftKustoclustersattachedDatabaseConfigurations + MicrosoftKustoclustersdatabases Type = original.MicrosoftKustoclustersdatabases +) + +type AttachedDatabaseConfiguration = original.AttachedDatabaseConfiguration +type AttachedDatabaseConfigurationListResult = original.AttachedDatabaseConfigurationListResult +type AttachedDatabaseConfigurationProperties = original.AttachedDatabaseConfigurationProperties +type AttachedDatabaseConfigurationsClient = original.AttachedDatabaseConfigurationsClient +type AttachedDatabaseConfigurationsCreateOrUpdateFuture = original.AttachedDatabaseConfigurationsCreateOrUpdateFuture +type AttachedDatabaseConfigurationsDeleteFuture = original.AttachedDatabaseConfigurationsDeleteFuture type AzureCapacity = original.AzureCapacity type AzureEntityResource = original.AzureEntityResource type AzureResourceSku = original.AzureResourceSku type AzureSku = original.AzureSku type BaseClient = original.BaseClient type BasicDataConnection = original.BasicDataConnection +type BasicDatabase = original.BasicDatabase +type CheckNameRequest = original.CheckNameRequest type CheckNameResult = original.CheckNameResult type CloudError = original.CloudError type CloudErrorBody = original.CloudErrorBody @@ -154,6 +201,7 @@ type ClusterUpdate = original.ClusterUpdate type ClustersClient = original.ClustersClient type ClustersCreateOrUpdateFuture = original.ClustersCreateOrUpdateFuture type ClustersDeleteFuture = original.ClustersDeleteFuture +type ClustersDetachFollowerDatabasesFuture = original.ClustersDetachFollowerDatabasesFuture type ClustersStartFuture = original.ClustersStartFuture type ClustersStopFuture = original.ClustersStopFuture type ClustersUpdateFuture = original.ClustersUpdateFuture @@ -169,14 +217,12 @@ type DataConnectionsCreateOrUpdateFuture = original.DataConnectionsCreateOrUpdat type DataConnectionsDeleteFuture = original.DataConnectionsDeleteFuture type DataConnectionsUpdateFuture = original.DataConnectionsUpdateFuture type Database = original.Database -type DatabaseCheckNameRequest = original.DatabaseCheckNameRequest type DatabaseListResult = original.DatabaseListResult +type DatabaseModel = original.DatabaseModel type DatabasePrincipal = original.DatabasePrincipal type DatabasePrincipalListRequest = original.DatabasePrincipalListRequest type DatabasePrincipalListResult = original.DatabasePrincipalListResult -type DatabaseProperties = original.DatabaseProperties type DatabaseStatistics = original.DatabaseStatistics -type DatabaseUpdate = original.DatabaseUpdate type DatabasesClient = original.DatabasesClient type DatabasesCreateOrUpdateFuture = original.DatabasesCreateOrUpdateFuture type DatabasesDeleteFuture = original.DatabasesDeleteFuture @@ -185,8 +231,13 @@ type EventGridConnectionProperties = original.EventGridConnectionProperties type EventGridDataConnection = original.EventGridDataConnection type EventHubConnectionProperties = original.EventHubConnectionProperties type EventHubDataConnection = original.EventHubDataConnection +type FollowerDatabaseDefinition = original.FollowerDatabaseDefinition +type FollowerDatabaseListResult = original.FollowerDatabaseListResult +type Identity = original.Identity +type IdentityUserAssignedIdentitiesValue = original.IdentityUserAssignedIdentitiesValue type IotHubConnectionProperties = original.IotHubConnectionProperties type IotHubDataConnection = original.IotHubDataConnection +type KeyVaultProperties = original.KeyVaultProperties type ListResourceSkusResult = original.ListResourceSkusResult type Operation = original.Operation type OperationDisplay = original.OperationDisplay @@ -196,6 +247,10 @@ type OperationListResultPage = original.OperationListResultPage type OperationsClient = original.OperationsClient type OptimizedAutoscale = original.OptimizedAutoscale type ProxyResource = original.ProxyResource +type ReadOnlyFollowingDatabase = original.ReadOnlyFollowingDatabase +type ReadOnlyFollowingDatabaseProperties = original.ReadOnlyFollowingDatabaseProperties +type ReadWriteDatabase = original.ReadWriteDatabase +type ReadWriteDatabaseProperties = original.ReadWriteDatabaseProperties type Resource = original.Resource type SkuDescription = original.SkuDescription type SkuDescriptionList = original.SkuDescriptionList @@ -207,6 +262,12 @@ type VirtualNetworkConfiguration = original.VirtualNetworkConfiguration func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } +func NewAttachedDatabaseConfigurationsClient(subscriptionID string) AttachedDatabaseConfigurationsClient { + return original.NewAttachedDatabaseConfigurationsClient(subscriptionID) +} +func NewAttachedDatabaseConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) AttachedDatabaseConfigurationsClient { + return original.NewAttachedDatabaseConfigurationsClientWithBaseURI(baseURI, subscriptionID) +} func NewClustersClient(subscriptionID string) ClustersClient { return original.NewClustersClient(subscriptionID) } @@ -258,9 +319,21 @@ func PossibleDatabasePrincipalRoleValues() []DatabasePrincipalRole { func PossibleDatabasePrincipalTypeValues() []DatabasePrincipalType { return original.PossibleDatabasePrincipalTypeValues() } +func PossibleDefaultPrincipalsModificationKindValues() []DefaultPrincipalsModificationKind { + return original.PossibleDefaultPrincipalsModificationKindValues() +} +func PossibleIdentityTypeValues() []IdentityType { + return original.PossibleIdentityTypeValues() +} +func PossibleKindBasicDataConnectionValues() []KindBasicDataConnection { + return original.PossibleKindBasicDataConnectionValues() +} func PossibleKindValues() []Kind { return original.PossibleKindValues() } +func PossiblePrincipalsModificationKindValues() []PrincipalsModificationKind { + return original.PossiblePrincipalsModificationKindValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } @@ -270,6 +343,9 @@ func PossibleReasonValues() []Reason { func PossibleStateValues() []State { return original.PossibleStateValues() } +func PossibleTypeValues() []Type { + return original.PossibleTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/latest" } diff --git a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go index 0d80dd1aa71c..7304674d88f3 100644 --- a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go +++ b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go @@ -23,6 +23,7 @@ import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservi type MachineLearningComputeClientAPI = original.MachineLearningComputeClientAPI type OperationsClientAPI = original.OperationsClientAPI +type QuotasClientAPI = original.QuotasClientAPI type UsagesClientAPI = original.UsagesClientAPI type VirtualMachineSizesClientAPI = original.VirtualMachineSizesClientAPI type WorkspacesClientAPI = original.WorkspacesClientAPI diff --git a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go index 683b49dd75be..ee20b507ed49 100644 --- a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go +++ b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go @@ -100,6 +100,12 @@ const ( Updating ProvisioningState = original.Updating ) +type QuotaUnit = original.QuotaUnit + +const ( + Count QuotaUnit = original.Count +) + type RemoteLoginPortPublicAccess = original.RemoteLoginPortPublicAccess const ( @@ -117,8 +123,19 @@ const ( type Status = original.Status const ( - StatusDisabled Status = original.StatusDisabled - StatusEnabled Status = original.StatusEnabled + Failure Status = original.Failure + InvalidQuotaBelowClusterMinimum Status = original.InvalidQuotaBelowClusterMinimum + InvalidQuotaExceedsSubscriptionLimit Status = original.InvalidQuotaExceedsSubscriptionLimit + InvalidVMFamilyName Status = original.InvalidVMFamilyName + Success Status = original.Success + Undefined Status = original.Undefined +) + +type Status1 = original.Status1 + +const ( + Status1Disabled Status1 = original.Status1Disabled + Status1Enabled Status1 = original.Status1Enabled ) type UnderlyingResourceAction = original.UnderlyingResourceAction @@ -131,7 +148,7 @@ const ( type UsageUnit = original.UsageUnit const ( - Count UsageUnit = original.Count + UsageUnitCount UsageUnit = original.UsageUnitCount ) type VMPriority = original.VMPriority @@ -176,6 +193,9 @@ type ListUsagesResult = original.ListUsagesResult type ListUsagesResultIterator = original.ListUsagesResultIterator type ListUsagesResultPage = original.ListUsagesResultPage type ListWorkspaceKeysResult = original.ListWorkspaceKeysResult +type ListWorkspaceQuotas = original.ListWorkspaceQuotas +type ListWorkspaceQuotasIterator = original.ListWorkspaceQuotasIterator +type ListWorkspaceQuotasPage = original.ListWorkspaceQuotasPage type MachineLearningComputeClient = original.MachineLearningComputeClient type MachineLearningComputeCreateOrUpdateFuture = original.MachineLearningComputeCreateOrUpdateFuture type MachineLearningComputeDeleteFuture = original.MachineLearningComputeDeleteFuture @@ -189,13 +209,20 @@ type PaginatedComputeResourcesList = original.PaginatedComputeResourcesList type PaginatedComputeResourcesListIterator = original.PaginatedComputeResourcesListIterator type PaginatedComputeResourcesListPage = original.PaginatedComputeResourcesListPage type Password = original.Password +type QuotaBaseProperties = original.QuotaBaseProperties +type QuotaUpdateParameters = original.QuotaUpdateParameters +type QuotasClient = original.QuotasClient type RegistryListCredentialsResult = original.RegistryListCredentialsResult type Resource = original.Resource type ResourceID = original.ResourceID +type ResourceName = original.ResourceName +type ResourceQuota = original.ResourceQuota type ScaleSettings = original.ScaleSettings type ServicePrincipalCredentials = original.ServicePrincipalCredentials type SslConfiguration = original.SslConfiguration type SystemService = original.SystemService +type UpdateWorkspaceQuotas = original.UpdateWorkspaceQuotas +type UpdateWorkspaceQuotasResult = original.UpdateWorkspaceQuotasResult type Usage = original.Usage type UsageName = original.UsageName type UsagesClient = original.UsagesClient @@ -225,6 +252,12 @@ func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIter func NewListUsagesResultPage(getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { return original.NewListUsagesResultPage(getNextPage) } +func NewListWorkspaceQuotasIterator(page ListWorkspaceQuotasPage) ListWorkspaceQuotasIterator { + return original.NewListWorkspaceQuotasIterator(page) +} +func NewListWorkspaceQuotasPage(getNextPage func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error)) ListWorkspaceQuotasPage { + return original.NewListWorkspaceQuotasPage(getNextPage) +} func NewMachineLearningComputeClient(subscriptionID string) MachineLearningComputeClient { return original.NewMachineLearningComputeClient(subscriptionID) } @@ -243,6 +276,12 @@ func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesList func NewPaginatedComputeResourcesListPage(getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage { return original.NewPaginatedComputeResourcesListPage(getNextPage) } +func NewQuotasClient(subscriptionID string) QuotasClient { + return original.NewQuotasClient(subscriptionID) +} +func NewQuotasClientWithBaseURI(baseURI string, subscriptionID string) QuotasClient { + return original.NewQuotasClientWithBaseURI(baseURI, subscriptionID) +} func NewUsagesClient(subscriptionID string) UsagesClient { return original.NewUsagesClient(subscriptionID) } @@ -291,12 +330,18 @@ func PossibleNodeStateValues() []NodeState { func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } +func PossibleQuotaUnitValues() []QuotaUnit { + return original.PossibleQuotaUnitValues() +} func PossibleRemoteLoginPortPublicAccessValues() []RemoteLoginPortPublicAccess { return original.PossibleRemoteLoginPortPublicAccessValues() } func PossibleResourceIdentityTypeValues() []ResourceIdentityType { return original.PossibleResourceIdentityTypeValues() } +func PossibleStatus1Values() []Status1 { + return original.PossibleStatus1Values() +} func PossibleStatusValues() []Status { return original.PossibleStatusValues() } diff --git a/profiles/latest/mobileengagement/mgmt/mobileengagement/models.go b/profiles/latest/mobileengagement/mgmt/mobileengagement/models.go deleted file mode 100644 index aa0e123aae85..000000000000 --- a/profiles/latest/mobileengagement/mgmt/mobileengagement/models.go +++ /dev/null @@ -1,394 +0,0 @@ -// +build go1.9 - -// Copyright 2019 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 mobileengagement - -import original "github.com/Azure/azure-sdk-for-go/services/mobileengagement/mgmt/2014-12-01/mobileengagement" - -const ( - DefaultBaseURI = original.DefaultBaseURI -) - -type AudienceOperators = original.AudienceOperators - -const ( - EQ AudienceOperators = original.EQ - GE AudienceOperators = original.GE - GT AudienceOperators = original.GT - LE AudienceOperators = original.LE - LT AudienceOperators = original.LT -) - -type CampaignFeedbacks = original.CampaignFeedbacks - -const ( - Actioned CampaignFeedbacks = original.Actioned - Exited CampaignFeedbacks = original.Exited - Pushed CampaignFeedbacks = original.Pushed - Replied CampaignFeedbacks = original.Replied -) - -type CampaignKinds = original.CampaignKinds - -const ( - Announcements CampaignKinds = original.Announcements - DataPushes CampaignKinds = original.DataPushes - NativePushes CampaignKinds = original.NativePushes - Polls CampaignKinds = original.Polls -) - -type CampaignStates = original.CampaignStates - -const ( - Draft CampaignStates = original.Draft - Finished CampaignStates = original.Finished - InProgress CampaignStates = original.InProgress - Queued CampaignStates = original.Queued - Scheduled CampaignStates = original.Scheduled -) - -type CampaignType = original.CampaignType - -const ( - Announcement CampaignType = original.Announcement - DataPush CampaignType = original.DataPush - NativePush CampaignType = original.NativePush - Poll CampaignType = original.Poll -) - -type CampaignTypes = original.CampaignTypes - -const ( - OnlyNotif CampaignTypes = original.OnlyNotif - Textbase64 CampaignTypes = original.Textbase64 - Texthtml CampaignTypes = original.Texthtml - Textplain CampaignTypes = original.Textplain -) - -type DeliveryTimes = original.DeliveryTimes - -const ( - Any DeliveryTimes = original.Any - Background DeliveryTimes = original.Background - Session DeliveryTimes = original.Session -) - -type ExportFormat = original.ExportFormat - -const ( - CsvBlob ExportFormat = original.CsvBlob - JSONBlob ExportFormat = original.JSONBlob -) - -type ExportState = original.ExportState - -const ( - ExportStateFailed ExportState = original.ExportStateFailed - ExportStateQueued ExportState = original.ExportStateQueued - ExportStateStarted ExportState = original.ExportStateStarted - ExportStateSucceeded ExportState = original.ExportStateSucceeded -) - -type ExportType = original.ExportType - -const ( - ExportTypeActivity ExportType = original.ExportTypeActivity - ExportTypeCrash ExportType = original.ExportTypeCrash - ExportTypeError ExportType = original.ExportTypeError - ExportTypeEvent ExportType = original.ExportTypeEvent - ExportTypeJob ExportType = original.ExportTypeJob - ExportTypePush ExportType = original.ExportTypePush - ExportTypeSession ExportType = original.ExportTypeSession - ExportTypeTag ExportType = original.ExportTypeTag - ExportTypeToken ExportType = original.ExportTypeToken -) - -type JobStates = original.JobStates - -const ( - JobStatesFailed JobStates = original.JobStatesFailed - JobStatesQueued JobStates = original.JobStatesQueued - JobStatesStarted JobStates = original.JobStatesStarted - JobStatesSucceeded JobStates = original.JobStatesSucceeded -) - -type NotificationTypes = original.NotificationTypes - -const ( - Popup NotificationTypes = original.Popup - System NotificationTypes = original.System -) - -type ProvisioningStates = original.ProvisioningStates - -const ( - Creating ProvisioningStates = original.Creating - Succeeded ProvisioningStates = original.Succeeded -) - -type PushModes = original.PushModes - -const ( - Manual PushModes = original.Manual - OneShot PushModes = original.OneShot - RealTime PushModes = original.RealTime -) - -type Type = original.Type - -const ( - TypeAnnouncementFeedback Type = original.TypeAnnouncementFeedback - TypeApplicationVersion Type = original.TypeApplicationVersion - TypeBooleanTag Type = original.TypeBooleanTag - TypeCarrierCountry Type = original.TypeCarrierCountry - TypeCarrierName Type = original.TypeCarrierName - TypeCriterion Type = original.TypeCriterion - TypeDatapushFeedback Type = original.TypeDatapushFeedback - TypeDateTag Type = original.TypeDateTag - TypeDeviceManufacturer Type = original.TypeDeviceManufacturer - TypeDeviceModel Type = original.TypeDeviceModel - TypeFirmwareVersion Type = original.TypeFirmwareVersion - TypeGeoFencing Type = original.TypeGeoFencing - TypeIntegerTag Type = original.TypeIntegerTag - TypeLanguage Type = original.TypeLanguage - TypeLocation Type = original.TypeLocation - TypeNetworkType Type = original.TypeNetworkType - TypePollAnswerFeedback Type = original.TypePollAnswerFeedback - TypePollFeedback Type = original.TypePollFeedback - TypeScreenSize Type = original.TypeScreenSize - TypeSegment Type = original.TypeSegment - TypeStringTag Type = original.TypeStringTag -) - -type TypeBasicFilter = original.TypeBasicFilter - -const ( - TypeAppInfo TypeBasicFilter = original.TypeAppInfo - TypeEngageActiveUsers TypeBasicFilter = original.TypeEngageActiveUsers - TypeEngageIdleUsers TypeBasicFilter = original.TypeEngageIdleUsers - TypeEngageNewUsers TypeBasicFilter = original.TypeEngageNewUsers - TypeEngageOldUsers TypeBasicFilter = original.TypeEngageOldUsers - TypeEngageSubset TypeBasicFilter = original.TypeEngageSubset - TypeFilter TypeBasicFilter = original.TypeFilter - TypeNativePushEnabled TypeBasicFilter = original.TypeNativePushEnabled - TypePushQuota TypeBasicFilter = original.TypePushQuota -) - -type APIError = original.APIError -type APIErrorError = original.APIErrorError -type AnnouncementFeedbackCriterion = original.AnnouncementFeedbackCriterion -type App = original.App -type AppCollection = original.AppCollection -type AppCollectionListResult = original.AppCollectionListResult -type AppCollectionListResultIterator = original.AppCollectionListResultIterator -type AppCollectionListResultPage = original.AppCollectionListResultPage -type AppCollectionNameAvailability = original.AppCollectionNameAvailability -type AppCollectionProperties = original.AppCollectionProperties -type AppCollectionsClient = original.AppCollectionsClient -type AppInfoFilter = original.AppInfoFilter -type AppListResult = original.AppListResult -type AppListResultIterator = original.AppListResultIterator -type AppListResultPage = original.AppListResultPage -type AppProperties = original.AppProperties -type ApplicationVersionCriterion = original.ApplicationVersionCriterion -type AppsClient = original.AppsClient -type BaseClient = original.BaseClient -type BasicCriterion = original.BasicCriterion -type BasicFilter = original.BasicFilter -type BooleanTagCriterion = original.BooleanTagCriterion -type Campaign = original.Campaign -type CampaignAudience = original.CampaignAudience -type CampaignListResult = original.CampaignListResult -type CampaignLocalization = original.CampaignLocalization -type CampaignPushParameters = original.CampaignPushParameters -type CampaignPushResult = original.CampaignPushResult -type CampaignResult = original.CampaignResult -type CampaignState = original.CampaignState -type CampaignStateResult = original.CampaignStateResult -type CampaignStatisticsResult = original.CampaignStatisticsResult -type CampaignTestNewParameters = original.CampaignTestNewParameters -type CampaignTestSavedParameters = original.CampaignTestSavedParameters -type CampaignsClient = original.CampaignsClient -type CampaignsListResult = original.CampaignsListResult -type CampaignsListResultIterator = original.CampaignsListResultIterator -type CampaignsListResultPage = original.CampaignsListResultPage -type CarrierCountryCriterion = original.CarrierCountryCriterion -type CarrierNameCriterion = original.CarrierNameCriterion -type Criterion = original.Criterion -type DatapushFeedbackCriterion = original.DatapushFeedbackCriterion -type DateRangeExportTaskParameter = original.DateRangeExportTaskParameter -type DateTagCriterion = original.DateTagCriterion -type Device = original.Device -type DeviceInfo = original.DeviceInfo -type DeviceLocation = original.DeviceLocation -type DeviceManufacturerCriterion = original.DeviceManufacturerCriterion -type DeviceMeta = original.DeviceMeta -type DeviceModelCriterion = original.DeviceModelCriterion -type DeviceQueryResult = original.DeviceQueryResult -type DeviceTagsParameters = original.DeviceTagsParameters -type DeviceTagsResult = original.DeviceTagsResult -type DevicesClient = original.DevicesClient -type DevicesQueryResult = original.DevicesQueryResult -type DevicesQueryResultIterator = original.DevicesQueryResultIterator -type DevicesQueryResultPage = original.DevicesQueryResultPage -type EngageActiveUsersFilter = original.EngageActiveUsersFilter -type EngageIdleUsersFilter = original.EngageIdleUsersFilter -type EngageNewUsersFilter = original.EngageNewUsersFilter -type EngageOldUsersFilter = original.EngageOldUsersFilter -type EngageSubsetFilter = original.EngageSubsetFilter -type ExportOptions = original.ExportOptions -type ExportTaskListResult = original.ExportTaskListResult -type ExportTaskListResultIterator = original.ExportTaskListResultIterator -type ExportTaskListResultPage = original.ExportTaskListResultPage -type ExportTaskParameter = original.ExportTaskParameter -type ExportTaskResult = original.ExportTaskResult -type ExportTasksClient = original.ExportTasksClient -type FeedbackByCampaignParameter = original.FeedbackByCampaignParameter -type FeedbackByDateRangeParameter = original.FeedbackByDateRangeParameter -type Filter = original.Filter -type FirmwareVersionCriterion = original.FirmwareVersionCriterion -type GeoFencingCriterion = original.GeoFencingCriterion -type ImportTask = original.ImportTask -type ImportTaskListResult = original.ImportTaskListResult -type ImportTaskListResultIterator = original.ImportTaskListResultIterator -type ImportTaskListResultPage = original.ImportTaskListResultPage -type ImportTaskResult = original.ImportTaskResult -type ImportTasksClient = original.ImportTasksClient -type IntegerTagCriterion = original.IntegerTagCriterion -type LanguageCriterion = original.LanguageCriterion -type LocationCriterion = original.LocationCriterion -type NativePushEnabledFilter = original.NativePushEnabledFilter -type NetworkTypeCriterion = original.NetworkTypeCriterion -type NotificationOptions = original.NotificationOptions -type PollAnswerFeedbackCriterion = original.PollAnswerFeedbackCriterion -type PollFeedbackCriterion = original.PollFeedbackCriterion -type PollQuestion = original.PollQuestion -type PollQuestionChoice = original.PollQuestionChoice -type PollQuestionChoiceLocalization = original.PollQuestionChoiceLocalization -type PollQuestionLocalization = original.PollQuestionLocalization -type PushQuotaFilter = original.PushQuotaFilter -type Resource = original.Resource -type ScreenSizeCriterion = original.ScreenSizeCriterion -type SegmentCriterion = original.SegmentCriterion -type StringTagCriterion = original.StringTagCriterion -type SupportedPlatformsClient = original.SupportedPlatformsClient -type SupportedPlatformsListResult = original.SupportedPlatformsListResult - -func New(subscriptionID string) BaseClient { - return original.New(subscriptionID) -} -func NewAppCollectionsClient(subscriptionID string) AppCollectionsClient { - return original.NewAppCollectionsClient(subscriptionID) -} -func NewAppCollectionsClientWithBaseURI(baseURI string, subscriptionID string) AppCollectionsClient { - return original.NewAppCollectionsClientWithBaseURI(baseURI, subscriptionID) -} -func NewAppsClient(subscriptionID string) AppsClient { - return original.NewAppsClient(subscriptionID) -} -func NewAppsClientWithBaseURI(baseURI string, subscriptionID string) AppsClient { - return original.NewAppsClientWithBaseURI(baseURI, subscriptionID) -} -func NewCampaignsClient(subscriptionID string) CampaignsClient { - return original.NewCampaignsClient(subscriptionID) -} -func NewCampaignsClientWithBaseURI(baseURI string, subscriptionID string) CampaignsClient { - return original.NewCampaignsClientWithBaseURI(baseURI, subscriptionID) -} -func NewDevicesClient(subscriptionID string) DevicesClient { - return original.NewDevicesClient(subscriptionID) -} -func NewDevicesClientWithBaseURI(baseURI string, subscriptionID string) DevicesClient { - return original.NewDevicesClientWithBaseURI(baseURI, subscriptionID) -} -func NewExportTasksClient(subscriptionID string) ExportTasksClient { - return original.NewExportTasksClient(subscriptionID) -} -func NewExportTasksClientWithBaseURI(baseURI string, subscriptionID string) ExportTasksClient { - return original.NewExportTasksClientWithBaseURI(baseURI, subscriptionID) -} -func NewImportTasksClient(subscriptionID string) ImportTasksClient { - return original.NewImportTasksClient(subscriptionID) -} -func NewImportTasksClientWithBaseURI(baseURI string, subscriptionID string) ImportTasksClient { - return original.NewImportTasksClientWithBaseURI(baseURI, subscriptionID) -} -func NewSupportedPlatformsClient(subscriptionID string) SupportedPlatformsClient { - return original.NewSupportedPlatformsClient(subscriptionID) -} -func NewSupportedPlatformsClientWithBaseURI(baseURI string, subscriptionID string) SupportedPlatformsClient { - return original.NewSupportedPlatformsClientWithBaseURI(baseURI, subscriptionID) -} -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return original.NewWithBaseURI(baseURI, subscriptionID) -} -func PossibleAudienceOperatorsValues() []AudienceOperators { - return original.PossibleAudienceOperatorsValues() -} -func PossibleCampaignFeedbacksValues() []CampaignFeedbacks { - return original.PossibleCampaignFeedbacksValues() -} -func PossibleCampaignKindsValues() []CampaignKinds { - return original.PossibleCampaignKindsValues() -} -func PossibleCampaignStatesValues() []CampaignStates { - return original.PossibleCampaignStatesValues() -} -func PossibleCampaignTypeValues() []CampaignType { - return original.PossibleCampaignTypeValues() -} -func PossibleCampaignTypesValues() []CampaignTypes { - return original.PossibleCampaignTypesValues() -} -func PossibleDeliveryTimesValues() []DeliveryTimes { - return original.PossibleDeliveryTimesValues() -} -func PossibleExportFormatValues() []ExportFormat { - return original.PossibleExportFormatValues() -} -func PossibleExportStateValues() []ExportState { - return original.PossibleExportStateValues() -} -func PossibleExportTypeValues() []ExportType { - return original.PossibleExportTypeValues() -} -func PossibleJobStatesValues() []JobStates { - return original.PossibleJobStatesValues() -} -func PossibleNotificationTypesValues() []NotificationTypes { - return original.PossibleNotificationTypesValues() -} -func PossibleProvisioningStatesValues() []ProvisioningStates { - return original.PossibleProvisioningStatesValues() -} -func PossiblePushModesValues() []PushModes { - return original.PossiblePushModesValues() -} -func PossibleTypeBasicFilterValues() []TypeBasicFilter { - return original.PossibleTypeBasicFilterValues() -} -func PossibleTypeValues() []Type { - return original.PossibleTypeValues() -} -func UserAgent() string { - return original.UserAgent() + " profiles/latest" -} -func Version() string { - return original.Version() -} diff --git a/profiles/latest/resources/mgmt/subscriptions/models.go b/profiles/latest/resources/mgmt/subscriptions/models.go index ed022ca731f3..0013c129fd6f 100644 --- a/profiles/latest/resources/mgmt/subscriptions/models.go +++ b/profiles/latest/resources/mgmt/subscriptions/models.go @@ -22,7 +22,7 @@ package subscriptions import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions" + original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions" ) const ( @@ -54,6 +54,7 @@ type ListResultIterator = original.ListResultIterator type ListResultPage = original.ListResultPage type Location = original.Location type LocationListResult = original.LocationListResult +type ManagedByTenant = original.ManagedByTenant type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult diff --git a/profiles/latest/resources/mgmt/subscriptions/subscriptionsapi/models.go b/profiles/latest/resources/mgmt/subscriptions/subscriptionsapi/models.go index 310ddf1a3680..160e7606fe40 100644 --- a/profiles/latest/resources/mgmt/subscriptions/subscriptionsapi/models.go +++ b/profiles/latest/resources/mgmt/subscriptions/subscriptionsapi/models.go @@ -19,7 +19,7 @@ package subscriptionsapi -import original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions/subscriptionsapi" +import original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/subscriptionsapi" type ClientAPI = original.ClientAPI type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/latest/servicebus/mgmt/servicebus/models.go b/profiles/latest/servicebus/mgmt/servicebus/models.go index f43a1dcb5b3c..a2bf7db2ca77 100644 --- a/profiles/latest/servicebus/mgmt/servicebus/models.go +++ b/profiles/latest/servicebus/mgmt/servicebus/models.go @@ -187,6 +187,9 @@ type NamespacesClient = original.NamespacesClient type NamespacesCreateOrUpdateFuture = original.NamespacesCreateOrUpdateFuture type NamespacesDeleteFuture = original.NamespacesDeleteFuture type NetworkRuleSet = original.NetworkRuleSet +type NetworkRuleSetListResult = original.NetworkRuleSetListResult +type NetworkRuleSetListResultIterator = original.NetworkRuleSetListResultIterator +type NetworkRuleSetListResultPage = original.NetworkRuleSetListResultPage type NetworkRuleSetProperties = original.NetworkRuleSetProperties type Operation = original.Operation type OperationDisplay = original.OperationDisplay @@ -296,6 +299,12 @@ func NewNamespacesClient(subscriptionID string) NamespacesClient { func NewNamespacesClientWithBaseURI(baseURI string, subscriptionID string) NamespacesClient { return original.NewNamespacesClientWithBaseURI(baseURI, subscriptionID) } +func NewNetworkRuleSetListResultIterator(page NetworkRuleSetListResultPage) NetworkRuleSetListResultIterator { + return original.NewNetworkRuleSetListResultIterator(page) +} +func NewNetworkRuleSetListResultPage(getNextPage func(context.Context, NetworkRuleSetListResult) (NetworkRuleSetListResult, error)) NetworkRuleSetListResultPage { + return original.NewNetworkRuleSetListResultPage(getNextPage) +} func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return original.NewOperationListResultIterator(page) } diff --git a/profiles/latest/storage/datalake/storagedatalake/models.go b/profiles/latest/storage/datalake/storagedatalake/models.go index 00f7de7109ea..2c818b7bc172 100644 --- a/profiles/latest/storage/datalake/storagedatalake/models.go +++ b/profiles/latest/storage/datalake/storagedatalake/models.go @@ -19,7 +19,7 @@ package storagedatalake -import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-11-09/storagedatalake" +import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2019-10-31/storagedatalake" const ( DefaultDNSSuffix = original.DefaultDNSSuffix @@ -28,6 +28,7 @@ const ( type PathGetPropertiesAction = original.PathGetPropertiesAction const ( + CheckAccess PathGetPropertiesAction = original.CheckAccess GetAccessControl PathGetPropertiesAction = original.GetAccessControl GetStatus PathGetPropertiesAction = original.GetStatus ) diff --git a/profiles/latest/storage/datalake/storagedatalake/storagedatalakeapi/models.go b/profiles/latest/storage/datalake/storagedatalake/storagedatalakeapi/models.go index 278b9df7f518..fe6cd4856f06 100644 --- a/profiles/latest/storage/datalake/storagedatalake/storagedatalakeapi/models.go +++ b/profiles/latest/storage/datalake/storagedatalake/storagedatalakeapi/models.go @@ -19,7 +19,7 @@ package storagedatalakeapi -import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-11-09/storagedatalake/storagedatalakeapi" +import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2019-10-31/storagedatalake/storagedatalakeapi" type FilesystemClientAPI = original.FilesystemClientAPI type PathClientAPI = original.PathClientAPI diff --git a/profiles/latest/storage/mgmt/storage/models.go b/profiles/latest/storage/mgmt/storage/models.go index 0c1eee97ccf2..a37cf2345411 100644 --- a/profiles/latest/storage/mgmt/storage/models.go +++ b/profiles/latest/storage/mgmt/storage/models.go @@ -142,6 +142,13 @@ const ( StorageV2 Kind = original.StorageV2 ) +type LargeFileSharesState = original.LargeFileSharesState + +const ( + Disabled LargeFileSharesState = original.Disabled + Enabled LargeFileSharesState = original.Enabled +) + type LeaseDuration = original.LeaseDuration const ( @@ -282,6 +289,8 @@ type AccountCreateParameters = original.AccountCreateParameters type AccountKey = original.AccountKey type AccountListKeysResult = original.AccountListKeysResult type AccountListResult = original.AccountListResult +type AccountListResultIterator = original.AccountListResultIterator +type AccountListResultPage = original.AccountListResultPage type AccountProperties = original.AccountProperties type AccountPropertiesCreateParameters = original.AccountPropertiesCreateParameters type AccountPropertiesUpdateParameters = original.AccountPropertiesUpdateParameters @@ -300,7 +309,10 @@ type BlobServiceItems = original.BlobServiceItems type BlobServiceProperties = original.BlobServiceProperties type BlobServicePropertiesProperties = original.BlobServicePropertiesProperties type BlobServicesClient = original.BlobServicesClient +type ChangeFeed = original.ChangeFeed type CheckNameAvailabilityResult = original.CheckNameAvailabilityResult +type CloudError = original.CloudError +type CloudErrorBody = original.CloudErrorBody type ContainerProperties = original.ContainerProperties type CorsRule = original.CorsRule type CorsRules = original.CorsRules @@ -313,8 +325,6 @@ type Encryption = original.Encryption type EncryptionService = original.EncryptionService type EncryptionServices = original.EncryptionServices type Endpoints = original.Endpoints -type ErrorResponse = original.ErrorResponse -type ErrorResponseBody = original.ErrorResponseBody type FileServiceItems = original.FileServiceItems type FileServiceProperties = original.FileServiceProperties type FileServicePropertiesProperties = original.FileServicePropertiesProperties @@ -381,6 +391,12 @@ type VirtualNetworkRule = original.VirtualNetworkRule func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } +func NewAccountListResultIterator(page AccountListResultPage) AccountListResultIterator { + return original.NewAccountListResultIterator(page) +} +func NewAccountListResultPage(getNextPage func(context.Context, AccountListResult) (AccountListResult, error)) AccountListResultPage { + return original.NewAccountListResultPage(getNextPage) +} func NewAccountsClient(subscriptionID string) AccountsClient { return original.NewAccountsClient(subscriptionID) } @@ -495,6 +511,9 @@ func PossibleKeySourceValues() []KeySource { func PossibleKindValues() []Kind { return original.PossibleKindValues() } +func PossibleLargeFileSharesStateValues() []LargeFileSharesState { + return original.PossibleLargeFileSharesStateValues() +} func PossibleLeaseDurationValues() []LeaseDuration { return original.PossibleLeaseDurationValues() } diff --git a/profiles/preview/appinsights/insights/models.go b/profiles/preview/appinsights/insights/models.go deleted file mode 100644 index cc63022b1de0..000000000000 --- a/profiles/preview/appinsights/insights/models.go +++ /dev/null @@ -1,229 +0,0 @@ -// +build go1.9 - -// Copyright 2019 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 insights - -import original "github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights" - -const ( - DefaultBaseURI = original.DefaultBaseURI -) - -type EventType = original.EventType - -const ( - All EventType = original.All - AvailabilityResults EventType = original.AvailabilityResults - BrowserTimings EventType = original.BrowserTimings - CustomEvents EventType = original.CustomEvents - CustomMetrics EventType = original.CustomMetrics - Dependencies EventType = original.Dependencies - Exceptions EventType = original.Exceptions - PageViews EventType = original.PageViews - PerformanceCounters EventType = original.PerformanceCounters - Requests EventType = original.Requests - Traces EventType = original.Traces -) - -type MetricID = original.MetricID - -const ( - AvailabilityResultsavailabilityPercentage MetricID = original.AvailabilityResultsavailabilityPercentage - AvailabilityResultsduration MetricID = original.AvailabilityResultsduration - BillingtelemetryCount MetricID = original.BillingtelemetryCount - ClientnetworkDuration MetricID = original.ClientnetworkDuration - ClientprocessingDuration MetricID = original.ClientprocessingDuration - ClientreceiveDuration MetricID = original.ClientreceiveDuration - ClientsendDuration MetricID = original.ClientsendDuration - ClienttotalDuration MetricID = original.ClienttotalDuration - CustomEventscount MetricID = original.CustomEventscount - Dependenciescount MetricID = original.Dependenciescount - Dependenciesduration MetricID = original.Dependenciesduration - Dependenciesfailed MetricID = original.Dependenciesfailed - Exceptionsbrowser MetricID = original.Exceptionsbrowser - Exceptionscount MetricID = original.Exceptionscount - Exceptionsserver MetricID = original.Exceptionsserver - PageViewscount MetricID = original.PageViewscount - PageViewsduration MetricID = original.PageViewsduration - PerformanceCountersexceptionsPerSecond MetricID = original.PerformanceCountersexceptionsPerSecond - PerformanceCountersmemoryAvailableBytes MetricID = original.PerformanceCountersmemoryAvailableBytes - PerformanceCountersprocessCPUPercentage MetricID = original.PerformanceCountersprocessCPUPercentage - PerformanceCountersprocessIOBytesPerSecond MetricID = original.PerformanceCountersprocessIOBytesPerSecond - PerformanceCountersprocessorCPUPercentage MetricID = original.PerformanceCountersprocessorCPUPercentage - PerformanceCountersprocessPrivateBytes MetricID = original.PerformanceCountersprocessPrivateBytes - PerformanceCountersrequestExecutionTime MetricID = original.PerformanceCountersrequestExecutionTime - PerformanceCountersrequestsInQueue MetricID = original.PerformanceCountersrequestsInQueue - PerformanceCountersrequestsPerSecond MetricID = original.PerformanceCountersrequestsPerSecond - Requestscount MetricID = original.Requestscount - Requestsduration MetricID = original.Requestsduration - Requestsfailed MetricID = original.Requestsfailed - Sessionscount MetricID = original.Sessionscount - Usersauthenticated MetricID = original.Usersauthenticated - Userscount MetricID = original.Userscount -) - -type MetricsAggregation = original.MetricsAggregation - -const ( - Avg MetricsAggregation = original.Avg - Count MetricsAggregation = original.Count - Max MetricsAggregation = original.Max - Min MetricsAggregation = original.Min - Sum MetricsAggregation = original.Sum - Unique MetricsAggregation = original.Unique -) - -type MetricsSegment = original.MetricsSegment - -const ( - ApplicationBuild MetricsSegment = original.ApplicationBuild - ApplicationVersion MetricsSegment = original.ApplicationVersion - AuthenticatedOrAnonymousTraffic MetricsSegment = original.AuthenticatedOrAnonymousTraffic - Browser MetricsSegment = original.Browser - BrowserVersion MetricsSegment = original.BrowserVersion - City MetricsSegment = original.City - CloudRoleName MetricsSegment = original.CloudRoleName - CloudServiceName MetricsSegment = original.CloudServiceName - Continent MetricsSegment = original.Continent - CountryOrRegion MetricsSegment = original.CountryOrRegion - DeploymentID MetricsSegment = original.DeploymentID - DeploymentUnit MetricsSegment = original.DeploymentUnit - DeviceType MetricsSegment = original.DeviceType - Environment MetricsSegment = original.Environment - HostingLocation MetricsSegment = original.HostingLocation - InstanceName MetricsSegment = original.InstanceName -) - -type Type = original.Type - -const ( - TypeAvailabilityResult Type = original.TypeAvailabilityResult - TypeBrowserTiming Type = original.TypeBrowserTiming - TypeCustomEvent Type = original.TypeCustomEvent - TypeCustomMetric Type = original.TypeCustomMetric - TypeDependency Type = original.TypeDependency - TypeEventsResultData Type = original.TypeEventsResultData - TypeException Type = original.TypeException - TypePageView Type = original.TypePageView - TypePerformanceCounter Type = original.TypePerformanceCounter - TypeRequest Type = original.TypeRequest - TypeTrace Type = original.TypeTrace -) - -type BaseClient = original.BaseClient -type BasicEventsResultData = original.BasicEventsResultData -type Column = original.Column -type ErrorDetail = original.ErrorDetail -type ErrorInfo = original.ErrorInfo -type ErrorResponse = original.ErrorResponse -type EventsAiInfo = original.EventsAiInfo -type EventsApplicationInfo = original.EventsApplicationInfo -type EventsAvailabilityResultInfo = original.EventsAvailabilityResultInfo -type EventsAvailabilityResultResult = original.EventsAvailabilityResultResult -type EventsBrowserTimingInfo = original.EventsBrowserTimingInfo -type EventsBrowserTimingResult = original.EventsBrowserTimingResult -type EventsClient = original.EventsClient -type EventsClientInfo = original.EventsClientInfo -type EventsClientPerformanceInfo = original.EventsClientPerformanceInfo -type EventsCloudInfo = original.EventsCloudInfo -type EventsCustomEventInfo = original.EventsCustomEventInfo -type EventsCustomEventResult = original.EventsCustomEventResult -type EventsCustomMetricInfo = original.EventsCustomMetricInfo -type EventsCustomMetricResult = original.EventsCustomMetricResult -type EventsDependencyInfo = original.EventsDependencyInfo -type EventsDependencyResult = original.EventsDependencyResult -type EventsExceptionDetail = original.EventsExceptionDetail -type EventsExceptionDetailsParsedStack = original.EventsExceptionDetailsParsedStack -type EventsExceptionInfo = original.EventsExceptionInfo -type EventsExceptionResult = original.EventsExceptionResult -type EventsOperationInfo = original.EventsOperationInfo -type EventsPageViewInfo = original.EventsPageViewInfo -type EventsPageViewResult = original.EventsPageViewResult -type EventsPerformanceCounterInfo = original.EventsPerformanceCounterInfo -type EventsPerformanceCounterResult = original.EventsPerformanceCounterResult -type EventsRequestInfo = original.EventsRequestInfo -type EventsRequestResult = original.EventsRequestResult -type EventsResult = original.EventsResult -type EventsResultData = original.EventsResultData -type EventsResultDataCustomDimensions = original.EventsResultDataCustomDimensions -type EventsResultDataCustomMeasurements = original.EventsResultDataCustomMeasurements -type EventsResults = original.EventsResults -type EventsSessionInfo = original.EventsSessionInfo -type EventsTraceInfo = original.EventsTraceInfo -type EventsTraceResult = original.EventsTraceResult -type EventsUserInfo = original.EventsUserInfo -type ListMetricsResultsItem = original.ListMetricsResultsItem -type MetricsClient = original.MetricsClient -type MetricsPostBodySchema = original.MetricsPostBodySchema -type MetricsPostBodySchemaParameters = original.MetricsPostBodySchemaParameters -type MetricsResult = original.MetricsResult -type MetricsResultInfo = original.MetricsResultInfo -type MetricsResultsItem = original.MetricsResultsItem -type MetricsSegmentInfo = original.MetricsSegmentInfo -type QueryBody = original.QueryBody -type QueryClient = original.QueryClient -type QueryResults = original.QueryResults -type SetObject = original.SetObject -type Table = original.Table - -func New() BaseClient { - return original.New() -} -func NewEventsClient() EventsClient { - return original.NewEventsClient() -} -func NewEventsClientWithBaseURI(baseURI string) EventsClient { - return original.NewEventsClientWithBaseURI(baseURI) -} -func NewMetricsClient() MetricsClient { - return original.NewMetricsClient() -} -func NewMetricsClientWithBaseURI(baseURI string) MetricsClient { - return original.NewMetricsClientWithBaseURI(baseURI) -} -func NewQueryClient() QueryClient { - return original.NewQueryClient() -} -func NewQueryClientWithBaseURI(baseURI string) QueryClient { - return original.NewQueryClientWithBaseURI(baseURI) -} -func NewWithBaseURI(baseURI string) BaseClient { - return original.NewWithBaseURI(baseURI) -} -func PossibleEventTypeValues() []EventType { - return original.PossibleEventTypeValues() -} -func PossibleMetricIDValues() []MetricID { - return original.PossibleMetricIDValues() -} -func PossibleMetricsAggregationValues() []MetricsAggregation { - return original.PossibleMetricsAggregationValues() -} -func PossibleMetricsSegmentValues() []MetricsSegment { - return original.PossibleMetricsSegmentValues() -} -func PossibleTypeValues() []Type { - return original.PossibleTypeValues() -} -func UserAgent() string { - return original.UserAgent() + " profiles/preview" -} -func Version() string { - return original.Version() -} diff --git a/profiles/preview/cognitiveservices/anomalyfinder/models.go b/profiles/preview/cognitiveservices/anomalyfinder/models.go deleted file mode 100644 index a0cb7dd25a4f..000000000000 --- a/profiles/preview/cognitiveservices/anomalyfinder/models.go +++ /dev/null @@ -1,56 +0,0 @@ -// +build go1.9 - -// Copyright 2019 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 anomalyfinder - -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder" - -type Granularity = original.Granularity - -const ( - Daily Granularity = original.Daily - Hourly Granularity = original.Hourly - Minutely Granularity = original.Minutely - Monthly Granularity = original.Monthly - Weekly Granularity = original.Weekly - Yearly Granularity = original.Yearly -) - -type APIError = original.APIError -type BaseClient = original.BaseClient -type EntireDetectResponse = original.EntireDetectResponse -type LastDetectResponse = original.LastDetectResponse -type Point = original.Point -type Request = original.Request - -func New(endpoint string) BaseClient { - return original.New(endpoint) -} -func NewWithoutDefaults(endpoint string) BaseClient { - return original.NewWithoutDefaults(endpoint) -} -func PossibleGranularityValues() []Granularity { - return original.PossibleGranularityValues() -} -func UserAgent() string { - return original.UserAgent() + " profiles/preview" -} -func Version() string { - return original.Version() -} diff --git a/profiles/preview/cognitiveservices/luis/programmatic/models.go b/profiles/preview/cognitiveservices/luis/programmatic/models.go deleted file mode 100644 index bb1528ceddbc..000000000000 --- a/profiles/preview/cognitiveservices/luis/programmatic/models.go +++ /dev/null @@ -1,453 +0,0 @@ -// +build go1.9 - -// Copyright 2019 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 programmatic - -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/programmatic" - -type AzureRegions = original.AzureRegions - -const ( - Australiaeast AzureRegions = original.Australiaeast - Brazilsouth AzureRegions = original.Brazilsouth - Eastasia AzureRegions = original.Eastasia - Eastus AzureRegions = original.Eastus - Eastus2 AzureRegions = original.Eastus2 - Northeurope AzureRegions = original.Northeurope - Southcentralus AzureRegions = original.Southcentralus - Southeastasia AzureRegions = original.Southeastasia - Westcentralus AzureRegions = original.Westcentralus - Westeurope AzureRegions = original.Westeurope - Westus AzureRegions = original.Westus - Westus2 AzureRegions = original.Westus2 -) - -type OperationStatusType = original.OperationStatusType - -const ( - Failed OperationStatusType = original.Failed - FAILED OperationStatusType = original.FAILED - Success OperationStatusType = original.Success -) - -type ReadableType = original.ReadableType - -const ( - ReadableTypeClosedListEntityExtractor ReadableType = original.ReadableTypeClosedListEntityExtractor - ReadableTypeCompositeEntityExtractor ReadableType = original.ReadableTypeCompositeEntityExtractor - ReadableTypeEntityExtractor ReadableType = original.ReadableTypeEntityExtractor - ReadableTypeHierarchicalChildEntityExtractor ReadableType = original.ReadableTypeHierarchicalChildEntityExtractor - ReadableTypeHierarchicalEntityExtractor ReadableType = original.ReadableTypeHierarchicalEntityExtractor - ReadableTypeIntentClassifier ReadableType = original.ReadableTypeIntentClassifier - ReadableTypePatternAnyEntityExtractor ReadableType = original.ReadableTypePatternAnyEntityExtractor - ReadableTypePrebuiltEntityExtractor ReadableType = original.ReadableTypePrebuiltEntityExtractor - ReadableTypeRegexEntityExtractor ReadableType = original.ReadableTypeRegexEntityExtractor -) - -type ReadableType1 = original.ReadableType1 - -const ( - ReadableType1ClosedListEntityExtractor ReadableType1 = original.ReadableType1ClosedListEntityExtractor - ReadableType1CompositeEntityExtractor ReadableType1 = original.ReadableType1CompositeEntityExtractor - ReadableType1EntityExtractor ReadableType1 = original.ReadableType1EntityExtractor - ReadableType1HierarchicalChildEntityExtractor ReadableType1 = original.ReadableType1HierarchicalChildEntityExtractor - ReadableType1HierarchicalEntityExtractor ReadableType1 = original.ReadableType1HierarchicalEntityExtractor - ReadableType1IntentClassifier ReadableType1 = original.ReadableType1IntentClassifier - ReadableType1PatternAnyEntityExtractor ReadableType1 = original.ReadableType1PatternAnyEntityExtractor - ReadableType1PrebuiltEntityExtractor ReadableType1 = original.ReadableType1PrebuiltEntityExtractor - ReadableType1RegexEntityExtractor ReadableType1 = original.ReadableType1RegexEntityExtractor -) - -type ReadableType10 = original.ReadableType10 - -const ( - ReadableType10ClosedListEntityExtractor ReadableType10 = original.ReadableType10ClosedListEntityExtractor - ReadableType10CompositeEntityExtractor ReadableType10 = original.ReadableType10CompositeEntityExtractor - ReadableType10EntityExtractor ReadableType10 = original.ReadableType10EntityExtractor - ReadableType10HierarchicalChildEntityExtractor ReadableType10 = original.ReadableType10HierarchicalChildEntityExtractor - ReadableType10HierarchicalEntityExtractor ReadableType10 = original.ReadableType10HierarchicalEntityExtractor - ReadableType10IntentClassifier ReadableType10 = original.ReadableType10IntentClassifier - ReadableType10PatternAnyEntityExtractor ReadableType10 = original.ReadableType10PatternAnyEntityExtractor - ReadableType10PrebuiltEntityExtractor ReadableType10 = original.ReadableType10PrebuiltEntityExtractor - ReadableType10RegexEntityExtractor ReadableType10 = original.ReadableType10RegexEntityExtractor -) - -type ReadableType2 = original.ReadableType2 - -const ( - ReadableType2ClosedListEntityExtractor ReadableType2 = original.ReadableType2ClosedListEntityExtractor - ReadableType2CompositeEntityExtractor ReadableType2 = original.ReadableType2CompositeEntityExtractor - ReadableType2EntityExtractor ReadableType2 = original.ReadableType2EntityExtractor - ReadableType2HierarchicalChildEntityExtractor ReadableType2 = original.ReadableType2HierarchicalChildEntityExtractor - ReadableType2HierarchicalEntityExtractor ReadableType2 = original.ReadableType2HierarchicalEntityExtractor - ReadableType2IntentClassifier ReadableType2 = original.ReadableType2IntentClassifier - ReadableType2PatternAnyEntityExtractor ReadableType2 = original.ReadableType2PatternAnyEntityExtractor - ReadableType2PrebuiltEntityExtractor ReadableType2 = original.ReadableType2PrebuiltEntityExtractor - ReadableType2RegexEntityExtractor ReadableType2 = original.ReadableType2RegexEntityExtractor -) - -type ReadableType3 = original.ReadableType3 - -const ( - ReadableType3ClosedListEntityExtractor ReadableType3 = original.ReadableType3ClosedListEntityExtractor - ReadableType3CompositeEntityExtractor ReadableType3 = original.ReadableType3CompositeEntityExtractor - ReadableType3EntityExtractor ReadableType3 = original.ReadableType3EntityExtractor - ReadableType3HierarchicalChildEntityExtractor ReadableType3 = original.ReadableType3HierarchicalChildEntityExtractor - ReadableType3HierarchicalEntityExtractor ReadableType3 = original.ReadableType3HierarchicalEntityExtractor - ReadableType3IntentClassifier ReadableType3 = original.ReadableType3IntentClassifier - ReadableType3PatternAnyEntityExtractor ReadableType3 = original.ReadableType3PatternAnyEntityExtractor - ReadableType3PrebuiltEntityExtractor ReadableType3 = original.ReadableType3PrebuiltEntityExtractor - ReadableType3RegexEntityExtractor ReadableType3 = original.ReadableType3RegexEntityExtractor -) - -type ReadableType4 = original.ReadableType4 - -const ( - ReadableType4ClosedListEntityExtractor ReadableType4 = original.ReadableType4ClosedListEntityExtractor - ReadableType4CompositeEntityExtractor ReadableType4 = original.ReadableType4CompositeEntityExtractor - ReadableType4EntityExtractor ReadableType4 = original.ReadableType4EntityExtractor - ReadableType4HierarchicalChildEntityExtractor ReadableType4 = original.ReadableType4HierarchicalChildEntityExtractor - ReadableType4HierarchicalEntityExtractor ReadableType4 = original.ReadableType4HierarchicalEntityExtractor - ReadableType4IntentClassifier ReadableType4 = original.ReadableType4IntentClassifier - ReadableType4PatternAnyEntityExtractor ReadableType4 = original.ReadableType4PatternAnyEntityExtractor - ReadableType4PrebuiltEntityExtractor ReadableType4 = original.ReadableType4PrebuiltEntityExtractor - ReadableType4RegexEntityExtractor ReadableType4 = original.ReadableType4RegexEntityExtractor -) - -type ReadableType5 = original.ReadableType5 - -const ( - ReadableType5ClosedListEntityExtractor ReadableType5 = original.ReadableType5ClosedListEntityExtractor - ReadableType5CompositeEntityExtractor ReadableType5 = original.ReadableType5CompositeEntityExtractor - ReadableType5EntityExtractor ReadableType5 = original.ReadableType5EntityExtractor - ReadableType5HierarchicalChildEntityExtractor ReadableType5 = original.ReadableType5HierarchicalChildEntityExtractor - ReadableType5HierarchicalEntityExtractor ReadableType5 = original.ReadableType5HierarchicalEntityExtractor - ReadableType5IntentClassifier ReadableType5 = original.ReadableType5IntentClassifier - ReadableType5PatternAnyEntityExtractor ReadableType5 = original.ReadableType5PatternAnyEntityExtractor - ReadableType5PrebuiltEntityExtractor ReadableType5 = original.ReadableType5PrebuiltEntityExtractor - ReadableType5RegexEntityExtractor ReadableType5 = original.ReadableType5RegexEntityExtractor -) - -type ReadableType6 = original.ReadableType6 - -const ( - ReadableType6ClosedListEntityExtractor ReadableType6 = original.ReadableType6ClosedListEntityExtractor - ReadableType6CompositeEntityExtractor ReadableType6 = original.ReadableType6CompositeEntityExtractor - ReadableType6EntityExtractor ReadableType6 = original.ReadableType6EntityExtractor - ReadableType6HierarchicalChildEntityExtractor ReadableType6 = original.ReadableType6HierarchicalChildEntityExtractor - ReadableType6HierarchicalEntityExtractor ReadableType6 = original.ReadableType6HierarchicalEntityExtractor - ReadableType6IntentClassifier ReadableType6 = original.ReadableType6IntentClassifier - ReadableType6PatternAnyEntityExtractor ReadableType6 = original.ReadableType6PatternAnyEntityExtractor - ReadableType6PrebuiltEntityExtractor ReadableType6 = original.ReadableType6PrebuiltEntityExtractor - ReadableType6RegexEntityExtractor ReadableType6 = original.ReadableType6RegexEntityExtractor -) - -type ReadableType7 = original.ReadableType7 - -const ( - ReadableType7ClosedListEntityExtractor ReadableType7 = original.ReadableType7ClosedListEntityExtractor - ReadableType7CompositeEntityExtractor ReadableType7 = original.ReadableType7CompositeEntityExtractor - ReadableType7EntityExtractor ReadableType7 = original.ReadableType7EntityExtractor - ReadableType7HierarchicalChildEntityExtractor ReadableType7 = original.ReadableType7HierarchicalChildEntityExtractor - ReadableType7HierarchicalEntityExtractor ReadableType7 = original.ReadableType7HierarchicalEntityExtractor - ReadableType7IntentClassifier ReadableType7 = original.ReadableType7IntentClassifier - ReadableType7PatternAnyEntityExtractor ReadableType7 = original.ReadableType7PatternAnyEntityExtractor - ReadableType7PrebuiltEntityExtractor ReadableType7 = original.ReadableType7PrebuiltEntityExtractor - ReadableType7RegexEntityExtractor ReadableType7 = original.ReadableType7RegexEntityExtractor -) - -type ReadableType8 = original.ReadableType8 - -const ( - ReadableType8ClosedListEntityExtractor ReadableType8 = original.ReadableType8ClosedListEntityExtractor - ReadableType8CompositeEntityExtractor ReadableType8 = original.ReadableType8CompositeEntityExtractor - ReadableType8EntityExtractor ReadableType8 = original.ReadableType8EntityExtractor - ReadableType8HierarchicalChildEntityExtractor ReadableType8 = original.ReadableType8HierarchicalChildEntityExtractor - ReadableType8HierarchicalEntityExtractor ReadableType8 = original.ReadableType8HierarchicalEntityExtractor - ReadableType8IntentClassifier ReadableType8 = original.ReadableType8IntentClassifier - ReadableType8PatternAnyEntityExtractor ReadableType8 = original.ReadableType8PatternAnyEntityExtractor - ReadableType8PrebuiltEntityExtractor ReadableType8 = original.ReadableType8PrebuiltEntityExtractor - ReadableType8RegexEntityExtractor ReadableType8 = original.ReadableType8RegexEntityExtractor -) - -type ReadableType9 = original.ReadableType9 - -const ( - ReadableType9ClosedListEntityExtractor ReadableType9 = original.ReadableType9ClosedListEntityExtractor - ReadableType9CompositeEntityExtractor ReadableType9 = original.ReadableType9CompositeEntityExtractor - ReadableType9EntityExtractor ReadableType9 = original.ReadableType9EntityExtractor - ReadableType9HierarchicalChildEntityExtractor ReadableType9 = original.ReadableType9HierarchicalChildEntityExtractor - ReadableType9HierarchicalEntityExtractor ReadableType9 = original.ReadableType9HierarchicalEntityExtractor - ReadableType9IntentClassifier ReadableType9 = original.ReadableType9IntentClassifier - ReadableType9PatternAnyEntityExtractor ReadableType9 = original.ReadableType9PatternAnyEntityExtractor - ReadableType9PrebuiltEntityExtractor ReadableType9 = original.ReadableType9PrebuiltEntityExtractor - ReadableType9RegexEntityExtractor ReadableType9 = original.ReadableType9RegexEntityExtractor -) - -type Status = original.Status - -const ( - StatusFail Status = original.StatusFail - StatusInProgress Status = original.StatusInProgress - StatusQueued Status = original.StatusQueued - StatusSuccess Status = original.StatusSuccess - StatusUpToDate Status = original.StatusUpToDate -) - -type Status1 = original.Status1 - -const ( - Status1Fail Status1 = original.Status1Fail - Status1InProgress Status1 = original.Status1InProgress - Status1Queued Status1 = original.Status1Queued - Status1Success Status1 = original.Status1Success - Status1UpToDate Status1 = original.Status1UpToDate -) - -type TrainingStatus = original.TrainingStatus - -const ( - InProgress TrainingStatus = original.InProgress - NeedsTraining TrainingStatus = original.NeedsTraining - Trained TrainingStatus = original.Trained -) - -type ApplicationCreateObject = original.ApplicationCreateObject -type ApplicationInfoResponse = original.ApplicationInfoResponse -type ApplicationPublishObject = original.ApplicationPublishObject -type ApplicationSettingUpdateObject = original.ApplicationSettingUpdateObject -type ApplicationSettings = original.ApplicationSettings -type ApplicationUpdateObject = original.ApplicationUpdateObject -type AppsClient = original.AppsClient -type AvailableCulture = original.AvailableCulture -type AvailablePrebuiltEntityModel = original.AvailablePrebuiltEntityModel -type BaseClient = original.BaseClient -type BatchLabelExample = original.BatchLabelExample -type ChildEntity = original.ChildEntity -type ClosedList = original.ClosedList -type ClosedListEntityExtractor = original.ClosedListEntityExtractor -type ClosedListModelCreateObject = original.ClosedListModelCreateObject -type ClosedListModelPatchObject = original.ClosedListModelPatchObject -type ClosedListModelUpdateObject = original.ClosedListModelUpdateObject -type CollaboratorsArray = original.CollaboratorsArray -type CompositeChildModelCreateObject = original.CompositeChildModelCreateObject -type CompositeEntityExtractor = original.CompositeEntityExtractor -type CompositeEntityModel = original.CompositeEntityModel -type CustomPrebuiltModel = original.CustomPrebuiltModel -type EndpointInfo = original.EndpointInfo -type EnqueueTrainingResponse = original.EnqueueTrainingResponse -type EntitiesSuggestionExample = original.EntitiesSuggestionExample -type EntityExtractor = original.EntityExtractor -type EntityLabel = original.EntityLabel -type EntityLabelObject = original.EntityLabelObject -type EntityModelInfo = original.EntityModelInfo -type EntityPrediction = original.EntityPrediction -type EntityRole = original.EntityRole -type EntityRoleCreateObject = original.EntityRoleCreateObject -type EntityRoleUpdateObject = original.EntityRoleUpdateObject -type ErrorResponse = original.ErrorResponse -type ExampleLabelObject = original.ExampleLabelObject -type ExamplesClient = original.ExamplesClient -type ExplicitListItem = original.ExplicitListItem -type ExplicitListItemCreateObject = original.ExplicitListItemCreateObject -type ExplicitListItemUpdateObject = original.ExplicitListItemUpdateObject -type FeatureInfoObject = original.FeatureInfoObject -type FeaturesClient = original.FeaturesClient -type FeaturesResponseObject = original.FeaturesResponseObject -type HierarchicalChildEntity = original.HierarchicalChildEntity -type HierarchicalChildModelCreateObject = original.HierarchicalChildModelCreateObject -type HierarchicalChildModelUpdateObject = original.HierarchicalChildModelUpdateObject -type HierarchicalEntityExtractor = original.HierarchicalEntityExtractor -type HierarchicalEntityModel = original.HierarchicalEntityModel -type HierarchicalModel = original.HierarchicalModel -type Int32 = original.Int32 -type IntentClassifier = original.IntentClassifier -type IntentPrediction = original.IntentPrediction -type IntentsSuggestionExample = original.IntentsSuggestionExample -type JSONEntity = original.JSONEntity -type JSONModelFeature = original.JSONModelFeature -type JSONRegexFeature = original.JSONRegexFeature -type JSONUtterance = original.JSONUtterance -type LabelExampleResponse = original.LabelExampleResponse -type LabeledUtterance = original.LabeledUtterance -type ListApplicationInfoResponse = original.ListApplicationInfoResponse -type ListAvailableCulture = original.ListAvailableCulture -type ListAvailablePrebuiltEntityModel = original.ListAvailablePrebuiltEntityModel -type ListBatchLabelExample = original.ListBatchLabelExample -type ListClosedListEntityExtractor = original.ListClosedListEntityExtractor -type ListCompositeEntityExtractor = original.ListCompositeEntityExtractor -type ListCustomPrebuiltModel = original.ListCustomPrebuiltModel -type ListEntitiesSuggestionExample = original.ListEntitiesSuggestionExample -type ListEntityExtractor = original.ListEntityExtractor -type ListEntityRole = original.ListEntityRole -type ListExplicitListItem = original.ListExplicitListItem -type ListHierarchicalEntityExtractor = original.ListHierarchicalEntityExtractor -type ListIntentClassifier = original.ListIntentClassifier -type ListIntentsSuggestionExample = original.ListIntentsSuggestionExample -type ListLabeledUtterance = original.ListLabeledUtterance -type ListModelInfoResponse = original.ListModelInfoResponse -type ListModelTrainingInfo = original.ListModelTrainingInfo -type ListPatternAnyEntityExtractor = original.ListPatternAnyEntityExtractor -type ListPatternRuleInfo = original.ListPatternRuleInfo -type ListPhraseListFeatureInfo = original.ListPhraseListFeatureInfo -type ListPrebuiltDomain = original.ListPrebuiltDomain -type ListPrebuiltEntityExtractor = original.ListPrebuiltEntityExtractor -type ListRegexEntityExtractor = original.ListRegexEntityExtractor -type ListString = original.ListString -type ListUUID = original.ListUUID -type ListVersionInfo = original.ListVersionInfo -type LuisApp = original.LuisApp -type ModelClient = original.ModelClient -type ModelCreateObject = original.ModelCreateObject -type ModelInfo = original.ModelInfo -type ModelInfoResponse = original.ModelInfoResponse -type ModelTrainingDetails = original.ModelTrainingDetails -type ModelTrainingInfo = original.ModelTrainingInfo -type ModelUpdateObject = original.ModelUpdateObject -type OperationError = original.OperationError -type OperationStatus = original.OperationStatus -type PatternAny = original.PatternAny -type PatternAnyEntityExtractor = original.PatternAnyEntityExtractor -type PatternAnyModelCreateObject = original.PatternAnyModelCreateObject -type PatternAnyModelUpdateObject = original.PatternAnyModelUpdateObject -type PatternClient = original.PatternClient -type PatternCreateObject = original.PatternCreateObject -type PatternFeatureInfo = original.PatternFeatureInfo -type PatternRule = original.PatternRule -type PatternRuleCreateObject = original.PatternRuleCreateObject -type PatternRuleInfo = original.PatternRuleInfo -type PatternRuleUpdateObject = original.PatternRuleUpdateObject -type PatternUpdateObject = original.PatternUpdateObject -type PermissionsClient = original.PermissionsClient -type PersonalAssistantsResponse = original.PersonalAssistantsResponse -type PhraseListFeatureInfo = original.PhraseListFeatureInfo -type PhraselistCreateObject = original.PhraselistCreateObject -type PhraselistUpdateObject = original.PhraselistUpdateObject -type PrebuiltDomain = original.PrebuiltDomain -type PrebuiltDomainCreateBaseObject = original.PrebuiltDomainCreateBaseObject -type PrebuiltDomainCreateObject = original.PrebuiltDomainCreateObject -type PrebuiltDomainItem = original.PrebuiltDomainItem -type PrebuiltDomainModelCreateObject = original.PrebuiltDomainModelCreateObject -type PrebuiltDomainObject = original.PrebuiltDomainObject -type PrebuiltEntity = original.PrebuiltEntity -type PrebuiltEntityExtractor = original.PrebuiltEntityExtractor -type ProductionOrStagingEndpointInfo = original.ProductionOrStagingEndpointInfo -type ReadCloser = original.ReadCloser -type RegexEntity = original.RegexEntity -type RegexEntityExtractor = original.RegexEntityExtractor -type RegexModelCreateObject = original.RegexModelCreateObject -type RegexModelUpdateObject = original.RegexModelUpdateObject -type SetString = original.SetString -type String = original.String -type SubClosedList = original.SubClosedList -type SubClosedListResponse = original.SubClosedListResponse -type TaskUpdateObject = original.TaskUpdateObject -type TrainClient = original.TrainClient -type UUID = original.UUID -type UserAccessList = original.UserAccessList -type UserCollaborator = original.UserCollaborator -type VersionInfo = original.VersionInfo -type VersionsClient = original.VersionsClient -type WordListBaseUpdateObject = original.WordListBaseUpdateObject -type WordListObject = original.WordListObject - -func New(azureRegion AzureRegions) BaseClient { - return original.New(azureRegion) -} -func NewAppsClient(azureRegion AzureRegions) AppsClient { - return original.NewAppsClient(azureRegion) -} -func NewExamplesClient(azureRegion AzureRegions) ExamplesClient { - return original.NewExamplesClient(azureRegion) -} -func NewFeaturesClient(azureRegion AzureRegions) FeaturesClient { - return original.NewFeaturesClient(azureRegion) -} -func NewModelClient(azureRegion AzureRegions) ModelClient { - return original.NewModelClient(azureRegion) -} -func NewPatternClient(azureRegion AzureRegions) PatternClient { - return original.NewPatternClient(azureRegion) -} -func NewPermissionsClient(azureRegion AzureRegions) PermissionsClient { - return original.NewPermissionsClient(azureRegion) -} -func NewTrainClient(azureRegion AzureRegions) TrainClient { - return original.NewTrainClient(azureRegion) -} -func NewVersionsClient(azureRegion AzureRegions) VersionsClient { - return original.NewVersionsClient(azureRegion) -} -func NewWithoutDefaults(azureRegion AzureRegions) BaseClient { - return original.NewWithoutDefaults(azureRegion) -} -func PossibleAzureRegionsValues() []AzureRegions { - return original.PossibleAzureRegionsValues() -} -func PossibleOperationStatusTypeValues() []OperationStatusType { - return original.PossibleOperationStatusTypeValues() -} -func PossibleReadableType10Values() []ReadableType10 { - return original.PossibleReadableType10Values() -} -func PossibleReadableType1Values() []ReadableType1 { - return original.PossibleReadableType1Values() -} -func PossibleReadableType2Values() []ReadableType2 { - return original.PossibleReadableType2Values() -} -func PossibleReadableType3Values() []ReadableType3 { - return original.PossibleReadableType3Values() -} -func PossibleReadableType4Values() []ReadableType4 { - return original.PossibleReadableType4Values() -} -func PossibleReadableType5Values() []ReadableType5 { - return original.PossibleReadableType5Values() -} -func PossibleReadableType6Values() []ReadableType6 { - return original.PossibleReadableType6Values() -} -func PossibleReadableType7Values() []ReadableType7 { - return original.PossibleReadableType7Values() -} -func PossibleReadableType8Values() []ReadableType8 { - return original.PossibleReadableType8Values() -} -func PossibleReadableType9Values() []ReadableType9 { - return original.PossibleReadableType9Values() -} -func PossibleReadableTypeValues() []ReadableType { - return original.PossibleReadableTypeValues() -} -func PossibleStatus1Values() []Status1 { - return original.PossibleStatus1Values() -} -func PossibleStatusValues() []Status { - return original.PossibleStatusValues() -} -func PossibleTrainingStatusValues() []TrainingStatus { - return original.PossibleTrainingStatusValues() -} -func UserAgent() string { - return original.UserAgent() + " profiles/preview" -} -func Version() string { - return original.Version() -} diff --git a/profiles/preview/compute/mgmt/compute/models.go b/profiles/preview/compute/mgmt/compute/models.go index c83bb89dce7c..0eb12de56c1f 100644 --- a/profiles/preview/compute/mgmt/compute/models.go +++ b/profiles/preview/compute/mgmt/compute/models.go @@ -460,6 +460,14 @@ const ( Regular VirtualMachinePriorityTypes = original.Regular ) +type VirtualMachineScaleSetScaleInRules = original.VirtualMachineScaleSetScaleInRules + +const ( + Default VirtualMachineScaleSetScaleInRules = original.Default + NewestVM VirtualMachineScaleSetScaleInRules = original.NewestVM + OldestVM VirtualMachineScaleSetScaleInRules = original.OldestVM +) + type VirtualMachineScaleSetSkuScaleType = original.VirtualMachineScaleSetSkuScaleType const ( @@ -866,6 +874,7 @@ type RunCommandParameterDefinition = original.RunCommandParameterDefinition type RunCommandResult = original.RunCommandResult type SSHConfiguration = original.SSHConfiguration type SSHPublicKey = original.SSHPublicKey +type ScaleInPolicy = original.ScaleInPolicy type ScheduledEventsProfile = original.ScheduledEventsProfile type Sku = original.Sku type Snapshot = original.Snapshot @@ -1508,6 +1517,9 @@ func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionP func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { return original.PossibleVirtualMachinePriorityTypesValues() } +func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { + return original.PossibleVirtualMachineScaleSetScaleInRulesValues() +} func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType { return original.PossibleVirtualMachineScaleSetSkuScaleTypeValues() } diff --git a/profiles/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go b/profiles/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go index 976f96f6266c..1d33365b1341 100644 --- a/profiles/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go +++ b/profiles/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go @@ -25,5 +25,7 @@ type OperationsClientAPI = original.OperationsClientAPI type RegistriesClientAPI = original.RegistriesClientAPI type ReplicationsClientAPI = original.ReplicationsClientAPI type RunsClientAPI = original.RunsClientAPI +type ScopeMapsClientAPI = original.ScopeMapsClientAPI type TasksClientAPI = original.TasksClientAPI +type TokensClientAPI = original.TokensClientAPI type WebhooksClientAPI = original.WebhooksClientAPI diff --git a/profiles/preview/containerregistry/mgmt/containerregistry/models.go b/profiles/preview/containerregistry/mgmt/containerregistry/models.go index dbe09e21f9ce..39b34d0ed182 100644 --- a/profiles/preview/containerregistry/mgmt/containerregistry/models.go +++ b/profiles/preview/containerregistry/mgmt/containerregistry/models.go @@ -196,6 +196,27 @@ const ( TaskStatusEnabled TaskStatus = original.TaskStatusEnabled ) +type TokenCertificateName = original.TokenCertificateName + +const ( + Certificate1 TokenCertificateName = original.Certificate1 + Certificate2 TokenCertificateName = original.Certificate2 +) + +type TokenPasswordName = original.TokenPasswordName + +const ( + TokenPasswordNamePassword1 TokenPasswordName = original.TokenPasswordNamePassword1 + TokenPasswordNamePassword2 TokenPasswordName = original.TokenPasswordNamePassword2 +) + +type TokenStatus = original.TokenStatus + +const ( + TokenStatusDisabled TokenStatus = original.TokenStatusDisabled + TokenStatusEnabled TokenStatus = original.TokenStatusEnabled +) + type TokenType = original.TokenType const ( @@ -247,8 +268,8 @@ const ( type UpdateTriggerPayloadType = original.UpdateTriggerPayloadType const ( - Default UpdateTriggerPayloadType = original.Default - Token UpdateTriggerPayloadType = original.Token + UpdateTriggerPayloadTypeDefault UpdateTriggerPayloadType = original.UpdateTriggerPayloadTypeDefault + UpdateTriggerPayloadTypeToken UpdateTriggerPayloadType = original.UpdateTriggerPayloadTypeToken ) type Variant = original.Variant @@ -308,6 +329,8 @@ type EventResponseMessage = original.EventResponseMessage type FileTaskRunRequest = original.FileTaskRunRequest type FileTaskStep = original.FileTaskStep type FileTaskStepUpdateParameters = original.FileTaskStepUpdateParameters +type GenerateCredentialsParameters = original.GenerateCredentialsParameters +type GenerateCredentialsResult = original.GenerateCredentialsResult type IPRule = original.IPRule type IdentityProperties = original.IdentityProperties type ImageDescriptor = original.ImageDescriptor @@ -335,6 +358,7 @@ type RegenerateCredentialParameters = original.RegenerateCredentialParameters type RegistriesClient = original.RegistriesClient type RegistriesCreateFuture = original.RegistriesCreateFuture type RegistriesDeleteFuture = original.RegistriesDeleteFuture +type RegistriesGenerateCredentialsFuture = original.RegistriesGenerateCredentialsFuture type RegistriesImportImageFuture = original.RegistriesImportImageFuture type RegistriesScheduleRunFuture = original.RegistriesScheduleRunFuture type RegistriesUpdateFuture = original.RegistriesUpdateFuture @@ -376,6 +400,17 @@ type RunUpdateParameters = original.RunUpdateParameters type RunsCancelFuture = original.RunsCancelFuture type RunsClient = original.RunsClient type RunsUpdateFuture = original.RunsUpdateFuture +type ScopeMap = original.ScopeMap +type ScopeMapListResult = original.ScopeMapListResult +type ScopeMapListResultIterator = original.ScopeMapListResultIterator +type ScopeMapListResultPage = original.ScopeMapListResultPage +type ScopeMapProperties = original.ScopeMapProperties +type ScopeMapPropertiesUpdateParameters = original.ScopeMapPropertiesUpdateParameters +type ScopeMapUpdateParameters = original.ScopeMapUpdateParameters +type ScopeMapsClient = original.ScopeMapsClient +type ScopeMapsCreateFuture = original.ScopeMapsCreateFuture +type ScopeMapsDeleteFuture = original.ScopeMapsDeleteFuture +type ScopeMapsUpdateFuture = original.ScopeMapsUpdateFuture type SecretObject = original.SecretObject type SetValue = original.SetValue type Sku = original.Sku @@ -407,6 +442,20 @@ type TasksUpdateFuture = original.TasksUpdateFuture type TimerTrigger = original.TimerTrigger type TimerTriggerDescriptor = original.TimerTriggerDescriptor type TimerTriggerUpdateParameters = original.TimerTriggerUpdateParameters +type Token = original.Token +type TokenCertificate = original.TokenCertificate +type TokenCredentialsProperties = original.TokenCredentialsProperties +type TokenListResult = original.TokenListResult +type TokenListResultIterator = original.TokenListResultIterator +type TokenListResultPage = original.TokenListResultPage +type TokenPassword = original.TokenPassword +type TokenProperties = original.TokenProperties +type TokenUpdateParameters = original.TokenUpdateParameters +type TokenUpdateProperties = original.TokenUpdateProperties +type TokensClient = original.TokensClient +type TokensCreateFuture = original.TokensCreateFuture +type TokensDeleteFuture = original.TokensDeleteFuture +type TokensUpdateFuture = original.TokensUpdateFuture type TriggerProperties = original.TriggerProperties type TriggerUpdateParameters = original.TriggerUpdateParameters type TrustPolicy = original.TrustPolicy @@ -483,6 +532,18 @@ func NewRunsClient(subscriptionID string) RunsClient { func NewRunsClientWithBaseURI(baseURI string, subscriptionID string) RunsClient { return original.NewRunsClientWithBaseURI(baseURI, subscriptionID) } +func NewScopeMapListResultIterator(page ScopeMapListResultPage) ScopeMapListResultIterator { + return original.NewScopeMapListResultIterator(page) +} +func NewScopeMapListResultPage(getNextPage func(context.Context, ScopeMapListResult) (ScopeMapListResult, error)) ScopeMapListResultPage { + return original.NewScopeMapListResultPage(getNextPage) +} +func NewScopeMapsClient(subscriptionID string) ScopeMapsClient { + return original.NewScopeMapsClient(subscriptionID) +} +func NewScopeMapsClientWithBaseURI(baseURI string, subscriptionID string) ScopeMapsClient { + return original.NewScopeMapsClientWithBaseURI(baseURI, subscriptionID) +} func NewTaskListResultIterator(page TaskListResultPage) TaskListResultIterator { return original.NewTaskListResultIterator(page) } @@ -495,6 +556,18 @@ func NewTasksClient(subscriptionID string) TasksClient { func NewTasksClientWithBaseURI(baseURI string, subscriptionID string) TasksClient { return original.NewTasksClientWithBaseURI(baseURI, subscriptionID) } +func NewTokenListResultIterator(page TokenListResultPage) TokenListResultIterator { + return original.NewTokenListResultIterator(page) +} +func NewTokenListResultPage(getNextPage func(context.Context, TokenListResult) (TokenListResult, error)) TokenListResultPage { + return original.NewTokenListResultPage(getNextPage) +} +func NewTokensClient(subscriptionID string) TokensClient { + return original.NewTokensClient(subscriptionID) +} +func NewTokensClientWithBaseURI(baseURI string, subscriptionID string) TokensClient { + return original.NewTokensClientWithBaseURI(baseURI, subscriptionID) +} func NewWebhookListResultIterator(page WebhookListResultPage) WebhookListResultIterator { return original.NewWebhookListResultIterator(page) } @@ -573,6 +646,15 @@ func PossibleSourceTriggerEventValues() []SourceTriggerEvent { func PossibleTaskStatusValues() []TaskStatus { return original.PossibleTaskStatusValues() } +func PossibleTokenCertificateNameValues() []TokenCertificateName { + return original.PossibleTokenCertificateNameValues() +} +func PossibleTokenPasswordNameValues() []TokenPasswordName { + return original.PossibleTokenPasswordNameValues() +} +func PossibleTokenStatusValues() []TokenStatus { + return original.PossibleTokenStatusValues() +} func PossibleTokenTypeValues() []TokenType { return original.PossibleTokenTypeValues() } diff --git a/profiles/preview/cosmos-db/mgmt/documentdb/models.go b/profiles/preview/cosmos-db/mgmt/documentdb/models.go index 079c75b4b084..dbc3ce68bf22 100644 --- a/profiles/preview/cosmos-db/mgmt/documentdb/models.go +++ b/profiles/preview/cosmos-db/mgmt/documentdb/models.go @@ -112,12 +112,12 @@ const ( type PrimaryAggregationType = original.PrimaryAggregationType const ( - PrimaryAggregationTypeAverage PrimaryAggregationType = original.PrimaryAggregationTypeAverage - PrimaryAggregationTypeLast PrimaryAggregationType = original.PrimaryAggregationTypeLast - PrimaryAggregationTypeMaximum PrimaryAggregationType = original.PrimaryAggregationTypeMaximum - PrimaryAggregationTypeMinimimum PrimaryAggregationType = original.PrimaryAggregationTypeMinimimum - PrimaryAggregationTypeNone PrimaryAggregationType = original.PrimaryAggregationTypeNone - PrimaryAggregationTypeTotal PrimaryAggregationType = original.PrimaryAggregationTypeTotal + PrimaryAggregationTypeAverage PrimaryAggregationType = original.PrimaryAggregationTypeAverage + PrimaryAggregationTypeLast PrimaryAggregationType = original.PrimaryAggregationTypeLast + PrimaryAggregationTypeMaximum PrimaryAggregationType = original.PrimaryAggregationTypeMaximum + PrimaryAggregationTypeMinimum PrimaryAggregationType = original.PrimaryAggregationTypeMinimum + PrimaryAggregationTypeNone PrimaryAggregationType = original.PrimaryAggregationTypeNone + PrimaryAggregationTypeTotal PrimaryAggregationType = original.PrimaryAggregationTypeTotal ) type UnitType = original.UnitType diff --git a/profiles/preview/databox/mgmt/databox/databoxapi/models.go b/profiles/preview/databox/mgmt/databox/databoxapi/models.go index 4cbd950b6a9b..d1f0705c3f4b 100644 --- a/profiles/preview/databox/mgmt/databox/databoxapi/models.go +++ b/profiles/preview/databox/mgmt/databox/databoxapi/models.go @@ -19,7 +19,7 @@ package databoxapi -import original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2018-01-01/databox/databoxapi" +import original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2019-09-01/databox/databoxapi" type JobsClientAPI = original.JobsClientAPI type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/preview/databox/mgmt/databox/models.go b/profiles/preview/databox/mgmt/databox/models.go index ca081e0e77d4..ab19aaa4a8f5 100644 --- a/profiles/preview/databox/mgmt/databox/models.go +++ b/profiles/preview/databox/mgmt/databox/models.go @@ -22,7 +22,7 @@ package databox import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2018-01-01/databox" + original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2019-09-01/databox" ) const ( @@ -64,20 +64,39 @@ const ( type CopyStatus = original.CopyStatus const ( - Completed CopyStatus = original.Completed - CompletedWithErrors CopyStatus = original.CompletedWithErrors - Failed CopyStatus = original.Failed - InProgress CopyStatus = original.InProgress - NotReturned CopyStatus = original.NotReturned - NotStarted CopyStatus = original.NotStarted + Completed CopyStatus = original.Completed + CompletedWithErrors CopyStatus = original.CompletedWithErrors + DeviceFormatted CopyStatus = original.DeviceFormatted + DeviceMetadataModified CopyStatus = original.DeviceMetadataModified + Failed CopyStatus = original.Failed + HardwareError CopyStatus = original.HardwareError + InProgress CopyStatus = original.InProgress + NotReturned CopyStatus = original.NotReturned + NotStarted CopyStatus = original.NotStarted + StorageAccountNotAccessible CopyStatus = original.StorageAccountNotAccessible + UnsupportedData CopyStatus = original.UnsupportedData ) type DataDestinationType = original.DataDestinationType const ( - DataDestinationTypeDestinationAccountDetails DataDestinationType = original.DataDestinationTypeDestinationAccountDetails - DataDestinationTypeManagedDisk DataDestinationType = original.DataDestinationTypeManagedDisk - DataDestinationTypeStorageAccount DataDestinationType = original.DataDestinationTypeStorageAccount + ManagedDisk DataDestinationType = original.ManagedDisk + StorageAccount DataDestinationType = original.StorageAccount +) + +type DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeBasicDestinationAccountDetails + +const ( + DataDestinationTypeDestinationAccountDetails DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeDestinationAccountDetails + DataDestinationTypeManagedDisk DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeManagedDisk + DataDestinationTypeStorageAccount DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeStorageAccount +) + +type JobDeliveryType = original.JobDeliveryType + +const ( + NonScheduled JobDeliveryType = original.NonScheduled + Scheduled JobDeliveryType = original.Scheduled ) type JobDetailsTypeEnum = original.JobDetailsTypeEnum @@ -109,15 +128,23 @@ const ( PickedUp NotificationStageName = original.PickedUp ) +type OverallValidationStatus = original.OverallValidationStatus + +const ( + AllValidToProceed OverallValidationStatus = original.AllValidToProceed + CertainInputValidationsSkipped OverallValidationStatus = original.CertainInputValidationsSkipped + InputsRevisitRequired OverallValidationStatus = original.InputsRevisitRequired +) + type ShareDestinationFormatType = original.ShareDestinationFormatType const ( - AzureFile ShareDestinationFormatType = original.AzureFile - BlockBlob ShareDestinationFormatType = original.BlockBlob - HCS ShareDestinationFormatType = original.HCS - ManagedDisk ShareDestinationFormatType = original.ManagedDisk - PageBlob ShareDestinationFormatType = original.PageBlob - UnknownType ShareDestinationFormatType = original.UnknownType + ShareDestinationFormatTypeAzureFile ShareDestinationFormatType = original.ShareDestinationFormatTypeAzureFile + ShareDestinationFormatTypeBlockBlob ShareDestinationFormatType = original.ShareDestinationFormatTypeBlockBlob + ShareDestinationFormatTypeHCS ShareDestinationFormatType = original.ShareDestinationFormatTypeHCS + ShareDestinationFormatTypeManagedDisk ShareDestinationFormatType = original.ShareDestinationFormatTypeManagedDisk + ShareDestinationFormatTypePageBlob ShareDestinationFormatType = original.ShareDestinationFormatTypePageBlob + ShareDestinationFormatTypeUnknownType ShareDestinationFormatType = original.ShareDestinationFormatTypeUnknownType ) type SkuDisabledReason = original.SkuDisabledReason @@ -139,6 +166,15 @@ const ( DataBoxHeavy SkuName = original.DataBoxHeavy ) +type SkuNameBasicScheduleAvailabilityRequest = original.SkuNameBasicScheduleAvailabilityRequest + +const ( + SkuNameDataBox SkuNameBasicScheduleAvailabilityRequest = original.SkuNameDataBox + SkuNameDataBoxDisk SkuNameBasicScheduleAvailabilityRequest = original.SkuNameDataBoxDisk + SkuNameDataBoxHeavy SkuNameBasicScheduleAvailabilityRequest = original.SkuNameDataBoxHeavy + SkuNameScheduleAvailabilityRequest SkuNameBasicScheduleAvailabilityRequest = original.SkuNameScheduleAvailabilityRequest +) + type StageName = original.StageName const ( @@ -147,6 +183,7 @@ const ( StageNameCancelled StageName = original.StageNameCancelled StageNameCompleted StageName = original.StageNameCompleted StageNameCompletedWithErrors StageName = original.StageNameCompletedWithErrors + StageNameCompletedWithWarnings StageName = original.StageNameCompletedWithWarnings StageNameDataCopy StageName = original.StageNameDataCopy StageNameDelivered StageName = original.StageNameDelivered StageNameDeviceOrdered StageName = original.StageNameDeviceOrdered @@ -155,6 +192,8 @@ const ( StageNameFailedIssueDetectedAtAzureDC StageName = original.StageNameFailedIssueDetectedAtAzureDC StageNameFailedIssueReportedAtCustomer StageName = original.StageNameFailedIssueReportedAtCustomer StageNamePickedUp StageName = original.StageNamePickedUp + StageNameReadyToDispatchFromAzureDC StageName = original.StageNameReadyToDispatchFromAzureDC + StageNameReadyToReceiveAtAzureDC StageName = original.StageNameReadyToReceiveAtAzureDC ) type StageStatus = original.StageStatus @@ -169,6 +208,52 @@ const ( StageStatusSucceededWithErrors StageStatus = original.StageStatusSucceededWithErrors ) +type TransportShipmentTypes = original.TransportShipmentTypes + +const ( + CustomerManaged TransportShipmentTypes = original.CustomerManaged + MicrosoftManaged TransportShipmentTypes = original.MicrosoftManaged +) + +type ValidationCategory = original.ValidationCategory + +const ( + ValidationCategoryJobCreationValidation ValidationCategory = original.ValidationCategoryJobCreationValidation + ValidationCategoryValidationRequest ValidationCategory = original.ValidationCategoryValidationRequest +) + +type ValidationStatus = original.ValidationStatus + +const ( + ValidationStatusInvalid ValidationStatus = original.ValidationStatusInvalid + ValidationStatusSkipped ValidationStatus = original.ValidationStatusSkipped + ValidationStatusValid ValidationStatus = original.ValidationStatusValid +) + +type ValidationType = original.ValidationType + +const ( + ValidationTypeValidateAddress ValidationType = original.ValidationTypeValidateAddress + ValidationTypeValidateCreateOrderLimit ValidationType = original.ValidationTypeValidateCreateOrderLimit + ValidationTypeValidateDataDestinationDetails ValidationType = original.ValidationTypeValidateDataDestinationDetails + ValidationTypeValidatePreferences ValidationType = original.ValidationTypeValidatePreferences + ValidationTypeValidateSkuAvailability ValidationType = original.ValidationTypeValidateSkuAvailability + ValidationTypeValidateSubscriptionIsAllowedToCreateJob ValidationType = original.ValidationTypeValidateSubscriptionIsAllowedToCreateJob + ValidationTypeValidationInputRequest ValidationType = original.ValidationTypeValidationInputRequest +) + +type ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponse + +const ( + ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress + ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit + ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails + ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences + ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability + ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob + ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse +) + type AccountCopyLogDetails = original.AccountCopyLogDetails type AccountCredentialDetails = original.AccountCredentialDetails type AddressValidationOutput = original.AddressValidationOutput @@ -184,10 +269,21 @@ type BasicCopyLogDetails = original.BasicCopyLogDetails type BasicDestinationAccountDetails = original.BasicDestinationAccountDetails type BasicJobDetails = original.BasicJobDetails type BasicJobSecrets = original.BasicJobSecrets +type BasicScheduleAvailabilityRequest = original.BasicScheduleAvailabilityRequest +type BasicValidationInputRequest = original.BasicValidationInputRequest +type BasicValidationInputResponse = original.BasicValidationInputResponse +type BasicValidationRequest = original.BasicValidationRequest type CancellationReason = original.CancellationReason +type CloudError = original.CloudError type ContactDetails = original.ContactDetails type CopyLogDetails = original.CopyLogDetails type CopyProgress = original.CopyProgress +type CreateJobValidations = original.CreateJobValidations +type CreateOrderLimitForSubscriptionValidationRequest = original.CreateOrderLimitForSubscriptionValidationRequest +type CreateOrderLimitForSubscriptionValidationResponseProperties = original.CreateOrderLimitForSubscriptionValidationResponseProperties +type DataDestinationDetailsValidationRequest = original.DataDestinationDetailsValidationRequest +type DataDestinationDetailsValidationResponseProperties = original.DataDestinationDetailsValidationResponseProperties +type DcAccessSecurityCode = original.DcAccessSecurityCode type DestinationAccountDetails = original.DestinationAccountDetails type DestinationManagedDiskDetails = original.DestinationManagedDiskDetails type DestinationStorageAccountDetails = original.DestinationStorageAccountDetails @@ -196,12 +292,15 @@ type DiskCopyLogDetails = original.DiskCopyLogDetails type DiskCopyProgress = original.DiskCopyProgress type DiskJobDetails = original.DiskJobDetails type DiskJobSecrets = original.DiskJobSecrets +type DiskScheduleAvailabilityRequest = original.DiskScheduleAvailabilityRequest type DiskSecret = original.DiskSecret type Error = original.Error type HeavyAccountCopyLogDetails = original.HeavyAccountCopyLogDetails type HeavyJobDetails = original.HeavyJobDetails type HeavyJobSecrets = original.HeavyJobSecrets +type HeavyScheduleAvailabilityRequest = original.HeavyScheduleAvailabilityRequest type HeavySecret = original.HeavySecret +type JobDeliveryInfo = original.JobDeliveryInfo type JobDetails = original.JobDetails type JobDetailsType = original.JobDetailsType type JobErrorDetails = original.JobErrorDetails @@ -227,7 +326,14 @@ type OperationListPage = original.OperationListPage type OperationsClient = original.OperationsClient type PackageShippingDetails = original.PackageShippingDetails type Preferences = original.Preferences +type PreferencesValidationRequest = original.PreferencesValidationRequest +type PreferencesValidationResponseProperties = original.PreferencesValidationResponseProperties +type RegionConfigurationRequest = original.RegionConfigurationRequest +type RegionConfigurationResponse = original.RegionConfigurationResponse type Resource = original.Resource +type ScheduleAvailabilityRequest = original.ScheduleAvailabilityRequest +type ScheduleAvailabilityRequestType = original.ScheduleAvailabilityRequestType +type ScheduleAvailabilityResponse = original.ScheduleAvailabilityResponse type Secret = original.Secret type ServiceClient = original.ServiceClient type ShareCredentialDetails = original.ShareCredentialDetails @@ -235,15 +341,28 @@ type ShipmentPickUpRequest = original.ShipmentPickUpRequest type ShipmentPickUpResponse = original.ShipmentPickUpResponse type ShippingAddress = original.ShippingAddress type Sku = original.Sku +type SkuAvailabilityValidationRequest = original.SkuAvailabilityValidationRequest +type SkuAvailabilityValidationResponseProperties = original.SkuAvailabilityValidationResponseProperties type SkuCapacity = original.SkuCapacity type SkuCost = original.SkuCost type SkuInformation = original.SkuInformation type SkuProperties = original.SkuProperties +type SubscriptionIsAllowedToCreateJobValidationRequest = original.SubscriptionIsAllowedToCreateJobValidationRequest +type SubscriptionIsAllowedToCreateJobValidationResponseProperties = original.SubscriptionIsAllowedToCreateJobValidationResponseProperties +type TransportAvailabilityDetails = original.TransportAvailabilityDetails +type TransportAvailabilityRequest = original.TransportAvailabilityRequest +type TransportAvailabilityResponse = original.TransportAvailabilityResponse +type TransportPreferences = original.TransportPreferences type UnencryptedCredentials = original.UnencryptedCredentials type UnencryptedCredentialsList = original.UnencryptedCredentialsList type UpdateJobDetails = original.UpdateJobDetails type UpdateJobProperties = original.UpdateJobProperties type ValidateAddress = original.ValidateAddress +type ValidationInputRequest = original.ValidationInputRequest +type ValidationInputResponse = original.ValidationInputResponse +type ValidationRequest = original.ValidationRequest +type ValidationResponse = original.ValidationResponse +type ValidationResponseProperties = original.ValidationResponseProperties func New(subscriptionID string) BaseClient { return original.New(subscriptionID) @@ -302,9 +421,15 @@ func PossibleCopyLogDetailsTypeValues() []CopyLogDetailsType { func PossibleCopyStatusValues() []CopyStatus { return original.PossibleCopyStatusValues() } +func PossibleDataDestinationTypeBasicDestinationAccountDetailsValues() []DataDestinationTypeBasicDestinationAccountDetails { + return original.PossibleDataDestinationTypeBasicDestinationAccountDetailsValues() +} func PossibleDataDestinationTypeValues() []DataDestinationType { return original.PossibleDataDestinationTypeValues() } +func PossibleJobDeliveryTypeValues() []JobDeliveryType { + return original.PossibleJobDeliveryTypeValues() +} func PossibleJobDetailsTypeEnumValues() []JobDetailsTypeEnum { return original.PossibleJobDetailsTypeEnumValues() } @@ -314,12 +439,18 @@ func PossibleJobSecretsTypeEnumValues() []JobSecretsTypeEnum { func PossibleNotificationStageNameValues() []NotificationStageName { return original.PossibleNotificationStageNameValues() } +func PossibleOverallValidationStatusValues() []OverallValidationStatus { + return original.PossibleOverallValidationStatusValues() +} func PossibleShareDestinationFormatTypeValues() []ShareDestinationFormatType { return original.PossibleShareDestinationFormatTypeValues() } func PossibleSkuDisabledReasonValues() []SkuDisabledReason { return original.PossibleSkuDisabledReasonValues() } +func PossibleSkuNameBasicScheduleAvailabilityRequestValues() []SkuNameBasicScheduleAvailabilityRequest { + return original.PossibleSkuNameBasicScheduleAvailabilityRequestValues() +} func PossibleSkuNameValues() []SkuName { return original.PossibleSkuNameValues() } @@ -329,6 +460,21 @@ func PossibleStageNameValues() []StageName { func PossibleStageStatusValues() []StageStatus { return original.PossibleStageStatusValues() } +func PossibleTransportShipmentTypesValues() []TransportShipmentTypes { + return original.PossibleTransportShipmentTypesValues() +} +func PossibleValidationCategoryValues() []ValidationCategory { + return original.PossibleValidationCategoryValues() +} +func PossibleValidationStatusValues() []ValidationStatus { + return original.PossibleValidationStatusValues() +} +func PossibleValidationTypeBasicValidationInputResponseValues() []ValidationTypeBasicValidationInputResponse { + return original.PossibleValidationTypeBasicValidationInputResponseValues() +} +func PossibleValidationTypeValues() []ValidationType { + return original.PossibleValidationTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/edgegateway/mgmt/edgegateway/edgegatewayapi/models.go b/profiles/preview/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go similarity index 88% rename from profiles/preview/edgegateway/mgmt/edgegateway/edgegatewayapi/models.go rename to profiles/preview/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go index c73455d1c53f..fa769db5d05e 100644 --- a/profiles/preview/edgegateway/mgmt/edgegateway/edgegatewayapi/models.go +++ b/profiles/preview/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go @@ -17,14 +17,15 @@ // This code was auto-generated by: // github.com/Azure/azure-sdk-for-go/tools/profileBuilder -package edgegatewayapi +package databoxedgeapi -import original "github.com/Azure/azure-sdk-for-go/services/edgegateway/mgmt/2019-03-01/edgegateway/edgegatewayapi" +import original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-07-01/databoxedge/databoxedgeapi" type AlertsClientAPI = original.AlertsClientAPI type BandwidthSchedulesClientAPI = original.BandwidthSchedulesClientAPI type DevicesClientAPI = original.DevicesClientAPI type JobsClientAPI = original.JobsClientAPI +type NodesClientAPI = original.NodesClientAPI type OperationsClientAPI = original.OperationsClientAPI type OperationsStatusClientAPI = original.OperationsStatusClientAPI type OrdersClientAPI = original.OrdersClientAPI diff --git a/profiles/preview/edgegateway/mgmt/edgegateway/models.go b/profiles/preview/databoxedge/mgmt/databoxedge/models.go similarity index 91% rename from profiles/preview/edgegateway/mgmt/edgegateway/models.go rename to profiles/preview/databoxedge/mgmt/databoxedge/models.go index 8f963cdad2e5..873bd0836bb3 100644 --- a/profiles/preview/edgegateway/mgmt/edgegateway/models.go +++ b/profiles/preview/databoxedge/mgmt/databoxedge/models.go @@ -17,12 +17,12 @@ // This code was auto-generated by: // github.com/Azure/azure-sdk-for-go/tools/profileBuilder -package edgegateway +package databoxedge import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/edgegateway/mgmt/2019-03-01/edgegateway" + original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-07-01/databoxedge" ) const ( @@ -67,17 +67,6 @@ const ( ReadWrite ClientPermissionType = original.ReadWrite ) -type DataBoxEdgeDeviceStatus = original.DataBoxEdgeDeviceStatus - -const ( - Disconnected DataBoxEdgeDeviceStatus = original.Disconnected - NeedsAttention DataBoxEdgeDeviceStatus = original.NeedsAttention - Offline DataBoxEdgeDeviceStatus = original.Offline - Online DataBoxEdgeDeviceStatus = original.Online - PartiallyDisconnected DataBoxEdgeDeviceStatus = original.PartiallyDisconnected - ReadyToSetup DataBoxEdgeDeviceStatus = original.ReadyToSetup -) - type DataPolicy = original.DataPolicy const ( @@ -97,10 +86,22 @@ const ( Wednesday DayOfWeek = original.Wednesday ) +type DeviceStatus = original.DeviceStatus + +const ( + Disconnected DeviceStatus = original.Disconnected + Maintenance DeviceStatus = original.Maintenance + NeedsAttention DeviceStatus = original.NeedsAttention + Offline DeviceStatus = original.Offline + Online DeviceStatus = original.Online + PartiallyDisconnected DeviceStatus = original.PartiallyDisconnected + ReadyToSetup DeviceStatus = original.ReadyToSetup +) + type DeviceType = original.DeviceType const ( - DeviceTypeDataBoxEdgeDevice DeviceType = original.DeviceTypeDataBoxEdgeDevice + DataBoxEdgeDevice DeviceType = original.DataBoxEdgeDevice ) type DownloadPhase = original.DownloadPhase @@ -233,6 +234,16 @@ const ( NetworkGroupRDMA NetworkGroup = original.NetworkGroupRDMA ) +type NodeStatus = original.NodeStatus + +const ( + NodeStatusDown NodeStatus = original.NodeStatusDown + NodeStatusRebooting NodeStatus = original.NodeStatusRebooting + NodeStatusShuttingDown NodeStatus = original.NodeStatusShuttingDown + NodeStatusUnknown NodeStatus = original.NodeStatusUnknown + NodeStatusUp NodeStatus = original.NodeStatusUp +) + type OrderState = original.OrderState const ( @@ -300,8 +311,11 @@ const ( type ShareStatus = original.ShareStatus const ( - ShareStatusOffline ShareStatus = original.ShareStatusOffline - ShareStatusOnline ShareStatus = original.ShareStatusOnline + ShareStatusNeedsAttention ShareStatus = original.ShareStatusNeedsAttention + ShareStatusOffline ShareStatus = original.ShareStatusOffline + ShareStatusOK ShareStatus = original.ShareStatusOK + ShareStatusUnknown ShareStatus = original.ShareStatusUnknown + ShareStatusUpdating ShareStatus = original.ShareStatusUpdating ) type SkuName = original.SkuName @@ -388,14 +402,14 @@ type ClientAccessRight = original.ClientAccessRight type CloudError = original.CloudError type CloudErrorBody = original.CloudErrorBody type ContactDetails = original.ContactDetails -type DataBoxEdgeDevice = original.DataBoxEdgeDevice -type DataBoxEdgeDeviceExtendedInfo = original.DataBoxEdgeDeviceExtendedInfo -type DataBoxEdgeDeviceExtendedInfoProperties = original.DataBoxEdgeDeviceExtendedInfoProperties -type DataBoxEdgeDeviceList = original.DataBoxEdgeDeviceList -type DataBoxEdgeDeviceListIterator = original.DataBoxEdgeDeviceListIterator -type DataBoxEdgeDeviceListPage = original.DataBoxEdgeDeviceListPage -type DataBoxEdgeDevicePatch = original.DataBoxEdgeDevicePatch -type DataBoxEdgeDeviceProperties = original.DataBoxEdgeDeviceProperties +type Device = original.Device +type DeviceExtendedInfo = original.DeviceExtendedInfo +type DeviceExtendedInfoProperties = original.DeviceExtendedInfoProperties +type DeviceList = original.DeviceList +type DeviceListIterator = original.DeviceListIterator +type DeviceListPage = original.DeviceListPage +type DevicePatch = original.DevicePatch +type DeviceProperties = original.DeviceProperties type DevicesClient = original.DevicesClient type DevicesCreateOrUpdateFuture = original.DevicesCreateOrUpdateFuture type DevicesCreateOrUpdateSecuritySettingsFuture = original.DevicesCreateOrUpdateSecuritySettingsFuture @@ -423,6 +437,10 @@ type NetworkAdapter = original.NetworkAdapter type NetworkAdapterPosition = original.NetworkAdapterPosition type NetworkSettings = original.NetworkSettings type NetworkSettingsProperties = original.NetworkSettingsProperties +type Node = original.Node +type NodeList = original.NodeList +type NodeProperties = original.NodeProperties +type NodesClient = original.NodesClient type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationProperties = original.OperationProperties @@ -529,11 +547,11 @@ func NewBandwidthSchedulesListIterator(page BandwidthSchedulesListPage) Bandwidt func NewBandwidthSchedulesListPage(getNextPage func(context.Context, BandwidthSchedulesList) (BandwidthSchedulesList, error)) BandwidthSchedulesListPage { return original.NewBandwidthSchedulesListPage(getNextPage) } -func NewDataBoxEdgeDeviceListIterator(page DataBoxEdgeDeviceListPage) DataBoxEdgeDeviceListIterator { - return original.NewDataBoxEdgeDeviceListIterator(page) +func NewDeviceListIterator(page DeviceListPage) DeviceListIterator { + return original.NewDeviceListIterator(page) } -func NewDataBoxEdgeDeviceListPage(getNextPage func(context.Context, DataBoxEdgeDeviceList) (DataBoxEdgeDeviceList, error)) DataBoxEdgeDeviceListPage { - return original.NewDataBoxEdgeDeviceListPage(getNextPage) +func NewDeviceListPage(getNextPage func(context.Context, DeviceList) (DeviceList, error)) DeviceListPage { + return original.NewDeviceListPage(getNextPage) } func NewDevicesClient(subscriptionID string) DevicesClient { return original.NewDevicesClient(subscriptionID) @@ -547,6 +565,12 @@ func NewJobsClient(subscriptionID string) JobsClient { func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient { return original.NewJobsClientWithBaseURI(baseURI, subscriptionID) } +func NewNodesClient(subscriptionID string) NodesClient { + return original.NewNodesClient(subscriptionID) +} +func NewNodesClientWithBaseURI(baseURI string, subscriptionID string) NodesClient { + return original.NewNodesClientWithBaseURI(baseURI, subscriptionID) +} func NewOperationsClient(subscriptionID string) OperationsClient { return original.NewOperationsClient(subscriptionID) } @@ -655,15 +679,15 @@ func PossibleAzureContainerDataFormatValues() []AzureContainerDataFormat { func PossibleClientPermissionTypeValues() []ClientPermissionType { return original.PossibleClientPermissionTypeValues() } -func PossibleDataBoxEdgeDeviceStatusValues() []DataBoxEdgeDeviceStatus { - return original.PossibleDataBoxEdgeDeviceStatusValues() -} func PossibleDataPolicyValues() []DataPolicy { return original.PossibleDataPolicyValues() } func PossibleDayOfWeekValues() []DayOfWeek { return original.PossibleDayOfWeekValues() } +func PossibleDeviceStatusValues() []DeviceStatus { + return original.PossibleDeviceStatusValues() +} func PossibleDeviceTypeValues() []DeviceType { return original.PossibleDeviceTypeValues() } @@ -712,6 +736,9 @@ func PossibleNetworkAdapterStatusValues() []NetworkAdapterStatus { func PossibleNetworkGroupValues() []NetworkGroup { return original.PossibleNetworkGroupValues() } +func PossibleNodeStatusValues() []NodeStatus { + return original.PossibleNodeStatusValues() +} func PossibleOrderStateValues() []OrderState { return original.PossibleOrderStateValues() } diff --git a/profiles/preview/datafactory/mgmt/datafactory/datafactoryapi/models.go b/profiles/preview/datafactory/mgmt/datafactory/datafactoryapi/models.go index 2a039a860394..28f064af3a1b 100644 --- a/profiles/preview/datafactory/mgmt/datafactory/datafactoryapi/models.go +++ b/profiles/preview/datafactory/mgmt/datafactory/datafactoryapi/models.go @@ -22,6 +22,8 @@ package datafactoryapi import original "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/datafactoryapi" type ActivityRunsClientAPI = original.ActivityRunsClientAPI +type DataFlowDebugSessionClientAPI = original.DataFlowDebugSessionClientAPI +type DataFlowsClientAPI = original.DataFlowsClientAPI type DatasetsClientAPI = original.DatasetsClientAPI type ExposureControlClientAPI = original.ExposureControlClientAPI type FactoriesClientAPI = original.FactoriesClientAPI diff --git a/profiles/preview/datafactory/mgmt/datafactory/models.go b/profiles/preview/datafactory/mgmt/datafactory/models.go index 5b7373730a53..fd2334ff249f 100644 --- a/profiles/preview/datafactory/mgmt/datafactory/models.go +++ b/profiles/preview/datafactory/mgmt/datafactory/models.go @@ -97,6 +97,22 @@ const ( TWO CassandraSourceReadConsistencyLevels = original.TWO ) +type DataFlowComputeType = original.DataFlowComputeType + +const ( + ComputeOptimized DataFlowComputeType = original.ComputeOptimized + General DataFlowComputeType = original.General + MemoryOptimized DataFlowComputeType = original.MemoryOptimized +) + +type DataFlowDebugCommandType = original.DataFlowDebugCommandType + +const ( + ExecuteExpressionQuery DataFlowDebugCommandType = original.ExecuteExpressionQuery + ExecutePreviewQuery DataFlowDebugCommandType = original.ExecutePreviewQuery + ExecuteStatisticsQuery DataFlowDebugCommandType = original.ExecuteStatisticsQuery +) + type DayOfWeek = original.DayOfWeek const ( @@ -667,6 +683,7 @@ const ( TypeDatabricksSparkPython TypeBasicActivity = original.TypeDatabricksSparkPython TypeDataLakeAnalyticsUSQL TypeBasicActivity = original.TypeDataLakeAnalyticsUSQL TypeDelete TypeBasicActivity = original.TypeDelete + TypeExecuteDataFlow TypeBasicActivity = original.TypeExecuteDataFlow TypeExecutePipeline TypeBasicActivity = original.TypeExecutePipeline TypeExecuteSSISPackage TypeBasicActivity = original.TypeExecuteSSISPackage TypeExecution TypeBasicActivity = original.TypeExecution @@ -707,6 +724,7 @@ const ( TypeCommonDataServiceForAppsSink TypeBasicCopySink = original.TypeCommonDataServiceForAppsSink TypeCopySink TypeBasicCopySink = original.TypeCopySink TypeCosmosDbMongoDbAPISink TypeBasicCopySink = original.TypeCosmosDbMongoDbAPISink + TypeCosmosDbSQLAPISink TypeBasicCopySink = original.TypeCosmosDbSQLAPISink TypeDelimitedTextSink TypeBasicCopySink = original.TypeDelimitedTextSink TypeDocumentDbCollectionSink TypeBasicCopySink = original.TypeDocumentDbCollectionSink TypeDynamicsCrmSink TypeBasicCopySink = original.TypeDynamicsCrmSink @@ -717,6 +735,7 @@ const ( TypeMicrosoftAccessSink TypeBasicCopySink = original.TypeMicrosoftAccessSink TypeOdbcSink TypeBasicCopySink = original.TypeOdbcSink TypeOracleSink TypeBasicCopySink = original.TypeOracleSink + TypeOrcSink TypeBasicCopySink = original.TypeOrcSink TypeParquetSink TypeBasicCopySink = original.TypeParquetSink TypeSalesforceServiceCloudSink TypeBasicCopySink = original.TypeSalesforceServiceCloudSink TypeSalesforceSink TypeBasicCopySink = original.TypeSalesforceSink @@ -748,6 +767,7 @@ const ( TypeConcurSource TypeBasicCopySource = original.TypeConcurSource TypeCopySource TypeBasicCopySource = original.TypeCopySource TypeCosmosDbMongoDbAPISource TypeBasicCopySource = original.TypeCosmosDbMongoDbAPISource + TypeCosmosDbSQLAPISource TypeBasicCopySource = original.TypeCosmosDbSQLAPISource TypeCouchbaseSource TypeBasicCopySource = original.TypeCouchbaseSource TypeDb2Source TypeBasicCopySource = original.TypeDb2Source TypeDelimitedTextSource TypeBasicCopySource = original.TypeDelimitedTextSource @@ -783,6 +803,7 @@ const ( TypeOffice365Source TypeBasicCopySource = original.TypeOffice365Source TypeOracleServiceCloudSource TypeBasicCopySource = original.TypeOracleServiceCloudSource TypeOracleSource TypeBasicCopySource = original.TypeOracleSource + TypeOrcSource TypeBasicCopySource = original.TypeOrcSource TypeParquetSource TypeBasicCopySource = original.TypeParquetSource TypePaypalSource TypeBasicCopySource = original.TypePaypalSource TypePhoenixSource TypeBasicCopySource = original.TypePhoenixSource @@ -810,6 +831,7 @@ const ( TypeSQLSource TypeBasicCopySource = original.TypeSQLSource TypeSquareSource TypeBasicCopySource = original.TypeSquareSource TypeSybaseSource TypeBasicCopySource = original.TypeSybaseSource + TypeTabularSource TypeBasicCopySource = original.TypeTabularSource TypeTeradataSource TypeBasicCopySource = original.TypeTeradataSource TypeVerticaSource TypeBasicCopySource = original.TypeVerticaSource TypeWebSource TypeBasicCopySource = original.TypeWebSource @@ -817,6 +839,22 @@ const ( TypeZohoSource TypeBasicCopySource = original.TypeZohoSource ) +type TypeBasicCustomSetupBase = original.TypeBasicCustomSetupBase + +const ( + TypeCmdkeySetup TypeBasicCustomSetupBase = original.TypeCmdkeySetup + TypeComponentSetup TypeBasicCustomSetupBase = original.TypeComponentSetup + TypeCustomSetupBase TypeBasicCustomSetupBase = original.TypeCustomSetupBase + TypeEnvironmentVariableSetup TypeBasicCustomSetupBase = original.TypeEnvironmentVariableSetup +) + +type TypeBasicDataFlow = original.TypeBasicDataFlow + +const ( + TypeDataFlow TypeBasicDataFlow = original.TypeDataFlow + TypeMappingDataFlow TypeBasicDataFlow = original.TypeMappingDataFlow +) + type TypeBasicDataset = original.TypeBasicDataset const ( @@ -841,6 +879,7 @@ const ( TypeCommonDataServiceForAppsEntity TypeBasicDataset = original.TypeCommonDataServiceForAppsEntity TypeConcurObject TypeBasicDataset = original.TypeConcurObject TypeCosmosDbMongoDbAPICollection TypeBasicDataset = original.TypeCosmosDbMongoDbAPICollection + TypeCosmosDbSQLAPICollection TypeBasicDataset = original.TypeCosmosDbSQLAPICollection TypeCouchbaseTable TypeBasicDataset = original.TypeCouchbaseTable TypeCustomDataset TypeBasicDataset = original.TypeCustomDataset TypeDataset TypeBasicDataset = original.TypeDataset @@ -877,6 +916,7 @@ const ( TypeOffice365Table TypeBasicDataset = original.TypeOffice365Table TypeOracleServiceCloudObject TypeBasicDataset = original.TypeOracleServiceCloudObject TypeOracleTable TypeBasicDataset = original.TypeOracleTable + TypeOrc TypeBasicDataset = original.TypeOrc TypeParquet TypeBasicDataset = original.TypeParquet TypePaypalObject TypeBasicDataset = original.TypePaypalObject TypePhoenixObject TypeBasicDataset = original.TypePhoenixObject @@ -1084,6 +1124,7 @@ type TypeBasicTrigger = original.TypeBasicTrigger const ( TypeBlobEventsTrigger TypeBasicTrigger = original.TypeBlobEventsTrigger TypeBlobTrigger TypeBasicTrigger = original.TypeBlobTrigger + TypeChainingTrigger TypeBasicTrigger = original.TypeChainingTrigger TypeMultiplePipelineTrigger TypeBasicTrigger = original.TypeMultiplePipelineTrigger TypeRerunTumblingWindowTrigger TypeBasicTrigger = original.TypeRerunTumblingWindowTrigger TypeScheduleTrigger TypeBasicTrigger = original.TypeScheduleTrigger @@ -1121,6 +1162,7 @@ type ActivityPolicy = original.ActivityPolicy type ActivityRun = original.ActivityRun type ActivityRunsClient = original.ActivityRunsClient type ActivityRunsQueryResponse = original.ActivityRunsQueryResponse +type AddDataFlowToDebugSessionResponse = original.AddDataFlowToDebugSessionResponse type AmazonMWSLinkedService = original.AmazonMWSLinkedService type AmazonMWSLinkedServiceTypeProperties = original.AmazonMWSLinkedServiceTypeProperties type AmazonMWSObjectDataset = original.AmazonMWSObjectDataset @@ -1245,6 +1287,8 @@ type BasicActivity = original.BasicActivity type BasicControlActivity = original.BasicControlActivity type BasicCopySink = original.BasicCopySink type BasicCopySource = original.BasicCopySource +type BasicCustomSetupBase = original.BasicCustomSetupBase +type BasicDataFlow = original.BasicDataFlow type BasicDataset = original.BasicDataset type BasicDatasetCompression = original.BasicDatasetCompression type BasicDatasetStorageFormat = original.BasicDatasetStorageFormat @@ -1259,6 +1303,7 @@ type BasicMultiplePipelineTrigger = original.BasicMultiplePipelineTrigger type BasicSecretBase = original.BasicSecretBase type BasicSsisObjectMetadata = original.BasicSsisObjectMetadata type BasicStoreWriteSettings = original.BasicStoreWriteSettings +type BasicTabularSource = original.BasicTabularSource type BasicTrigger = original.BasicTrigger type BasicTriggerDependencyReference = original.BasicTriggerDependencyReference type BasicWebLinkedServiceTypeProperties = original.BasicWebLinkedServiceTypeProperties @@ -1277,14 +1322,19 @@ type CassandraLinkedServiceTypeProperties = original.CassandraLinkedServiceTypeP type CassandraSource = original.CassandraSource type CassandraTableDataset = original.CassandraTableDataset type CassandraTableDatasetTypeProperties = original.CassandraTableDatasetTypeProperties +type ChainingTrigger = original.ChainingTrigger +type ChainingTriggerTypeProperties = original.ChainingTriggerTypeProperties type CloudError = original.CloudError type CloudErrorBody = original.CloudErrorBody +type CmdkeySetup = original.CmdkeySetup +type CmdkeySetupTypeProperties = original.CmdkeySetupTypeProperties type CommonDataServiceForAppsEntityDataset = original.CommonDataServiceForAppsEntityDataset type CommonDataServiceForAppsEntityDatasetTypeProperties = original.CommonDataServiceForAppsEntityDatasetTypeProperties type CommonDataServiceForAppsLinkedService = original.CommonDataServiceForAppsLinkedService type CommonDataServiceForAppsLinkedServiceTypeProperties = original.CommonDataServiceForAppsLinkedServiceTypeProperties type CommonDataServiceForAppsSink = original.CommonDataServiceForAppsSink type CommonDataServiceForAppsSource = original.CommonDataServiceForAppsSource +type ComponentSetup = original.ComponentSetup type ConcurLinkedService = original.ConcurLinkedService type ConcurLinkedServiceTypeProperties = original.ConcurLinkedServiceTypeProperties type ConcurObjectDataset = original.ConcurObjectDataset @@ -1302,10 +1352,16 @@ type CosmosDbMongoDbAPILinkedService = original.CosmosDbMongoDbAPILinkedService type CosmosDbMongoDbAPILinkedServiceTypeProperties = original.CosmosDbMongoDbAPILinkedServiceTypeProperties type CosmosDbMongoDbAPISink = original.CosmosDbMongoDbAPISink type CosmosDbMongoDbAPISource = original.CosmosDbMongoDbAPISource +type CosmosDbSQLAPICollectionDataset = original.CosmosDbSQLAPICollectionDataset +type CosmosDbSQLAPICollectionDatasetTypeProperties = original.CosmosDbSQLAPICollectionDatasetTypeProperties +type CosmosDbSQLAPISink = original.CosmosDbSQLAPISink +type CosmosDbSQLAPISource = original.CosmosDbSQLAPISource type CouchbaseLinkedService = original.CouchbaseLinkedService type CouchbaseLinkedServiceTypeProperties = original.CouchbaseLinkedServiceTypeProperties type CouchbaseSource = original.CouchbaseSource type CouchbaseTableDataset = original.CouchbaseTableDataset +type CreateDataFlowDebugSessionRequest = original.CreateDataFlowDebugSessionRequest +type CreateDataFlowDebugSessionResponse = original.CreateDataFlowDebugSessionResponse type CreateLinkedIntegrationRuntimeRequest = original.CreateLinkedIntegrationRuntimeRequest type CreateRunResponse = original.CreateRunResponse type CustomActivity = original.CustomActivity @@ -1313,6 +1369,28 @@ type CustomActivityReferenceObject = original.CustomActivityReferenceObject type CustomActivityTypeProperties = original.CustomActivityTypeProperties type CustomDataSourceLinkedService = original.CustomDataSourceLinkedService type CustomDataset = original.CustomDataset +type CustomSetupBase = original.CustomSetupBase +type DataFlow = original.DataFlow +type DataFlowDebugCommandPayload = original.DataFlowDebugCommandPayload +type DataFlowDebugCommandRequest = original.DataFlowDebugCommandRequest +type DataFlowDebugCommandResponse = original.DataFlowDebugCommandResponse +type DataFlowDebugPackage = original.DataFlowDebugPackage +type DataFlowDebugPackageDebugSettings = original.DataFlowDebugPackageDebugSettings +type DataFlowDebugSessionClient = original.DataFlowDebugSessionClient +type DataFlowDebugSessionCreateFuture = original.DataFlowDebugSessionCreateFuture +type DataFlowDebugSessionExecuteCommandFuture = original.DataFlowDebugSessionExecuteCommandFuture +type DataFlowDebugSessionInfo = original.DataFlowDebugSessionInfo +type DataFlowFolder = original.DataFlowFolder +type DataFlowListResponse = original.DataFlowListResponse +type DataFlowListResponseIterator = original.DataFlowListResponseIterator +type DataFlowListResponsePage = original.DataFlowListResponsePage +type DataFlowReference = original.DataFlowReference +type DataFlowResource = original.DataFlowResource +type DataFlowSink = original.DataFlowSink +type DataFlowSource = original.DataFlowSource +type DataFlowSourceSetting = original.DataFlowSourceSetting +type DataFlowStagingInfo = original.DataFlowStagingInfo +type DataFlowsClient = original.DataFlowsClient type DataLakeAnalyticsUSQLActivity = original.DataLakeAnalyticsUSQLActivity type DataLakeAnalyticsUSQLActivityTypeProperties = original.DataLakeAnalyticsUSQLActivityTypeProperties type DatabricksNotebookActivity = original.DatabricksNotebookActivity @@ -1343,6 +1421,7 @@ type Db2TableDataset = original.Db2TableDataset type Db2TableDatasetTypeProperties = original.Db2TableDatasetTypeProperties type DeleteActivity = original.DeleteActivity type DeleteActivityTypeProperties = original.DeleteActivityTypeProperties +type DeleteDataFlowDebugSessionRequest = original.DeleteDataFlowDebugSessionRequest type DelimitedTextDataset = original.DelimitedTextDataset type DelimitedTextDatasetTypeProperties = original.DelimitedTextDatasetTypeProperties type DelimitedTextReadSettings = original.DelimitedTextReadSettings @@ -1382,6 +1461,10 @@ type EloquaLinkedServiceTypeProperties = original.EloquaLinkedServiceTypePropert type EloquaObjectDataset = original.EloquaObjectDataset type EloquaSource = original.EloquaSource type EntityReference = original.EntityReference +type EnvironmentVariableSetup = original.EnvironmentVariableSetup +type EnvironmentVariableSetupTypeProperties = original.EnvironmentVariableSetupTypeProperties +type ExecuteDataFlowActivity = original.ExecuteDataFlowActivity +type ExecuteDataFlowActivityTypeProperties = original.ExecuteDataFlowActivityTypeProperties type ExecutePipelineActivity = original.ExecutePipelineActivity type ExecutePipelineActivityTypeProperties = original.ExecutePipelineActivityTypeProperties type ExecuteSSISPackageActivity = original.ExecuteSSISPackageActivity @@ -1423,6 +1506,7 @@ type FtpServerLinkedService = original.FtpServerLinkedService type FtpServerLinkedServiceTypeProperties = original.FtpServerLinkedServiceTypeProperties type FtpServerLocation = original.FtpServerLocation type GenericDatasetTypeProperties = original.GenericDatasetTypeProperties +type GetDataFactoryOperationStatusResponse = original.GetDataFactoryOperationStatusResponse type GetMetadataActivity = original.GetMetadataActivity type GetMetadataActivityTypeProperties = original.GetMetadataActivityTypeProperties type GetSsisObjectMetadataRequest = original.GetSsisObjectMetadataRequest @@ -1499,6 +1583,7 @@ type IntegrationRuntimeAuthKeys = original.IntegrationRuntimeAuthKeys type IntegrationRuntimeComputeProperties = original.IntegrationRuntimeComputeProperties type IntegrationRuntimeConnectionInfo = original.IntegrationRuntimeConnectionInfo type IntegrationRuntimeCustomSetupScriptProperties = original.IntegrationRuntimeCustomSetupScriptProperties +type IntegrationRuntimeDataFlowProperties = original.IntegrationRuntimeDataFlowProperties type IntegrationRuntimeDataProxyProperties = original.IntegrationRuntimeDataProxyProperties type IntegrationRuntimeListResponse = original.IntegrationRuntimeListResponse type IntegrationRuntimeListResponseIterator = original.IntegrationRuntimeListResponseIterator @@ -1531,6 +1616,7 @@ type JiraLinkedService = original.JiraLinkedService type JiraLinkedServiceTypeProperties = original.JiraLinkedServiceTypeProperties type JiraObjectDataset = original.JiraObjectDataset type JiraSource = original.JiraSource +type LicensedComponentSetupTypeProperties = original.LicensedComponentSetupTypeProperties type LinkedIntegrationRuntime = original.LinkedIntegrationRuntime type LinkedIntegrationRuntimeKeyAuthorization = original.LinkedIntegrationRuntimeKeyAuthorization type LinkedIntegrationRuntimeRbacAuthorization = original.LinkedIntegrationRuntimeRbacAuthorization @@ -1557,6 +1643,8 @@ type ManagedIntegrationRuntimeOperationResult = original.ManagedIntegrationRunti type ManagedIntegrationRuntimeStatus = original.ManagedIntegrationRuntimeStatus type ManagedIntegrationRuntimeStatusTypeProperties = original.ManagedIntegrationRuntimeStatusTypeProperties type ManagedIntegrationRuntimeTypeProperties = original.ManagedIntegrationRuntimeTypeProperties +type MappingDataFlow = original.MappingDataFlow +type MappingDataFlowTypeProperties = original.MappingDataFlowTypeProperties type MariaDBLinkedService = original.MariaDBLinkedService type MariaDBLinkedServiceTypeProperties = original.MariaDBLinkedServiceTypeProperties type MariaDBSource = original.MariaDBSource @@ -1633,7 +1721,11 @@ type OracleSink = original.OracleSink type OracleSource = original.OracleSource type OracleTableDataset = original.OracleTableDataset type OracleTableDatasetTypeProperties = original.OracleTableDatasetTypeProperties +type OrcDataset = original.OrcDataset +type OrcDatasetTypeProperties = original.OrcDatasetTypeProperties type OrcFormat = original.OrcFormat +type OrcSink = original.OrcSink +type OrcSource = original.OrcSource type ParameterSpecification = original.ParameterSpecification type ParquetDataset = original.ParquetDataset type ParquetDatasetTypeProperties = original.ParquetDatasetTypeProperties @@ -1672,6 +1764,9 @@ type PrestoLinkedService = original.PrestoLinkedService type PrestoLinkedServiceTypeProperties = original.PrestoLinkedServiceTypeProperties type PrestoObjectDataset = original.PrestoObjectDataset type PrestoSource = original.PrestoSource +type QueryDataFlowDebugSessionsResponse = original.QueryDataFlowDebugSessionsResponse +type QueryDataFlowDebugSessionsResponseIterator = original.QueryDataFlowDebugSessionsResponseIterator +type QueryDataFlowDebugSessionsResponsePage = original.QueryDataFlowDebugSessionsResponsePage type QuickBooksLinkedService = original.QuickBooksLinkedService type QuickBooksLinkedServiceTypeProperties = original.QuickBooksLinkedServiceTypeProperties type QuickBooksObjectDataset = original.QuickBooksObjectDataset @@ -1832,6 +1927,7 @@ type SybaseLinkedServiceTypeProperties = original.SybaseLinkedServiceTypePropert type SybaseSource = original.SybaseSource type SybaseTableDataset = original.SybaseTableDataset type SybaseTableDatasetTypeProperties = original.SybaseTableDatasetTypeProperties +type TabularSource = original.TabularSource type TeradataLinkedService = original.TeradataLinkedService type TeradataLinkedServiceTypeProperties = original.TeradataLinkedServiceTypeProperties type TeradataPartitionSettings = original.TeradataPartitionSettings @@ -1839,6 +1935,7 @@ type TeradataSource = original.TeradataSource type TeradataTableDataset = original.TeradataTableDataset type TeradataTableDatasetTypeProperties = original.TeradataTableDatasetTypeProperties type TextFormat = original.TextFormat +type Transformation = original.Transformation type Trigger = original.Trigger type TriggerDependencyReference = original.TriggerDependencyReference type TriggerListResponse = original.TriggerListResponse @@ -1906,6 +2003,24 @@ func NewActivityRunsClient(subscriptionID string) ActivityRunsClient { func NewActivityRunsClientWithBaseURI(baseURI string, subscriptionID string) ActivityRunsClient { return original.NewActivityRunsClientWithBaseURI(baseURI, subscriptionID) } +func NewDataFlowDebugSessionClient(subscriptionID string) DataFlowDebugSessionClient { + return original.NewDataFlowDebugSessionClient(subscriptionID) +} +func NewDataFlowDebugSessionClientWithBaseURI(baseURI string, subscriptionID string) DataFlowDebugSessionClient { + return original.NewDataFlowDebugSessionClientWithBaseURI(baseURI, subscriptionID) +} +func NewDataFlowListResponseIterator(page DataFlowListResponsePage) DataFlowListResponseIterator { + return original.NewDataFlowListResponseIterator(page) +} +func NewDataFlowListResponsePage(getNextPage func(context.Context, DataFlowListResponse) (DataFlowListResponse, error)) DataFlowListResponsePage { + return original.NewDataFlowListResponsePage(getNextPage) +} +func NewDataFlowsClient(subscriptionID string) DataFlowsClient { + return original.NewDataFlowsClient(subscriptionID) +} +func NewDataFlowsClientWithBaseURI(baseURI string, subscriptionID string) DataFlowsClient { + return original.NewDataFlowsClientWithBaseURI(baseURI, subscriptionID) +} func NewDatasetListResponseIterator(page DatasetListResponsePage) DatasetListResponseIterator { return original.NewDatasetListResponseIterator(page) } @@ -2002,6 +2117,12 @@ func NewPipelinesClient(subscriptionID string) PipelinesClient { func NewPipelinesClientWithBaseURI(baseURI string, subscriptionID string) PipelinesClient { return original.NewPipelinesClientWithBaseURI(baseURI, subscriptionID) } +func NewQueryDataFlowDebugSessionsResponseIterator(page QueryDataFlowDebugSessionsResponsePage) QueryDataFlowDebugSessionsResponseIterator { + return original.NewQueryDataFlowDebugSessionsResponseIterator(page) +} +func NewQueryDataFlowDebugSessionsResponsePage(getNextPage func(context.Context, QueryDataFlowDebugSessionsResponse) (QueryDataFlowDebugSessionsResponse, error)) QueryDataFlowDebugSessionsResponsePage { + return original.NewQueryDataFlowDebugSessionsResponsePage(getNextPage) +} func NewRerunTriggerListResponseIterator(page RerunTriggerListResponsePage) RerunTriggerListResponseIterator { return original.NewRerunTriggerListResponseIterator(page) } @@ -2056,6 +2177,12 @@ func PossibleBlobEventTypesValues() []BlobEventTypes { func PossibleCassandraSourceReadConsistencyLevelsValues() []CassandraSourceReadConsistencyLevels { return original.PossibleCassandraSourceReadConsistencyLevelsValues() } +func PossibleDataFlowComputeTypeValues() []DataFlowComputeType { + return original.PossibleDataFlowComputeTypeValues() +} +func PossibleDataFlowDebugCommandTypeValues() []DataFlowDebugCommandType { + return original.PossibleDataFlowDebugCommandTypeValues() +} func PossibleDayOfWeekValues() []DayOfWeek { return original.PossibleDayOfWeekValues() } @@ -2257,6 +2384,12 @@ func PossibleTypeBasicCopySinkValues() []TypeBasicCopySink { func PossibleTypeBasicCopySourceValues() []TypeBasicCopySource { return original.PossibleTypeBasicCopySourceValues() } +func PossibleTypeBasicCustomSetupBaseValues() []TypeBasicCustomSetupBase { + return original.PossibleTypeBasicCustomSetupBaseValues() +} +func PossibleTypeBasicDataFlowValues() []TypeBasicDataFlow { + return original.PossibleTypeBasicDataFlowValues() +} func PossibleTypeBasicDatasetCompressionValues() []TypeBasicDatasetCompression { return original.PossibleTypeBasicDatasetCompressionValues() } diff --git a/profiles/preview/eventgrid/eventgrid/models.go b/profiles/preview/eventgrid/eventgrid/models.go index bbf6b0545a9a..74269b8b100a 100644 --- a/profiles/preview/eventgrid/eventgrid/models.go +++ b/profiles/preview/eventgrid/eventgrid/models.go @@ -102,6 +102,15 @@ type IotHubDeviceCreatedEventData = original.IotHubDeviceCreatedEventData type IotHubDeviceDeletedEventData = original.IotHubDeviceDeletedEventData type IotHubDeviceDisconnectedEventData = original.IotHubDeviceDisconnectedEventData type IotHubDeviceTelemetryEventData = original.IotHubDeviceTelemetryEventData +type KeyVaultCertificateExpiredEventData = original.KeyVaultCertificateExpiredEventData +type KeyVaultCertificateNearExpiryEventData = original.KeyVaultCertificateNearExpiryEventData +type KeyVaultCertificateNewVersionCreatedEventData = original.KeyVaultCertificateNewVersionCreatedEventData +type KeyVaultKeyExpiredEventData = original.KeyVaultKeyExpiredEventData +type KeyVaultKeyNearExpiryEventData = original.KeyVaultKeyNearExpiryEventData +type KeyVaultKeyNewVersionCreatedEventData = original.KeyVaultKeyNewVersionCreatedEventData +type KeyVaultSecretExpiredEventData = original.KeyVaultSecretExpiredEventData +type KeyVaultSecretNearExpiryEventData = original.KeyVaultSecretNearExpiryEventData +type KeyVaultSecretNewVersionCreatedEventData = original.KeyVaultSecretNewVersionCreatedEventData type MapsGeofenceEnteredEventData = original.MapsGeofenceEnteredEventData type MapsGeofenceEventProperties = original.MapsGeofenceEventProperties type MapsGeofenceExitedEventData = original.MapsGeofenceExitedEventData diff --git a/profiles/preview/eventhub/mgmt/eventhub/models.go b/profiles/preview/eventhub/mgmt/eventhub/models.go index ea5dbb5867e7..47ba92e0dbf1 100644 --- a/profiles/preview/eventhub/mgmt/eventhub/models.go +++ b/profiles/preview/eventhub/mgmt/eventhub/models.go @@ -167,6 +167,9 @@ type NamespacesClient = original.NamespacesClient type NamespacesCreateOrUpdateFuture = original.NamespacesCreateOrUpdateFuture type NamespacesDeleteFuture = original.NamespacesDeleteFuture type NetworkRuleSet = original.NetworkRuleSet +type NetworkRuleSetListResult = original.NetworkRuleSetListResult +type NetworkRuleSetListResultIterator = original.NetworkRuleSetListResultIterator +type NetworkRuleSetListResultPage = original.NetworkRuleSetListResultPage type NetworkRuleSetProperties = original.NetworkRuleSetProperties type Operation = original.Operation type OperationDisplay = original.OperationDisplay @@ -245,6 +248,12 @@ func NewNamespacesClient(subscriptionID string) NamespacesClient { func NewNamespacesClientWithBaseURI(baseURI string, subscriptionID string) NamespacesClient { return original.NewNamespacesClientWithBaseURI(baseURI, subscriptionID) } +func NewNetworkRuleSetListResultIterator(page NetworkRuleSetListResultPage) NetworkRuleSetListResultIterator { + return original.NewNetworkRuleSetListResultIterator(page) +} +func NewNetworkRuleSetListResultPage(getNextPage func(context.Context, NetworkRuleSetListResult) (NetworkRuleSetListResult, error)) NetworkRuleSetListResultPage { + return original.NewNetworkRuleSetListResultPage(getNextPage) +} func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return original.NewOperationListResultIterator(page) } diff --git a/profiles/preview/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go b/profiles/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go similarity index 63% rename from profiles/preview/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go rename to profiles/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go index 497b8771a7f0..08954a3ee34d 100644 --- a/profiles/preview/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go +++ b/profiles/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go @@ -17,8 +17,13 @@ // This code was auto-generated by: // github.com/Azure/azure-sdk-for-go/tools/profileBuilder -package anomalyfinderapi +package frontdoorapi -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi" +import original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-05-01/frontdoor/frontdoorapi" type BaseClientAPI = original.BaseClientAPI +type EndpointsClientAPI = original.EndpointsClientAPI +type FrontDoorsClientAPI = original.FrontDoorsClientAPI +type FrontendEndpointsClientAPI = original.FrontendEndpointsClientAPI +type ManagedRuleSetsClientAPI = original.ManagedRuleSetsClientAPI +type PoliciesClientAPI = original.PoliciesClientAPI diff --git a/profiles/preview/frontdoor/mgmt/frontdoor/models.go b/profiles/preview/frontdoor/mgmt/frontdoor/models.go new file mode 100644 index 000000000000..b2c48ed85c7f --- /dev/null +++ b/profiles/preview/frontdoor/mgmt/frontdoor/models.go @@ -0,0 +1,561 @@ +// +build go1.9 + +// Copyright 2019 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 frontdoor + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-05-01/frontdoor" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type ActionType = original.ActionType + +const ( + Allow ActionType = original.Allow + Block ActionType = original.Block + Log ActionType = original.Log + Redirect ActionType = original.Redirect +) + +type Availability = original.Availability + +const ( + Available Availability = original.Available + Unavailable Availability = original.Unavailable +) + +type BackendEnabledState = original.BackendEnabledState + +const ( + Disabled BackendEnabledState = original.Disabled + Enabled BackendEnabledState = original.Enabled +) + +type CertificateSource = original.CertificateSource + +const ( + CertificateSourceAzureKeyVault CertificateSource = original.CertificateSourceAzureKeyVault + CertificateSourceFrontDoor CertificateSource = original.CertificateSourceFrontDoor +) + +type CertificateType = original.CertificateType + +const ( + Dedicated CertificateType = original.Dedicated +) + +type CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningState + +const ( + CustomHTTPSProvisioningStateDisabled CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateDisabled + CustomHTTPSProvisioningStateDisabling CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateDisabling + CustomHTTPSProvisioningStateEnabled CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateEnabled + CustomHTTPSProvisioningStateEnabling CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateEnabling + CustomHTTPSProvisioningStateFailed CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateFailed +) + +type CustomHTTPSProvisioningSubstate = original.CustomHTTPSProvisioningSubstate + +const ( + CertificateDeleted CustomHTTPSProvisioningSubstate = original.CertificateDeleted + CertificateDeployed CustomHTTPSProvisioningSubstate = original.CertificateDeployed + DeletingCertificate CustomHTTPSProvisioningSubstate = original.DeletingCertificate + DeployingCertificate CustomHTTPSProvisioningSubstate = original.DeployingCertificate + DomainControlValidationRequestApproved CustomHTTPSProvisioningSubstate = original.DomainControlValidationRequestApproved + DomainControlValidationRequestRejected CustomHTTPSProvisioningSubstate = original.DomainControlValidationRequestRejected + DomainControlValidationRequestTimedOut CustomHTTPSProvisioningSubstate = original.DomainControlValidationRequestTimedOut + IssuingCertificate CustomHTTPSProvisioningSubstate = original.IssuingCertificate + PendingDomainControlValidationREquestApproval CustomHTTPSProvisioningSubstate = original.PendingDomainControlValidationREquestApproval + SubmittingDomainControlValidationRequest CustomHTTPSProvisioningSubstate = original.SubmittingDomainControlValidationRequest +) + +type CustomRuleEnabledState = original.CustomRuleEnabledState + +const ( + CustomRuleEnabledStateDisabled CustomRuleEnabledState = original.CustomRuleEnabledStateDisabled + CustomRuleEnabledStateEnabled CustomRuleEnabledState = original.CustomRuleEnabledStateEnabled +) + +type DynamicCompressionEnabled = original.DynamicCompressionEnabled + +const ( + DynamicCompressionEnabledDisabled DynamicCompressionEnabled = original.DynamicCompressionEnabledDisabled + DynamicCompressionEnabledEnabled DynamicCompressionEnabled = original.DynamicCompressionEnabledEnabled +) + +type EnabledState = original.EnabledState + +const ( + EnabledStateDisabled EnabledState = original.EnabledStateDisabled + EnabledStateEnabled EnabledState = original.EnabledStateEnabled +) + +type EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledState + +const ( + EnforceCertificateNameCheckEnabledStateDisabled EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledStateDisabled + EnforceCertificateNameCheckEnabledStateEnabled EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledStateEnabled +) + +type ForwardingProtocol = original.ForwardingProtocol + +const ( + HTTPOnly ForwardingProtocol = original.HTTPOnly + HTTPSOnly ForwardingProtocol = original.HTTPSOnly + MatchRequest ForwardingProtocol = original.MatchRequest +) + +type HealthProbeEnabled = original.HealthProbeEnabled + +const ( + HealthProbeEnabledDisabled HealthProbeEnabled = original.HealthProbeEnabledDisabled + HealthProbeEnabledEnabled HealthProbeEnabled = original.HealthProbeEnabledEnabled +) + +type HealthProbeMethod = original.HealthProbeMethod + +const ( + GET HealthProbeMethod = original.GET + HEAD HealthProbeMethod = original.HEAD +) + +type ManagedRuleEnabledState = original.ManagedRuleEnabledState + +const ( + ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = original.ManagedRuleEnabledStateDisabled + ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = original.ManagedRuleEnabledStateEnabled +) + +type MatchVariable = original.MatchVariable + +const ( + Cookies MatchVariable = original.Cookies + PostArgs MatchVariable = original.PostArgs + QueryString MatchVariable = original.QueryString + RemoteAddr MatchVariable = original.RemoteAddr + RequestBody MatchVariable = original.RequestBody + RequestHeader MatchVariable = original.RequestHeader + RequestMethod MatchVariable = original.RequestMethod + RequestURI MatchVariable = original.RequestURI + SocketAddr MatchVariable = original.SocketAddr +) + +type MinimumTLSVersion = original.MinimumTLSVersion + +const ( + OneFullStopTwo MinimumTLSVersion = original.OneFullStopTwo + OneFullStopZero MinimumTLSVersion = original.OneFullStopZero +) + +type NetworkOperationStatus = original.NetworkOperationStatus + +const ( + Failed NetworkOperationStatus = original.Failed + InProgress NetworkOperationStatus = original.InProgress + Succeeded NetworkOperationStatus = original.Succeeded +) + +type OdataType = original.OdataType + +const ( + OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration OdataType = original.OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration + OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration OdataType = original.OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration + OdataTypeRouteConfiguration OdataType = original.OdataTypeRouteConfiguration +) + +type Operator = original.Operator + +const ( + Any Operator = original.Any + BeginsWith Operator = original.BeginsWith + Contains Operator = original.Contains + EndsWith Operator = original.EndsWith + Equal Operator = original.Equal + GeoMatch Operator = original.GeoMatch + GreaterThan Operator = original.GreaterThan + GreaterThanOrEqual Operator = original.GreaterThanOrEqual + IPMatch Operator = original.IPMatch + LessThan Operator = original.LessThan + LessThanOrEqual Operator = original.LessThanOrEqual + RegEx Operator = original.RegEx +) + +type PolicyEnabledState = original.PolicyEnabledState + +const ( + PolicyEnabledStateDisabled PolicyEnabledState = original.PolicyEnabledStateDisabled + PolicyEnabledStateEnabled PolicyEnabledState = original.PolicyEnabledStateEnabled +) + +type PolicyMode = original.PolicyMode + +const ( + Detection PolicyMode = original.Detection + Prevention PolicyMode = original.Prevention +) + +type PolicyResourceState = original.PolicyResourceState + +const ( + PolicyResourceStateCreating PolicyResourceState = original.PolicyResourceStateCreating + PolicyResourceStateDeleting PolicyResourceState = original.PolicyResourceStateDeleting + PolicyResourceStateDisabled PolicyResourceState = original.PolicyResourceStateDisabled + PolicyResourceStateDisabling PolicyResourceState = original.PolicyResourceStateDisabling + PolicyResourceStateEnabled PolicyResourceState = original.PolicyResourceStateEnabled + PolicyResourceStateEnabling PolicyResourceState = original.PolicyResourceStateEnabling +) + +type Protocol = original.Protocol + +const ( + HTTP Protocol = original.HTTP + HTTPS Protocol = original.HTTPS +) + +type Query = original.Query + +const ( + StripAll Query = original.StripAll + StripNone Query = original.StripNone +) + +type RedirectProtocol = original.RedirectProtocol + +const ( + RedirectProtocolHTTPOnly RedirectProtocol = original.RedirectProtocolHTTPOnly + RedirectProtocolHTTPSOnly RedirectProtocol = original.RedirectProtocolHTTPSOnly + RedirectProtocolMatchRequest RedirectProtocol = original.RedirectProtocolMatchRequest +) + +type RedirectType = original.RedirectType + +const ( + Found RedirectType = original.Found + Moved RedirectType = original.Moved + PermanentRedirect RedirectType = original.PermanentRedirect + TemporaryRedirect RedirectType = original.TemporaryRedirect +) + +type ResourceState = original.ResourceState + +const ( + ResourceStateCreating ResourceState = original.ResourceStateCreating + ResourceStateDeleting ResourceState = original.ResourceStateDeleting + ResourceStateDisabled ResourceState = original.ResourceStateDisabled + ResourceStateDisabling ResourceState = original.ResourceStateDisabling + ResourceStateEnabled ResourceState = original.ResourceStateEnabled + ResourceStateEnabling ResourceState = original.ResourceStateEnabling +) + +type ResourceType = original.ResourceType + +const ( + MicrosoftNetworkfrontDoors ResourceType = original.MicrosoftNetworkfrontDoors + MicrosoftNetworkfrontDoorsfrontendEndpoints ResourceType = original.MicrosoftNetworkfrontDoorsfrontendEndpoints +) + +type RoutingRuleEnabledState = original.RoutingRuleEnabledState + +const ( + RoutingRuleEnabledStateDisabled RoutingRuleEnabledState = original.RoutingRuleEnabledStateDisabled + RoutingRuleEnabledStateEnabled RoutingRuleEnabledState = original.RoutingRuleEnabledStateEnabled +) + +type RuleType = original.RuleType + +const ( + MatchRule RuleType = original.MatchRule + RateLimitRule RuleType = original.RateLimitRule +) + +type SessionAffinityEnabledState = original.SessionAffinityEnabledState + +const ( + SessionAffinityEnabledStateDisabled SessionAffinityEnabledState = original.SessionAffinityEnabledStateDisabled + SessionAffinityEnabledStateEnabled SessionAffinityEnabledState = original.SessionAffinityEnabledStateEnabled +) + +type TransformType = original.TransformType + +const ( + Lowercase TransformType = original.Lowercase + RemoveNulls TransformType = original.RemoveNulls + Trim TransformType = original.Trim + Uppercase TransformType = original.Uppercase + URLDecode TransformType = original.URLDecode + URLEncode TransformType = original.URLEncode +) + +type AzureAsyncOperationResult = original.AzureAsyncOperationResult +type Backend = original.Backend +type BackendPool = original.BackendPool +type BackendPoolListResult = original.BackendPoolListResult +type BackendPoolProperties = original.BackendPoolProperties +type BackendPoolUpdateParameters = original.BackendPoolUpdateParameters +type BackendPoolsSettings = original.BackendPoolsSettings +type BaseClient = original.BaseClient +type BasicRouteConfiguration = original.BasicRouteConfiguration +type CacheConfiguration = original.CacheConfiguration +type CertificateSourceParameters = original.CertificateSourceParameters +type CheckNameAvailabilityInput = original.CheckNameAvailabilityInput +type CheckNameAvailabilityOutput = original.CheckNameAvailabilityOutput +type CustomHTTPSConfiguration = original.CustomHTTPSConfiguration +type CustomRule = original.CustomRule +type CustomRuleList = original.CustomRuleList +type EndpointsClient = original.EndpointsClient +type EndpointsPurgeContentFuture = original.EndpointsPurgeContentFuture +type Error = original.Error +type ErrorDetails = original.ErrorDetails +type ErrorResponse = original.ErrorResponse +type ForwardingConfiguration = original.ForwardingConfiguration +type FrontDoor = original.FrontDoor +type FrontDoorsClient = original.FrontDoorsClient +type FrontDoorsCreateOrUpdateFutureType = original.FrontDoorsCreateOrUpdateFutureType +type FrontDoorsDeleteFutureType = original.FrontDoorsDeleteFutureType +type FrontendEndpoint = original.FrontendEndpoint +type FrontendEndpointLink = original.FrontendEndpointLink +type FrontendEndpointProperties = original.FrontendEndpointProperties +type FrontendEndpointUpdateParameters = original.FrontendEndpointUpdateParameters +type FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink = original.FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink +type FrontendEndpointsClient = original.FrontendEndpointsClient +type FrontendEndpointsDisableHTTPSFuture = original.FrontendEndpointsDisableHTTPSFuture +type FrontendEndpointsEnableHTTPSFuture = original.FrontendEndpointsEnableHTTPSFuture +type FrontendEndpointsListResult = original.FrontendEndpointsListResult +type FrontendEndpointsListResultIterator = original.FrontendEndpointsListResultIterator +type FrontendEndpointsListResultPage = original.FrontendEndpointsListResultPage +type HealthProbeSettingsListResult = original.HealthProbeSettingsListResult +type HealthProbeSettingsModel = original.HealthProbeSettingsModel +type HealthProbeSettingsProperties = original.HealthProbeSettingsProperties +type HealthProbeSettingsUpdateParameters = original.HealthProbeSettingsUpdateParameters +type KeyVaultCertificateSourceParameters = original.KeyVaultCertificateSourceParameters +type KeyVaultCertificateSourceParametersVault = original.KeyVaultCertificateSourceParametersVault +type ListResult = original.ListResult +type ListResultIterator = original.ListResultIterator +type ListResultPage = original.ListResultPage +type LoadBalancingSettingsListResult = original.LoadBalancingSettingsListResult +type LoadBalancingSettingsModel = original.LoadBalancingSettingsModel +type LoadBalancingSettingsProperties = original.LoadBalancingSettingsProperties +type LoadBalancingSettingsUpdateParameters = original.LoadBalancingSettingsUpdateParameters +type ManagedRuleDefinition = original.ManagedRuleDefinition +type ManagedRuleGroupDefinition = original.ManagedRuleGroupDefinition +type ManagedRuleGroupOverride = original.ManagedRuleGroupOverride +type ManagedRuleOverride = original.ManagedRuleOverride +type ManagedRuleSet = original.ManagedRuleSet +type ManagedRuleSetDefinition = original.ManagedRuleSetDefinition +type ManagedRuleSetDefinitionList = original.ManagedRuleSetDefinitionList +type ManagedRuleSetDefinitionListIterator = original.ManagedRuleSetDefinitionListIterator +type ManagedRuleSetDefinitionListPage = original.ManagedRuleSetDefinitionListPage +type ManagedRuleSetDefinitionProperties = original.ManagedRuleSetDefinitionProperties +type ManagedRuleSetList = original.ManagedRuleSetList +type ManagedRuleSetsClient = original.ManagedRuleSetsClient +type MatchCondition = original.MatchCondition +type PoliciesClient = original.PoliciesClient +type PoliciesCreateOrUpdateFuture = original.PoliciesCreateOrUpdateFuture +type PoliciesDeleteFuture = original.PoliciesDeleteFuture +type PolicySettings = original.PolicySettings +type Properties = original.Properties +type PurgeParameters = original.PurgeParameters +type RedirectConfiguration = original.RedirectConfiguration +type Resource = original.Resource +type RouteConfiguration = original.RouteConfiguration +type RoutingRule = original.RoutingRule +type RoutingRuleListResult = original.RoutingRuleListResult +type RoutingRuleProperties = original.RoutingRuleProperties +type RoutingRuleUpdateParameters = original.RoutingRuleUpdateParameters +type SubResource = original.SubResource +type TagsObject = original.TagsObject +type UpdateParameters = original.UpdateParameters +type ValidateCustomDomainInput = original.ValidateCustomDomainInput +type ValidateCustomDomainOutput = original.ValidateCustomDomainOutput +type WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicy +type WebApplicationFirewallPolicyList = original.WebApplicationFirewallPolicyList +type WebApplicationFirewallPolicyListIterator = original.WebApplicationFirewallPolicyListIterator +type WebApplicationFirewallPolicyListPage = original.WebApplicationFirewallPolicyListPage +type WebApplicationFirewallPolicyProperties = original.WebApplicationFirewallPolicyProperties + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewEndpointsClient(subscriptionID string) EndpointsClient { + return original.NewEndpointsClient(subscriptionID) +} +func NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string) EndpointsClient { + return original.NewEndpointsClientWithBaseURI(baseURI, subscriptionID) +} +func NewFrontDoorsClient(subscriptionID string) FrontDoorsClient { + return original.NewFrontDoorsClient(subscriptionID) +} +func NewFrontDoorsClientWithBaseURI(baseURI string, subscriptionID string) FrontDoorsClient { + return original.NewFrontDoorsClientWithBaseURI(baseURI, subscriptionID) +} +func NewFrontendEndpointsClient(subscriptionID string) FrontendEndpointsClient { + return original.NewFrontendEndpointsClient(subscriptionID) +} +func NewFrontendEndpointsClientWithBaseURI(baseURI string, subscriptionID string) FrontendEndpointsClient { + return original.NewFrontendEndpointsClientWithBaseURI(baseURI, subscriptionID) +} +func NewFrontendEndpointsListResultIterator(page FrontendEndpointsListResultPage) FrontendEndpointsListResultIterator { + return original.NewFrontendEndpointsListResultIterator(page) +} +func NewFrontendEndpointsListResultPage(getNextPage func(context.Context, FrontendEndpointsListResult) (FrontendEndpointsListResult, error)) FrontendEndpointsListResultPage { + return original.NewFrontendEndpointsListResultPage(getNextPage) +} +func NewListResultIterator(page ListResultPage) ListResultIterator { + return original.NewListResultIterator(page) +} +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return original.NewListResultPage(getNextPage) +} +func NewManagedRuleSetDefinitionListIterator(page ManagedRuleSetDefinitionListPage) ManagedRuleSetDefinitionListIterator { + return original.NewManagedRuleSetDefinitionListIterator(page) +} +func NewManagedRuleSetDefinitionListPage(getNextPage func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error)) ManagedRuleSetDefinitionListPage { + return original.NewManagedRuleSetDefinitionListPage(getNextPage) +} +func NewManagedRuleSetsClient(subscriptionID string) ManagedRuleSetsClient { + return original.NewManagedRuleSetsClient(subscriptionID) +} +func NewManagedRuleSetsClientWithBaseURI(baseURI string, subscriptionID string) ManagedRuleSetsClient { + return original.NewManagedRuleSetsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPoliciesClient(subscriptionID string) PoliciesClient { + return original.NewPoliciesClient(subscriptionID) +} +func NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string) PoliciesClient { + return original.NewPoliciesClientWithBaseURI(baseURI, subscriptionID) +} +func NewWebApplicationFirewallPolicyListIterator(page WebApplicationFirewallPolicyListPage) WebApplicationFirewallPolicyListIterator { + return original.NewWebApplicationFirewallPolicyListIterator(page) +} +func NewWebApplicationFirewallPolicyListPage(getNextPage func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error)) WebApplicationFirewallPolicyListPage { + return original.NewWebApplicationFirewallPolicyListPage(getNextPage) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleActionTypeValues() []ActionType { + return original.PossibleActionTypeValues() +} +func PossibleAvailabilityValues() []Availability { + return original.PossibleAvailabilityValues() +} +func PossibleBackendEnabledStateValues() []BackendEnabledState { + return original.PossibleBackendEnabledStateValues() +} +func PossibleCertificateSourceValues() []CertificateSource { + return original.PossibleCertificateSourceValues() +} +func PossibleCertificateTypeValues() []CertificateType { + return original.PossibleCertificateTypeValues() +} +func PossibleCustomHTTPSProvisioningStateValues() []CustomHTTPSProvisioningState { + return original.PossibleCustomHTTPSProvisioningStateValues() +} +func PossibleCustomHTTPSProvisioningSubstateValues() []CustomHTTPSProvisioningSubstate { + return original.PossibleCustomHTTPSProvisioningSubstateValues() +} +func PossibleCustomRuleEnabledStateValues() []CustomRuleEnabledState { + return original.PossibleCustomRuleEnabledStateValues() +} +func PossibleDynamicCompressionEnabledValues() []DynamicCompressionEnabled { + return original.PossibleDynamicCompressionEnabledValues() +} +func PossibleEnabledStateValues() []EnabledState { + return original.PossibleEnabledStateValues() +} +func PossibleEnforceCertificateNameCheckEnabledStateValues() []EnforceCertificateNameCheckEnabledState { + return original.PossibleEnforceCertificateNameCheckEnabledStateValues() +} +func PossibleForwardingProtocolValues() []ForwardingProtocol { + return original.PossibleForwardingProtocolValues() +} +func PossibleHealthProbeEnabledValues() []HealthProbeEnabled { + return original.PossibleHealthProbeEnabledValues() +} +func PossibleHealthProbeMethodValues() []HealthProbeMethod { + return original.PossibleHealthProbeMethodValues() +} +func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { + return original.PossibleManagedRuleEnabledStateValues() +} +func PossibleMatchVariableValues() []MatchVariable { + return original.PossibleMatchVariableValues() +} +func PossibleMinimumTLSVersionValues() []MinimumTLSVersion { + return original.PossibleMinimumTLSVersionValues() +} +func PossibleNetworkOperationStatusValues() []NetworkOperationStatus { + return original.PossibleNetworkOperationStatusValues() +} +func PossibleOdataTypeValues() []OdataType { + return original.PossibleOdataTypeValues() +} +func PossibleOperatorValues() []Operator { + return original.PossibleOperatorValues() +} +func PossiblePolicyEnabledStateValues() []PolicyEnabledState { + return original.PossiblePolicyEnabledStateValues() +} +func PossiblePolicyModeValues() []PolicyMode { + return original.PossiblePolicyModeValues() +} +func PossiblePolicyResourceStateValues() []PolicyResourceState { + return original.PossiblePolicyResourceStateValues() +} +func PossibleProtocolValues() []Protocol { + return original.PossibleProtocolValues() +} +func PossibleQueryValues() []Query { + return original.PossibleQueryValues() +} +func PossibleRedirectProtocolValues() []RedirectProtocol { + return original.PossibleRedirectProtocolValues() +} +func PossibleRedirectTypeValues() []RedirectType { + return original.PossibleRedirectTypeValues() +} +func PossibleResourceStateValues() []ResourceState { + return original.PossibleResourceStateValues() +} +func PossibleResourceTypeValues() []ResourceType { + return original.PossibleResourceTypeValues() +} +func PossibleRoutingRuleEnabledStateValues() []RoutingRuleEnabledState { + return original.PossibleRoutingRuleEnabledStateValues() +} +func PossibleRuleTypeValues() []RuleType { + return original.PossibleRuleTypeValues() +} +func PossibleSessionAffinityEnabledStateValues() []SessionAffinityEnabledState { + return original.PossibleSessionAffinityEnabledStateValues() +} +func PossibleTransformTypeValues() []TransformType { + return original.PossibleTransformTypeValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/profiles/preview/preview/machinelearning/mgmt/services/servicesapi/models.go b/profiles/preview/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go similarity index 72% rename from profiles/preview/preview/machinelearning/mgmt/services/servicesapi/models.go rename to profiles/preview/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go index 14f1fcfc2676..ebd9615bd1ab 100644 --- a/profiles/preview/preview/machinelearning/mgmt/services/servicesapi/models.go +++ b/profiles/preview/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go @@ -17,10 +17,10 @@ // This code was auto-generated by: // github.com/Azure/azure-sdk-for-go/tools/profileBuilder -package servicesapi +package healthcareapisapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2018-03-01-preview/services/servicesapi" +import original "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis/healthcareapisapi" -type MachineLearningComputeClientAPI = original.MachineLearningComputeClientAPI +type OperationResultsClientAPI = original.OperationResultsClientAPI type OperationsClientAPI = original.OperationsClientAPI -type WorkspacesClientAPI = original.WorkspacesClientAPI +type ServicesClientAPI = original.ServicesClientAPI diff --git a/profiles/preview/healthcareapis/mgmt/healthcareapis/models.go b/profiles/preview/healthcareapis/mgmt/healthcareapis/models.go new file mode 100644 index 000000000000..13f5929787eb --- /dev/null +++ b/profiles/preview/healthcareapis/mgmt/healthcareapis/models.go @@ -0,0 +1,154 @@ +// +build go1.9 + +// Copyright 2019 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 healthcareapis + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type Kind = original.Kind + +const ( + Fhir Kind = original.Fhir + FhirR4 Kind = original.FhirR4 + FhirStu3 Kind = original.FhirStu3 +) + +type OperationResultStatus = original.OperationResultStatus + +const ( + Canceled OperationResultStatus = original.Canceled + Failed OperationResultStatus = original.Failed + Requested OperationResultStatus = original.Requested + Running OperationResultStatus = original.Running + Succeeded OperationResultStatus = original.Succeeded +) + +type ProvisioningState = original.ProvisioningState + +const ( + ProvisioningStateAccepted ProvisioningState = original.ProvisioningStateAccepted + ProvisioningStateCanceled ProvisioningState = original.ProvisioningStateCanceled + ProvisioningStateCreating ProvisioningState = original.ProvisioningStateCreating + ProvisioningStateDeleting ProvisioningState = original.ProvisioningStateDeleting + ProvisioningStateDeprovisioned ProvisioningState = original.ProvisioningStateDeprovisioned + ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed + ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded + ProvisioningStateUpdating ProvisioningState = original.ProvisioningStateUpdating + ProvisioningStateVerifying ProvisioningState = original.ProvisioningStateVerifying +) + +type ServiceNameUnavailabilityReason = original.ServiceNameUnavailabilityReason + +const ( + AlreadyExists ServiceNameUnavailabilityReason = original.AlreadyExists + Invalid ServiceNameUnavailabilityReason = original.Invalid +) + +type BaseClient = original.BaseClient +type CheckNameAvailabilityParameters = original.CheckNameAvailabilityParameters +type ErrorDetails = original.ErrorDetails +type ErrorDetailsInternal = original.ErrorDetailsInternal +type Operation = original.Operation +type OperationDisplay = original.OperationDisplay +type OperationListResult = original.OperationListResult +type OperationListResultIterator = original.OperationListResultIterator +type OperationListResultPage = original.OperationListResultPage +type OperationResultsClient = original.OperationResultsClient +type OperationResultsDescription = original.OperationResultsDescription +type OperationsClient = original.OperationsClient +type Resource = original.Resource +type ServiceAccessPolicyEntry = original.ServiceAccessPolicyEntry +type ServiceAuthenticationConfigurationInfo = original.ServiceAuthenticationConfigurationInfo +type ServiceCorsConfigurationInfo = original.ServiceCorsConfigurationInfo +type ServiceCosmosDbConfigurationInfo = original.ServiceCosmosDbConfigurationInfo +type ServicesClient = original.ServicesClient +type ServicesCreateOrUpdateFuture = original.ServicesCreateOrUpdateFuture +type ServicesDeleteFuture = original.ServicesDeleteFuture +type ServicesDescription = original.ServicesDescription +type ServicesDescriptionListResult = original.ServicesDescriptionListResult +type ServicesDescriptionListResultIterator = original.ServicesDescriptionListResultIterator +type ServicesDescriptionListResultPage = original.ServicesDescriptionListResultPage +type ServicesNameAvailabilityInfo = original.ServicesNameAvailabilityInfo +type ServicesPatchDescription = original.ServicesPatchDescription +type ServicesProperties = original.ServicesProperties +type ServicesUpdateFuture = original.ServicesUpdateFuture +type SetObject = original.SetObject + +func New(subscriptionID string) BaseClient { + return original.New(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 NewOperationResultsClient(subscriptionID string) OperationResultsClient { + return original.NewOperationResultsClient(subscriptionID) +} +func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationResultsClient { + return original.NewOperationResultsClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewServicesClient(subscriptionID string) ServicesClient { + return original.NewServicesClient(subscriptionID) +} +func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { + return original.NewServicesClientWithBaseURI(baseURI, subscriptionID) +} +func NewServicesDescriptionListResultIterator(page ServicesDescriptionListResultPage) ServicesDescriptionListResultIterator { + return original.NewServicesDescriptionListResultIterator(page) +} +func NewServicesDescriptionListResultPage(getNextPage func(context.Context, ServicesDescriptionListResult) (ServicesDescriptionListResult, error)) ServicesDescriptionListResultPage { + return original.NewServicesDescriptionListResultPage(getNextPage) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleKindValues() []Kind { + return original.PossibleKindValues() +} +func PossibleOperationResultStatusValues() []OperationResultStatus { + return original.PossibleOperationResultStatusValues() +} +func PossibleProvisioningStateValues() []ProvisioningState { + return original.PossibleProvisioningStateValues() +} +func PossibleServiceNameUnavailabilityReasonValues() []ServiceNameUnavailabilityReason { + return original.PossibleServiceNameUnavailabilityReasonValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/profiles/preview/kusto/mgmt/kusto/kustoapi/models.go b/profiles/preview/kusto/mgmt/kusto/kustoapi/models.go index 07c81eaf8dab..25b871538b2d 100644 --- a/profiles/preview/kusto/mgmt/kusto/kustoapi/models.go +++ b/profiles/preview/kusto/mgmt/kusto/kustoapi/models.go @@ -19,8 +19,9 @@ package kustoapi -import original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-05-15/kusto/kustoapi" +import original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-09-07/kusto/kustoapi" +type AttachedDatabaseConfigurationsClientAPI = original.AttachedDatabaseConfigurationsClientAPI type ClustersClientAPI = original.ClustersClientAPI type DataConnectionsClientAPI = original.DataConnectionsClientAPI type DatabasesClientAPI = original.DatabasesClientAPI diff --git a/profiles/preview/kusto/mgmt/kusto/models.go b/profiles/preview/kusto/mgmt/kusto/models.go index 85187acf6ee2..0683433aa011 100644 --- a/profiles/preview/kusto/mgmt/kusto/models.go +++ b/profiles/preview/kusto/mgmt/kusto/models.go @@ -22,7 +22,7 @@ package kusto import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-05-15/kusto" + original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-09-07/kusto" ) const ( @@ -74,6 +74,7 @@ const ( SINGLEJSON DataFormat = original.SINGLEJSON SOHSV DataFormat = original.SOHSV TSV DataFormat = original.TSV + TSVE DataFormat = original.TSVE TXT DataFormat = original.TXT ) @@ -96,13 +97,44 @@ const ( DatabasePrincipalTypeUser DatabasePrincipalType = original.DatabasePrincipalTypeUser ) +type DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKind + +const ( + DefaultPrincipalsModificationKindNone DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKindNone + DefaultPrincipalsModificationKindReplace DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKindReplace + DefaultPrincipalsModificationKindUnion DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKindUnion +) + +type IdentityType = original.IdentityType + +const ( + IdentityTypeNone IdentityType = original.IdentityTypeNone + IdentityTypeSystemAssigned IdentityType = original.IdentityTypeSystemAssigned +) + type Kind = original.Kind const ( - KindDataConnection Kind = original.KindDataConnection - KindEventGrid Kind = original.KindEventGrid - KindEventHub Kind = original.KindEventHub - KindIotHub Kind = original.KindIotHub + KindDatabase Kind = original.KindDatabase + KindReadOnlyFollowing Kind = original.KindReadOnlyFollowing + KindReadWrite Kind = original.KindReadWrite +) + +type KindBasicDataConnection = original.KindBasicDataConnection + +const ( + KindDataConnection KindBasicDataConnection = original.KindDataConnection + KindEventGrid KindBasicDataConnection = original.KindEventGrid + KindEventHub KindBasicDataConnection = original.KindEventHub + KindIotHub KindBasicDataConnection = original.KindIotHub +) + +type PrincipalsModificationKind = original.PrincipalsModificationKind + +const ( + PrincipalsModificationKindNone PrincipalsModificationKind = original.PrincipalsModificationKindNone + PrincipalsModificationKindReplace PrincipalsModificationKind = original.PrincipalsModificationKindReplace + PrincipalsModificationKindUnion PrincipalsModificationKind = original.PrincipalsModificationKindUnion ) type ProvisioningState = original.ProvisioningState @@ -137,12 +169,27 @@ const ( StateUpdating State = original.StateUpdating ) +type Type = original.Type + +const ( + MicrosoftKustoclustersattachedDatabaseConfigurations Type = original.MicrosoftKustoclustersattachedDatabaseConfigurations + MicrosoftKustoclustersdatabases Type = original.MicrosoftKustoclustersdatabases +) + +type AttachedDatabaseConfiguration = original.AttachedDatabaseConfiguration +type AttachedDatabaseConfigurationListResult = original.AttachedDatabaseConfigurationListResult +type AttachedDatabaseConfigurationProperties = original.AttachedDatabaseConfigurationProperties +type AttachedDatabaseConfigurationsClient = original.AttachedDatabaseConfigurationsClient +type AttachedDatabaseConfigurationsCreateOrUpdateFuture = original.AttachedDatabaseConfigurationsCreateOrUpdateFuture +type AttachedDatabaseConfigurationsDeleteFuture = original.AttachedDatabaseConfigurationsDeleteFuture type AzureCapacity = original.AzureCapacity type AzureEntityResource = original.AzureEntityResource type AzureResourceSku = original.AzureResourceSku type AzureSku = original.AzureSku type BaseClient = original.BaseClient type BasicDataConnection = original.BasicDataConnection +type BasicDatabase = original.BasicDatabase +type CheckNameRequest = original.CheckNameRequest type CheckNameResult = original.CheckNameResult type CloudError = original.CloudError type CloudErrorBody = original.CloudErrorBody @@ -154,6 +201,7 @@ type ClusterUpdate = original.ClusterUpdate type ClustersClient = original.ClustersClient type ClustersCreateOrUpdateFuture = original.ClustersCreateOrUpdateFuture type ClustersDeleteFuture = original.ClustersDeleteFuture +type ClustersDetachFollowerDatabasesFuture = original.ClustersDetachFollowerDatabasesFuture type ClustersStartFuture = original.ClustersStartFuture type ClustersStopFuture = original.ClustersStopFuture type ClustersUpdateFuture = original.ClustersUpdateFuture @@ -169,14 +217,12 @@ type DataConnectionsCreateOrUpdateFuture = original.DataConnectionsCreateOrUpdat type DataConnectionsDeleteFuture = original.DataConnectionsDeleteFuture type DataConnectionsUpdateFuture = original.DataConnectionsUpdateFuture type Database = original.Database -type DatabaseCheckNameRequest = original.DatabaseCheckNameRequest type DatabaseListResult = original.DatabaseListResult +type DatabaseModel = original.DatabaseModel type DatabasePrincipal = original.DatabasePrincipal type DatabasePrincipalListRequest = original.DatabasePrincipalListRequest type DatabasePrincipalListResult = original.DatabasePrincipalListResult -type DatabaseProperties = original.DatabaseProperties type DatabaseStatistics = original.DatabaseStatistics -type DatabaseUpdate = original.DatabaseUpdate type DatabasesClient = original.DatabasesClient type DatabasesCreateOrUpdateFuture = original.DatabasesCreateOrUpdateFuture type DatabasesDeleteFuture = original.DatabasesDeleteFuture @@ -185,8 +231,13 @@ type EventGridConnectionProperties = original.EventGridConnectionProperties type EventGridDataConnection = original.EventGridDataConnection type EventHubConnectionProperties = original.EventHubConnectionProperties type EventHubDataConnection = original.EventHubDataConnection +type FollowerDatabaseDefinition = original.FollowerDatabaseDefinition +type FollowerDatabaseListResult = original.FollowerDatabaseListResult +type Identity = original.Identity +type IdentityUserAssignedIdentitiesValue = original.IdentityUserAssignedIdentitiesValue type IotHubConnectionProperties = original.IotHubConnectionProperties type IotHubDataConnection = original.IotHubDataConnection +type KeyVaultProperties = original.KeyVaultProperties type ListResourceSkusResult = original.ListResourceSkusResult type Operation = original.Operation type OperationDisplay = original.OperationDisplay @@ -196,6 +247,10 @@ type OperationListResultPage = original.OperationListResultPage type OperationsClient = original.OperationsClient type OptimizedAutoscale = original.OptimizedAutoscale type ProxyResource = original.ProxyResource +type ReadOnlyFollowingDatabase = original.ReadOnlyFollowingDatabase +type ReadOnlyFollowingDatabaseProperties = original.ReadOnlyFollowingDatabaseProperties +type ReadWriteDatabase = original.ReadWriteDatabase +type ReadWriteDatabaseProperties = original.ReadWriteDatabaseProperties type Resource = original.Resource type SkuDescription = original.SkuDescription type SkuDescriptionList = original.SkuDescriptionList @@ -207,6 +262,12 @@ type VirtualNetworkConfiguration = original.VirtualNetworkConfiguration func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } +func NewAttachedDatabaseConfigurationsClient(subscriptionID string) AttachedDatabaseConfigurationsClient { + return original.NewAttachedDatabaseConfigurationsClient(subscriptionID) +} +func NewAttachedDatabaseConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) AttachedDatabaseConfigurationsClient { + return original.NewAttachedDatabaseConfigurationsClientWithBaseURI(baseURI, subscriptionID) +} func NewClustersClient(subscriptionID string) ClustersClient { return original.NewClustersClient(subscriptionID) } @@ -258,9 +319,21 @@ func PossibleDatabasePrincipalRoleValues() []DatabasePrincipalRole { func PossibleDatabasePrincipalTypeValues() []DatabasePrincipalType { return original.PossibleDatabasePrincipalTypeValues() } +func PossibleDefaultPrincipalsModificationKindValues() []DefaultPrincipalsModificationKind { + return original.PossibleDefaultPrincipalsModificationKindValues() +} +func PossibleIdentityTypeValues() []IdentityType { + return original.PossibleIdentityTypeValues() +} +func PossibleKindBasicDataConnectionValues() []KindBasicDataConnection { + return original.PossibleKindBasicDataConnectionValues() +} func PossibleKindValues() []Kind { return original.PossibleKindValues() } +func PossiblePrincipalsModificationKindValues() []PrincipalsModificationKind { + return original.PossiblePrincipalsModificationKindValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } @@ -270,6 +343,9 @@ func PossibleReasonValues() []Reason { func PossibleStateValues() []State { return original.PossibleStateValues() } +func PossibleTypeValues() []Type { + return original.PossibleTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go index 0d80dd1aa71c..7304674d88f3 100644 --- a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go +++ b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go @@ -23,6 +23,7 @@ import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservi type MachineLearningComputeClientAPI = original.MachineLearningComputeClientAPI type OperationsClientAPI = original.OperationsClientAPI +type QuotasClientAPI = original.QuotasClientAPI type UsagesClientAPI = original.UsagesClientAPI type VirtualMachineSizesClientAPI = original.VirtualMachineSizesClientAPI type WorkspacesClientAPI = original.WorkspacesClientAPI diff --git a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go index de8a0ceee1f8..d685dcb8580c 100644 --- a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go +++ b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go @@ -100,6 +100,12 @@ const ( Updating ProvisioningState = original.Updating ) +type QuotaUnit = original.QuotaUnit + +const ( + Count QuotaUnit = original.Count +) + type RemoteLoginPortPublicAccess = original.RemoteLoginPortPublicAccess const ( @@ -117,8 +123,19 @@ const ( type Status = original.Status const ( - StatusDisabled Status = original.StatusDisabled - StatusEnabled Status = original.StatusEnabled + Failure Status = original.Failure + InvalidQuotaBelowClusterMinimum Status = original.InvalidQuotaBelowClusterMinimum + InvalidQuotaExceedsSubscriptionLimit Status = original.InvalidQuotaExceedsSubscriptionLimit + InvalidVMFamilyName Status = original.InvalidVMFamilyName + Success Status = original.Success + Undefined Status = original.Undefined +) + +type Status1 = original.Status1 + +const ( + Status1Disabled Status1 = original.Status1Disabled + Status1Enabled Status1 = original.Status1Enabled ) type UnderlyingResourceAction = original.UnderlyingResourceAction @@ -131,7 +148,7 @@ const ( type UsageUnit = original.UsageUnit const ( - Count UsageUnit = original.Count + UsageUnitCount UsageUnit = original.UsageUnitCount ) type VMPriority = original.VMPriority @@ -176,6 +193,9 @@ type ListUsagesResult = original.ListUsagesResult type ListUsagesResultIterator = original.ListUsagesResultIterator type ListUsagesResultPage = original.ListUsagesResultPage type ListWorkspaceKeysResult = original.ListWorkspaceKeysResult +type ListWorkspaceQuotas = original.ListWorkspaceQuotas +type ListWorkspaceQuotasIterator = original.ListWorkspaceQuotasIterator +type ListWorkspaceQuotasPage = original.ListWorkspaceQuotasPage type MachineLearningComputeClient = original.MachineLearningComputeClient type MachineLearningComputeCreateOrUpdateFuture = original.MachineLearningComputeCreateOrUpdateFuture type MachineLearningComputeDeleteFuture = original.MachineLearningComputeDeleteFuture @@ -189,13 +209,20 @@ type PaginatedComputeResourcesList = original.PaginatedComputeResourcesList type PaginatedComputeResourcesListIterator = original.PaginatedComputeResourcesListIterator type PaginatedComputeResourcesListPage = original.PaginatedComputeResourcesListPage type Password = original.Password +type QuotaBaseProperties = original.QuotaBaseProperties +type QuotaUpdateParameters = original.QuotaUpdateParameters +type QuotasClient = original.QuotasClient type RegistryListCredentialsResult = original.RegistryListCredentialsResult type Resource = original.Resource type ResourceID = original.ResourceID +type ResourceName = original.ResourceName +type ResourceQuota = original.ResourceQuota type ScaleSettings = original.ScaleSettings type ServicePrincipalCredentials = original.ServicePrincipalCredentials type SslConfiguration = original.SslConfiguration type SystemService = original.SystemService +type UpdateWorkspaceQuotas = original.UpdateWorkspaceQuotas +type UpdateWorkspaceQuotasResult = original.UpdateWorkspaceQuotasResult type Usage = original.Usage type UsageName = original.UsageName type UsagesClient = original.UsagesClient @@ -225,6 +252,12 @@ func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIter func NewListUsagesResultPage(getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { return original.NewListUsagesResultPage(getNextPage) } +func NewListWorkspaceQuotasIterator(page ListWorkspaceQuotasPage) ListWorkspaceQuotasIterator { + return original.NewListWorkspaceQuotasIterator(page) +} +func NewListWorkspaceQuotasPage(getNextPage func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error)) ListWorkspaceQuotasPage { + return original.NewListWorkspaceQuotasPage(getNextPage) +} func NewMachineLearningComputeClient(subscriptionID string) MachineLearningComputeClient { return original.NewMachineLearningComputeClient(subscriptionID) } @@ -243,6 +276,12 @@ func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesList func NewPaginatedComputeResourcesListPage(getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage { return original.NewPaginatedComputeResourcesListPage(getNextPage) } +func NewQuotasClient(subscriptionID string) QuotasClient { + return original.NewQuotasClient(subscriptionID) +} +func NewQuotasClientWithBaseURI(baseURI string, subscriptionID string) QuotasClient { + return original.NewQuotasClientWithBaseURI(baseURI, subscriptionID) +} func NewUsagesClient(subscriptionID string) UsagesClient { return original.NewUsagesClient(subscriptionID) } @@ -291,12 +330,18 @@ func PossibleNodeStateValues() []NodeState { func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } +func PossibleQuotaUnitValues() []QuotaUnit { + return original.PossibleQuotaUnitValues() +} func PossibleRemoteLoginPortPublicAccessValues() []RemoteLoginPortPublicAccess { return original.PossibleRemoteLoginPortPublicAccessValues() } func PossibleResourceIdentityTypeValues() []ResourceIdentityType { return original.PossibleResourceIdentityTypeValues() } +func PossibleStatus1Values() []Status1 { + return original.PossibleStatus1Values() +} func PossibleStatusValues() []Status { return original.PossibleStatusValues() } diff --git a/profiles/preview/mobileengagement/mgmt/mobileengagement/models.go b/profiles/preview/mobileengagement/mgmt/mobileengagement/models.go deleted file mode 100644 index d00733e2a2db..000000000000 --- a/profiles/preview/mobileengagement/mgmt/mobileengagement/models.go +++ /dev/null @@ -1,394 +0,0 @@ -// +build go1.9 - -// Copyright 2019 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 mobileengagement - -import original "github.com/Azure/azure-sdk-for-go/services/mobileengagement/mgmt/2014-12-01/mobileengagement" - -const ( - DefaultBaseURI = original.DefaultBaseURI -) - -type AudienceOperators = original.AudienceOperators - -const ( - EQ AudienceOperators = original.EQ - GE AudienceOperators = original.GE - GT AudienceOperators = original.GT - LE AudienceOperators = original.LE - LT AudienceOperators = original.LT -) - -type CampaignFeedbacks = original.CampaignFeedbacks - -const ( - Actioned CampaignFeedbacks = original.Actioned - Exited CampaignFeedbacks = original.Exited - Pushed CampaignFeedbacks = original.Pushed - Replied CampaignFeedbacks = original.Replied -) - -type CampaignKinds = original.CampaignKinds - -const ( - Announcements CampaignKinds = original.Announcements - DataPushes CampaignKinds = original.DataPushes - NativePushes CampaignKinds = original.NativePushes - Polls CampaignKinds = original.Polls -) - -type CampaignStates = original.CampaignStates - -const ( - Draft CampaignStates = original.Draft - Finished CampaignStates = original.Finished - InProgress CampaignStates = original.InProgress - Queued CampaignStates = original.Queued - Scheduled CampaignStates = original.Scheduled -) - -type CampaignType = original.CampaignType - -const ( - Announcement CampaignType = original.Announcement - DataPush CampaignType = original.DataPush - NativePush CampaignType = original.NativePush - Poll CampaignType = original.Poll -) - -type CampaignTypes = original.CampaignTypes - -const ( - OnlyNotif CampaignTypes = original.OnlyNotif - Textbase64 CampaignTypes = original.Textbase64 - Texthtml CampaignTypes = original.Texthtml - Textplain CampaignTypes = original.Textplain -) - -type DeliveryTimes = original.DeliveryTimes - -const ( - Any DeliveryTimes = original.Any - Background DeliveryTimes = original.Background - Session DeliveryTimes = original.Session -) - -type ExportFormat = original.ExportFormat - -const ( - CsvBlob ExportFormat = original.CsvBlob - JSONBlob ExportFormat = original.JSONBlob -) - -type ExportState = original.ExportState - -const ( - ExportStateFailed ExportState = original.ExportStateFailed - ExportStateQueued ExportState = original.ExportStateQueued - ExportStateStarted ExportState = original.ExportStateStarted - ExportStateSucceeded ExportState = original.ExportStateSucceeded -) - -type ExportType = original.ExportType - -const ( - ExportTypeActivity ExportType = original.ExportTypeActivity - ExportTypeCrash ExportType = original.ExportTypeCrash - ExportTypeError ExportType = original.ExportTypeError - ExportTypeEvent ExportType = original.ExportTypeEvent - ExportTypeJob ExportType = original.ExportTypeJob - ExportTypePush ExportType = original.ExportTypePush - ExportTypeSession ExportType = original.ExportTypeSession - ExportTypeTag ExportType = original.ExportTypeTag - ExportTypeToken ExportType = original.ExportTypeToken -) - -type JobStates = original.JobStates - -const ( - JobStatesFailed JobStates = original.JobStatesFailed - JobStatesQueued JobStates = original.JobStatesQueued - JobStatesStarted JobStates = original.JobStatesStarted - JobStatesSucceeded JobStates = original.JobStatesSucceeded -) - -type NotificationTypes = original.NotificationTypes - -const ( - Popup NotificationTypes = original.Popup - System NotificationTypes = original.System -) - -type ProvisioningStates = original.ProvisioningStates - -const ( - Creating ProvisioningStates = original.Creating - Succeeded ProvisioningStates = original.Succeeded -) - -type PushModes = original.PushModes - -const ( - Manual PushModes = original.Manual - OneShot PushModes = original.OneShot - RealTime PushModes = original.RealTime -) - -type Type = original.Type - -const ( - TypeAnnouncementFeedback Type = original.TypeAnnouncementFeedback - TypeApplicationVersion Type = original.TypeApplicationVersion - TypeBooleanTag Type = original.TypeBooleanTag - TypeCarrierCountry Type = original.TypeCarrierCountry - TypeCarrierName Type = original.TypeCarrierName - TypeCriterion Type = original.TypeCriterion - TypeDatapushFeedback Type = original.TypeDatapushFeedback - TypeDateTag Type = original.TypeDateTag - TypeDeviceManufacturer Type = original.TypeDeviceManufacturer - TypeDeviceModel Type = original.TypeDeviceModel - TypeFirmwareVersion Type = original.TypeFirmwareVersion - TypeGeoFencing Type = original.TypeGeoFencing - TypeIntegerTag Type = original.TypeIntegerTag - TypeLanguage Type = original.TypeLanguage - TypeLocation Type = original.TypeLocation - TypeNetworkType Type = original.TypeNetworkType - TypePollAnswerFeedback Type = original.TypePollAnswerFeedback - TypePollFeedback Type = original.TypePollFeedback - TypeScreenSize Type = original.TypeScreenSize - TypeSegment Type = original.TypeSegment - TypeStringTag Type = original.TypeStringTag -) - -type TypeBasicFilter = original.TypeBasicFilter - -const ( - TypeAppInfo TypeBasicFilter = original.TypeAppInfo - TypeEngageActiveUsers TypeBasicFilter = original.TypeEngageActiveUsers - TypeEngageIdleUsers TypeBasicFilter = original.TypeEngageIdleUsers - TypeEngageNewUsers TypeBasicFilter = original.TypeEngageNewUsers - TypeEngageOldUsers TypeBasicFilter = original.TypeEngageOldUsers - TypeEngageSubset TypeBasicFilter = original.TypeEngageSubset - TypeFilter TypeBasicFilter = original.TypeFilter - TypeNativePushEnabled TypeBasicFilter = original.TypeNativePushEnabled - TypePushQuota TypeBasicFilter = original.TypePushQuota -) - -type APIError = original.APIError -type APIErrorError = original.APIErrorError -type AnnouncementFeedbackCriterion = original.AnnouncementFeedbackCriterion -type App = original.App -type AppCollection = original.AppCollection -type AppCollectionListResult = original.AppCollectionListResult -type AppCollectionListResultIterator = original.AppCollectionListResultIterator -type AppCollectionListResultPage = original.AppCollectionListResultPage -type AppCollectionNameAvailability = original.AppCollectionNameAvailability -type AppCollectionProperties = original.AppCollectionProperties -type AppCollectionsClient = original.AppCollectionsClient -type AppInfoFilter = original.AppInfoFilter -type AppListResult = original.AppListResult -type AppListResultIterator = original.AppListResultIterator -type AppListResultPage = original.AppListResultPage -type AppProperties = original.AppProperties -type ApplicationVersionCriterion = original.ApplicationVersionCriterion -type AppsClient = original.AppsClient -type BaseClient = original.BaseClient -type BasicCriterion = original.BasicCriterion -type BasicFilter = original.BasicFilter -type BooleanTagCriterion = original.BooleanTagCriterion -type Campaign = original.Campaign -type CampaignAudience = original.CampaignAudience -type CampaignListResult = original.CampaignListResult -type CampaignLocalization = original.CampaignLocalization -type CampaignPushParameters = original.CampaignPushParameters -type CampaignPushResult = original.CampaignPushResult -type CampaignResult = original.CampaignResult -type CampaignState = original.CampaignState -type CampaignStateResult = original.CampaignStateResult -type CampaignStatisticsResult = original.CampaignStatisticsResult -type CampaignTestNewParameters = original.CampaignTestNewParameters -type CampaignTestSavedParameters = original.CampaignTestSavedParameters -type CampaignsClient = original.CampaignsClient -type CampaignsListResult = original.CampaignsListResult -type CampaignsListResultIterator = original.CampaignsListResultIterator -type CampaignsListResultPage = original.CampaignsListResultPage -type CarrierCountryCriterion = original.CarrierCountryCriterion -type CarrierNameCriterion = original.CarrierNameCriterion -type Criterion = original.Criterion -type DatapushFeedbackCriterion = original.DatapushFeedbackCriterion -type DateRangeExportTaskParameter = original.DateRangeExportTaskParameter -type DateTagCriterion = original.DateTagCriterion -type Device = original.Device -type DeviceInfo = original.DeviceInfo -type DeviceLocation = original.DeviceLocation -type DeviceManufacturerCriterion = original.DeviceManufacturerCriterion -type DeviceMeta = original.DeviceMeta -type DeviceModelCriterion = original.DeviceModelCriterion -type DeviceQueryResult = original.DeviceQueryResult -type DeviceTagsParameters = original.DeviceTagsParameters -type DeviceTagsResult = original.DeviceTagsResult -type DevicesClient = original.DevicesClient -type DevicesQueryResult = original.DevicesQueryResult -type DevicesQueryResultIterator = original.DevicesQueryResultIterator -type DevicesQueryResultPage = original.DevicesQueryResultPage -type EngageActiveUsersFilter = original.EngageActiveUsersFilter -type EngageIdleUsersFilter = original.EngageIdleUsersFilter -type EngageNewUsersFilter = original.EngageNewUsersFilter -type EngageOldUsersFilter = original.EngageOldUsersFilter -type EngageSubsetFilter = original.EngageSubsetFilter -type ExportOptions = original.ExportOptions -type ExportTaskListResult = original.ExportTaskListResult -type ExportTaskListResultIterator = original.ExportTaskListResultIterator -type ExportTaskListResultPage = original.ExportTaskListResultPage -type ExportTaskParameter = original.ExportTaskParameter -type ExportTaskResult = original.ExportTaskResult -type ExportTasksClient = original.ExportTasksClient -type FeedbackByCampaignParameter = original.FeedbackByCampaignParameter -type FeedbackByDateRangeParameter = original.FeedbackByDateRangeParameter -type Filter = original.Filter -type FirmwareVersionCriterion = original.FirmwareVersionCriterion -type GeoFencingCriterion = original.GeoFencingCriterion -type ImportTask = original.ImportTask -type ImportTaskListResult = original.ImportTaskListResult -type ImportTaskListResultIterator = original.ImportTaskListResultIterator -type ImportTaskListResultPage = original.ImportTaskListResultPage -type ImportTaskResult = original.ImportTaskResult -type ImportTasksClient = original.ImportTasksClient -type IntegerTagCriterion = original.IntegerTagCriterion -type LanguageCriterion = original.LanguageCriterion -type LocationCriterion = original.LocationCriterion -type NativePushEnabledFilter = original.NativePushEnabledFilter -type NetworkTypeCriterion = original.NetworkTypeCriterion -type NotificationOptions = original.NotificationOptions -type PollAnswerFeedbackCriterion = original.PollAnswerFeedbackCriterion -type PollFeedbackCriterion = original.PollFeedbackCriterion -type PollQuestion = original.PollQuestion -type PollQuestionChoice = original.PollQuestionChoice -type PollQuestionChoiceLocalization = original.PollQuestionChoiceLocalization -type PollQuestionLocalization = original.PollQuestionLocalization -type PushQuotaFilter = original.PushQuotaFilter -type Resource = original.Resource -type ScreenSizeCriterion = original.ScreenSizeCriterion -type SegmentCriterion = original.SegmentCriterion -type StringTagCriterion = original.StringTagCriterion -type SupportedPlatformsClient = original.SupportedPlatformsClient -type SupportedPlatformsListResult = original.SupportedPlatformsListResult - -func New(subscriptionID string) BaseClient { - return original.New(subscriptionID) -} -func NewAppCollectionsClient(subscriptionID string) AppCollectionsClient { - return original.NewAppCollectionsClient(subscriptionID) -} -func NewAppCollectionsClientWithBaseURI(baseURI string, subscriptionID string) AppCollectionsClient { - return original.NewAppCollectionsClientWithBaseURI(baseURI, subscriptionID) -} -func NewAppsClient(subscriptionID string) AppsClient { - return original.NewAppsClient(subscriptionID) -} -func NewAppsClientWithBaseURI(baseURI string, subscriptionID string) AppsClient { - return original.NewAppsClientWithBaseURI(baseURI, subscriptionID) -} -func NewCampaignsClient(subscriptionID string) CampaignsClient { - return original.NewCampaignsClient(subscriptionID) -} -func NewCampaignsClientWithBaseURI(baseURI string, subscriptionID string) CampaignsClient { - return original.NewCampaignsClientWithBaseURI(baseURI, subscriptionID) -} -func NewDevicesClient(subscriptionID string) DevicesClient { - return original.NewDevicesClient(subscriptionID) -} -func NewDevicesClientWithBaseURI(baseURI string, subscriptionID string) DevicesClient { - return original.NewDevicesClientWithBaseURI(baseURI, subscriptionID) -} -func NewExportTasksClient(subscriptionID string) ExportTasksClient { - return original.NewExportTasksClient(subscriptionID) -} -func NewExportTasksClientWithBaseURI(baseURI string, subscriptionID string) ExportTasksClient { - return original.NewExportTasksClientWithBaseURI(baseURI, subscriptionID) -} -func NewImportTasksClient(subscriptionID string) ImportTasksClient { - return original.NewImportTasksClient(subscriptionID) -} -func NewImportTasksClientWithBaseURI(baseURI string, subscriptionID string) ImportTasksClient { - return original.NewImportTasksClientWithBaseURI(baseURI, subscriptionID) -} -func NewSupportedPlatformsClient(subscriptionID string) SupportedPlatformsClient { - return original.NewSupportedPlatformsClient(subscriptionID) -} -func NewSupportedPlatformsClientWithBaseURI(baseURI string, subscriptionID string) SupportedPlatformsClient { - return original.NewSupportedPlatformsClientWithBaseURI(baseURI, subscriptionID) -} -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return original.NewWithBaseURI(baseURI, subscriptionID) -} -func PossibleAudienceOperatorsValues() []AudienceOperators { - return original.PossibleAudienceOperatorsValues() -} -func PossibleCampaignFeedbacksValues() []CampaignFeedbacks { - return original.PossibleCampaignFeedbacksValues() -} -func PossibleCampaignKindsValues() []CampaignKinds { - return original.PossibleCampaignKindsValues() -} -func PossibleCampaignStatesValues() []CampaignStates { - return original.PossibleCampaignStatesValues() -} -func PossibleCampaignTypeValues() []CampaignType { - return original.PossibleCampaignTypeValues() -} -func PossibleCampaignTypesValues() []CampaignTypes { - return original.PossibleCampaignTypesValues() -} -func PossibleDeliveryTimesValues() []DeliveryTimes { - return original.PossibleDeliveryTimesValues() -} -func PossibleExportFormatValues() []ExportFormat { - return original.PossibleExportFormatValues() -} -func PossibleExportStateValues() []ExportState { - return original.PossibleExportStateValues() -} -func PossibleExportTypeValues() []ExportType { - return original.PossibleExportTypeValues() -} -func PossibleJobStatesValues() []JobStates { - return original.PossibleJobStatesValues() -} -func PossibleNotificationTypesValues() []NotificationTypes { - return original.PossibleNotificationTypesValues() -} -func PossibleProvisioningStatesValues() []ProvisioningStates { - return original.PossibleProvisioningStatesValues() -} -func PossiblePushModesValues() []PushModes { - return original.PossiblePushModesValues() -} -func PossibleTypeBasicFilterValues() []TypeBasicFilter { - return original.PossibleTypeBasicFilterValues() -} -func PossibleTypeValues() []Type { - return original.PossibleTypeValues() -} -func UserAgent() string { - return original.UserAgent() + " profiles/preview" -} -func Version() string { - return original.Version() -} diff --git a/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go b/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go index 6ac37bf91349..695ea51ccff1 100644 --- a/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go +++ b/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go @@ -57,6 +57,8 @@ type ConfigurationStoresCreateFuture = original.ConfigurationStoresCreateFuture type ConfigurationStoresDeleteFuture = original.ConfigurationStoresDeleteFuture type ConfigurationStoresUpdateFuture = original.ConfigurationStoresUpdateFuture type Error = original.Error +type KeyValue = original.KeyValue +type ListKeyValueParameters = original.ListKeyValueParameters type NameAvailabilityStatus = original.NameAvailabilityStatus type OperationDefinition = original.OperationDefinition type OperationDefinitionDisplay = original.OperationDefinitionDisplay diff --git a/profiles/preview/preview/datashare/mgmt/datashare/models.go b/profiles/preview/preview/datashare/mgmt/datashare/models.go index 1de16e97db28..a2f529f07097 100644 --- a/profiles/preview/preview/datashare/mgmt/datashare/models.go +++ b/profiles/preview/preview/datashare/mgmt/datashare/models.go @@ -47,6 +47,8 @@ const ( Blob DataSetType = original.Blob BlobFolder DataSetType = original.BlobFolder Container DataSetType = original.Container + SQLDBTable DataSetType = original.SQLDBTable + SQLDWTable DataSetType = original.SQLDWTable ) type InvitationStatus = original.InvitationStatus @@ -70,6 +72,8 @@ const ( KindBlobFolder Kind = original.KindBlobFolder KindContainer Kind = original.KindContainer KindDataSet Kind = original.KindDataSet + KindSQLDBTable Kind = original.KindSQLDBTable + KindSQLDWTable Kind = original.KindSQLDWTable ) type KindBasicDataSetMapping = original.KindBasicDataSetMapping @@ -82,6 +86,8 @@ const ( KindBasicDataSetMappingKindBlobFolder KindBasicDataSetMapping = original.KindBasicDataSetMappingKindBlobFolder KindBasicDataSetMappingKindContainer KindBasicDataSetMapping = original.KindBasicDataSetMappingKindContainer KindBasicDataSetMappingKindDataSetMapping KindBasicDataSetMapping = original.KindBasicDataSetMappingKindDataSetMapping + KindBasicDataSetMappingKindSQLDBTable KindBasicDataSetMapping = original.KindBasicDataSetMappingKindSQLDBTable + KindBasicDataSetMappingKindSQLDWTable KindBasicDataSetMapping = original.KindBasicDataSetMappingKindSQLDWTable ) type KindBasicSourceShareSynchronizationSetting = original.KindBasicSourceShareSynchronizationSetting @@ -105,6 +111,13 @@ const ( KindBasicTriggerKindTrigger KindBasicTrigger = original.KindBasicTriggerKindTrigger ) +type OutputType = original.OutputType + +const ( + Csv OutputType = original.Csv + Parquet OutputType = original.Parquet +) + type ProvisioningState = original.ProvisioningState const ( @@ -266,6 +279,14 @@ type ProviderShareSubscriptionProperties = original.ProviderShareSubscriptionPro type ProviderShareSubscriptionsClient = original.ProviderShareSubscriptionsClient type ProviderShareSubscriptionsRevokeFuture = original.ProviderShareSubscriptionsRevokeFuture type ProxyDto = original.ProxyDto +type SQLDBTableDataSet = original.SQLDBTableDataSet +type SQLDBTableDataSetMapping = original.SQLDBTableDataSetMapping +type SQLDBTableDataSetMappingProperties = original.SQLDBTableDataSetMappingProperties +type SQLDBTableProperties = original.SQLDBTableProperties +type SQLDWTableDataSet = original.SQLDWTableDataSet +type SQLDWTableDataSetMapping = original.SQLDWTableDataSetMapping +type SQLDWTableDataSetMappingProperties = original.SQLDWTableDataSetMappingProperties +type SQLDWTableProperties = original.SQLDWTableProperties type ScheduledSourceShareSynchronizationSettingProperties = original.ScheduledSourceShareSynchronizationSettingProperties type ScheduledSourceSynchronizationSetting = original.ScheduledSourceSynchronizationSetting type ScheduledSynchronizationSetting = original.ScheduledSynchronizationSetting @@ -519,6 +540,9 @@ func PossibleKindBasicTriggerValues() []KindBasicTrigger { func PossibleKindValues() []Kind { return original.PossibleKindValues() } +func PossibleOutputTypeValues() []OutputType { + return original.PossibleOutputTypeValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } diff --git a/profiles/preview/preview/devspaces/mgmt/devspaces/models.go b/profiles/preview/preview/devspaces/mgmt/devspaces/models.go deleted file mode 100644 index c083fceafe9b..000000000000 --- a/profiles/preview/preview/devspaces/mgmt/devspaces/models.go +++ /dev/null @@ -1,137 +0,0 @@ -// +build go1.9 - -// Copyright 2019 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 devspaces - -import ( - "context" - - original "github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces" -) - -const ( - DefaultBaseURI = original.DefaultBaseURI -) - -type InstanceType = original.InstanceType - -const ( - InstanceTypeKubernetes InstanceType = original.InstanceTypeKubernetes - InstanceTypeOrchestratorSpecificConnectionDetails InstanceType = original.InstanceTypeOrchestratorSpecificConnectionDetails -) - -type ProvisioningState = original.ProvisioningState - -const ( - Canceled ProvisioningState = original.Canceled - Creating ProvisioningState = original.Creating - Deleted ProvisioningState = original.Deleted - Deleting ProvisioningState = original.Deleting - Failed ProvisioningState = original.Failed - Succeeded ProvisioningState = original.Succeeded - Updating ProvisioningState = original.Updating -) - -type SkuTier = original.SkuTier - -const ( - Standard SkuTier = original.Standard -) - -type BaseClient = original.BaseClient -type BasicOrchestratorSpecificConnectionDetails = original.BasicOrchestratorSpecificConnectionDetails -type ContainerHostMapping = original.ContainerHostMapping -type ContainerHostMappingsClient = original.ContainerHostMappingsClient -type Controller = original.Controller -type ControllerConnectionDetails = original.ControllerConnectionDetails -type ControllerConnectionDetailsList = original.ControllerConnectionDetailsList -type ControllerList = original.ControllerList -type ControllerListIterator = original.ControllerListIterator -type ControllerListPage = original.ControllerListPage -type ControllerProperties = original.ControllerProperties -type ControllerUpdateParameters = original.ControllerUpdateParameters -type ControllersClient = original.ControllersClient -type ControllersCreateFuture = original.ControllersCreateFuture -type ControllersDeleteFuture = original.ControllersDeleteFuture -type ErrorDetails = original.ErrorDetails -type ErrorResponse = original.ErrorResponse -type KubernetesConnectionDetails = original.KubernetesConnectionDetails -type OperationsClient = original.OperationsClient -type OrchestratorSpecificConnectionDetails = original.OrchestratorSpecificConnectionDetails -type Resource = original.Resource -type ResourceProviderOperationDefinition = original.ResourceProviderOperationDefinition -type ResourceProviderOperationDisplay = original.ResourceProviderOperationDisplay -type ResourceProviderOperationList = original.ResourceProviderOperationList -type ResourceProviderOperationListIterator = original.ResourceProviderOperationListIterator -type ResourceProviderOperationListPage = original.ResourceProviderOperationListPage -type SetObject = original.SetObject -type Sku = original.Sku -type TrackedResource = original.TrackedResource - -func New(subscriptionID string) BaseClient { - return original.New(subscriptionID) -} -func NewContainerHostMappingsClient(subscriptionID string) ContainerHostMappingsClient { - return original.NewContainerHostMappingsClient(subscriptionID) -} -func NewContainerHostMappingsClientWithBaseURI(baseURI string, subscriptionID string) ContainerHostMappingsClient { - return original.NewContainerHostMappingsClientWithBaseURI(baseURI, subscriptionID) -} -func NewControllerListIterator(page ControllerListPage) ControllerListIterator { - return original.NewControllerListIterator(page) -} -func NewControllerListPage(getNextPage func(context.Context, ControllerList) (ControllerList, error)) ControllerListPage { - return original.NewControllerListPage(getNextPage) -} -func NewControllersClient(subscriptionID string) ControllersClient { - return original.NewControllersClient(subscriptionID) -} -func NewControllersClientWithBaseURI(baseURI string, subscriptionID string) ControllersClient { - return original.NewControllersClientWithBaseURI(baseURI, subscriptionID) -} -func NewOperationsClient(subscriptionID string) OperationsClient { - return original.NewOperationsClient(subscriptionID) -} -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) -} -func NewResourceProviderOperationListIterator(page ResourceProviderOperationListPage) ResourceProviderOperationListIterator { - return original.NewResourceProviderOperationListIterator(page) -} -func NewResourceProviderOperationListPage(getNextPage func(context.Context, ResourceProviderOperationList) (ResourceProviderOperationList, error)) ResourceProviderOperationListPage { - return original.NewResourceProviderOperationListPage(getNextPage) -} -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return original.NewWithBaseURI(baseURI, subscriptionID) -} -func PossibleInstanceTypeValues() []InstanceType { - return original.PossibleInstanceTypeValues() -} -func PossibleProvisioningStateValues() []ProvisioningState { - return original.PossibleProvisioningStateValues() -} -func PossibleSkuTierValues() []SkuTier { - return original.PossibleSkuTierValues() -} -func UserAgent() string { - return original.UserAgent() + " profiles/preview" -} -func Version() string { - return original.Version() -} diff --git a/profiles/preview/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go b/profiles/preview/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go index b2d40a2d8b82..8a4e9fe3dfdd 100644 --- a/profiles/preview/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go +++ b/profiles/preview/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go @@ -19,15 +19,10 @@ package frontdoorapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/frontdoorapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/frontdoorapi" -type BackendPoolsClientAPI = original.BackendPoolsClientAPI type BaseClientAPI = original.BaseClientAPI type EndpointsClientAPI = original.EndpointsClientAPI type FrontDoorsClientAPI = original.FrontDoorsClientAPI type FrontendEndpointsClientAPI = original.FrontendEndpointsClientAPI -type HealthProbeSettingsClientAPI = original.HealthProbeSettingsClientAPI -type LoadBalancingSettingsClientAPI = original.LoadBalancingSettingsClientAPI -type ManagedRuleSetsClientAPI = original.ManagedRuleSetsClientAPI type PoliciesClientAPI = original.PoliciesClientAPI -type RoutingRulesClientAPI = original.RoutingRulesClientAPI diff --git a/profiles/preview/preview/frontdoor/mgmt/frontdoor/models.go b/profiles/preview/preview/frontdoor/mgmt/frontdoor/models.go index 38aa56ec23bf..f7bfa1e2a7e0 100644 --- a/profiles/preview/preview/frontdoor/mgmt/frontdoor/models.go +++ b/profiles/preview/preview/frontdoor/mgmt/frontdoor/models.go @@ -22,20 +22,19 @@ package frontdoor import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/frontdoor/mgmt/2019-05-01/frontdoor" + original "github.com/Azure/azure-sdk-for-go/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor" ) const ( DefaultBaseURI = original.DefaultBaseURI ) -type ActionType = original.ActionType +type Action = original.Action const ( - Allow ActionType = original.Allow - Block ActionType = original.Block - Log ActionType = original.Log - Redirect ActionType = original.Redirect + Allow Action = original.Allow + Block Action = original.Block + Log Action = original.Log ) type Availability = original.Availability @@ -45,13 +44,6 @@ const ( Unavailable Availability = original.Unavailable ) -type BackendEnabledState = original.BackendEnabledState - -const ( - Disabled BackendEnabledState = original.Disabled - Enabled BackendEnabledState = original.Enabled -) - type CertificateSource = original.CertificateSource const ( @@ -68,11 +60,11 @@ const ( type CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningState const ( - CustomHTTPSProvisioningStateDisabled CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateDisabled - CustomHTTPSProvisioningStateDisabling CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateDisabling - CustomHTTPSProvisioningStateEnabled CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateEnabled - CustomHTTPSProvisioningStateEnabling CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateEnabling - CustomHTTPSProvisioningStateFailed CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateFailed + Disabled CustomHTTPSProvisioningState = original.Disabled + Disabling CustomHTTPSProvisioningState = original.Disabling + Enabled CustomHTTPSProvisioningState = original.Enabled + Enabling CustomHTTPSProvisioningState = original.Enabling + Failed CustomHTTPSProvisioningState = original.Failed ) type CustomHTTPSProvisioningSubstate = original.CustomHTTPSProvisioningSubstate @@ -90,13 +82,6 @@ const ( SubmittingDomainControlValidationRequest CustomHTTPSProvisioningSubstate = original.SubmittingDomainControlValidationRequest ) -type CustomRuleEnabledState = original.CustomRuleEnabledState - -const ( - CustomRuleEnabledStateDisabled CustomRuleEnabledState = original.CustomRuleEnabledStateDisabled - CustomRuleEnabledStateEnabled CustomRuleEnabledState = original.CustomRuleEnabledStateEnabled -) - type DynamicCompressionEnabled = original.DynamicCompressionEnabled const ( @@ -111,11 +96,11 @@ const ( EnabledStateEnabled EnabledState = original.EnabledStateEnabled ) -type EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledState +type EnabledStateEnum = original.EnabledStateEnum const ( - EnforceCertificateNameCheckEnabledStateDisabled EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledStateDisabled - EnforceCertificateNameCheckEnabledStateEnabled EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledStateEnabled + EnabledStateEnumDisabled EnabledStateEnum = original.EnabledStateEnumDisabled + EnabledStateEnumEnabled EnabledStateEnum = original.EnabledStateEnumEnabled ) type ForwardingProtocol = original.ForwardingProtocol @@ -126,62 +111,31 @@ const ( MatchRequest ForwardingProtocol = original.MatchRequest ) -type HealthProbeEnabled = original.HealthProbeEnabled - -const ( - HealthProbeEnabledDisabled HealthProbeEnabled = original.HealthProbeEnabledDisabled - HealthProbeEnabledEnabled HealthProbeEnabled = original.HealthProbeEnabledEnabled -) - -type HealthProbeMethod = original.HealthProbeMethod - -const ( - GET HealthProbeMethod = original.GET - HEAD HealthProbeMethod = original.HEAD -) - -type ManagedRuleEnabledState = original.ManagedRuleEnabledState - -const ( - ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = original.ManagedRuleEnabledStateDisabled - ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = original.ManagedRuleEnabledStateEnabled -) - -type MatchVariable = original.MatchVariable +type MatchCondition = original.MatchCondition const ( - Cookies MatchVariable = original.Cookies - PostArgs MatchVariable = original.PostArgs - QueryString MatchVariable = original.QueryString - RemoteAddr MatchVariable = original.RemoteAddr - RequestBody MatchVariable = original.RequestBody - RequestHeader MatchVariable = original.RequestHeader - RequestMethod MatchVariable = original.RequestMethod - RequestURI MatchVariable = original.RequestURI - SocketAddr MatchVariable = original.SocketAddr + PostArgs MatchCondition = original.PostArgs + QueryString MatchCondition = original.QueryString + RemoteAddr MatchCondition = original.RemoteAddr + RequestBody MatchCondition = original.RequestBody + RequestHeader MatchCondition = original.RequestHeader + RequestMethod MatchCondition = original.RequestMethod + RequestURI MatchCondition = original.RequestURI ) -type MinimumTLSVersion = original.MinimumTLSVersion +type Mode = original.Mode const ( - OneFullStopTwo MinimumTLSVersion = original.OneFullStopTwo - OneFullStopZero MinimumTLSVersion = original.OneFullStopZero + Detection Mode = original.Detection + Prevention Mode = original.Prevention ) type NetworkOperationStatus = original.NetworkOperationStatus const ( - Failed NetworkOperationStatus = original.Failed - InProgress NetworkOperationStatus = original.InProgress - Succeeded NetworkOperationStatus = original.Succeeded -) - -type OdataType = original.OdataType - -const ( - OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration OdataType = original.OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration - OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration OdataType = original.OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration - OdataTypeRouteConfiguration OdataType = original.OdataTypeRouteConfiguration + NetworkOperationStatusFailed NetworkOperationStatus = original.NetworkOperationStatusFailed + NetworkOperationStatusInProgress NetworkOperationStatus = original.NetworkOperationStatusInProgress + NetworkOperationStatusSucceeded NetworkOperationStatus = original.NetworkOperationStatusSucceeded ) type Operator = original.Operator @@ -198,32 +152,6 @@ const ( IPMatch Operator = original.IPMatch LessThan Operator = original.LessThan LessThanOrEqual Operator = original.LessThanOrEqual - RegEx Operator = original.RegEx -) - -type PolicyEnabledState = original.PolicyEnabledState - -const ( - PolicyEnabledStateDisabled PolicyEnabledState = original.PolicyEnabledStateDisabled - PolicyEnabledStateEnabled PolicyEnabledState = original.PolicyEnabledStateEnabled -) - -type PolicyMode = original.PolicyMode - -const ( - Detection PolicyMode = original.Detection - Prevention PolicyMode = original.Prevention -) - -type PolicyResourceState = original.PolicyResourceState - -const ( - PolicyResourceStateCreating PolicyResourceState = original.PolicyResourceStateCreating - PolicyResourceStateDeleting PolicyResourceState = original.PolicyResourceStateDeleting - PolicyResourceStateDisabled PolicyResourceState = original.PolicyResourceStateDisabled - PolicyResourceStateDisabling PolicyResourceState = original.PolicyResourceStateDisabling - PolicyResourceStateEnabled PolicyResourceState = original.PolicyResourceStateEnabled - PolicyResourceStateEnabling PolicyResourceState = original.PolicyResourceStateEnabling ) type Protocol = original.Protocol @@ -240,23 +168,6 @@ const ( StripNone Query = original.StripNone ) -type RedirectProtocol = original.RedirectProtocol - -const ( - RedirectProtocolHTTPOnly RedirectProtocol = original.RedirectProtocolHTTPOnly - RedirectProtocolHTTPSOnly RedirectProtocol = original.RedirectProtocolHTTPSOnly - RedirectProtocolMatchRequest RedirectProtocol = original.RedirectProtocolMatchRequest -) - -type RedirectType = original.RedirectType - -const ( - Found RedirectType = original.Found - Moved RedirectType = original.Moved - PermanentRedirect RedirectType = original.PermanentRedirect - TemporaryRedirect RedirectType = original.TemporaryRedirect -) - type ResourceState = original.ResourceState const ( @@ -275,11 +186,18 @@ const ( MicrosoftNetworkfrontDoorsfrontendEndpoints ResourceType = original.MicrosoftNetworkfrontDoorsfrontendEndpoints ) -type RoutingRuleEnabledState = original.RoutingRuleEnabledState +type RuleGroupOverride = original.RuleGroupOverride + +const ( + SQLInjection RuleGroupOverride = original.SQLInjection + XSS RuleGroupOverride = original.XSS +) + +type RuleSetType = original.RuleSetType const ( - RoutingRuleEnabledStateDisabled RoutingRuleEnabledState = original.RoutingRuleEnabledStateDisabled - RoutingRuleEnabledStateEnabled RoutingRuleEnabledState = original.RoutingRuleEnabledStateEnabled + RuleSetTypeAzureManagedRuleSet RuleSetType = original.RuleSetTypeAzureManagedRuleSet + RuleSetTypeUnknown RuleSetType = original.RuleSetTypeUnknown ) type RuleType = original.RuleType @@ -296,67 +214,72 @@ const ( SessionAffinityEnabledStateEnabled SessionAffinityEnabledState = original.SessionAffinityEnabledStateEnabled ) -type TransformType = original.TransformType +type TLSProtocolType = original.TLSProtocolType + +const ( + ServerNameIndication TLSProtocolType = original.ServerNameIndication +) + +type Transform = original.Transform + +const ( + HTMLEntityDecode Transform = original.HTMLEntityDecode + Lowercase Transform = original.Lowercase + RemoveNulls Transform = original.RemoveNulls + Trim Transform = original.Trim + Uppercase Transform = original.Uppercase + URLDecode Transform = original.URLDecode + URLEncode Transform = original.URLEncode +) + +type WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicy const ( - Lowercase TransformType = original.Lowercase - RemoveNulls TransformType = original.RemoveNulls - Trim TransformType = original.Trim - Uppercase TransformType = original.Uppercase - URLDecode TransformType = original.URLDecode - URLEncode TransformType = original.URLEncode + WebApplicationFirewallPolicyCreating WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicyCreating + WebApplicationFirewallPolicyDeleting WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicyDeleting + WebApplicationFirewallPolicyDisabled WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicyDisabled + WebApplicationFirewallPolicyDisabling WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicyDisabling + WebApplicationFirewallPolicyEnabled WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicyEnabled + WebApplicationFirewallPolicyEnabling WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicyEnabling ) type AzureAsyncOperationResult = original.AzureAsyncOperationResult +type AzureManagedOverrideRuleGroup = original.AzureManagedOverrideRuleGroup +type AzureManagedRuleSet = original.AzureManagedRuleSet type Backend = original.Backend type BackendPool = original.BackendPool type BackendPoolListResult = original.BackendPoolListResult -type BackendPoolListResultIterator = original.BackendPoolListResultIterator -type BackendPoolListResultPage = original.BackendPoolListResultPage type BackendPoolProperties = original.BackendPoolProperties type BackendPoolUpdateParameters = original.BackendPoolUpdateParameters -type BackendPoolsClient = original.BackendPoolsClient -type BackendPoolsCreateOrUpdateFuture = original.BackendPoolsCreateOrUpdateFuture -type BackendPoolsDeleteFuture = original.BackendPoolsDeleteFuture -type BackendPoolsSettings = original.BackendPoolsSettings type BaseClient = original.BaseClient -type BasicRouteConfiguration = original.BasicRouteConfiguration +type BasicManagedRuleSet = original.BasicManagedRuleSet type CacheConfiguration = original.CacheConfiguration type CertificateSourceParameters = original.CertificateSourceParameters type CheckNameAvailabilityInput = original.CheckNameAvailabilityInput type CheckNameAvailabilityOutput = original.CheckNameAvailabilityOutput type CustomHTTPSConfiguration = original.CustomHTTPSConfiguration type CustomRule = original.CustomRule -type CustomRuleList = original.CustomRuleList +type CustomRules = original.CustomRules type EndpointsClient = original.EndpointsClient type EndpointsPurgeContentFuture = original.EndpointsPurgeContentFuture type Error = original.Error type ErrorDetails = original.ErrorDetails type ErrorResponse = original.ErrorResponse -type ForwardingConfiguration = original.ForwardingConfiguration type FrontDoor = original.FrontDoor type FrontDoorsClient = original.FrontDoorsClient type FrontDoorsCreateOrUpdateFutureType = original.FrontDoorsCreateOrUpdateFutureType type FrontDoorsDeleteFutureType = original.FrontDoorsDeleteFutureType type FrontendEndpoint = original.FrontendEndpoint -type FrontendEndpointLink = original.FrontendEndpointLink type FrontendEndpointProperties = original.FrontendEndpointProperties type FrontendEndpointUpdateParameters = original.FrontendEndpointUpdateParameters type FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink = original.FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink type FrontendEndpointsClient = original.FrontendEndpointsClient -type FrontendEndpointsCreateOrUpdateFuture = original.FrontendEndpointsCreateOrUpdateFuture -type FrontendEndpointsDeleteFuture = original.FrontendEndpointsDeleteFuture type FrontendEndpointsDisableHTTPSFuture = original.FrontendEndpointsDisableHTTPSFuture type FrontendEndpointsEnableHTTPSFuture = original.FrontendEndpointsEnableHTTPSFuture type FrontendEndpointsListResult = original.FrontendEndpointsListResult type FrontendEndpointsListResultIterator = original.FrontendEndpointsListResultIterator type FrontendEndpointsListResultPage = original.FrontendEndpointsListResultPage -type HealthProbeSettingsClient = original.HealthProbeSettingsClient -type HealthProbeSettingsCreateOrUpdateFuture = original.HealthProbeSettingsCreateOrUpdateFuture -type HealthProbeSettingsDeleteFuture = original.HealthProbeSettingsDeleteFuture type HealthProbeSettingsListResult = original.HealthProbeSettingsListResult -type HealthProbeSettingsListResultIterator = original.HealthProbeSettingsListResultIterator -type HealthProbeSettingsListResultPage = original.HealthProbeSettingsListResultPage type HealthProbeSettingsModel = original.HealthProbeSettingsModel type HealthProbeSettingsProperties = original.HealthProbeSettingsProperties type HealthProbeSettingsUpdateParameters = original.HealthProbeSettingsUpdateParameters @@ -365,72 +288,37 @@ type KeyVaultCertificateSourceParametersVault = original.KeyVaultCertificateSour type ListResult = original.ListResult type ListResultIterator = original.ListResultIterator type ListResultPage = original.ListResultPage -type LoadBalancingSettingsClient = original.LoadBalancingSettingsClient -type LoadBalancingSettingsCreateOrUpdateFuture = original.LoadBalancingSettingsCreateOrUpdateFuture -type LoadBalancingSettingsDeleteFuture = original.LoadBalancingSettingsDeleteFuture type LoadBalancingSettingsListResult = original.LoadBalancingSettingsListResult -type LoadBalancingSettingsListResultIterator = original.LoadBalancingSettingsListResultIterator -type LoadBalancingSettingsListResultPage = original.LoadBalancingSettingsListResultPage type LoadBalancingSettingsModel = original.LoadBalancingSettingsModel type LoadBalancingSettingsProperties = original.LoadBalancingSettingsProperties type LoadBalancingSettingsUpdateParameters = original.LoadBalancingSettingsUpdateParameters -type ManagedRuleDefinition = original.ManagedRuleDefinition -type ManagedRuleGroupDefinition = original.ManagedRuleGroupDefinition -type ManagedRuleGroupOverride = original.ManagedRuleGroupOverride -type ManagedRuleOverride = original.ManagedRuleOverride type ManagedRuleSet = original.ManagedRuleSet -type ManagedRuleSetDefinition = original.ManagedRuleSetDefinition -type ManagedRuleSetDefinitionList = original.ManagedRuleSetDefinitionList -type ManagedRuleSetDefinitionListIterator = original.ManagedRuleSetDefinitionListIterator -type ManagedRuleSetDefinitionListPage = original.ManagedRuleSetDefinitionListPage -type ManagedRuleSetDefinitionProperties = original.ManagedRuleSetDefinitionProperties -type ManagedRuleSetList = original.ManagedRuleSetList -type ManagedRuleSetsClient = original.ManagedRuleSetsClient -type MatchCondition = original.MatchCondition +type ManagedRuleSets = original.ManagedRuleSets +type MatchCondition1 = original.MatchCondition1 type PoliciesClient = original.PoliciesClient -type PoliciesCreateOrUpdateFuture = original.PoliciesCreateOrUpdateFuture type PoliciesDeleteFuture = original.PoliciesDeleteFuture type PolicySettings = original.PolicySettings type Properties = original.Properties type PurgeParameters = original.PurgeParameters -type RedirectConfiguration = original.RedirectConfiguration type Resource = original.Resource -type RouteConfiguration = original.RouteConfiguration type RoutingRule = original.RoutingRule type RoutingRuleListResult = original.RoutingRuleListResult -type RoutingRuleListResultIterator = original.RoutingRuleListResultIterator -type RoutingRuleListResultPage = original.RoutingRuleListResultPage type RoutingRuleProperties = original.RoutingRuleProperties type RoutingRuleUpdateParameters = original.RoutingRuleUpdateParameters -type RoutingRulesClient = original.RoutingRulesClient -type RoutingRulesCreateOrUpdateFuture = original.RoutingRulesCreateOrUpdateFuture -type RoutingRulesDeleteFuture = original.RoutingRulesDeleteFuture type SubResource = original.SubResource type TagsObject = original.TagsObject type UpdateParameters = original.UpdateParameters type ValidateCustomDomainInput = original.ValidateCustomDomainInput type ValidateCustomDomainOutput = original.ValidateCustomDomainOutput -type WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicy -type WebApplicationFirewallPolicyList = original.WebApplicationFirewallPolicyList -type WebApplicationFirewallPolicyListIterator = original.WebApplicationFirewallPolicyListIterator -type WebApplicationFirewallPolicyListPage = original.WebApplicationFirewallPolicyListPage -type WebApplicationFirewallPolicyProperties = original.WebApplicationFirewallPolicyProperties +type WebApplicationFirewallPolicy1 = original.WebApplicationFirewallPolicy1 +type WebApplicationFirewallPolicyListResult = original.WebApplicationFirewallPolicyListResult +type WebApplicationFirewallPolicyListResultIterator = original.WebApplicationFirewallPolicyListResultIterator +type WebApplicationFirewallPolicyListResultPage = original.WebApplicationFirewallPolicyListResultPage +type WebApplicationFirewallPolicyPropertiesFormat = original.WebApplicationFirewallPolicyPropertiesFormat func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } -func NewBackendPoolListResultIterator(page BackendPoolListResultPage) BackendPoolListResultIterator { - return original.NewBackendPoolListResultIterator(page) -} -func NewBackendPoolListResultPage(getNextPage func(context.Context, BackendPoolListResult) (BackendPoolListResult, error)) BackendPoolListResultPage { - return original.NewBackendPoolListResultPage(getNextPage) -} -func NewBackendPoolsClient(subscriptionID string) BackendPoolsClient { - return original.NewBackendPoolsClient(subscriptionID) -} -func NewBackendPoolsClientWithBaseURI(baseURI string, subscriptionID string) BackendPoolsClient { - return original.NewBackendPoolsClientWithBaseURI(baseURI, subscriptionID) -} func NewEndpointsClient(subscriptionID string) EndpointsClient { return original.NewEndpointsClient(subscriptionID) } @@ -455,84 +343,33 @@ func NewFrontendEndpointsListResultIterator(page FrontendEndpointsListResultPage func NewFrontendEndpointsListResultPage(getNextPage func(context.Context, FrontendEndpointsListResult) (FrontendEndpointsListResult, error)) FrontendEndpointsListResultPage { return original.NewFrontendEndpointsListResultPage(getNextPage) } -func NewHealthProbeSettingsClient(subscriptionID string) HealthProbeSettingsClient { - return original.NewHealthProbeSettingsClient(subscriptionID) -} -func NewHealthProbeSettingsClientWithBaseURI(baseURI string, subscriptionID string) HealthProbeSettingsClient { - return original.NewHealthProbeSettingsClientWithBaseURI(baseURI, subscriptionID) -} -func NewHealthProbeSettingsListResultIterator(page HealthProbeSettingsListResultPage) HealthProbeSettingsListResultIterator { - return original.NewHealthProbeSettingsListResultIterator(page) -} -func NewHealthProbeSettingsListResultPage(getNextPage func(context.Context, HealthProbeSettingsListResult) (HealthProbeSettingsListResult, error)) HealthProbeSettingsListResultPage { - return original.NewHealthProbeSettingsListResultPage(getNextPage) -} func NewListResultIterator(page ListResultPage) ListResultIterator { return original.NewListResultIterator(page) } func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { return original.NewListResultPage(getNextPage) } -func NewLoadBalancingSettingsClient(subscriptionID string) LoadBalancingSettingsClient { - return original.NewLoadBalancingSettingsClient(subscriptionID) -} -func NewLoadBalancingSettingsClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancingSettingsClient { - return original.NewLoadBalancingSettingsClientWithBaseURI(baseURI, subscriptionID) -} -func NewLoadBalancingSettingsListResultIterator(page LoadBalancingSettingsListResultPage) LoadBalancingSettingsListResultIterator { - return original.NewLoadBalancingSettingsListResultIterator(page) -} -func NewLoadBalancingSettingsListResultPage(getNextPage func(context.Context, LoadBalancingSettingsListResult) (LoadBalancingSettingsListResult, error)) LoadBalancingSettingsListResultPage { - return original.NewLoadBalancingSettingsListResultPage(getNextPage) -} -func NewManagedRuleSetDefinitionListIterator(page ManagedRuleSetDefinitionListPage) ManagedRuleSetDefinitionListIterator { - return original.NewManagedRuleSetDefinitionListIterator(page) -} -func NewManagedRuleSetDefinitionListPage(getNextPage func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error)) ManagedRuleSetDefinitionListPage { - return original.NewManagedRuleSetDefinitionListPage(getNextPage) -} -func NewManagedRuleSetsClient(subscriptionID string) ManagedRuleSetsClient { - return original.NewManagedRuleSetsClient(subscriptionID) -} -func NewManagedRuleSetsClientWithBaseURI(baseURI string, subscriptionID string) ManagedRuleSetsClient { - return original.NewManagedRuleSetsClientWithBaseURI(baseURI, subscriptionID) -} func NewPoliciesClient(subscriptionID string) PoliciesClient { return original.NewPoliciesClient(subscriptionID) } func NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string) PoliciesClient { return original.NewPoliciesClientWithBaseURI(baseURI, subscriptionID) } -func NewRoutingRuleListResultIterator(page RoutingRuleListResultPage) RoutingRuleListResultIterator { - return original.NewRoutingRuleListResultIterator(page) -} -func NewRoutingRuleListResultPage(getNextPage func(context.Context, RoutingRuleListResult) (RoutingRuleListResult, error)) RoutingRuleListResultPage { - return original.NewRoutingRuleListResultPage(getNextPage) -} -func NewRoutingRulesClient(subscriptionID string) RoutingRulesClient { - return original.NewRoutingRulesClient(subscriptionID) +func NewWebApplicationFirewallPolicyListResultIterator(page WebApplicationFirewallPolicyListResultPage) WebApplicationFirewallPolicyListResultIterator { + return original.NewWebApplicationFirewallPolicyListResultIterator(page) } -func NewRoutingRulesClientWithBaseURI(baseURI string, subscriptionID string) RoutingRulesClient { - return original.NewRoutingRulesClientWithBaseURI(baseURI, subscriptionID) -} -func NewWebApplicationFirewallPolicyListIterator(page WebApplicationFirewallPolicyListPage) WebApplicationFirewallPolicyListIterator { - return original.NewWebApplicationFirewallPolicyListIterator(page) -} -func NewWebApplicationFirewallPolicyListPage(getNextPage func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error)) WebApplicationFirewallPolicyListPage { - return original.NewWebApplicationFirewallPolicyListPage(getNextPage) +func NewWebApplicationFirewallPolicyListResultPage(getNextPage func(context.Context, WebApplicationFirewallPolicyListResult) (WebApplicationFirewallPolicyListResult, error)) WebApplicationFirewallPolicyListResultPage { + return original.NewWebApplicationFirewallPolicyListResultPage(getNextPage) } func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } -func PossibleActionTypeValues() []ActionType { - return original.PossibleActionTypeValues() +func PossibleActionValues() []Action { + return original.PossibleActionValues() } func PossibleAvailabilityValues() []Availability { return original.PossibleAvailabilityValues() } -func PossibleBackendEnabledStateValues() []BackendEnabledState { - return original.PossibleBackendEnabledStateValues() -} func PossibleCertificateSourceValues() []CertificateSource { return original.PossibleCertificateSourceValues() } @@ -545,74 +382,47 @@ func PossibleCustomHTTPSProvisioningStateValues() []CustomHTTPSProvisioningState func PossibleCustomHTTPSProvisioningSubstateValues() []CustomHTTPSProvisioningSubstate { return original.PossibleCustomHTTPSProvisioningSubstateValues() } -func PossibleCustomRuleEnabledStateValues() []CustomRuleEnabledState { - return original.PossibleCustomRuleEnabledStateValues() -} func PossibleDynamicCompressionEnabledValues() []DynamicCompressionEnabled { return original.PossibleDynamicCompressionEnabledValues() } +func PossibleEnabledStateEnumValues() []EnabledStateEnum { + return original.PossibleEnabledStateEnumValues() +} func PossibleEnabledStateValues() []EnabledState { return original.PossibleEnabledStateValues() } -func PossibleEnforceCertificateNameCheckEnabledStateValues() []EnforceCertificateNameCheckEnabledState { - return original.PossibleEnforceCertificateNameCheckEnabledStateValues() -} func PossibleForwardingProtocolValues() []ForwardingProtocol { return original.PossibleForwardingProtocolValues() } -func PossibleHealthProbeEnabledValues() []HealthProbeEnabled { - return original.PossibleHealthProbeEnabledValues() +func PossibleMatchConditionValues() []MatchCondition { + return original.PossibleMatchConditionValues() } -func PossibleHealthProbeMethodValues() []HealthProbeMethod { - return original.PossibleHealthProbeMethodValues() -} -func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { - return original.PossibleManagedRuleEnabledStateValues() -} -func PossibleMatchVariableValues() []MatchVariable { - return original.PossibleMatchVariableValues() -} -func PossibleMinimumTLSVersionValues() []MinimumTLSVersion { - return original.PossibleMinimumTLSVersionValues() +func PossibleModeValues() []Mode { + return original.PossibleModeValues() } func PossibleNetworkOperationStatusValues() []NetworkOperationStatus { return original.PossibleNetworkOperationStatusValues() } -func PossibleOdataTypeValues() []OdataType { - return original.PossibleOdataTypeValues() -} func PossibleOperatorValues() []Operator { return original.PossibleOperatorValues() } -func PossiblePolicyEnabledStateValues() []PolicyEnabledState { - return original.PossiblePolicyEnabledStateValues() -} -func PossiblePolicyModeValues() []PolicyMode { - return original.PossiblePolicyModeValues() -} -func PossiblePolicyResourceStateValues() []PolicyResourceState { - return original.PossiblePolicyResourceStateValues() -} func PossibleProtocolValues() []Protocol { return original.PossibleProtocolValues() } func PossibleQueryValues() []Query { return original.PossibleQueryValues() } -func PossibleRedirectProtocolValues() []RedirectProtocol { - return original.PossibleRedirectProtocolValues() -} -func PossibleRedirectTypeValues() []RedirectType { - return original.PossibleRedirectTypeValues() -} func PossibleResourceStateValues() []ResourceState { return original.PossibleResourceStateValues() } func PossibleResourceTypeValues() []ResourceType { return original.PossibleResourceTypeValues() } -func PossibleRoutingRuleEnabledStateValues() []RoutingRuleEnabledState { - return original.PossibleRoutingRuleEnabledStateValues() +func PossibleRuleGroupOverrideValues() []RuleGroupOverride { + return original.PossibleRuleGroupOverrideValues() +} +func PossibleRuleSetTypeValues() []RuleSetType { + return original.PossibleRuleSetTypeValues() } func PossibleRuleTypeValues() []RuleType { return original.PossibleRuleTypeValues() @@ -620,8 +430,14 @@ func PossibleRuleTypeValues() []RuleType { func PossibleSessionAffinityEnabledStateValues() []SessionAffinityEnabledState { return original.PossibleSessionAffinityEnabledStateValues() } -func PossibleTransformTypeValues() []TransformType { - return original.PossibleTransformTypeValues() +func PossibleTLSProtocolTypeValues() []TLSProtocolType { + return original.PossibleTLSProtocolTypeValues() +} +func PossibleTransformValues() []Transform { + return original.PossibleTransformValues() +} +func PossibleWebApplicationFirewallPolicyValues() []WebApplicationFirewallPolicy { + return original.PossibleWebApplicationFirewallPolicyValues() } func UserAgent() string { return original.UserAgent() + " profiles/preview" diff --git a/profiles/preview/preview/logic/mgmt/logic/logicapi/models.go b/profiles/preview/preview/logic/mgmt/logic/logicapi/models.go index 14c12e7e0d6b..707ce253505e 100644 --- a/profiles/preview/preview/logic/mgmt/logic/logicapi/models.go +++ b/profiles/preview/preview/logic/mgmt/logic/logicapi/models.go @@ -19,7 +19,7 @@ package logicapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/logic/mgmt/2018-07-01-preview/logic/logicapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/logic/mgmt/2019-05-01/logic/logicapi" type IntegrationAccountAgreementsClientAPI = original.IntegrationAccountAgreementsClientAPI type IntegrationAccountAssembliesClientAPI = original.IntegrationAccountAssembliesClientAPI @@ -30,6 +30,11 @@ type IntegrationAccountPartnersClientAPI = original.IntegrationAccountPartnersCl type IntegrationAccountSchemasClientAPI = original.IntegrationAccountSchemasClientAPI type IntegrationAccountSessionsClientAPI = original.IntegrationAccountSessionsClientAPI type IntegrationAccountsClientAPI = original.IntegrationAccountsClientAPI +type IntegrationServiceEnvironmentManagedAPIOperationsClientAPI = original.IntegrationServiceEnvironmentManagedAPIOperationsClientAPI +type IntegrationServiceEnvironmentManagedApisClientAPI = original.IntegrationServiceEnvironmentManagedApisClientAPI +type IntegrationServiceEnvironmentNetworkHealthClientAPI = original.IntegrationServiceEnvironmentNetworkHealthClientAPI +type IntegrationServiceEnvironmentSkusClientAPI = original.IntegrationServiceEnvironmentSkusClientAPI +type IntegrationServiceEnvironmentsClientAPI = original.IntegrationServiceEnvironmentsClientAPI type OperationsClientAPI = original.OperationsClientAPI type WorkflowRunActionRepetitionsClientAPI = original.WorkflowRunActionRepetitionsClientAPI type WorkflowRunActionRepetitionsRequestHistoriesClientAPI = original.WorkflowRunActionRepetitionsRequestHistoriesClientAPI diff --git a/profiles/preview/preview/logic/mgmt/logic/models.go b/profiles/preview/preview/logic/mgmt/logic/models.go index 4840cfe366c6..d440b4dcda88 100644 --- a/profiles/preview/preview/logic/mgmt/logic/models.go +++ b/profiles/preview/preview/logic/mgmt/logic/models.go @@ -22,13 +22,38 @@ package logic import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/logic/mgmt/2018-07-01-preview/logic" + original "github.com/Azure/azure-sdk-for-go/services/preview/logic/mgmt/2019-05-01/logic" ) const ( DefaultBaseURI = original.DefaultBaseURI ) +type APIDeploymentParameterVisibility = original.APIDeploymentParameterVisibility + +const ( + APIDeploymentParameterVisibilityDefault APIDeploymentParameterVisibility = original.APIDeploymentParameterVisibilityDefault + APIDeploymentParameterVisibilityInternal APIDeploymentParameterVisibility = original.APIDeploymentParameterVisibilityInternal + APIDeploymentParameterVisibilityNotSpecified APIDeploymentParameterVisibility = original.APIDeploymentParameterVisibilityNotSpecified +) + +type APITier = original.APITier + +const ( + APITierEnterprise APITier = original.APITierEnterprise + APITierNotSpecified APITier = original.APITierNotSpecified + APITierPremium APITier = original.APITierPremium + APITierStandard APITier = original.APITierStandard +) + +type APIType = original.APIType + +const ( + APITypeNotSpecified APIType = original.APITypeNotSpecified + APITypeRest APIType = original.APITypeRest + APITypeSoap APIType = original.APITypeSoap +) + type AgreementType = original.AgreementType const ( @@ -38,6 +63,15 @@ const ( X12 AgreementType = original.X12 ) +type AzureAsyncOperationState = original.AzureAsyncOperationState + +const ( + Canceled AzureAsyncOperationState = original.Canceled + Failed AzureAsyncOperationState = original.Failed + Pending AzureAsyncOperationState = original.Pending + Succeeded AzureAsyncOperationState = original.Succeeded +) + type DayOfWeek = original.DayOfWeek const ( @@ -102,6 +136,15 @@ const ( EncryptionAlgorithmRC2 EncryptionAlgorithm = original.EncryptionAlgorithmRC2 ) +type ErrorResponseCode = original.ErrorResponseCode + +const ( + ErrorResponseCodeIntegrationServiceEnvironmentNotFound ErrorResponseCode = original.ErrorResponseCodeIntegrationServiceEnvironmentNotFound + ErrorResponseCodeInternalServerError ErrorResponseCode = original.ErrorResponseCodeInternalServerError + ErrorResponseCodeInvalidOperationID ErrorResponseCode = original.ErrorResponseCodeInvalidOperationID + ErrorResponseCodeNotSpecified ErrorResponseCode = original.ErrorResponseCodeNotSpecified +) + type EventLevel = original.EventLevel const ( @@ -134,6 +177,65 @@ const ( IntegrationAccountSkuNameStandard IntegrationAccountSkuName = original.IntegrationAccountSkuNameStandard ) +type IntegrationServiceEnvironmentAccessEndpointType = original.IntegrationServiceEnvironmentAccessEndpointType + +const ( + IntegrationServiceEnvironmentAccessEndpointTypeExternal IntegrationServiceEnvironmentAccessEndpointType = original.IntegrationServiceEnvironmentAccessEndpointTypeExternal + IntegrationServiceEnvironmentAccessEndpointTypeInternal IntegrationServiceEnvironmentAccessEndpointType = original.IntegrationServiceEnvironmentAccessEndpointTypeInternal + IntegrationServiceEnvironmentAccessEndpointTypeNotSpecified IntegrationServiceEnvironmentAccessEndpointType = original.IntegrationServiceEnvironmentAccessEndpointTypeNotSpecified +) + +type IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryType + +const ( + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAccessEndpoints IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAccessEndpoints + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureActiveDirectory IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureActiveDirectory + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureManagement IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureManagement + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureStorage IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureStorage + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeDiagnosticLogsAndMetrics IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeDiagnosticLogsAndMetrics + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeIntegrationServiceEnvironmentConnectors IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeIntegrationServiceEnvironmentConnectors + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeNotSpecified IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeNotSpecified + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRecoveryService IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRecoveryService + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRedisCache IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRedisCache + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRegionalService IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRegionalService + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSQL IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSQL + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSSLCertificateVerification IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSSLCertificateVerification +) + +type IntegrationServiceEnvironmentNetworkDependencyHealthState = original.IntegrationServiceEnvironmentNetworkDependencyHealthState + +const ( + IntegrationServiceEnvironmentNetworkDependencyHealthStateHealthy IntegrationServiceEnvironmentNetworkDependencyHealthState = original.IntegrationServiceEnvironmentNetworkDependencyHealthStateHealthy + IntegrationServiceEnvironmentNetworkDependencyHealthStateNotSpecified IntegrationServiceEnvironmentNetworkDependencyHealthState = original.IntegrationServiceEnvironmentNetworkDependencyHealthStateNotSpecified + IntegrationServiceEnvironmentNetworkDependencyHealthStateUnhealthy IntegrationServiceEnvironmentNetworkDependencyHealthState = original.IntegrationServiceEnvironmentNetworkDependencyHealthStateUnhealthy + IntegrationServiceEnvironmentNetworkDependencyHealthStateUnknown IntegrationServiceEnvironmentNetworkDependencyHealthState = original.IntegrationServiceEnvironmentNetworkDependencyHealthStateUnknown +) + +type IntegrationServiceEnvironmentNetworkEndPointAccessibilityState = original.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState + +const ( + IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateAvailable IntegrationServiceEnvironmentNetworkEndPointAccessibilityState = original.IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateAvailable + IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotAvailable IntegrationServiceEnvironmentNetworkEndPointAccessibilityState = original.IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotAvailable + IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotSpecified IntegrationServiceEnvironmentNetworkEndPointAccessibilityState = original.IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotSpecified + IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateUnknown IntegrationServiceEnvironmentNetworkEndPointAccessibilityState = original.IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateUnknown +) + +type IntegrationServiceEnvironmentSkuName = original.IntegrationServiceEnvironmentSkuName + +const ( + IntegrationServiceEnvironmentSkuNameDeveloper IntegrationServiceEnvironmentSkuName = original.IntegrationServiceEnvironmentSkuNameDeveloper + IntegrationServiceEnvironmentSkuNameNotSpecified IntegrationServiceEnvironmentSkuName = original.IntegrationServiceEnvironmentSkuNameNotSpecified + IntegrationServiceEnvironmentSkuNamePremium IntegrationServiceEnvironmentSkuName = original.IntegrationServiceEnvironmentSkuNamePremium +) + +type IntegrationServiceEnvironmentSkuScaleType = original.IntegrationServiceEnvironmentSkuScaleType + +const ( + Automatic IntegrationServiceEnvironmentSkuScaleType = original.Automatic + Manual IntegrationServiceEnvironmentSkuScaleType = original.Manual + None IntegrationServiceEnvironmentSkuScaleType = original.None +) + type KeyType = original.KeyType const ( @@ -233,11 +335,32 @@ const ( SkuNameStandard SkuName = original.SkuNameStandard ) +type StatusAnnotation = original.StatusAnnotation + +const ( + StatusAnnotationNotSpecified StatusAnnotation = original.StatusAnnotationNotSpecified + StatusAnnotationPreview StatusAnnotation = original.StatusAnnotationPreview + StatusAnnotationProduction StatusAnnotation = original.StatusAnnotationProduction +) + +type SwaggerSchemaType = original.SwaggerSchemaType + +const ( + Array SwaggerSchemaType = original.Array + Boolean SwaggerSchemaType = original.Boolean + File SwaggerSchemaType = original.File + Integer SwaggerSchemaType = original.Integer + Null SwaggerSchemaType = original.Null + Number SwaggerSchemaType = original.Number + Object SwaggerSchemaType = original.Object + String SwaggerSchemaType = original.String +) + type TrackEventsOperationOptions = original.TrackEventsOperationOptions const ( - DisableSourceInfoEnrich TrackEventsOperationOptions = original.DisableSourceInfoEnrich - None TrackEventsOperationOptions = original.None + TrackEventsOperationOptionsDisableSourceInfoEnrich TrackEventsOperationOptions = original.TrackEventsOperationOptionsDisableSourceInfoEnrich + TrackEventsOperationOptionsNone TrackEventsOperationOptions = original.TrackEventsOperationOptionsNone ) type TrackingRecordType = original.TrackingRecordType @@ -354,6 +477,14 @@ const ( WorkflowTriggerProvisioningStateUpdating WorkflowTriggerProvisioningState = original.WorkflowTriggerProvisioningStateUpdating ) +type WsdlImportMethod = original.WsdlImportMethod + +const ( + WsdlImportMethodNotSpecified WsdlImportMethod = original.WsdlImportMethodNotSpecified + WsdlImportMethodSoapPassThrough WsdlImportMethod = original.WsdlImportMethodSoapPassThrough + WsdlImportMethodSoapToRest WsdlImportMethod = original.WsdlImportMethodSoapToRest +) + type X12CharacterSet = original.X12CharacterSet const ( @@ -381,6 +512,21 @@ const ( X12TimeFormatNotSpecified X12TimeFormat = original.X12TimeFormatNotSpecified ) +type APIDeploymentParameterMetadata = original.APIDeploymentParameterMetadata +type APIDeploymentParameterMetadataSet = original.APIDeploymentParameterMetadataSet +type APIOperation = original.APIOperation +type APIOperationAnnotation = original.APIOperationAnnotation +type APIOperationListResult = original.APIOperationListResult +type APIOperationListResultIterator = original.APIOperationListResultIterator +type APIOperationListResultPage = original.APIOperationListResultPage +type APIOperationPropertiesDefinition = original.APIOperationPropertiesDefinition +type APIReference = original.APIReference +type APIResourceBackendService = original.APIResourceBackendService +type APIResourceDefinitions = original.APIResourceDefinitions +type APIResourceGeneralInformation = original.APIResourceGeneralInformation +type APIResourceMetadata = original.APIResourceMetadata +type APIResourcePolicies = original.APIResourcePolicies +type APIResourceProperties = original.APIResourceProperties type AS2AcknowledgementConnectionSettings = original.AS2AcknowledgementConnectionSettings type AS2AgreementContent = original.AS2AgreementContent type AS2EnvelopeSettings = original.AS2EnvelopeSettings @@ -429,8 +575,12 @@ type ErrorResponse = original.ErrorResponse type Expression = original.Expression type ExpressionRoot = original.ExpressionRoot type ExpressionTraces = original.ExpressionTraces +type ExtendedErrorInfo = original.ExtendedErrorInfo +type FlowEndpoints = original.FlowEndpoints +type FlowEndpointsConfiguration = original.FlowEndpointsConfiguration type GenerateUpgradedDefinitionParameters = original.GenerateUpgradedDefinitionParameters type GetCallbackURLParameters = original.GetCallbackURLParameters +type IPAddress = original.IPAddress type IntegrationAccount = original.IntegrationAccount type IntegrationAccountAgreement = original.IntegrationAccountAgreement type IntegrationAccountAgreementFilter = original.IntegrationAccountAgreementFilter @@ -465,6 +615,7 @@ type IntegrationAccountPartnerListResultIterator = original.IntegrationAccountPa type IntegrationAccountPartnerListResultPage = original.IntegrationAccountPartnerListResultPage type IntegrationAccountPartnerProperties = original.IntegrationAccountPartnerProperties type IntegrationAccountPartnersClient = original.IntegrationAccountPartnersClient +type IntegrationAccountProperties = original.IntegrationAccountProperties type IntegrationAccountSchema = original.IntegrationAccountSchema type IntegrationAccountSchemaFilter = original.IntegrationAccountSchemaFilter type IntegrationAccountSchemaListResult = original.IntegrationAccountSchemaListResult @@ -481,6 +632,32 @@ type IntegrationAccountSessionProperties = original.IntegrationAccountSessionPro type IntegrationAccountSessionsClient = original.IntegrationAccountSessionsClient type IntegrationAccountSku = original.IntegrationAccountSku type IntegrationAccountsClient = original.IntegrationAccountsClient +type IntegrationServiceEnvironment = original.IntegrationServiceEnvironment +type IntegrationServiceEnvironmentAccessEndpoint = original.IntegrationServiceEnvironmentAccessEndpoint +type IntegrationServiceEnvironmentListResult = original.IntegrationServiceEnvironmentListResult +type IntegrationServiceEnvironmentListResultIterator = original.IntegrationServiceEnvironmentListResultIterator +type IntegrationServiceEnvironmentListResultPage = original.IntegrationServiceEnvironmentListResultPage +type IntegrationServiceEnvironmentManagedAPIOperationsClient = original.IntegrationServiceEnvironmentManagedAPIOperationsClient +type IntegrationServiceEnvironmentManagedApisClient = original.IntegrationServiceEnvironmentManagedApisClient +type IntegrationServiceEnvironmentManagedApisDeleteFuture = original.IntegrationServiceEnvironmentManagedApisDeleteFuture +type IntegrationServiceEnvironmentManagedApisPutFuture = original.IntegrationServiceEnvironmentManagedApisPutFuture +type IntegrationServiceEnvironmentNetworkDependency = original.IntegrationServiceEnvironmentNetworkDependency +type IntegrationServiceEnvironmentNetworkDependencyHealth = original.IntegrationServiceEnvironmentNetworkDependencyHealth +type IntegrationServiceEnvironmentNetworkEndpoint = original.IntegrationServiceEnvironmentNetworkEndpoint +type IntegrationServiceEnvironmentNetworkHealthClient = original.IntegrationServiceEnvironmentNetworkHealthClient +type IntegrationServiceEnvironmentProperties = original.IntegrationServiceEnvironmentProperties +type IntegrationServiceEnvironmentSku = original.IntegrationServiceEnvironmentSku +type IntegrationServiceEnvironmentSkuCapacity = original.IntegrationServiceEnvironmentSkuCapacity +type IntegrationServiceEnvironmentSkuDefinition = original.IntegrationServiceEnvironmentSkuDefinition +type IntegrationServiceEnvironmentSkuDefinitionSku = original.IntegrationServiceEnvironmentSkuDefinitionSku +type IntegrationServiceEnvironmentSkuList = original.IntegrationServiceEnvironmentSkuList +type IntegrationServiceEnvironmentSkuListIterator = original.IntegrationServiceEnvironmentSkuListIterator +type IntegrationServiceEnvironmentSkuListPage = original.IntegrationServiceEnvironmentSkuListPage +type IntegrationServiceEnvironmentSkusClient = original.IntegrationServiceEnvironmentSkusClient +type IntegrationServiceEnvironmentSubnetNetworkHealth = original.IntegrationServiceEnvironmentSubnetNetworkHealth +type IntegrationServiceEnvironmentsClient = original.IntegrationServiceEnvironmentsClient +type IntegrationServiceEnvironmentsCreateOrUpdateFuture = original.IntegrationServiceEnvironmentsCreateOrUpdateFuture +type IntegrationServiceEnvironmentsUpdateFuture = original.IntegrationServiceEnvironmentsUpdateFuture type JSONSchema = original.JSONSchema type KeyVaultKey = original.KeyVaultKey type KeyVaultKeyAttributes = original.KeyVaultKeyAttributes @@ -489,6 +666,11 @@ type KeyVaultKeyReference = original.KeyVaultKeyReference type KeyVaultKeyReferenceKeyVault = original.KeyVaultKeyReferenceKeyVault type KeyVaultReference = original.KeyVaultReference type ListKeyVaultKeysDefinition = original.ListKeyVaultKeysDefinition +type ManagedAPI = original.ManagedAPI +type ManagedAPIListResult = original.ManagedAPIListResult +type ManagedAPIListResultIterator = original.ManagedAPIListResultIterator +type ManagedAPIListResultPage = original.ManagedAPIListResultPage +type NetworkConfiguration = original.NetworkConfiguration type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult @@ -514,10 +696,21 @@ type Response = original.Response type RetryHistory = original.RetryHistory type RunActionCorrelation = original.RunActionCorrelation type RunCorrelation = original.RunCorrelation +type SetIntegrationServiceEnvironmentSubnetNetworkHealth = original.SetIntegrationServiceEnvironmentSubnetNetworkHealth type SetObject = original.SetObject type SetTriggerStateActionDefinition = original.SetTriggerStateActionDefinition type Sku = original.Sku type SubResource = original.SubResource +type SwaggerCustomDynamicList = original.SwaggerCustomDynamicList +type SwaggerCustomDynamicProperties = original.SwaggerCustomDynamicProperties +type SwaggerCustomDynamicSchema = original.SwaggerCustomDynamicSchema +type SwaggerCustomDynamicTree = original.SwaggerCustomDynamicTree +type SwaggerCustomDynamicTreeCommand = original.SwaggerCustomDynamicTreeCommand +type SwaggerCustomDynamicTreeParameter = original.SwaggerCustomDynamicTreeParameter +type SwaggerCustomDynamicTreeSettings = original.SwaggerCustomDynamicTreeSettings +type SwaggerExternalDocumentation = original.SwaggerExternalDocumentation +type SwaggerSchema = original.SwaggerSchema +type SwaggerXML = original.SwaggerXML type TrackingEvent = original.TrackingEvent type TrackingEventErrorInfo = original.TrackingEventErrorInfo type TrackingEventsDefinition = original.TrackingEventsDefinition @@ -577,6 +770,8 @@ type WorkflowVersionProperties = original.WorkflowVersionProperties type WorkflowVersionTriggersClient = original.WorkflowVersionTriggersClient type WorkflowVersionsClient = original.WorkflowVersionsClient type WorkflowsClient = original.WorkflowsClient +type WorkflowsMoveFuture = original.WorkflowsMoveFuture +type WsdlService = original.WsdlService type X12AcknowledgementSettings = original.X12AcknowledgementSettings type X12AgreementContent = original.X12AgreementContent type X12DelimiterOverrides = original.X12DelimiterOverrides @@ -596,6 +791,12 @@ type X12ValidationSettings = original.X12ValidationSettings func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } +func NewAPIOperationListResultIterator(page APIOperationListResultPage) APIOperationListResultIterator { + return original.NewAPIOperationListResultIterator(page) +} +func NewAPIOperationListResultPage(getNextPage func(context.Context, APIOperationListResult) (APIOperationListResult, error)) APIOperationListResultPage { + return original.NewAPIOperationListResultPage(getNextPage) +} func NewIntegrationAccountAgreementListResultIterator(page IntegrationAccountAgreementListResultPage) IntegrationAccountAgreementListResultIterator { return original.NewIntegrationAccountAgreementListResultIterator(page) } @@ -692,6 +893,54 @@ func NewIntegrationAccountsClient(subscriptionID string) IntegrationAccountsClie func NewIntegrationAccountsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountsClient { return original.NewIntegrationAccountsClientWithBaseURI(baseURI, subscriptionID) } +func NewIntegrationServiceEnvironmentListResultIterator(page IntegrationServiceEnvironmentListResultPage) IntegrationServiceEnvironmentListResultIterator { + return original.NewIntegrationServiceEnvironmentListResultIterator(page) +} +func NewIntegrationServiceEnvironmentListResultPage(getNextPage func(context.Context, IntegrationServiceEnvironmentListResult) (IntegrationServiceEnvironmentListResult, error)) IntegrationServiceEnvironmentListResultPage { + return original.NewIntegrationServiceEnvironmentListResultPage(getNextPage) +} +func NewIntegrationServiceEnvironmentManagedAPIOperationsClient(subscriptionID string) IntegrationServiceEnvironmentManagedAPIOperationsClient { + return original.NewIntegrationServiceEnvironmentManagedAPIOperationsClient(subscriptionID) +} +func NewIntegrationServiceEnvironmentManagedAPIOperationsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentManagedAPIOperationsClient { + return original.NewIntegrationServiceEnvironmentManagedAPIOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewIntegrationServiceEnvironmentManagedApisClient(subscriptionID string) IntegrationServiceEnvironmentManagedApisClient { + return original.NewIntegrationServiceEnvironmentManagedApisClient(subscriptionID) +} +func NewIntegrationServiceEnvironmentManagedApisClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentManagedApisClient { + return original.NewIntegrationServiceEnvironmentManagedApisClientWithBaseURI(baseURI, subscriptionID) +} +func NewIntegrationServiceEnvironmentNetworkHealthClient(subscriptionID string) IntegrationServiceEnvironmentNetworkHealthClient { + return original.NewIntegrationServiceEnvironmentNetworkHealthClient(subscriptionID) +} +func NewIntegrationServiceEnvironmentNetworkHealthClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentNetworkHealthClient { + return original.NewIntegrationServiceEnvironmentNetworkHealthClientWithBaseURI(baseURI, subscriptionID) +} +func NewIntegrationServiceEnvironmentSkuListIterator(page IntegrationServiceEnvironmentSkuListPage) IntegrationServiceEnvironmentSkuListIterator { + return original.NewIntegrationServiceEnvironmentSkuListIterator(page) +} +func NewIntegrationServiceEnvironmentSkuListPage(getNextPage func(context.Context, IntegrationServiceEnvironmentSkuList) (IntegrationServiceEnvironmentSkuList, error)) IntegrationServiceEnvironmentSkuListPage { + return original.NewIntegrationServiceEnvironmentSkuListPage(getNextPage) +} +func NewIntegrationServiceEnvironmentSkusClient(subscriptionID string) IntegrationServiceEnvironmentSkusClient { + return original.NewIntegrationServiceEnvironmentSkusClient(subscriptionID) +} +func NewIntegrationServiceEnvironmentSkusClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentSkusClient { + return original.NewIntegrationServiceEnvironmentSkusClientWithBaseURI(baseURI, subscriptionID) +} +func NewIntegrationServiceEnvironmentsClient(subscriptionID string) IntegrationServiceEnvironmentsClient { + return original.NewIntegrationServiceEnvironmentsClient(subscriptionID) +} +func NewIntegrationServiceEnvironmentsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentsClient { + return original.NewIntegrationServiceEnvironmentsClientWithBaseURI(baseURI, subscriptionID) +} +func NewManagedAPIListResultIterator(page ManagedAPIListResultPage) ManagedAPIListResultIterator { + return original.NewManagedAPIListResultIterator(page) +} +func NewManagedAPIListResultPage(getNextPage func(context.Context, ManagedAPIListResult) (ManagedAPIListResult, error)) ManagedAPIListResultPage { + return original.NewManagedAPIListResultPage(getNextPage) +} func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return original.NewOperationListResultIterator(page) } @@ -821,9 +1070,21 @@ func NewWorkflowsClient(subscriptionID string) WorkflowsClient { func NewWorkflowsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowsClient { return original.NewWorkflowsClientWithBaseURI(baseURI, subscriptionID) } +func PossibleAPIDeploymentParameterVisibilityValues() []APIDeploymentParameterVisibility { + return original.PossibleAPIDeploymentParameterVisibilityValues() +} +func PossibleAPITierValues() []APITier { + return original.PossibleAPITierValues() +} +func PossibleAPITypeValues() []APIType { + return original.PossibleAPITypeValues() +} func PossibleAgreementTypeValues() []AgreementType { return original.PossibleAgreementTypeValues() } +func PossibleAzureAsyncOperationStateValues() []AzureAsyncOperationState { + return original.PossibleAzureAsyncOperationStateValues() +} func PossibleDayOfWeekValues() []DayOfWeek { return original.PossibleDayOfWeekValues() } @@ -839,6 +1100,9 @@ func PossibleEdifactDecimalIndicatorValues() []EdifactDecimalIndicator { func PossibleEncryptionAlgorithmValues() []EncryptionAlgorithm { return original.PossibleEncryptionAlgorithmValues() } +func PossibleErrorResponseCodeValues() []ErrorResponseCode { + return original.PossibleErrorResponseCodeValues() +} func PossibleEventLevelValues() []EventLevel { return original.PossibleEventLevelValues() } @@ -848,6 +1112,24 @@ func PossibleHashingAlgorithmValues() []HashingAlgorithm { func PossibleIntegrationAccountSkuNameValues() []IntegrationAccountSkuName { return original.PossibleIntegrationAccountSkuNameValues() } +func PossibleIntegrationServiceEnvironmentAccessEndpointTypeValues() []IntegrationServiceEnvironmentAccessEndpointType { + return original.PossibleIntegrationServiceEnvironmentAccessEndpointTypeValues() +} +func PossibleIntegrationServiceEnvironmentNetworkDependencyCategoryTypeValues() []IntegrationServiceEnvironmentNetworkDependencyCategoryType { + return original.PossibleIntegrationServiceEnvironmentNetworkDependencyCategoryTypeValues() +} +func PossibleIntegrationServiceEnvironmentNetworkDependencyHealthStateValues() []IntegrationServiceEnvironmentNetworkDependencyHealthState { + return original.PossibleIntegrationServiceEnvironmentNetworkDependencyHealthStateValues() +} +func PossibleIntegrationServiceEnvironmentNetworkEndPointAccessibilityStateValues() []IntegrationServiceEnvironmentNetworkEndPointAccessibilityState { + return original.PossibleIntegrationServiceEnvironmentNetworkEndPointAccessibilityStateValues() +} +func PossibleIntegrationServiceEnvironmentSkuNameValues() []IntegrationServiceEnvironmentSkuName { + return original.PossibleIntegrationServiceEnvironmentSkuNameValues() +} +func PossibleIntegrationServiceEnvironmentSkuScaleTypeValues() []IntegrationServiceEnvironmentSkuScaleType { + return original.PossibleIntegrationServiceEnvironmentSkuScaleTypeValues() +} func PossibleKeyTypeValues() []KeyType { return original.PossibleKeyTypeValues() } @@ -878,6 +1160,12 @@ func PossibleSigningAlgorithmValues() []SigningAlgorithm { func PossibleSkuNameValues() []SkuName { return original.PossibleSkuNameValues() } +func PossibleStatusAnnotationValues() []StatusAnnotation { + return original.PossibleStatusAnnotationValues() +} +func PossibleSwaggerSchemaTypeValues() []SwaggerSchemaType { + return original.PossibleSwaggerSchemaTypeValues() +} func PossibleTrackEventsOperationOptionsValues() []TrackEventsOperationOptions { return original.PossibleTrackEventsOperationOptionsValues() } @@ -902,6 +1190,9 @@ func PossibleWorkflowStatusValues() []WorkflowStatus { func PossibleWorkflowTriggerProvisioningStateValues() []WorkflowTriggerProvisioningState { return original.PossibleWorkflowTriggerProvisioningStateValues() } +func PossibleWsdlImportMethodValues() []WsdlImportMethod { + return original.PossibleWsdlImportMethodValues() +} func PossibleX12CharacterSetValues() []X12CharacterSet { return original.PossibleX12CharacterSetValues() } diff --git a/profiles/preview/preview/machinelearning/mgmt/services/models.go b/profiles/preview/preview/machinelearning/mgmt/services/models.go deleted file mode 100644 index 467c0da43664..000000000000 --- a/profiles/preview/preview/machinelearning/mgmt/services/models.go +++ /dev/null @@ -1,196 +0,0 @@ -// +build go1.9 - -// Copyright 2019 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 services - -import ( - "context" - - original "github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2018-03-01-preview/services" -) - -const ( - DefaultBaseURI = original.DefaultBaseURI -) - -type ComputeType = original.ComputeType - -const ( - ComputeTypeAKS ComputeType = original.ComputeTypeAKS - ComputeTypeBatchAI ComputeType = original.ComputeTypeBatchAI - ComputeTypeDataFactory ComputeType = original.ComputeTypeDataFactory - ComputeTypeHDInsight ComputeType = original.ComputeTypeHDInsight - ComputeTypeVirtualMachine ComputeType = original.ComputeTypeVirtualMachine -) - -type ComputeTypeBasicCompute = original.ComputeTypeBasicCompute - -const ( - ComputeTypeAKS1 ComputeTypeBasicCompute = original.ComputeTypeAKS1 - ComputeTypeBatchAI1 ComputeTypeBasicCompute = original.ComputeTypeBatchAI1 - ComputeTypeCompute ComputeTypeBasicCompute = original.ComputeTypeCompute - ComputeTypeDataFactory1 ComputeTypeBasicCompute = original.ComputeTypeDataFactory1 - ComputeTypeHDInsight1 ComputeTypeBasicCompute = original.ComputeTypeHDInsight1 - ComputeTypeVirtualMachine1 ComputeTypeBasicCompute = original.ComputeTypeVirtualMachine1 -) - -type ComputeTypeBasicComputeSecrets = original.ComputeTypeBasicComputeSecrets - -const ( - ComputeTypeBasicComputeSecretsComputeTypeAKS ComputeTypeBasicComputeSecrets = original.ComputeTypeBasicComputeSecretsComputeTypeAKS - ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets ComputeTypeBasicComputeSecrets = original.ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets - ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine ComputeTypeBasicComputeSecrets = original.ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine -) - -type ProvisioningState = original.ProvisioningState - -const ( - Canceled ProvisioningState = original.Canceled - Creating ProvisioningState = original.Creating - Deleting ProvisioningState = original.Deleting - Failed ProvisioningState = original.Failed - Succeeded ProvisioningState = original.Succeeded - Unknown ProvisioningState = original.Unknown - Updating ProvisioningState = original.Updating -) - -type ResourceIdentityType = original.ResourceIdentityType - -const ( - SystemAssigned ResourceIdentityType = original.SystemAssigned -) - -type Status = original.Status - -const ( - Disabled Status = original.Disabled - Enabled Status = original.Enabled -) - -type AKS = original.AKS -type AKSProperties = original.AKSProperties -type AksComputeSecrets = original.AksComputeSecrets -type BaseClient = original.BaseClient -type BasicCompute = original.BasicCompute -type BasicComputeSecrets = original.BasicComputeSecrets -type BatchAI = original.BatchAI -type BatchAIProperties = original.BatchAIProperties -type Compute = original.Compute -type ComputeResource = original.ComputeResource -type ComputeSecrets = original.ComputeSecrets -type ComputeSecretsModel = original.ComputeSecretsModel -type DataFactory = original.DataFactory -type ErrorDetail = original.ErrorDetail -type ErrorResponse = original.ErrorResponse -type HDInsight = original.HDInsight -type HDInsightProperties = original.HDInsightProperties -type Identity = original.Identity -type ListWorkspaceKeysResult = original.ListWorkspaceKeysResult -type MachineLearningComputeClient = original.MachineLearningComputeClient -type MachineLearningComputeCreateOrUpdateFuture = original.MachineLearningComputeCreateOrUpdateFuture -type MachineLearningComputeDeleteFuture = original.MachineLearningComputeDeleteFuture -type MachineLearningComputeSystemUpdateFuture = original.MachineLearningComputeSystemUpdateFuture -type MachineLearningServiceError = original.MachineLearningServiceError -type Operation = original.Operation -type OperationDisplay = original.OperationDisplay -type OperationListResult = original.OperationListResult -type OperationsClient = original.OperationsClient -type PaginatedComputeResourcesList = original.PaginatedComputeResourcesList -type PaginatedComputeResourcesListIterator = original.PaginatedComputeResourcesListIterator -type PaginatedComputeResourcesListPage = original.PaginatedComputeResourcesListPage -type Password = original.Password -type PrincipalCredentials = original.PrincipalCredentials -type RegistryListCredentialsResult = original.RegistryListCredentialsResult -type Resource = original.Resource -type ScaleSettings = original.ScaleSettings -type SslConfiguration = original.SslConfiguration -type SystemService = original.SystemService -type VirtualMachine = original.VirtualMachine -type VirtualMachineProperties = original.VirtualMachineProperties -type VirtualMachineSSHCredentials = original.VirtualMachineSSHCredentials -type VirtualMachineSecrets = original.VirtualMachineSecrets -type Workspace = original.Workspace -type WorkspaceListResult = original.WorkspaceListResult -type WorkspaceListResultIterator = original.WorkspaceListResultIterator -type WorkspaceListResultPage = original.WorkspaceListResultPage -type WorkspaceProperties = original.WorkspaceProperties -type WorkspacePropertiesUpdateParameters = original.WorkspacePropertiesUpdateParameters -type WorkspaceUpdateParameters = original.WorkspaceUpdateParameters -type WorkspacesClient = original.WorkspacesClient - -func New(subscriptionID string) BaseClient { - return original.New(subscriptionID) -} -func NewMachineLearningComputeClient(subscriptionID string) MachineLearningComputeClient { - return original.NewMachineLearningComputeClient(subscriptionID) -} -func NewMachineLearningComputeClientWithBaseURI(baseURI string, subscriptionID string) MachineLearningComputeClient { - return original.NewMachineLearningComputeClientWithBaseURI(baseURI, subscriptionID) -} -func NewOperationsClient(subscriptionID string) OperationsClient { - return original.NewOperationsClient(subscriptionID) -} -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) -} -func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesListPage) PaginatedComputeResourcesListIterator { - return original.NewPaginatedComputeResourcesListIterator(page) -} -func NewPaginatedComputeResourcesListPage(getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage { - return original.NewPaginatedComputeResourcesListPage(getNextPage) -} -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return original.NewWithBaseURI(baseURI, subscriptionID) -} -func NewWorkspaceListResultIterator(page WorkspaceListResultPage) WorkspaceListResultIterator { - return original.NewWorkspaceListResultIterator(page) -} -func NewWorkspaceListResultPage(getNextPage func(context.Context, WorkspaceListResult) (WorkspaceListResult, error)) WorkspaceListResultPage { - return original.NewWorkspaceListResultPage(getNextPage) -} -func NewWorkspacesClient(subscriptionID string) WorkspacesClient { - return original.NewWorkspacesClient(subscriptionID) -} -func NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacesClient { - return original.NewWorkspacesClientWithBaseURI(baseURI, subscriptionID) -} -func PossibleComputeTypeBasicComputeSecretsValues() []ComputeTypeBasicComputeSecrets { - return original.PossibleComputeTypeBasicComputeSecretsValues() -} -func PossibleComputeTypeBasicComputeValues() []ComputeTypeBasicCompute { - return original.PossibleComputeTypeBasicComputeValues() -} -func PossibleComputeTypeValues() []ComputeType { - return original.PossibleComputeTypeValues() -} -func PossibleProvisioningStateValues() []ProvisioningState { - return original.PossibleProvisioningStateValues() -} -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return original.PossibleResourceIdentityTypeValues() -} -func PossibleStatusValues() []Status { - return original.PossibleStatusValues() -} -func UserAgent() string { - return original.UserAgent() + " profiles/preview" -} -func Version() string { - return original.Version() -} diff --git a/profiles/preview/preview/maintenance/mgmt/maintenance/maintenanceapi/models.go b/profiles/preview/preview/maintenance/mgmt/maintenance/maintenanceapi/models.go new file mode 100644 index 000000000000..9aae9dd8b0d4 --- /dev/null +++ b/profiles/preview/preview/maintenance/mgmt/maintenance/maintenanceapi/models.go @@ -0,0 +1,28 @@ +// +build go1.9 + +// Copyright 2019 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 maintenanceapi + +import original "github.com/Azure/azure-sdk-for-go/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/maintenanceapi" + +type ApplyUpdatesClientAPI = original.ApplyUpdatesClientAPI +type ConfigurationAssignmentsClientAPI = original.ConfigurationAssignmentsClientAPI +type ConfigurationsClientAPI = original.ConfigurationsClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type UpdatesClientAPI = original.UpdatesClientAPI diff --git a/profiles/preview/preview/maintenance/mgmt/maintenance/models.go b/profiles/preview/preview/maintenance/mgmt/maintenance/models.go new file mode 100644 index 000000000000..873254c688c5 --- /dev/null +++ b/profiles/preview/preview/maintenance/mgmt/maintenance/models.go @@ -0,0 +1,130 @@ +// +build go1.9 + +// Copyright 2019 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 maintenance + +import original "github.com/Azure/azure-sdk-for-go/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance" + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type ImpactType = original.ImpactType + +const ( + Freeze ImpactType = original.Freeze + None ImpactType = original.None + Redeploy ImpactType = original.Redeploy + Restart ImpactType = original.Restart +) + +type Scope = original.Scope + +const ( + ScopeAll Scope = original.ScopeAll + ScopeHost Scope = original.ScopeHost + ScopeInResource Scope = original.ScopeInResource + ScopeResource Scope = original.ScopeResource +) + +type UpdateStatus = original.UpdateStatus + +const ( + Completed UpdateStatus = original.Completed + InProgress UpdateStatus = original.InProgress + Pending UpdateStatus = original.Pending + RetryLater UpdateStatus = original.RetryLater + RetryNow UpdateStatus = original.RetryNow +) + +type ApplyUpdate = original.ApplyUpdate +type ApplyUpdateProperties = original.ApplyUpdateProperties +type ApplyUpdatesClient = original.ApplyUpdatesClient +type BaseClient = original.BaseClient +type Configuration = original.Configuration +type ConfigurationAssignment = original.ConfigurationAssignment +type ConfigurationAssignmentProperties = original.ConfigurationAssignmentProperties +type ConfigurationAssignmentsClient = original.ConfigurationAssignmentsClient +type ConfigurationProperties = original.ConfigurationProperties +type ConfigurationsClient = original.ConfigurationsClient +type Error = original.Error +type ErrorDetails = original.ErrorDetails +type ListConfigurationAssignmentsResult = original.ListConfigurationAssignmentsResult +type ListMaintenanceConfigurationsResult = original.ListMaintenanceConfigurationsResult +type ListUpdatesResult = original.ListUpdatesResult +type Operation = original.Operation +type OperationInfo = original.OperationInfo +type OperationsClient = original.OperationsClient +type OperationsListResult = original.OperationsListResult +type Resource = original.Resource +type Update = original.Update +type UpdateProperties = original.UpdateProperties +type UpdatesClient = original.UpdatesClient + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewApplyUpdatesClient(subscriptionID string) ApplyUpdatesClient { + return original.NewApplyUpdatesClient(subscriptionID) +} +func NewApplyUpdatesClientWithBaseURI(baseURI string, subscriptionID string) ApplyUpdatesClient { + return original.NewApplyUpdatesClientWithBaseURI(baseURI, subscriptionID) +} +func NewConfigurationAssignmentsClient(subscriptionID string) ConfigurationAssignmentsClient { + return original.NewConfigurationAssignmentsClient(subscriptionID) +} +func NewConfigurationAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationAssignmentsClient { + return original.NewConfigurationAssignmentsClientWithBaseURI(baseURI, subscriptionID) +} +func NewConfigurationsClient(subscriptionID string) ConfigurationsClient { + return original.NewConfigurationsClient(subscriptionID) +} +func NewConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationsClient { + return original.NewConfigurationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewUpdatesClient(subscriptionID string) UpdatesClient { + return original.NewUpdatesClient(subscriptionID) +} +func NewUpdatesClientWithBaseURI(baseURI string, subscriptionID string) UpdatesClient { + return original.NewUpdatesClientWithBaseURI(baseURI, subscriptionID) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleImpactTypeValues() []ImpactType { + return original.PossibleImpactTypeValues() +} +func PossibleScopeValues() []Scope { + return original.PossibleScopeValues() +} +func PossibleUpdateStatusValues() []UpdateStatus { + return original.PossibleUpdateStatusValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/profiles/preview/preview/reservations/mgmt/reservations/models.go b/profiles/preview/preview/reservations/mgmt/reservations/models.go index 56e317240017..93e8b2bf8b0f 100644 --- a/profiles/preview/preview/reservations/mgmt/reservations/models.go +++ b/profiles/preview/preview/reservations/mgmt/reservations/models.go @@ -103,6 +103,22 @@ const ( On InstanceFlexibility = original.On ) +type PaymentStatus = original.PaymentStatus + +const ( + Cancelled PaymentStatus = original.Cancelled + Failed PaymentStatus = original.Failed + Scheduled PaymentStatus = original.Scheduled + Succeeded PaymentStatus = original.Succeeded +) + +type ReservationBillingPlan = original.ReservationBillingPlan + +const ( + Monthly ReservationBillingPlan = original.Monthly + Upfront ReservationBillingPlan = original.Upfront +) + type ReservationTerm = original.ReservationTerm const ( @@ -146,6 +162,7 @@ type CalculatePriceResponseProperties = original.CalculatePriceResponsePropertie type CalculatePriceResponsePropertiesBillingCurrencyTotal = original.CalculatePriceResponsePropertiesBillingCurrencyTotal type CalculatePriceResponsePropertiesPricingCurrencyTotal = original.CalculatePriceResponsePropertiesPricingCurrencyTotal type Catalog = original.Catalog +type CatalogBillingPlansItem = original.CatalogBillingPlansItem type Client = original.Client type Error = original.Error type ExtendedErrorInfo = original.ExtendedErrorInfo @@ -164,6 +181,7 @@ type OperationList = original.OperationList type OperationListIterator = original.OperationListIterator type OperationListPage = original.OperationListPage type OperationResponse = original.OperationResponse +type OrderBillingPlanInformation = original.OrderBillingPlanInformation type OrderClient = original.OrderClient type OrderList = original.OrderList type OrderListIterator = original.OrderListIterator @@ -174,6 +192,8 @@ type OrderResponse = original.OrderResponse type Patch = original.Patch type PatchProperties = original.PatchProperties type PatchPropertiesRenewProperties = original.PatchPropertiesRenewProperties +type PaymentDetail = original.PaymentDetail +type Price = original.Price type Properties = original.Properties type PropertiesType = original.PropertiesType type PurchaseRequest = original.PurchaseRequest @@ -247,6 +267,12 @@ func PossibleErrorResponseCodeValues() []ErrorResponseCode { func PossibleInstanceFlexibilityValues() []InstanceFlexibility { return original.PossibleInstanceFlexibilityValues() } +func PossiblePaymentStatusValues() []PaymentStatus { + return original.PossiblePaymentStatusValues() +} +func PossibleReservationBillingPlanValues() []ReservationBillingPlan { + return original.PossibleReservationBillingPlanValues() +} func PossibleReservationTermValues() []ReservationTerm { return original.PossibleReservationTermValues() } diff --git a/profiles/preview/preview/security/mgmt/security/models.go b/profiles/preview/preview/security/mgmt/security/models.go index 9798ac9547d7..9c7bccc72a46 100644 --- a/profiles/preview/preview/security/mgmt/security/models.go +++ b/profiles/preview/preview/security/mgmt/security/models.go @@ -59,6 +59,15 @@ const ( AlertsToAdminsOn AlertsToAdmins = original.AlertsToAdminsOn ) +type AssessedResourceType = original.AssessedResourceType + +const ( + AssessedResourceTypeAdditionalData AssessedResourceType = original.AssessedResourceTypeAdditionalData + AssessedResourceTypeContainerRegistryVulnerability AssessedResourceType = original.AssessedResourceTypeContainerRegistryVulnerability + AssessedResourceTypeServerVulnerabilityAssessment AssessedResourceType = original.AssessedResourceTypeServerVulnerabilityAssessment + AssessedResourceTypeSQLServerVulnerability AssessedResourceType = original.AssessedResourceTypeSQLServerVulnerability +) + type AutoProvision = original.AutoProvision const ( @@ -114,6 +123,7 @@ type EnforcementMode = original.EnforcementMode const ( Audit EnforcementMode = original.Audit Enforce EnforcementMode = original.Enforce + None EnforcementMode = original.None ) type EnforcementMode1 = original.EnforcementMode1 @@ -121,6 +131,23 @@ type EnforcementMode1 = original.EnforcementMode1 const ( EnforcementMode1Audit EnforcementMode1 = original.EnforcementMode1Audit EnforcementMode1Enforce EnforcementMode1 = original.EnforcementMode1Enforce + EnforcementMode1None EnforcementMode1 = original.EnforcementMode1None +) + +type Exe = original.Exe + +const ( + ExeAudit Exe = original.ExeAudit + ExeEnforce Exe = original.ExeEnforce + ExeNone Exe = original.ExeNone +) + +type Executable = original.Executable + +const ( + ExecutableAudit Executable = original.ExecutableAudit + ExecutableEnforce Executable = original.ExecutableEnforce + ExecutableNone Executable = original.ExecutableNone ) type ExportData = original.ExportData @@ -149,12 +176,12 @@ const ( type FileType = original.FileType const ( - Dll FileType = original.Dll - Exe FileType = original.Exe - Executable FileType = original.Executable - Msi FileType = original.Msi - Script FileType = original.Script - Unknown FileType = original.Unknown + FileTypeDll FileType = original.FileTypeDll + FileTypeExe FileType = original.FileTypeExe + FileTypeExecutable FileType = original.FileTypeExecutable + FileTypeMsi FileType = original.FileTypeMsi + FileTypeScript FileType = original.FileTypeScript + FileTypeUnknown FileType = original.FileTypeUnknown ) type Issue = original.Issue @@ -177,6 +204,14 @@ const ( KindExternalSecuritySolution KindEnum = original.KindExternalSecuritySolution ) +type Msi = original.Msi + +const ( + MsiAudit Msi = original.MsiAudit + MsiEnforce Msi = original.MsiEnforce + MsiNone Msi = original.MsiNone +) + type PricingTier = original.PricingTier const ( @@ -273,6 +308,14 @@ const ( OffByPolicy ResourceStatus = original.OffByPolicy ) +type Script = original.Script + +const ( + ScriptAudit Script = original.ScriptAudit + ScriptEnforce Script = original.ScriptEnforce + ScriptNone Script = original.ScriptNone +) + type SettingKind = original.SettingKind const ( @@ -280,6 +323,14 @@ const ( SettingKindDataExportSetting SettingKind = original.SettingKindDataExportSetting ) +type Severity = original.Severity + +const ( + SeverityHigh Severity = original.SeverityHigh + SeverityLow Severity = original.SeverityLow + SeverityMedium Severity = original.SeverityMedium +) + type SolutionStatus = original.SolutionStatus const ( @@ -287,14 +338,22 @@ const ( SolutionStatusEnabled SolutionStatus = original.SolutionStatusEnabled ) +type Source = original.Source + +const ( + SourceAws Source = original.SourceAws + SourceAzure Source = original.SourceAzure + SourceResourceDetails Source = original.SourceResourceDetails +) + type SourceSystem = original.SourceSystem const ( - AzureAppLocker SourceSystem = original.AzureAppLocker - AzureAuditD SourceSystem = original.AzureAuditD - NonAzureAppLocker SourceSystem = original.NonAzureAppLocker - NonAzureAuditD SourceSystem = original.NonAzureAuditD - None SourceSystem = original.None + SourceSystemAzureAppLocker SourceSystem = original.SourceSystemAzureAppLocker + SourceSystemAzureAuditD SourceSystem = original.SourceSystemAzureAuditD + SourceSystemNonAzureAppLocker SourceSystem = original.SourceSystemNonAzureAppLocker + SourceSystemNonAzureAuditD SourceSystem = original.SourceSystemNonAzureAuditD + SourceSystemNone SourceSystem = original.SourceSystemNone ) type State = original.State @@ -321,6 +380,14 @@ const ( UserRequested StatusReason = original.UserRequested ) +type SubAssessmentStatusCode = original.SubAssessmentStatusCode + +const ( + SubAssessmentStatusCodeHealthy SubAssessmentStatusCode = original.SubAssessmentStatusCodeHealthy + SubAssessmentStatusCodeNotApplicable SubAssessmentStatusCode = original.SubAssessmentStatusCodeNotApplicable + SubAssessmentStatusCodeUnhealthy SubAssessmentStatusCode = original.SubAssessmentStatusCodeUnhealthy +) + type Type = original.Type const ( @@ -332,10 +399,18 @@ const ( VersionAndAboveSignature Type = original.VersionAndAboveSignature ) +type ValueType = original.ValueType + +const ( + IPCidr ValueType = original.IPCidr + String ValueType = original.String +) + type AadConnectivityState1 = original.AadConnectivityState1 type AadExternalSecuritySolution = original.AadExternalSecuritySolution type AadSolutionProperties = original.AadSolutionProperties type AdaptiveApplicationControlsClient = original.AdaptiveApplicationControlsClient +type AdditionalData = original.AdditionalData type AdvancedThreatProtectionClient = original.AdvancedThreatProtectionClient type AdvancedThreatProtectionProperties = original.AdvancedThreatProtectionProperties type AdvancedThreatProtectionSetting = original.AdvancedThreatProtectionSetting @@ -353,6 +428,7 @@ type AllowedConnectionsListIterator = original.AllowedConnectionsListIterator type AllowedConnectionsListPage = original.AllowedConnectionsListPage type AllowedConnectionsResource = original.AllowedConnectionsResource type AllowedConnectionsResourceProperties = original.AllowedConnectionsResourceProperties +type AllowlistCustomAlertRule = original.AllowlistCustomAlertRule type AppWhitelistingGroup = original.AppWhitelistingGroup type AppWhitelistingGroupData = original.AppWhitelistingGroupData type AppWhitelistingGroups = original.AppWhitelistingGroups @@ -370,8 +446,14 @@ type AutoProvisioningSettingListIterator = original.AutoProvisioningSettingListI type AutoProvisioningSettingListPage = original.AutoProvisioningSettingListPage type AutoProvisioningSettingProperties = original.AutoProvisioningSettingProperties type AutoProvisioningSettingsClient = original.AutoProvisioningSettingsClient +type AwsResourceDetails = original.AwsResourceDetails +type AzureResourceDetails = original.AzureResourceDetails type BaseClient = original.BaseClient +type BasicAdditionalData = original.BasicAdditionalData type BasicExternalSecuritySolution = original.BasicExternalSecuritySolution +type BasicResourceDetails = original.BasicResourceDetails +type CVE = original.CVE +type CVSS = original.CVSS type CefExternalSecuritySolution = original.CefExternalSecuritySolution type CefSolutionProperties = original.CefSolutionProperties type CloudError = original.CloudError @@ -398,8 +480,17 @@ type ContactListIterator = original.ContactListIterator type ContactListPage = original.ContactListPage 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 DenylistCustomAlertRule = original.DenylistCustomAlertRule +type DeviceSecurityGroup = original.DeviceSecurityGroup +type DeviceSecurityGroupList = original.DeviceSecurityGroupList +type DeviceSecurityGroupListIterator = original.DeviceSecurityGroupListIterator +type DeviceSecurityGroupListPage = original.DeviceSecurityGroupListPage +type DeviceSecurityGroupProperties = original.DeviceSecurityGroupProperties +type DeviceSecurityGroupsClient = original.DeviceSecurityGroupsClient type DiscoveredSecuritySolution = original.DiscoveredSecuritySolution type DiscoveredSecuritySolutionList = original.DiscoveredSecuritySolutionList type DiscoveredSecuritySolutionListIterator = original.DiscoveredSecuritySolutionListIterator @@ -433,29 +524,22 @@ type IoTSecurityAggregatedRecommendationListIterator = original.IoTSecurityAggre type IoTSecurityAggregatedRecommendationListPage = original.IoTSecurityAggregatedRecommendationListPage type IoTSecurityAggregatedRecommendationProperties = original.IoTSecurityAggregatedRecommendationProperties type IoTSecurityAlertedDevice = original.IoTSecurityAlertedDevice -type IoTSecurityAlertedDevicesList = original.IoTSecurityAlertedDevicesList type IoTSecurityDeviceAlert = original.IoTSecurityDeviceAlert -type IoTSecurityDeviceAlertsList = original.IoTSecurityDeviceAlertsList type IoTSecurityDeviceRecommendation = original.IoTSecurityDeviceRecommendation -type IoTSecurityDeviceRecommendationsList = original.IoTSecurityDeviceRecommendationsList type IoTSecuritySolutionAnalyticsModel = original.IoTSecuritySolutionAnalyticsModel type IoTSecuritySolutionAnalyticsModelList = original.IoTSecuritySolutionAnalyticsModelList type IoTSecuritySolutionAnalyticsModelProperties = original.IoTSecuritySolutionAnalyticsModelProperties type IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem = original.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem type IoTSecuritySolutionModel = original.IoTSecuritySolutionModel type IoTSecuritySolutionProperties = original.IoTSecuritySolutionProperties -type IoTSecuritySolutionsAnalyticsAggregatedAlertClient = original.IoTSecuritySolutionsAnalyticsAggregatedAlertClient -type IoTSecuritySolutionsAnalyticsAggregatedAlertsClient = original.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient -type IoTSecuritySolutionsAnalyticsClient = original.IoTSecuritySolutionsAnalyticsClient -type IoTSecuritySolutionsAnalyticsRecommendationClient = original.IoTSecuritySolutionsAnalyticsRecommendationClient -type IoTSecuritySolutionsAnalyticsRecommendationsClient = original.IoTSecuritySolutionsAnalyticsRecommendationsClient -type IoTSecuritySolutionsClient = original.IoTSecuritySolutionsClient type IoTSecuritySolutionsList = original.IoTSecuritySolutionsList type IoTSecuritySolutionsListIterator = original.IoTSecuritySolutionsListIterator type IoTSecuritySolutionsListPage = original.IoTSecuritySolutionsListPage -type IoTSecuritySolutionsResourceGroupClient = original.IoTSecuritySolutionsResourceGroupClient type IoTSeverityMetrics = original.IoTSeverityMetrics +type IotSecuritySolutionAnalyticsClient = original.IotSecuritySolutionAnalyticsClient type IotSecuritySolutionClient = original.IotSecuritySolutionClient +type IotSecuritySolutionsAnalyticsAggregatedAlertClient = original.IotSecuritySolutionsAnalyticsAggregatedAlertClient +type IotSecuritySolutionsAnalyticsRecommendationClient = original.IotSecuritySolutionsAnalyticsRecommendationClient type JitNetworkAccessPoliciesClient = original.JitNetworkAccessPoliciesClient type JitNetworkAccessPoliciesList = original.JitNetworkAccessPoliciesList type JitNetworkAccessPoliciesListIterator = original.JitNetworkAccessPoliciesListIterator @@ -471,6 +555,7 @@ type JitNetworkAccessRequest = original.JitNetworkAccessRequest type JitNetworkAccessRequestPort = original.JitNetworkAccessRequestPort type JitNetworkAccessRequestVirtualMachine = original.JitNetworkAccessRequestVirtualMachine type Kind = original.Kind +type ListCustomAlertRule = original.ListCustomAlertRule type Location = original.Location type LocationsClient = original.LocationsClient type Operation = original.Operation @@ -484,6 +569,7 @@ type Pricing = original.Pricing type PricingList = original.PricingList type PricingProperties = original.PricingProperties type PricingsClient = original.PricingsClient +type ProtectionMode = original.ProtectionMode type PublisherInfo = original.PublisherInfo type RecommendationConfigurationProperties = original.RecommendationConfigurationProperties type RegulatoryComplianceAssessment = original.RegulatoryComplianceAssessment @@ -505,17 +591,27 @@ type RegulatoryComplianceStandardListPage = original.RegulatoryComplianceStandar type RegulatoryComplianceStandardProperties = original.RegulatoryComplianceStandardProperties type RegulatoryComplianceStandardsClient = original.RegulatoryComplianceStandardsClient type Resource = original.Resource +type ResourceDetails = original.ResourceDetails +type SQLServerVulnerabilityProperties = original.SQLServerVulnerabilityProperties type SensitivityLabel = original.SensitivityLabel type ServerVulnerabilityAssessment = original.ServerVulnerabilityAssessment type ServerVulnerabilityAssessmentClient = original.ServerVulnerabilityAssessmentClient type ServerVulnerabilityAssessmentProperties = original.ServerVulnerabilityAssessmentProperties type ServerVulnerabilityAssessmentsList = original.ServerVulnerabilityAssessmentsList +type ServerVulnerabilityProperties = original.ServerVulnerabilityProperties type Setting = original.Setting type SettingResource = original.SettingResource type SettingsClient = original.SettingsClient type SettingsList = original.SettingsList type SettingsListIterator = original.SettingsListIterator type SettingsListPage = original.SettingsListPage +type SubAssessment = original.SubAssessment +type SubAssessmentList = original.SubAssessmentList +type SubAssessmentListIterator = original.SubAssessmentListIterator +type SubAssessmentListPage = original.SubAssessmentListPage +type SubAssessmentProperties = original.SubAssessmentProperties +type SubAssessmentStatus = original.SubAssessmentStatus +type SubAssessmentsClient = original.SubAssessmentsClient type TagsResource = original.TagsResource type Task = original.Task type TaskList = original.TaskList @@ -524,6 +620,8 @@ type TaskListPage = original.TaskListPage type TaskParameters = original.TaskParameters type TaskProperties = original.TaskProperties type TasksClient = original.TasksClient +type ThresholdCustomAlertRule = original.ThresholdCustomAlertRule +type TimeWindowCustomAlertRule = original.TimeWindowCustomAlertRule type TopologyClient = original.TopologyClient type TopologyList = original.TopologyList type TopologyListIterator = original.TopologyListIterator @@ -533,10 +631,12 @@ type TopologyResourceProperties = original.TopologyResourceProperties type TopologySingleResource = original.TopologySingleResource type TopologySingleResourceChild = original.TopologySingleResourceChild type TopologySingleResourceParent = original.TopologySingleResourceParent +type UpdateIoTSecuritySolutionProperties = original.UpdateIoTSecuritySolutionProperties type UpdateIotSecuritySolutionData = original.UpdateIotSecuritySolutionData type UserDefinedResourcesProperties = original.UserDefinedResourcesProperties type UserRecommendation = original.UserRecommendation type VMRecommendation = original.VMRecommendation +type VendorReference = original.VendorReference type WorkspaceSetting = original.WorkspaceSetting type WorkspaceSettingList = original.WorkspaceSettingList type WorkspaceSettingListIterator = original.WorkspaceSettingListIterator @@ -637,6 +737,18 @@ func NewContactsClient(subscriptionID string, ascLocation string) ContactsClient func NewContactsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) ContactsClient { return original.NewContactsClientWithBaseURI(baseURI, subscriptionID, ascLocation) } +func NewDeviceSecurityGroupListIterator(page DeviceSecurityGroupListPage) DeviceSecurityGroupListIterator { + return original.NewDeviceSecurityGroupListIterator(page) +} +func NewDeviceSecurityGroupListPage(getNextPage func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error)) DeviceSecurityGroupListPage { + return original.NewDeviceSecurityGroupListPage(getNextPage) +} +func NewDeviceSecurityGroupsClient(subscriptionID string, ascLocation string) DeviceSecurityGroupsClient { + return original.NewDeviceSecurityGroupsClient(subscriptionID, ascLocation) +} +func NewDeviceSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DeviceSecurityGroupsClient { + return original.NewDeviceSecurityGroupsClientWithBaseURI(baseURI, subscriptionID, ascLocation) +} func NewDiscoveredSecuritySolutionListIterator(page DiscoveredSecuritySolutionListPage) DiscoveredSecuritySolutionListIterator { return original.NewDiscoveredSecuritySolutionListIterator(page) } @@ -685,53 +797,17 @@ func NewIoTSecurityAggregatedRecommendationListIterator(page IoTSecurityAggregat func NewIoTSecurityAggregatedRecommendationListPage(getNextPage func(context.Context, IoTSecurityAggregatedRecommendationList) (IoTSecurityAggregatedRecommendationList, error)) IoTSecurityAggregatedRecommendationListPage { return original.NewIoTSecurityAggregatedRecommendationListPage(getNextPage) } -func NewIoTSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertClient { - return original.NewIoTSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID, ascLocation) -} -func NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertClient { - return original.NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI, subscriptionID, ascLocation) -} -func NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertsClient { - return original.NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClient(subscriptionID, ascLocation) -} -func NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertsClient { - return original.NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI(baseURI, subscriptionID, ascLocation) -} -func NewIoTSecuritySolutionsAnalyticsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsClient { - return original.NewIoTSecuritySolutionsAnalyticsClient(subscriptionID, ascLocation) -} -func NewIoTSecuritySolutionsAnalyticsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsClient { - return original.NewIoTSecuritySolutionsAnalyticsClientWithBaseURI(baseURI, subscriptionID, ascLocation) -} -func NewIoTSecuritySolutionsAnalyticsRecommendationClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationClient { - return original.NewIoTSecuritySolutionsAnalyticsRecommendationClient(subscriptionID, ascLocation) -} -func NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationClient { - return original.NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI, subscriptionID, ascLocation) -} -func NewIoTSecuritySolutionsAnalyticsRecommendationsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationsClient { - return original.NewIoTSecuritySolutionsAnalyticsRecommendationsClient(subscriptionID, ascLocation) -} -func NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationsClient { - return original.NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI(baseURI, subscriptionID, ascLocation) -} -func NewIoTSecuritySolutionsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsClient { - return original.NewIoTSecuritySolutionsClient(subscriptionID, ascLocation) -} -func NewIoTSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsClient { - return original.NewIoTSecuritySolutionsClientWithBaseURI(baseURI, subscriptionID, ascLocation) -} func NewIoTSecuritySolutionsListIterator(page IoTSecuritySolutionsListPage) IoTSecuritySolutionsListIterator { return original.NewIoTSecuritySolutionsListIterator(page) } func NewIoTSecuritySolutionsListPage(getNextPage func(context.Context, IoTSecuritySolutionsList) (IoTSecuritySolutionsList, error)) IoTSecuritySolutionsListPage { return original.NewIoTSecuritySolutionsListPage(getNextPage) } -func NewIoTSecuritySolutionsResourceGroupClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsResourceGroupClient { - return original.NewIoTSecuritySolutionsResourceGroupClient(subscriptionID, ascLocation) +func NewIotSecuritySolutionAnalyticsClient(subscriptionID string, ascLocation string) IotSecuritySolutionAnalyticsClient { + return original.NewIotSecuritySolutionAnalyticsClient(subscriptionID, ascLocation) } -func NewIoTSecuritySolutionsResourceGroupClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsResourceGroupClient { - return original.NewIoTSecuritySolutionsResourceGroupClientWithBaseURI(baseURI, subscriptionID, ascLocation) +func NewIotSecuritySolutionAnalyticsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionAnalyticsClient { + return original.NewIotSecuritySolutionAnalyticsClientWithBaseURI(baseURI, subscriptionID, ascLocation) } func NewIotSecuritySolutionClient(subscriptionID string, ascLocation string) IotSecuritySolutionClient { return original.NewIotSecuritySolutionClient(subscriptionID, ascLocation) @@ -739,6 +815,18 @@ func NewIotSecuritySolutionClient(subscriptionID string, ascLocation string) Iot func NewIotSecuritySolutionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionClient { return original.NewIotSecuritySolutionClientWithBaseURI(baseURI, subscriptionID, ascLocation) } +func NewIotSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsAggregatedAlertClient { + return original.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID, ascLocation) +} +func NewIotSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsAggregatedAlertClient { + return original.NewIotSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI, subscriptionID, ascLocation) +} +func NewIotSecuritySolutionsAnalyticsRecommendationClient(subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsRecommendationClient { + return original.NewIotSecuritySolutionsAnalyticsRecommendationClient(subscriptionID, ascLocation) +} +func NewIotSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsRecommendationClient { + return original.NewIotSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI, subscriptionID, ascLocation) +} func NewJitNetworkAccessPoliciesClient(subscriptionID string, ascLocation string) JitNetworkAccessPoliciesClient { return original.NewJitNetworkAccessPoliciesClient(subscriptionID, ascLocation) } @@ -829,6 +917,18 @@ func NewSettingsListIterator(page SettingsListPage) SettingsListIterator { func NewSettingsListPage(getNextPage func(context.Context, SettingsList) (SettingsList, error)) SettingsListPage { return original.NewSettingsListPage(getNextPage) } +func NewSubAssessmentListIterator(page SubAssessmentListPage) SubAssessmentListIterator { + return original.NewSubAssessmentListIterator(page) +} +func NewSubAssessmentListPage(getNextPage func(context.Context, SubAssessmentList) (SubAssessmentList, error)) SubAssessmentListPage { + return original.NewSubAssessmentListPage(getNextPage) +} +func NewSubAssessmentsClient(subscriptionID string, ascLocation string) SubAssessmentsClient { + return original.NewSubAssessmentsClient(subscriptionID, ascLocation) +} +func NewSubAssessmentsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SubAssessmentsClient { + return original.NewSubAssessmentsClientWithBaseURI(baseURI, subscriptionID, ascLocation) +} func NewTaskListIterator(page TaskListPage) TaskListIterator { return original.NewTaskListIterator(page) } @@ -880,6 +980,9 @@ func PossibleAlertNotificationsValues() []AlertNotifications { func PossibleAlertsToAdminsValues() []AlertsToAdmins { return original.PossibleAlertsToAdminsValues() } +func PossibleAssessedResourceTypeValues() []AssessedResourceType { + return original.PossibleAssessedResourceTypeValues() +} func PossibleAutoProvisionValues() []AutoProvision { return original.PossibleAutoProvisionValues() } @@ -904,6 +1007,12 @@ func PossibleEnforcementMode1Values() []EnforcementMode1 { func PossibleEnforcementModeValues() []EnforcementMode { return original.PossibleEnforcementModeValues() } +func PossibleExeValues() []Exe { + return original.PossibleExeValues() +} +func PossibleExecutableValues() []Executable { + return original.PossibleExecutableValues() +} func PossibleExportDataValues() []ExportData { return original.PossibleExportDataValues() } @@ -922,6 +1031,9 @@ func PossibleIssueValues() []Issue { func PossibleKindEnumValues() []KindEnum { return original.PossibleKindEnumValues() } +func PossibleMsiValues() []Msi { + return original.PossibleMsiValues() +} func PossiblePricingTierValues() []PricingTier { return original.PossiblePricingTierValues() } @@ -952,15 +1064,24 @@ func PossibleReportedSeverityValues() []ReportedSeverity { func PossibleResourceStatusValues() []ResourceStatus { return original.PossibleResourceStatusValues() } +func PossibleScriptValues() []Script { + return original.PossibleScriptValues() +} func PossibleSettingKindValues() []SettingKind { return original.PossibleSettingKindValues() } +func PossibleSeverityValues() []Severity { + return original.PossibleSeverityValues() +} func PossibleSolutionStatusValues() []SolutionStatus { return original.PossibleSolutionStatusValues() } func PossibleSourceSystemValues() []SourceSystem { return original.PossibleSourceSystemValues() } +func PossibleSourceValues() []Source { + return original.PossibleSourceValues() +} func PossibleStateValues() []State { return original.PossibleStateValues() } @@ -970,9 +1091,15 @@ func PossibleStatusReasonValues() []StatusReason { func PossibleStatusValues() []Status { return original.PossibleStatusValues() } +func PossibleSubAssessmentStatusCodeValues() []SubAssessmentStatusCode { + return original.PossibleSubAssessmentStatusCodeValues() +} func PossibleTypeValues() []Type { return original.PossibleTypeValues() } +func PossibleValueTypeValues() []ValueType { + return original.PossibleValueTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/preview/security/mgmt/security/securityapi/models.go b/profiles/preview/preview/security/mgmt/security/securityapi/models.go index f3f1649c0b39..6291ca8035f2 100644 --- a/profiles/preview/preview/security/mgmt/security/securityapi/models.go +++ b/profiles/preview/preview/security/mgmt/security/securityapi/models.go @@ -29,17 +29,14 @@ type AutoProvisioningSettingsClientAPI = original.AutoProvisioningSettingsClient type ComplianceResultsClientAPI = original.ComplianceResultsClientAPI type CompliancesClientAPI = original.CompliancesClientAPI type ContactsClientAPI = original.ContactsClientAPI +type DeviceSecurityGroupsClientAPI = original.DeviceSecurityGroupsClientAPI type DiscoveredSecuritySolutionsClientAPI = original.DiscoveredSecuritySolutionsClientAPI type ExternalSecuritySolutionsClientAPI = original.ExternalSecuritySolutionsClientAPI type InformationProtectionPoliciesClientAPI = original.InformationProtectionPoliciesClientAPI -type IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI = original.IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI -type IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI = original.IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI -type IoTSecuritySolutionsAnalyticsClientAPI = original.IoTSecuritySolutionsAnalyticsClientAPI -type IoTSecuritySolutionsAnalyticsRecommendationClientAPI = original.IoTSecuritySolutionsAnalyticsRecommendationClientAPI -type IoTSecuritySolutionsAnalyticsRecommendationsClientAPI = original.IoTSecuritySolutionsAnalyticsRecommendationsClientAPI -type IoTSecuritySolutionsClientAPI = original.IoTSecuritySolutionsClientAPI -type IoTSecuritySolutionsResourceGroupClientAPI = original.IoTSecuritySolutionsResourceGroupClientAPI +type IotSecuritySolutionAnalyticsClientAPI = original.IotSecuritySolutionAnalyticsClientAPI type IotSecuritySolutionClientAPI = original.IotSecuritySolutionClientAPI +type IotSecuritySolutionsAnalyticsAggregatedAlertClientAPI = original.IotSecuritySolutionsAnalyticsAggregatedAlertClientAPI +type IotSecuritySolutionsAnalyticsRecommendationClientAPI = original.IotSecuritySolutionsAnalyticsRecommendationClientAPI type JitNetworkAccessPoliciesClientAPI = original.JitNetworkAccessPoliciesClientAPI type LocationsClientAPI = original.LocationsClientAPI type OperationsClientAPI = original.OperationsClientAPI @@ -49,6 +46,7 @@ type RegulatoryComplianceControlsClientAPI = original.RegulatoryComplianceContro type RegulatoryComplianceStandardsClientAPI = original.RegulatoryComplianceStandardsClientAPI type ServerVulnerabilityAssessmentClientAPI = original.ServerVulnerabilityAssessmentClientAPI type SettingsClientAPI = original.SettingsClientAPI +type SubAssessmentsClientAPI = original.SubAssessmentsClientAPI type TasksClientAPI = original.TasksClientAPI type TopologyClientAPI = original.TopologyClientAPI type WorkspaceSettingsClientAPI = original.WorkspaceSettingsClientAPI diff --git a/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go b/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go index b3dbd8e93239..600b5eef0a5d 100644 --- a/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go +++ b/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go @@ -38,9 +38,9 @@ const ( type AlertRuleKind = original.AlertRuleKind const ( - Filter AlertRuleKind = original.Filter - Fusion AlertRuleKind = original.Fusion - Scheduled AlertRuleKind = original.Scheduled + Fusion AlertRuleKind = original.Fusion + MicrosoftSecurityIncidentCreation AlertRuleKind = original.MicrosoftSecurityIncidentCreation + Scheduled AlertRuleKind = original.Scheduled ) type AlertSeverity = original.AlertSeverity @@ -72,6 +72,7 @@ const ( Discovery AttackTactic = original.Discovery Execution AttackTactic = original.Execution Exfiltration AttackTactic = original.Exfiltration + Impact AttackTactic = original.Impact InitialAccess AttackTactic = original.InitialAccess LateralMovement AttackTactic = original.LateralMovement Persistence AttackTactic = original.Persistence @@ -233,24 +234,26 @@ const ( type Kind = original.Kind const ( - KindAlertRule Kind = original.KindAlertRule - KindScheduled Kind = original.KindScheduled + KindAggregations Kind = original.KindAggregations + KindCasesAggregation Kind = original.KindCasesAggregation ) -type KindBasicAggregations = original.KindBasicAggregations +type KindBasicAlertRule = original.KindBasicAlertRule const ( - KindAggregations KindBasicAggregations = original.KindAggregations - KindCasesAggregation KindBasicAggregations = original.KindCasesAggregation + KindAlertRule KindBasicAlertRule = original.KindAlertRule + KindFusion KindBasicAlertRule = original.KindFusion + KindMicrosoftSecurityIncidentCreation KindBasicAlertRule = original.KindMicrosoftSecurityIncidentCreation + KindScheduled KindBasicAlertRule = original.KindScheduled ) type KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplate const ( - KindBasicAlertRuleTemplateKindAlertRuleTemplate KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindAlertRuleTemplate - KindBasicAlertRuleTemplateKindFilter KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindFilter - KindBasicAlertRuleTemplateKindFusion KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindFusion - KindBasicAlertRuleTemplateKindScheduled KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindScheduled + KindBasicAlertRuleTemplateKindAlertRuleTemplate KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindAlertRuleTemplate + KindBasicAlertRuleTemplateKindFusion KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindFusion + KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation + KindBasicAlertRuleTemplateKindScheduled KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindScheduled ) type KindBasicDataConnector = original.KindBasicDataConnector @@ -303,6 +306,15 @@ const ( LicenseStatusEnabled LicenseStatus = original.LicenseStatusEnabled ) +type MicrosoftSecurityProductName = original.MicrosoftSecurityProductName + +const ( + AzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = original.AzureActiveDirectoryIdentityProtection + AzureAdvancedThreatProtection MicrosoftSecurityProductName = original.AzureAdvancedThreatProtection + AzureSecurityCenter MicrosoftSecurityProductName = original.AzureSecurityCenter + MicrosoftCloudAppSecurity MicrosoftSecurityProductName = original.MicrosoftCloudAppSecurity +) + type OSFamily = original.OSFamily const ( @@ -340,6 +352,19 @@ const ( RegistryValueKindUnknown RegistryValueKind = original.RegistryValueKindUnknown ) +type RelationNodeKind = original.RelationNodeKind + +const ( + RelationNodeKindBookmark RelationNodeKind = original.RelationNodeKindBookmark + RelationNodeKindCase RelationNodeKind = original.RelationNodeKindCase +) + +type RelationTypes = original.RelationTypes + +const ( + CasesToBookmarks RelationTypes = original.CasesToBookmarks +) + type SettingKind = original.SettingKind const ( @@ -379,8 +404,10 @@ type ASCDataConnector = original.ASCDataConnector type ASCDataConnectorProperties = original.ASCDataConnectorProperties type AccountEntity = original.AccountEntity type AccountEntityProperties = original.AccountEntityProperties -type Action = original.Action -type ActionProperties = original.ActionProperties +type ActionRequest = original.ActionRequest +type ActionRequestProperties = original.ActionRequestProperties +type ActionResponse = original.ActionResponse +type ActionResponseProperties = original.ActionResponseProperties type ActionsClient = original.ActionsClient type ActionsList = original.ActionsList type ActionsListIterator = original.ActionsListIterator @@ -393,6 +420,7 @@ type AlertRuleKind1 = original.AlertRuleKind1 type AlertRuleModel = original.AlertRuleModel type AlertRuleTemplate = original.AlertRuleTemplate type AlertRuleTemplateModel = original.AlertRuleTemplateModel +type AlertRuleTemplatePropertiesBase = original.AlertRuleTemplatePropertiesBase type AlertRuleTemplatesClient = original.AlertRuleTemplatesClient type AlertRuleTemplatesList = original.AlertRuleTemplatesList type AlertRuleTemplatesListIterator = original.AlertRuleTemplatesListIterator @@ -409,7 +437,6 @@ type AwsCloudTrailDataConnectorDataTypesLogs = original.AwsCloudTrailDataConnect type AwsCloudTrailDataConnectorProperties = original.AwsCloudTrailDataConnectorProperties type AzureResourceEntity = original.AzureResourceEntity type AzureResourceEntityProperties = original.AzureResourceEntityProperties -type BaseAlertRuleTemplateProperties = original.BaseAlertRuleTemplateProperties type BaseClient = original.BaseClient type BasicAggregations = original.BasicAggregations type BasicAlertRule = original.BasicAlertRule @@ -422,6 +449,12 @@ 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 type CaseComment = original.CaseComment @@ -434,6 +467,12 @@ type CaseList = original.CaseList type CaseListIterator = original.CaseListIterator type CaseListPage = original.CaseListPage type CaseProperties = original.CaseProperties +type CaseRelation = original.CaseRelation +type CaseRelationList = original.CaseRelationList +type CaseRelationListIterator = original.CaseRelationListIterator +type CaseRelationListPage = original.CaseRelationListPage +type CaseRelationProperties = original.CaseRelationProperties +type CaseRelationsClient = original.CaseRelationsClient type CasesAggregation = original.CasesAggregation type CasesAggregationBySeverityProperties = original.CasesAggregationBySeverityProperties type CasesAggregationByStatusProperties = original.CasesAggregationByStatusProperties @@ -481,12 +520,10 @@ type FileEntity = original.FileEntity type FileEntityProperties = original.FileEntityProperties type FileHashEntity = original.FileHashEntity type FileHashEntityProperties = original.FileHashEntityProperties -type FilterAlertRuleTemplate = original.FilterAlertRuleTemplate -type FilterAlertRuleTemplateProperties = original.FilterAlertRuleTemplateProperties -type FilterAlertRuleTemplatePropertiesModel = original.FilterAlertRuleTemplatePropertiesModel +type FusionAlertRule = original.FusionAlertRule +type FusionAlertRuleProperties = original.FusionAlertRuleProperties type FusionAlertRuleTemplate = original.FusionAlertRuleTemplate type FusionAlertRuleTemplateProperties = original.FusionAlertRuleTemplateProperties -type FusionAlertRuleTemplatePropertiesModel = original.FusionAlertRuleTemplatePropertiesModel type GeoLocation = original.GeoLocation type HostEntity = original.HostEntity type HostEntityProperties = original.HostEntityProperties @@ -500,6 +537,11 @@ type MDATPDataConnector = original.MDATPDataConnector type MDATPDataConnectorProperties = original.MDATPDataConnectorProperties type MalwareEntity = original.MalwareEntity type MalwareEntityProperties = original.MalwareEntityProperties +type MicrosoftSecurityIncidentCreationAlertRule = original.MicrosoftSecurityIncidentCreationAlertRule +type MicrosoftSecurityIncidentCreationAlertRuleCommonProperties = original.MicrosoftSecurityIncidentCreationAlertRuleCommonProperties +type MicrosoftSecurityIncidentCreationAlertRuleProperties = original.MicrosoftSecurityIncidentCreationAlertRuleProperties +type MicrosoftSecurityIncidentCreationAlertRuleTemplate = original.MicrosoftSecurityIncidentCreationAlertRuleTemplate +type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties = original.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties type OfficeConsent = original.OfficeConsent type OfficeConsentList = original.OfficeConsentList type OfficeConsentListIterator = original.OfficeConsentListIterator @@ -524,12 +566,17 @@ type RegistryKeyEntity = original.RegistryKeyEntity type RegistryKeyEntityProperties = original.RegistryKeyEntityProperties type RegistryValueEntity = original.RegistryValueEntity type RegistryValueEntityProperties = original.RegistryValueEntityProperties +type RelationBase = original.RelationBase +type RelationNode = original.RelationNode +type RelationsModelInput = original.RelationsModelInput +type RelationsModelInputProperties = original.RelationsModelInputProperties type Resource = original.Resource +type ResourceWithEtag = original.ResourceWithEtag type ScheduledAlertRule = original.ScheduledAlertRule +type ScheduledAlertRuleCommonProperties = original.ScheduledAlertRuleCommonProperties type ScheduledAlertRuleProperties = original.ScheduledAlertRuleProperties type ScheduledAlertRuleTemplate = original.ScheduledAlertRuleTemplate type ScheduledAlertRuleTemplateProperties = original.ScheduledAlertRuleTemplateProperties -type ScheduledAlertRuleTemplatePropertiesModel = original.ScheduledAlertRuleTemplatePropertiesModel type SecurityAlert = original.SecurityAlert type SecurityAlertProperties = original.SecurityAlertProperties type SecurityAlertPropertiesConfidenceReasonsItem = original.SecurityAlertPropertiesConfidenceReasonsItem @@ -596,6 +643,18 @@ 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) +} +func NewBookmarkRelationsClientWithBaseURI(baseURI string, subscriptionID string) BookmarkRelationsClient { + return original.NewBookmarkRelationsClientWithBaseURI(baseURI, subscriptionID) +} func NewBookmarksClient(subscriptionID string) BookmarksClient { return original.NewBookmarksClient(subscriptionID) } @@ -620,6 +679,18 @@ func NewCaseListIterator(page CaseListPage) CaseListIterator { func NewCaseListPage(getNextPage func(context.Context, CaseList) (CaseList, error)) CaseListPage { return original.NewCaseListPage(getNextPage) } +func NewCaseRelationListIterator(page CaseRelationListPage) CaseRelationListIterator { + return original.NewCaseRelationListIterator(page) +} +func NewCaseRelationListPage(getNextPage func(context.Context, CaseRelationList) (CaseRelationList, error)) CaseRelationListPage { + return original.NewCaseRelationListPage(getNextPage) +} +func NewCaseRelationsClient(subscriptionID string) CaseRelationsClient { + return original.NewCaseRelationsClient(subscriptionID) +} +func NewCaseRelationsClientWithBaseURI(baseURI string, subscriptionID string) CaseRelationsClient { + return original.NewCaseRelationsClientWithBaseURI(baseURI, subscriptionID) +} func NewCasesAggregationsClient(subscriptionID string) CasesAggregationsClient { return original.NewCasesAggregationsClient(subscriptionID) } @@ -761,12 +832,12 @@ func PossibleFileHashAlgorithmValues() []FileHashAlgorithm { func PossibleKillChainIntentValues() []KillChainIntent { return original.PossibleKillChainIntentValues() } -func PossibleKindBasicAggregationsValues() []KindBasicAggregations { - return original.PossibleKindBasicAggregationsValues() -} func PossibleKindBasicAlertRuleTemplateValues() []KindBasicAlertRuleTemplate { return original.PossibleKindBasicAlertRuleTemplateValues() } +func PossibleKindBasicAlertRuleValues() []KindBasicAlertRule { + return original.PossibleKindBasicAlertRuleValues() +} func PossibleKindBasicDataConnectorValues() []KindBasicDataConnector { return original.PossibleKindBasicDataConnectorValues() } @@ -782,6 +853,9 @@ func PossibleKindValues() []Kind { func PossibleLicenseStatusValues() []LicenseStatus { return original.PossibleLicenseStatusValues() } +func PossibleMicrosoftSecurityProductNameValues() []MicrosoftSecurityProductName { + return original.PossibleMicrosoftSecurityProductNameValues() +} func PossibleOSFamilyValues() []OSFamily { return original.PossibleOSFamilyValues() } @@ -791,6 +865,12 @@ func PossibleRegistryHiveValues() []RegistryHive { func PossibleRegistryValueKindValues() []RegistryValueKind { return original.PossibleRegistryValueKindValues() } +func PossibleRelationNodeKindValues() []RelationNodeKind { + return original.PossibleRelationNodeKindValues() +} +func PossibleRelationTypesValues() []RelationTypes { + return original.PossibleRelationTypesValues() +} func PossibleSettingKindValues() []SettingKind { return original.PossibleSettingKindValues() } diff --git a/profiles/preview/preview/securityinsight/mgmt/securityinsight/securityinsightapi/models.go b/profiles/preview/preview/securityinsight/mgmt/securityinsight/securityinsightapi/models.go index 8ab6cea80eac..bcfdeb4c208a 100644 --- a/profiles/preview/preview/securityinsight/mgmt/securityinsight/securityinsightapi/models.go +++ b/profiles/preview/preview/securityinsight/mgmt/securityinsight/securityinsightapi/models.go @@ -24,8 +24,10 @@ import original "github.com/Azure/azure-sdk-for-go/services/preview/securityinsi type ActionsClientAPI = original.ActionsClientAPI type AlertRuleTemplatesClientAPI = original.AlertRuleTemplatesClientAPI type AlertRulesClientAPI = original.AlertRulesClientAPI +type BookmarkRelationsClientAPI = original.BookmarkRelationsClientAPI type BookmarksClientAPI = original.BookmarksClientAPI type CaseCommentsClientAPI = original.CaseCommentsClientAPI +type CaseRelationsClientAPI = original.CaseRelationsClientAPI type CasesAggregationsClientAPI = original.CasesAggregationsClientAPI type CasesClientAPI = original.CasesClientAPI type CommentsClientAPI = original.CommentsClientAPI diff --git a/profiles/preview/preview/servicefabric/mgmt/servicefabric/models.go b/profiles/preview/preview/servicefabric/mgmt/servicefabric/models.go index 4799a26cb37b..6e2171d4fdc5 100644 --- a/profiles/preview/preview/servicefabric/mgmt/servicefabric/models.go +++ b/profiles/preview/preview/servicefabric/mgmt/servicefabric/models.go @@ -22,7 +22,7 @@ package servicefabric import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/servicefabric/mgmt/2019-03-01/servicefabric" + original "github.com/Azure/azure-sdk-for-go/services/preview/servicefabric/mgmt/2019-03-01-preview/servicefabric" ) const ( diff --git a/profiles/preview/preview/servicefabric/mgmt/servicefabric/servicefabricapi/models.go b/profiles/preview/preview/servicefabric/mgmt/servicefabric/servicefabricapi/models.go index 3432230e9701..92bebee141b6 100644 --- a/profiles/preview/preview/servicefabric/mgmt/servicefabric/servicefabricapi/models.go +++ b/profiles/preview/preview/servicefabric/mgmt/servicefabric/servicefabricapi/models.go @@ -19,7 +19,7 @@ package servicefabricapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/servicefabricapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/servicefabric/mgmt/2019-03-01-preview/servicefabric/servicefabricapi" type ApplicationTypeVersionsClientAPI = original.ApplicationTypeVersionsClientAPI type ApplicationTypesClientAPI = original.ApplicationTypesClientAPI diff --git a/profiles/preview/resources/mgmt/subscriptions/models.go b/profiles/preview/resources/mgmt/subscriptions/models.go index 116a1e96c80d..614c49b0119d 100644 --- a/profiles/preview/resources/mgmt/subscriptions/models.go +++ b/profiles/preview/resources/mgmt/subscriptions/models.go @@ -22,7 +22,7 @@ package subscriptions import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions" + original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions" ) const ( @@ -54,6 +54,7 @@ type ListResultIterator = original.ListResultIterator type ListResultPage = original.ListResultPage type Location = original.Location type LocationListResult = original.LocationListResult +type ManagedByTenant = original.ManagedByTenant type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult diff --git a/profiles/preview/resources/mgmt/subscriptions/subscriptionsapi/models.go b/profiles/preview/resources/mgmt/subscriptions/subscriptionsapi/models.go index 310ddf1a3680..160e7606fe40 100644 --- a/profiles/preview/resources/mgmt/subscriptions/subscriptionsapi/models.go +++ b/profiles/preview/resources/mgmt/subscriptions/subscriptionsapi/models.go @@ -19,7 +19,7 @@ package subscriptionsapi -import original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions/subscriptionsapi" +import original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/subscriptionsapi" type ClientAPI = original.ClientAPI type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/preview/servicebus/mgmt/servicebus/models.go b/profiles/preview/servicebus/mgmt/servicebus/models.go index 76d678ad4ab6..be8dcde4933b 100644 --- a/profiles/preview/servicebus/mgmt/servicebus/models.go +++ b/profiles/preview/servicebus/mgmt/servicebus/models.go @@ -187,6 +187,9 @@ type NamespacesClient = original.NamespacesClient type NamespacesCreateOrUpdateFuture = original.NamespacesCreateOrUpdateFuture type NamespacesDeleteFuture = original.NamespacesDeleteFuture type NetworkRuleSet = original.NetworkRuleSet +type NetworkRuleSetListResult = original.NetworkRuleSetListResult +type NetworkRuleSetListResultIterator = original.NetworkRuleSetListResultIterator +type NetworkRuleSetListResultPage = original.NetworkRuleSetListResultPage type NetworkRuleSetProperties = original.NetworkRuleSetProperties type Operation = original.Operation type OperationDisplay = original.OperationDisplay @@ -296,6 +299,12 @@ func NewNamespacesClient(subscriptionID string) NamespacesClient { func NewNamespacesClientWithBaseURI(baseURI string, subscriptionID string) NamespacesClient { return original.NewNamespacesClientWithBaseURI(baseURI, subscriptionID) } +func NewNetworkRuleSetListResultIterator(page NetworkRuleSetListResultPage) NetworkRuleSetListResultIterator { + return original.NewNetworkRuleSetListResultIterator(page) +} +func NewNetworkRuleSetListResultPage(getNextPage func(context.Context, NetworkRuleSetListResult) (NetworkRuleSetListResult, error)) NetworkRuleSetListResultPage { + return original.NewNetworkRuleSetListResultPage(getNextPage) +} func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return original.NewOperationListResultIterator(page) } diff --git a/profiles/preview/storage/datalake/storagedatalake/models.go b/profiles/preview/storage/datalake/storagedatalake/models.go index d5962ab997f3..da811c3a9849 100644 --- a/profiles/preview/storage/datalake/storagedatalake/models.go +++ b/profiles/preview/storage/datalake/storagedatalake/models.go @@ -19,7 +19,7 @@ package storagedatalake -import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-11-09/storagedatalake" +import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2019-10-31/storagedatalake" const ( DefaultDNSSuffix = original.DefaultDNSSuffix @@ -28,6 +28,7 @@ const ( type PathGetPropertiesAction = original.PathGetPropertiesAction const ( + CheckAccess PathGetPropertiesAction = original.CheckAccess GetAccessControl PathGetPropertiesAction = original.GetAccessControl GetStatus PathGetPropertiesAction = original.GetStatus ) diff --git a/profiles/preview/storage/datalake/storagedatalake/storagedatalakeapi/models.go b/profiles/preview/storage/datalake/storagedatalake/storagedatalakeapi/models.go index 278b9df7f518..fe6cd4856f06 100644 --- a/profiles/preview/storage/datalake/storagedatalake/storagedatalakeapi/models.go +++ b/profiles/preview/storage/datalake/storagedatalake/storagedatalakeapi/models.go @@ -19,7 +19,7 @@ package storagedatalakeapi -import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-11-09/storagedatalake/storagedatalakeapi" +import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2019-10-31/storagedatalake/storagedatalakeapi" type FilesystemClientAPI = original.FilesystemClientAPI type PathClientAPI = original.PathClientAPI diff --git a/profiles/preview/storage/mgmt/storage/models.go b/profiles/preview/storage/mgmt/storage/models.go index e95058a8ae40..bd83eed0e792 100644 --- a/profiles/preview/storage/mgmt/storage/models.go +++ b/profiles/preview/storage/mgmt/storage/models.go @@ -142,6 +142,13 @@ const ( StorageV2 Kind = original.StorageV2 ) +type LargeFileSharesState = original.LargeFileSharesState + +const ( + Disabled LargeFileSharesState = original.Disabled + Enabled LargeFileSharesState = original.Enabled +) + type LeaseDuration = original.LeaseDuration const ( @@ -282,6 +289,8 @@ type AccountCreateParameters = original.AccountCreateParameters type AccountKey = original.AccountKey type AccountListKeysResult = original.AccountListKeysResult type AccountListResult = original.AccountListResult +type AccountListResultIterator = original.AccountListResultIterator +type AccountListResultPage = original.AccountListResultPage type AccountProperties = original.AccountProperties type AccountPropertiesCreateParameters = original.AccountPropertiesCreateParameters type AccountPropertiesUpdateParameters = original.AccountPropertiesUpdateParameters @@ -300,7 +309,10 @@ type BlobServiceItems = original.BlobServiceItems type BlobServiceProperties = original.BlobServiceProperties type BlobServicePropertiesProperties = original.BlobServicePropertiesProperties type BlobServicesClient = original.BlobServicesClient +type ChangeFeed = original.ChangeFeed type CheckNameAvailabilityResult = original.CheckNameAvailabilityResult +type CloudError = original.CloudError +type CloudErrorBody = original.CloudErrorBody type ContainerProperties = original.ContainerProperties type CorsRule = original.CorsRule type CorsRules = original.CorsRules @@ -313,8 +325,6 @@ type Encryption = original.Encryption type EncryptionService = original.EncryptionService type EncryptionServices = original.EncryptionServices type Endpoints = original.Endpoints -type ErrorResponse = original.ErrorResponse -type ErrorResponseBody = original.ErrorResponseBody type FileServiceItems = original.FileServiceItems type FileServiceProperties = original.FileServiceProperties type FileServicePropertiesProperties = original.FileServicePropertiesProperties @@ -381,6 +391,12 @@ type VirtualNetworkRule = original.VirtualNetworkRule func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } +func NewAccountListResultIterator(page AccountListResultPage) AccountListResultIterator { + return original.NewAccountListResultIterator(page) +} +func NewAccountListResultPage(getNextPage func(context.Context, AccountListResult) (AccountListResult, error)) AccountListResultPage { + return original.NewAccountListResultPage(getNextPage) +} func NewAccountsClient(subscriptionID string) AccountsClient { return original.NewAccountsClient(subscriptionID) } @@ -495,6 +511,9 @@ func PossibleKeySourceValues() []KeySource { func PossibleKindValues() []Kind { return original.PossibleKindValues() } +func PossibleLargeFileSharesStateValues() []LargeFileSharesState { + return original.PossibleLargeFileSharesStateValues() +} func PossibleLeaseDurationValues() []LeaseDuration { return original.PossibleLeaseDurationValues() } diff --git a/services/apimanagement/mgmt/2019-01-01/apimanagement/models.go b/services/apimanagement/mgmt/2019-01-01/apimanagement/models.go index c12845902b2f..5895c52c995c 100644 --- a/services/apimanagement/mgmt/2019-01-01/apimanagement/models.go +++ b/services/apimanagement/mgmt/2019-01-01/apimanagement/models.go @@ -2119,8 +2119,6 @@ type AuthenticationSettingsContract struct { OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` // Openid - OpenID Connect Authentication Settings Openid *OpenIDAuthenticationSettingsContract `json:"openid,omitempty"` - // SubscriptionKeyRequired - Specifies whether subscription key is required during call to this API, true - API is included into closed products only, false - API is included into open products alone, null - there is a mix of products. - SubscriptionKeyRequired *bool `json:"subscriptionKeyRequired,omitempty"` } // AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. diff --git a/services/appinsights/mgmt/2015-05-01/insights/components.go b/services/appinsights/mgmt/2015-05-01/insights/components.go index e888411b04c6..12014255144e 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/components.go +++ b/services/appinsights/mgmt/2015-05-01/insights/components.go @@ -636,6 +636,11 @@ func (client ComponentsClient) ListByResourceGroupComplete(ctx context.Context, } // Purge purges data in an Application Insights component 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. // resourceName - the name of the Application Insights component resource. diff --git a/services/appinsights/v1/insights/client.go b/services/appinsights/v1/insights/client.go deleted file mode 100644 index 49ccf5f10da4..000000000000 --- a/services/appinsights/v1/insights/client.go +++ /dev/null @@ -1,49 +0,0 @@ -// Package insights implements the Azure ARM Insights service API version v1. -// -// Composite Swagger for Application Insights Data Client -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 ( - "github.com/Azure/go-autorest/autorest" -) - -const ( - // DefaultBaseURI is the default URI used for the service Insights - DefaultBaseURI = "https://api.applicationinsights.io/v1" -) - -// BaseClient is the base client for Insights. -type BaseClient struct { - autorest.Client - BaseURI string -} - -// New creates an instance of the BaseClient client. -func New() BaseClient { - return NewWithBaseURI(DefaultBaseURI) -} - -// NewWithBaseURI creates an instance of the BaseClient client. -func NewWithBaseURI(baseURI string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - } -} diff --git a/services/appinsights/v1/insights/events.go b/services/appinsights/v1/insights/events.go deleted file mode 100644 index 64825cbc74c6..000000000000 --- a/services/appinsights/v1/insights/events.go +++ /dev/null @@ -1,311 +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" -) - -// EventsClient is the composite Swagger for Application Insights Data Client -type EventsClient struct { - BaseClient -} - -// NewEventsClient creates an instance of the EventsClient client. -func NewEventsClient() EventsClient { - return NewEventsClientWithBaseURI(DefaultBaseURI) -} - -// NewEventsClientWithBaseURI creates an instance of the EventsClient client. -func NewEventsClientWithBaseURI(baseURI string) EventsClient { - return EventsClient{NewWithBaseURI(baseURI)} -} - -// Get gets the data for a single event -// Parameters: -// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure -// portal. -// eventType - the type of events to query; either a standard event type (`traces`, `customEvents`, -// `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all -// event types. -// eventID - ID of event. -// timespan - optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This -// timespan is applied in addition to any that are specified in the Odata expression. -func (client EventsClient) Get(ctx context.Context, appID string, eventType EventType, eventID string, timespan string) (result EventsResults, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EventsClient.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, eventType, eventID, timespan) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.EventsClient", "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.EventsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.EventsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client EventsClient) GetPreparer(ctx context.Context, appID string, eventType EventType, eventID string, timespan string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "eventId": autorest.Encode("path", eventID), - "eventType": autorest.Encode("path", eventType), - } - - queryParameters := map[string]interface{}{} - if len(timespan) > 0 { - queryParameters["timespan"] = autorest.Encode("query", timespan) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/events/{eventType}/{eventId}", 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 EventsClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 EventsClient) GetResponder(resp *http.Response) (result EventsResults, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetByType executes an OData query for events -// Parameters: -// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure -// portal. -// eventType - the type of events to query; either a standard event type (`traces`, `customEvents`, -// `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all -// event types. -// timespan - optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This -// timespan is applied in addition to any that are specified in the Odata expression. -// filter - an expression used to filter the returned events -// search - a free-text search expression to match for whether a particular event should be returned -// orderby - a comma-separated list of properties with \"asc\" (the default) or \"desc\" to control the order -// of returned events -// selectParameter - limits the properties to just those requested on each returned event -// skip - the number of items to skip over before returning events -// top - the number of events to return -// formatParameter - format for the returned events -// count - request a count of matching items included with the returned events -// apply - an expression used for aggregation over returned events -func (client EventsClient) GetByType(ctx context.Context, appID string, eventType EventType, timespan string, filter string, search string, orderby string, selectParameter string, skip *int32, top *int32, formatParameter string, count *bool, apply string) (result EventsResults, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EventsClient.GetByType") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetByTypePreparer(ctx, appID, eventType, timespan, filter, search, orderby, selectParameter, skip, top, formatParameter, count, apply) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetByType", nil, "Failure preparing request") - return - } - - resp, err := client.GetByTypeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetByType", resp, "Failure sending request") - return - } - - result, err = client.GetByTypeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetByType", resp, "Failure responding to request") - } - - return -} - -// GetByTypePreparer prepares the GetByType request. -func (client EventsClient) GetByTypePreparer(ctx context.Context, appID string, eventType EventType, timespan string, filter string, search string, orderby string, selectParameter string, skip *int32, top *int32, formatParameter string, count *bool, apply string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "eventType": autorest.Encode("path", eventType), - } - - queryParameters := map[string]interface{}{} - if len(timespan) > 0 { - queryParameters["timespan"] = autorest.Encode("query", timespan) - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(search) > 0 { - queryParameters["$search"] = autorest.Encode("query", search) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(formatParameter) > 0 { - queryParameters["$format"] = autorest.Encode("query", formatParameter) - } - if count != nil { - queryParameters["$count"] = autorest.Encode("query", *count) - } - if len(apply) > 0 { - queryParameters["$apply"] = autorest.Encode("query", apply) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/events/{eventType}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetByTypeSender sends the GetByType request. The method will close the -// http.Response Body if it receives an error. -func (client EventsClient) GetByTypeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetByTypeResponder handles the response to the GetByType request. The method always -// closes the http.Response Body. -func (client EventsClient) GetByTypeResponder(resp *http.Response) (result EventsResults, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetOdataMetadata gets OData EDMX metadata describing the event data model -// Parameters: -// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure -// portal. -func (client EventsClient) GetOdataMetadata(ctx context.Context, appID string) (result SetObject, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EventsClient.GetOdataMetadata") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetOdataMetadataPreparer(ctx, appID) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetOdataMetadata", nil, "Failure preparing request") - return - } - - resp, err := client.GetOdataMetadataSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetOdataMetadata", resp, "Failure sending request") - return - } - - result, err = client.GetOdataMetadataResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetOdataMetadata", resp, "Failure responding to request") - } - - return -} - -// GetOdataMetadataPreparer prepares the GetOdataMetadata request. -func (client EventsClient) GetOdataMetadataPreparer(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}/events/$metadata", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetOdataMetadataSender sends the GetOdataMetadata request. The method will close the -// http.Response Body if it receives an error. -func (client EventsClient) GetOdataMetadataSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetOdataMetadataResponder handles the response to the GetOdataMetadata request. The method always -// closes the http.Response Body. -func (client EventsClient) GetOdataMetadataResponder(resp *http.Response) (result SetObject, 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/appinsights/v1/insights/metrics.go b/services/appinsights/v1/insights/metrics.go deleted file mode 100644 index 70f525fd57dc..000000000000 --- a/services/appinsights/v1/insights/metrics.go +++ /dev/null @@ -1,314 +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/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// MetricsClient is the composite Swagger for Application Insights Data Client -type MetricsClient struct { - BaseClient -} - -// NewMetricsClient creates an instance of the MetricsClient client. -func NewMetricsClient() MetricsClient { - return NewMetricsClientWithBaseURI(DefaultBaseURI) -} - -// NewMetricsClientWithBaseURI creates an instance of the MetricsClient client. -func NewMetricsClientWithBaseURI(baseURI string) MetricsClient { - return MetricsClient{NewWithBaseURI(baseURI)} -} - -// Get gets metric values for a single metric -// Parameters: -// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure -// portal. -// metricID - ID of the metric. This is either a standard AI metric, or an application-specific custom metric. -// timespan - the timespan over which to retrieve metric values. This is an ISO8601 time period value. If -// timespan is omitted, a default time range of `PT12H` ("last 12 hours") is used. The actual timespan that is -// queried may be adjusted by the server based. In all cases, the actual time span used for the query is -// included in the response. -// interval - the time interval to use when retrieving metric values. This is an ISO8601 duration. If interval -// is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server -// may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases, -// the actual interval used for the query is included in the response. -// aggregation - the aggregation to use when computing the metric values. To retrieve more than one aggregation -// at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the -// metric is used. -// segment - the name of the dimension to segment the metric values by. This dimension must be applicable to -// the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma -// (,). In this case, the metric data will be segmented in the order the dimensions are listed in the -// parameter. -// top - the number of segments to return. This value is only valid when segment is specified. -// orderby - the aggregation function and direction to sort the segments by. This value is only valid when -// segment is specified. -// filter - an expression used to filter the results. This value should be a valid OData filter expression -// where the keys of each clause should be applicable dimensions for the metric you are retrieving. -func (client MetricsClient) Get(ctx context.Context, appID string, metricID MetricID, timespan string, interval *string, aggregation []MetricsAggregation, segment []MetricsSegment, top *int32, orderby string, filter string) (result MetricsResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/MetricsClient.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: aggregation, - Constraints: []validation.Constraint{{Target: "aggregation", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "aggregation", Name: validation.MinItems, Rule: 1, Chain: nil}}}}}, - {TargetValue: segment, - Constraints: []validation.Constraint{{Target: "segment", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "segment", Name: validation.MinItems, Rule: 1, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("insights.MetricsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, appID, metricID, timespan, interval, aggregation, segment, top, orderby, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.MetricsClient", "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.MetricsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.MetricsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client MetricsClient) GetPreparer(ctx context.Context, appID string, metricID MetricID, timespan string, interval *string, aggregation []MetricsAggregation, segment []MetricsSegment, top *int32, orderby string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "metricId": autorest.Encode("path", metricID), - } - - queryParameters := map[string]interface{}{} - if len(timespan) > 0 { - queryParameters["timespan"] = autorest.Encode("query", timespan) - } - if interval != nil { - queryParameters["interval"] = autorest.Encode("query", *interval) - } - if aggregation != nil && len(aggregation) > 0 { - queryParameters["aggregation"] = autorest.Encode("query", aggregation, ",") - } - if segment != nil && len(segment) > 0 { - queryParameters["segment"] = autorest.Encode("query", segment, ",") - } - if top != nil { - queryParameters["top"] = autorest.Encode("query", *top) - } - if len(orderby) > 0 { - queryParameters["orderby"] = autorest.Encode("query", orderby) - } - if len(filter) > 0 { - queryParameters["filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/metrics/{metricId}", 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 MetricsClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 MetricsClient) GetResponder(resp *http.Response) (result MetricsResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetMetadata gets metadata describing the available metrics -// Parameters: -// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure -// portal. -func (client MetricsClient) GetMetadata(ctx context.Context, appID string) (result SetObject, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/MetricsClient.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, appID) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMetadata", nil, "Failure preparing request") - return - } - - resp, err := client.GetMetadataSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMetadata", resp, "Failure sending request") - return - } - - result, err = client.GetMetadataResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMetadata", resp, "Failure responding to request") - } - - return -} - -// GetMetadataPreparer prepares the GetMetadata request. -func (client MetricsClient) GetMetadataPreparer(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}/metrics/metadata", pathParameters)) - 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 MetricsClient) GetMetadataSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 MetricsClient) GetMetadataResponder(resp *http.Response) (result SetObject, 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 -} - -// GetMultiple gets metric values for multiple metrics -// Parameters: -// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure -// portal. -// body - the batched metrics query. -func (client MetricsClient) GetMultiple(ctx context.Context, appID string, body []MetricsPostBodySchema) (result ListMetricsResultsItem, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/MetricsClient.GetMultiple") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("insights.MetricsClient", "GetMultiple", err.Error()) - } - - req, err := client.GetMultiplePreparer(ctx, appID, body) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMultiple", nil, "Failure preparing request") - return - } - - resp, err := client.GetMultipleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMultiple", resp, "Failure sending request") - return - } - - result, err = client.GetMultipleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMultiple", resp, "Failure responding to request") - } - - return -} - -// GetMultiplePreparer prepares the GetMultiple request. -func (client MetricsClient) GetMultiplePreparer(ctx context.Context, appID string, body []MetricsPostBodySchema) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/metrics", pathParameters), - autorest.WithJSON(body)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetMultipleSender sends the GetMultiple request. The method will close the -// http.Response Body if it receives an error. -func (client MetricsClient) GetMultipleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetMultipleResponder handles the response to the GetMultiple request. The method always -// closes the http.Response Body. -func (client MetricsClient) GetMultipleResponder(resp *http.Response) (result ListMetricsResultsItem, 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/appinsights/v1/insights/models.go b/services/appinsights/v1/insights/models.go deleted file mode 100644 index 5165da8b8723..000000000000 --- a/services/appinsights/v1/insights/models.go +++ /dev/null @@ -1,2554 +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 ( - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/date" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights" - -// EventType enumerates the values for event type. -type EventType string - -const ( - // All ... - All EventType = "$all" - // AvailabilityResults ... - AvailabilityResults EventType = "availabilityResults" - // BrowserTimings ... - BrowserTimings EventType = "browserTimings" - // CustomEvents ... - CustomEvents EventType = "customEvents" - // CustomMetrics ... - CustomMetrics EventType = "customMetrics" - // Dependencies ... - Dependencies EventType = "dependencies" - // Exceptions ... - Exceptions EventType = "exceptions" - // PageViews ... - PageViews EventType = "pageViews" - // PerformanceCounters ... - PerformanceCounters EventType = "performanceCounters" - // Requests ... - Requests EventType = "requests" - // Traces ... - Traces EventType = "traces" -) - -// PossibleEventTypeValues returns an array of possible values for the EventType const type. -func PossibleEventTypeValues() []EventType { - return []EventType{All, AvailabilityResults, BrowserTimings, CustomEvents, CustomMetrics, Dependencies, Exceptions, PageViews, PerformanceCounters, Requests, Traces} -} - -// MetricID enumerates the values for metric id. -type MetricID string - -const ( - // AvailabilityResultsavailabilityPercentage ... - AvailabilityResultsavailabilityPercentage MetricID = "availabilityResults/availabilityPercentage" - // AvailabilityResultsduration ... - AvailabilityResultsduration MetricID = "availabilityResults/duration" - // BillingtelemetryCount ... - BillingtelemetryCount MetricID = "billing/telemetryCount" - // ClientnetworkDuration ... - ClientnetworkDuration MetricID = "client/networkDuration" - // ClientprocessingDuration ... - ClientprocessingDuration MetricID = "client/processingDuration" - // ClientreceiveDuration ... - ClientreceiveDuration MetricID = "client/receiveDuration" - // ClientsendDuration ... - ClientsendDuration MetricID = "client/sendDuration" - // ClienttotalDuration ... - ClienttotalDuration MetricID = "client/totalDuration" - // CustomEventscount ... - CustomEventscount MetricID = "customEvents/count" - // Dependenciescount ... - Dependenciescount MetricID = "dependencies/count" - // Dependenciesduration ... - Dependenciesduration MetricID = "dependencies/duration" - // Dependenciesfailed ... - Dependenciesfailed MetricID = "dependencies/failed" - // Exceptionsbrowser ... - Exceptionsbrowser MetricID = "exceptions/browser" - // Exceptionscount ... - Exceptionscount MetricID = "exceptions/count" - // Exceptionsserver ... - Exceptionsserver MetricID = "exceptions/server" - // PageViewscount ... - PageViewscount MetricID = "pageViews/count" - // PageViewsduration ... - PageViewsduration MetricID = "pageViews/duration" - // PerformanceCountersexceptionsPerSecond ... - PerformanceCountersexceptionsPerSecond MetricID = "performanceCounters/exceptionsPerSecond" - // PerformanceCountersmemoryAvailableBytes ... - PerformanceCountersmemoryAvailableBytes MetricID = "performanceCounters/memoryAvailableBytes" - // PerformanceCountersprocessCPUPercentage ... - PerformanceCountersprocessCPUPercentage MetricID = "performanceCounters/processCpuPercentage" - // PerformanceCountersprocessIOBytesPerSecond ... - PerformanceCountersprocessIOBytesPerSecond MetricID = "performanceCounters/processIOBytesPerSecond" - // PerformanceCountersprocessorCPUPercentage ... - PerformanceCountersprocessorCPUPercentage MetricID = "performanceCounters/processorCpuPercentage" - // PerformanceCountersprocessPrivateBytes ... - PerformanceCountersprocessPrivateBytes MetricID = "performanceCounters/processPrivateBytes" - // PerformanceCountersrequestExecutionTime ... - PerformanceCountersrequestExecutionTime MetricID = "performanceCounters/requestExecutionTime" - // PerformanceCountersrequestsInQueue ... - PerformanceCountersrequestsInQueue MetricID = "performanceCounters/requestsInQueue" - // PerformanceCountersrequestsPerSecond ... - PerformanceCountersrequestsPerSecond MetricID = "performanceCounters/requestsPerSecond" - // Requestscount ... - Requestscount MetricID = "requests/count" - // Requestsduration ... - Requestsduration MetricID = "requests/duration" - // Requestsfailed ... - Requestsfailed MetricID = "requests/failed" - // Sessionscount ... - Sessionscount MetricID = "sessions/count" - // Usersauthenticated ... - Usersauthenticated MetricID = "users/authenticated" - // Userscount ... - Userscount MetricID = "users/count" -) - -// PossibleMetricIDValues returns an array of possible values for the MetricID const type. -func PossibleMetricIDValues() []MetricID { - return []MetricID{AvailabilityResultsavailabilityPercentage, AvailabilityResultsduration, BillingtelemetryCount, ClientnetworkDuration, ClientprocessingDuration, ClientreceiveDuration, ClientsendDuration, ClienttotalDuration, CustomEventscount, Dependenciescount, Dependenciesduration, Dependenciesfailed, Exceptionsbrowser, Exceptionscount, Exceptionsserver, PageViewscount, PageViewsduration, PerformanceCountersexceptionsPerSecond, PerformanceCountersmemoryAvailableBytes, PerformanceCountersprocessCPUPercentage, PerformanceCountersprocessIOBytesPerSecond, PerformanceCountersprocessorCPUPercentage, PerformanceCountersprocessPrivateBytes, PerformanceCountersrequestExecutionTime, PerformanceCountersrequestsInQueue, PerformanceCountersrequestsPerSecond, Requestscount, Requestsduration, Requestsfailed, Sessionscount, Usersauthenticated, Userscount} -} - -// MetricsAggregation enumerates the values for metrics aggregation. -type MetricsAggregation string - -const ( - // Avg ... - Avg MetricsAggregation = "avg" - // Count ... - Count MetricsAggregation = "count" - // Max ... - Max MetricsAggregation = "max" - // Min ... - Min MetricsAggregation = "min" - // Sum ... - Sum MetricsAggregation = "sum" - // Unique ... - Unique MetricsAggregation = "unique" -) - -// PossibleMetricsAggregationValues returns an array of possible values for the MetricsAggregation const type. -func PossibleMetricsAggregationValues() []MetricsAggregation { - return []MetricsAggregation{Avg, Count, Max, Min, Sum, Unique} -} - -// MetricsSegment enumerates the values for metrics segment. -type MetricsSegment string - -const ( - // ApplicationBuild ... - ApplicationBuild MetricsSegment = "applicationBuild" - // ApplicationVersion ... - ApplicationVersion MetricsSegment = "applicationVersion" - // AuthenticatedOrAnonymousTraffic ... - AuthenticatedOrAnonymousTraffic MetricsSegment = "authenticatedOrAnonymousTraffic" - // Browser ... - Browser MetricsSegment = "browser" - // BrowserVersion ... - BrowserVersion MetricsSegment = "browserVersion" - // City ... - City MetricsSegment = "city" - // CloudRoleName ... - CloudRoleName MetricsSegment = "cloudRoleName" - // CloudServiceName ... - CloudServiceName MetricsSegment = "cloudServiceName" - // Continent ... - Continent MetricsSegment = "continent" - // CountryOrRegion ... - CountryOrRegion MetricsSegment = "countryOrRegion" - // DeploymentID ... - DeploymentID MetricsSegment = "deploymentId" - // DeploymentUnit ... - DeploymentUnit MetricsSegment = "deploymentUnit" - // DeviceType ... - DeviceType MetricsSegment = "deviceType" - // Environment ... - Environment MetricsSegment = "environment" - // HostingLocation ... - HostingLocation MetricsSegment = "hostingLocation" - // InstanceName ... - InstanceName MetricsSegment = "instanceName" -) - -// PossibleMetricsSegmentValues returns an array of possible values for the MetricsSegment const type. -func PossibleMetricsSegmentValues() []MetricsSegment { - return []MetricsSegment{ApplicationBuild, ApplicationVersion, AuthenticatedOrAnonymousTraffic, Browser, BrowserVersion, City, CloudRoleName, CloudServiceName, Continent, CountryOrRegion, DeploymentID, DeploymentUnit, DeviceType, Environment, HostingLocation, InstanceName} -} - -// Type enumerates the values for type. -type Type string - -const ( - // TypeAvailabilityResult ... - TypeAvailabilityResult Type = "availabilityResult" - // TypeBrowserTiming ... - TypeBrowserTiming Type = "browserTiming" - // TypeCustomEvent ... - TypeCustomEvent Type = "customEvent" - // TypeCustomMetric ... - TypeCustomMetric Type = "customMetric" - // TypeDependency ... - TypeDependency Type = "dependency" - // TypeEventsResultData ... - TypeEventsResultData Type = "eventsResultData" - // TypeException ... - TypeException Type = "exception" - // TypePageView ... - TypePageView Type = "pageView" - // TypePerformanceCounter ... - TypePerformanceCounter Type = "performanceCounter" - // TypeRequest ... - TypeRequest Type = "request" - // TypeTrace ... - TypeTrace Type = "trace" -) - -// PossibleTypeValues returns an array of possible values for the Type const type. -func PossibleTypeValues() []Type { - return []Type{TypeAvailabilityResult, TypeBrowserTiming, TypeCustomEvent, TypeCustomMetric, TypeDependency, TypeEventsResultData, TypeException, TypePageView, TypePerformanceCounter, TypeRequest, TypeTrace} -} - -// Column a column in a table. -type Column struct { - // Name - The name of this column. - Name *string `json:"name,omitempty"` - // Type - The data type of this column. - Type *string `json:"type,omitempty"` -} - -// ErrorDetail ... -type ErrorDetail struct { - // Code - The error's code. - Code *string `json:"code,omitempty"` - // Message - A human readable error message. - Message *string `json:"message,omitempty"` - // Target - Indicates which property in the request is responsible for the error. - Target *string `json:"target,omitempty"` - // Value - Indicates which value in 'target' is responsible for the error. - Value *string `json:"value,omitempty"` - // Resources - Indicates resources which were responsible for the error. - Resources *[]string `json:"resources,omitempty"` - AdditionalProperties interface{} `json:"additionalProperties,omitempty"` -} - -// ErrorInfo ... -type ErrorInfo struct { - // Code - A machine readable error code. - Code *string `json:"code,omitempty"` - // Message - A human readable error message. - Message *string `json:"message,omitempty"` - // Details - error details. - Details *[]ErrorDetail `json:"details,omitempty"` - // Innererror - Inner error details if they exist. - Innererror *ErrorInfo `json:"innererror,omitempty"` - AdditionalProperties interface{} `json:"additionalProperties,omitempty"` -} - -// ErrorResponse contains details when the response code indicates an error. -type ErrorResponse struct { - // Error - The error details. - Error *ErrorInfo `json:"error,omitempty"` -} - -// EventsAiInfo AI related application info for an event result -type EventsAiInfo struct { - // IKey - iKey of the app - IKey *string `json:"iKey,omitempty"` - // AppName - Name of the application - AppName *string `json:"appName,omitempty"` - // AppID - ID of the application - AppID *string `json:"appId,omitempty"` - // SdkVersion - SDK version of the application - SdkVersion *string `json:"sdkVersion,omitempty"` -} - -// EventsApplicationInfo application info for an event result -type EventsApplicationInfo struct { - // Version - Version of the application - Version *string `json:"version,omitempty"` -} - -// EventsAvailabilityResultInfo the availability result info -type EventsAvailabilityResultInfo struct { - // Name - The name of the availability result - Name *string `json:"name,omitempty"` - // Success - Indicates if the availability result was successful - Success *string `json:"success,omitempty"` - // Duration - The duration of the availability result - Duration *int64 `json:"duration,omitempty"` - // PerformanceBucket - The performance bucket of the availability result - PerformanceBucket *string `json:"performanceBucket,omitempty"` - // Message - The message of the availability result - Message *string `json:"message,omitempty"` - // Location - The location of the availability result - Location *string `json:"location,omitempty"` - // ID - The ID of the availability result - ID *string `json:"id,omitempty"` - // Size - The size of the availability result - Size *string `json:"size,omitempty"` -} - -// EventsAvailabilityResultResult an availability result result -type EventsAvailabilityResultResult struct { - AvailabilityResult *EventsAvailabilityResultInfo `json:"availabilityResult,omitempty"` - // ID - The unique ID for this event. - ID *string `json:"id,omitempty"` - // Count - Count of the event - Count *int64 `json:"count,omitempty"` - // Timestamp - Timestamp of the event - Timestamp *date.Time `json:"timestamp,omitempty"` - // CustomDimensions - Custom dimensions of the event - CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"` - // CustomMeasurements - Custom measurements of the event - CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"` - // Operation - Operation info of the event - Operation *EventsOperationInfo `json:"operation,omitempty"` - // Session - Session info of the event - Session *EventsSessionInfo `json:"session,omitempty"` - // User - User info of the event - User *EventsUserInfo `json:"user,omitempty"` - // Cloud - Cloud info of the event - Cloud *EventsCloudInfo `json:"cloud,omitempty"` - // Ai - AI info of the event - Ai *EventsAiInfo `json:"ai,omitempty"` - // Application - Application info of the event - Application *EventsApplicationInfo `json:"application,omitempty"` - // Client - Client info of the event - Client *EventsClientInfo `json:"client,omitempty"` - // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EventsAvailabilityResultResult. -func (earr EventsAvailabilityResultResult) MarshalJSON() ([]byte, error) { - earr.Type = TypeAvailabilityResult - objectMap := make(map[string]interface{}) - if earr.AvailabilityResult != nil { - objectMap["availabilityResult"] = earr.AvailabilityResult - } - if earr.ID != nil { - objectMap["id"] = earr.ID - } - if earr.Count != nil { - objectMap["count"] = earr.Count - } - if earr.Timestamp != nil { - objectMap["timestamp"] = earr.Timestamp - } - if earr.CustomDimensions != nil { - objectMap["customDimensions"] = earr.CustomDimensions - } - if earr.CustomMeasurements != nil { - objectMap["customMeasurements"] = earr.CustomMeasurements - } - if earr.Operation != nil { - objectMap["operation"] = earr.Operation - } - if earr.Session != nil { - objectMap["session"] = earr.Session - } - if earr.User != nil { - objectMap["user"] = earr.User - } - if earr.Cloud != nil { - objectMap["cloud"] = earr.Cloud - } - if earr.Ai != nil { - objectMap["ai"] = earr.Ai - } - if earr.Application != nil { - objectMap["application"] = earr.Application - } - if earr.Client != nil { - objectMap["client"] = earr.Client - } - if earr.Type != "" { - objectMap["type"] = earr.Type - } - return json.Marshal(objectMap) -} - -// AsEventsTraceResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult. -func (earr EventsAvailabilityResultResult) AsEventsTraceResult() (*EventsTraceResult, bool) { - return nil, false -} - -// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult. -func (earr EventsAvailabilityResultResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) { - return nil, false -} - -// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult. -func (earr EventsAvailabilityResultResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) { - return nil, false -} - -// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult. -func (earr EventsAvailabilityResultResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) { - return nil, false -} - -// AsEventsRequestResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult. -func (earr EventsAvailabilityResultResult) AsEventsRequestResult() (*EventsRequestResult, bool) { - return nil, false -} - -// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult. -func (earr EventsAvailabilityResultResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) { - return nil, false -} - -// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult. -func (earr EventsAvailabilityResultResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) { - return nil, false -} - -// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult. -func (earr EventsAvailabilityResultResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) { - return &earr, true -} - -// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult. -func (earr EventsAvailabilityResultResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) { - return nil, false -} - -// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult. -func (earr EventsAvailabilityResultResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) { - return nil, false -} - -// AsEventsResultData is the BasicEventsResultData implementation for EventsAvailabilityResultResult. -func (earr EventsAvailabilityResultResult) AsEventsResultData() (*EventsResultData, bool) { - return nil, false -} - -// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsAvailabilityResultResult. -func (earr EventsAvailabilityResultResult) AsBasicEventsResultData() (BasicEventsResultData, bool) { - return &earr, true -} - -// EventsBrowserTimingInfo the browser timing information -type EventsBrowserTimingInfo struct { - // URLPath - The path of the URL - URLPath *string `json:"urlPath,omitempty"` - // URLHost - The host of the URL - URLHost *string `json:"urlHost,omitempty"` - // Name - The name of the page - Name *string `json:"name,omitempty"` - // URL - The url of the page - URL *string `json:"url,omitempty"` - // TotalDuration - The total duration of the load - TotalDuration *int64 `json:"totalDuration,omitempty"` - // PerformanceBucket - The performance bucket of the load - PerformanceBucket *string `json:"performanceBucket,omitempty"` - // NetworkDuration - The network duration of the load - NetworkDuration *int64 `json:"networkDuration,omitempty"` - // SendDuration - The send duration of the load - SendDuration *int64 `json:"sendDuration,omitempty"` - // ReceiveDuration - The receive duration of the load - ReceiveDuration *int64 `json:"receiveDuration,omitempty"` - // ProcessingDuration - The processing duration of the load - ProcessingDuration *int64 `json:"processingDuration,omitempty"` -} - -// EventsBrowserTimingResult a browser timing result -type EventsBrowserTimingResult struct { - BrowserTiming *EventsBrowserTimingInfo `json:"browserTiming,omitempty"` - ClientPerformance *EventsClientPerformanceInfo `json:"clientPerformance,omitempty"` - // ID - The unique ID for this event. - ID *string `json:"id,omitempty"` - // Count - Count of the event - Count *int64 `json:"count,omitempty"` - // Timestamp - Timestamp of the event - Timestamp *date.Time `json:"timestamp,omitempty"` - // CustomDimensions - Custom dimensions of the event - CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"` - // CustomMeasurements - Custom measurements of the event - CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"` - // Operation - Operation info of the event - Operation *EventsOperationInfo `json:"operation,omitempty"` - // Session - Session info of the event - Session *EventsSessionInfo `json:"session,omitempty"` - // User - User info of the event - User *EventsUserInfo `json:"user,omitempty"` - // Cloud - Cloud info of the event - Cloud *EventsCloudInfo `json:"cloud,omitempty"` - // Ai - AI info of the event - Ai *EventsAiInfo `json:"ai,omitempty"` - // Application - Application info of the event - Application *EventsApplicationInfo `json:"application,omitempty"` - // Client - Client info of the event - Client *EventsClientInfo `json:"client,omitempty"` - // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EventsBrowserTimingResult. -func (ebtr EventsBrowserTimingResult) MarshalJSON() ([]byte, error) { - ebtr.Type = TypeBrowserTiming - objectMap := make(map[string]interface{}) - if ebtr.BrowserTiming != nil { - objectMap["browserTiming"] = ebtr.BrowserTiming - } - if ebtr.ClientPerformance != nil { - objectMap["clientPerformance"] = ebtr.ClientPerformance - } - if ebtr.ID != nil { - objectMap["id"] = ebtr.ID - } - if ebtr.Count != nil { - objectMap["count"] = ebtr.Count - } - if ebtr.Timestamp != nil { - objectMap["timestamp"] = ebtr.Timestamp - } - if ebtr.CustomDimensions != nil { - objectMap["customDimensions"] = ebtr.CustomDimensions - } - if ebtr.CustomMeasurements != nil { - objectMap["customMeasurements"] = ebtr.CustomMeasurements - } - if ebtr.Operation != nil { - objectMap["operation"] = ebtr.Operation - } - if ebtr.Session != nil { - objectMap["session"] = ebtr.Session - } - if ebtr.User != nil { - objectMap["user"] = ebtr.User - } - if ebtr.Cloud != nil { - objectMap["cloud"] = ebtr.Cloud - } - if ebtr.Ai != nil { - objectMap["ai"] = ebtr.Ai - } - if ebtr.Application != nil { - objectMap["application"] = ebtr.Application - } - if ebtr.Client != nil { - objectMap["client"] = ebtr.Client - } - if ebtr.Type != "" { - objectMap["type"] = ebtr.Type - } - return json.Marshal(objectMap) -} - -// AsEventsTraceResult is the BasicEventsResultData implementation for EventsBrowserTimingResult. -func (ebtr EventsBrowserTimingResult) AsEventsTraceResult() (*EventsTraceResult, bool) { - return nil, false -} - -// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsBrowserTimingResult. -func (ebtr EventsBrowserTimingResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) { - return nil, false -} - -// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsBrowserTimingResult. -func (ebtr EventsBrowserTimingResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) { - return nil, false -} - -// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsBrowserTimingResult. -func (ebtr EventsBrowserTimingResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) { - return &ebtr, true -} - -// AsEventsRequestResult is the BasicEventsResultData implementation for EventsBrowserTimingResult. -func (ebtr EventsBrowserTimingResult) AsEventsRequestResult() (*EventsRequestResult, bool) { - return nil, false -} - -// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsBrowserTimingResult. -func (ebtr EventsBrowserTimingResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) { - return nil, false -} - -// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsBrowserTimingResult. -func (ebtr EventsBrowserTimingResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) { - return nil, false -} - -// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsBrowserTimingResult. -func (ebtr EventsBrowserTimingResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) { - return nil, false -} - -// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsBrowserTimingResult. -func (ebtr EventsBrowserTimingResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) { - return nil, false -} - -// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsBrowserTimingResult. -func (ebtr EventsBrowserTimingResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) { - return nil, false -} - -// AsEventsResultData is the BasicEventsResultData implementation for EventsBrowserTimingResult. -func (ebtr EventsBrowserTimingResult) AsEventsResultData() (*EventsResultData, bool) { - return nil, false -} - -// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsBrowserTimingResult. -func (ebtr EventsBrowserTimingResult) AsBasicEventsResultData() (BasicEventsResultData, bool) { - return &ebtr, true -} - -// EventsClientInfo client info for an event result -type EventsClientInfo struct { - // Model - Model of the client - Model *string `json:"model,omitempty"` - // Os - Operating system of the client - Os *string `json:"os,omitempty"` - // Type - Type of the client - Type *string `json:"type,omitempty"` - // Browser - Browser of the client - Browser *string `json:"browser,omitempty"` - // IP - IP address of the client - IP *string `json:"ip,omitempty"` - // City - City of the client - City *string `json:"city,omitempty"` - // StateOrProvince - State or province of the client - StateOrProvince *string `json:"stateOrProvince,omitempty"` - // CountryOrRegion - Country or region of the client - CountryOrRegion *string `json:"countryOrRegion,omitempty"` -} - -// EventsClientPerformanceInfo client performance information -type EventsClientPerformanceInfo struct { - // Name - The name of the client performance - Name *string `json:"name,omitempty"` -} - -// EventsCloudInfo cloud info for an event result -type EventsCloudInfo struct { - // RoleName - Role name of the cloud - RoleName *string `json:"roleName,omitempty"` - // RoleInstance - Role instance of the cloud - RoleInstance *string `json:"roleInstance,omitempty"` -} - -// EventsCustomEventInfo the custom event information -type EventsCustomEventInfo struct { - // Name - The name of the custom event - Name *string `json:"name,omitempty"` -} - -// EventsCustomEventResult a custom event result -type EventsCustomEventResult struct { - CustomEvent *EventsCustomEventInfo `json:"customEvent,omitempty"` - // ID - The unique ID for this event. - ID *string `json:"id,omitempty"` - // Count - Count of the event - Count *int64 `json:"count,omitempty"` - // Timestamp - Timestamp of the event - Timestamp *date.Time `json:"timestamp,omitempty"` - // CustomDimensions - Custom dimensions of the event - CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"` - // CustomMeasurements - Custom measurements of the event - CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"` - // Operation - Operation info of the event - Operation *EventsOperationInfo `json:"operation,omitempty"` - // Session - Session info of the event - Session *EventsSessionInfo `json:"session,omitempty"` - // User - User info of the event - User *EventsUserInfo `json:"user,omitempty"` - // Cloud - Cloud info of the event - Cloud *EventsCloudInfo `json:"cloud,omitempty"` - // Ai - AI info of the event - Ai *EventsAiInfo `json:"ai,omitempty"` - // Application - Application info of the event - Application *EventsApplicationInfo `json:"application,omitempty"` - // Client - Client info of the event - Client *EventsClientInfo `json:"client,omitempty"` - // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EventsCustomEventResult. -func (ecer EventsCustomEventResult) MarshalJSON() ([]byte, error) { - ecer.Type = TypeCustomEvent - objectMap := make(map[string]interface{}) - if ecer.CustomEvent != nil { - objectMap["customEvent"] = ecer.CustomEvent - } - if ecer.ID != nil { - objectMap["id"] = ecer.ID - } - if ecer.Count != nil { - objectMap["count"] = ecer.Count - } - if ecer.Timestamp != nil { - objectMap["timestamp"] = ecer.Timestamp - } - if ecer.CustomDimensions != nil { - objectMap["customDimensions"] = ecer.CustomDimensions - } - if ecer.CustomMeasurements != nil { - objectMap["customMeasurements"] = ecer.CustomMeasurements - } - if ecer.Operation != nil { - objectMap["operation"] = ecer.Operation - } - if ecer.Session != nil { - objectMap["session"] = ecer.Session - } - if ecer.User != nil { - objectMap["user"] = ecer.User - } - if ecer.Cloud != nil { - objectMap["cloud"] = ecer.Cloud - } - if ecer.Ai != nil { - objectMap["ai"] = ecer.Ai - } - if ecer.Application != nil { - objectMap["application"] = ecer.Application - } - if ecer.Client != nil { - objectMap["client"] = ecer.Client - } - if ecer.Type != "" { - objectMap["type"] = ecer.Type - } - return json.Marshal(objectMap) -} - -// AsEventsTraceResult is the BasicEventsResultData implementation for EventsCustomEventResult. -func (ecer EventsCustomEventResult) AsEventsTraceResult() (*EventsTraceResult, bool) { - return nil, false -} - -// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsCustomEventResult. -func (ecer EventsCustomEventResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) { - return &ecer, true -} - -// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsCustomEventResult. -func (ecer EventsCustomEventResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) { - return nil, false -} - -// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsCustomEventResult. -func (ecer EventsCustomEventResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) { - return nil, false -} - -// AsEventsRequestResult is the BasicEventsResultData implementation for EventsCustomEventResult. -func (ecer EventsCustomEventResult) AsEventsRequestResult() (*EventsRequestResult, bool) { - return nil, false -} - -// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsCustomEventResult. -func (ecer EventsCustomEventResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) { - return nil, false -} - -// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsCustomEventResult. -func (ecer EventsCustomEventResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) { - return nil, false -} - -// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsCustomEventResult. -func (ecer EventsCustomEventResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) { - return nil, false -} - -// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsCustomEventResult. -func (ecer EventsCustomEventResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) { - return nil, false -} - -// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsCustomEventResult. -func (ecer EventsCustomEventResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) { - return nil, false -} - -// AsEventsResultData is the BasicEventsResultData implementation for EventsCustomEventResult. -func (ecer EventsCustomEventResult) AsEventsResultData() (*EventsResultData, bool) { - return nil, false -} - -// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsCustomEventResult. -func (ecer EventsCustomEventResult) AsBasicEventsResultData() (BasicEventsResultData, bool) { - return &ecer, true -} - -// EventsCustomMetricInfo the custom metric info -type EventsCustomMetricInfo struct { - // Name - The name of the custom metric - Name *string `json:"name,omitempty"` - // Value - The value of the custom metric - Value *float64 `json:"value,omitempty"` - // ValueSum - The sum of the custom metric - ValueSum *float64 `json:"valueSum,omitempty"` - // ValueCount - The count of the custom metric - ValueCount *int32 `json:"valueCount,omitempty"` - // ValueMin - The minimum value of the custom metric - ValueMin *float64 `json:"valueMin,omitempty"` - // ValueMax - The maximum value of the custom metric - ValueMax *float64 `json:"valueMax,omitempty"` - // ValueStdDev - The standard deviation of the custom metric - ValueStdDev *float64 `json:"valueStdDev,omitempty"` -} - -// EventsCustomMetricResult a custom metric result -type EventsCustomMetricResult struct { - CustomMetric *EventsCustomMetricInfo `json:"customMetric,omitempty"` - // ID - The unique ID for this event. - ID *string `json:"id,omitempty"` - // Count - Count of the event - Count *int64 `json:"count,omitempty"` - // Timestamp - Timestamp of the event - Timestamp *date.Time `json:"timestamp,omitempty"` - // CustomDimensions - Custom dimensions of the event - CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"` - // CustomMeasurements - Custom measurements of the event - CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"` - // Operation - Operation info of the event - Operation *EventsOperationInfo `json:"operation,omitempty"` - // Session - Session info of the event - Session *EventsSessionInfo `json:"session,omitempty"` - // User - User info of the event - User *EventsUserInfo `json:"user,omitempty"` - // Cloud - Cloud info of the event - Cloud *EventsCloudInfo `json:"cloud,omitempty"` - // Ai - AI info of the event - Ai *EventsAiInfo `json:"ai,omitempty"` - // Application - Application info of the event - Application *EventsApplicationInfo `json:"application,omitempty"` - // Client - Client info of the event - Client *EventsClientInfo `json:"client,omitempty"` - // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EventsCustomMetricResult. -func (ecmr EventsCustomMetricResult) MarshalJSON() ([]byte, error) { - ecmr.Type = TypeCustomMetric - objectMap := make(map[string]interface{}) - if ecmr.CustomMetric != nil { - objectMap["customMetric"] = ecmr.CustomMetric - } - if ecmr.ID != nil { - objectMap["id"] = ecmr.ID - } - if ecmr.Count != nil { - objectMap["count"] = ecmr.Count - } - if ecmr.Timestamp != nil { - objectMap["timestamp"] = ecmr.Timestamp - } - if ecmr.CustomDimensions != nil { - objectMap["customDimensions"] = ecmr.CustomDimensions - } - if ecmr.CustomMeasurements != nil { - objectMap["customMeasurements"] = ecmr.CustomMeasurements - } - if ecmr.Operation != nil { - objectMap["operation"] = ecmr.Operation - } - if ecmr.Session != nil { - objectMap["session"] = ecmr.Session - } - if ecmr.User != nil { - objectMap["user"] = ecmr.User - } - if ecmr.Cloud != nil { - objectMap["cloud"] = ecmr.Cloud - } - if ecmr.Ai != nil { - objectMap["ai"] = ecmr.Ai - } - if ecmr.Application != nil { - objectMap["application"] = ecmr.Application - } - if ecmr.Client != nil { - objectMap["client"] = ecmr.Client - } - if ecmr.Type != "" { - objectMap["type"] = ecmr.Type - } - return json.Marshal(objectMap) -} - -// AsEventsTraceResult is the BasicEventsResultData implementation for EventsCustomMetricResult. -func (ecmr EventsCustomMetricResult) AsEventsTraceResult() (*EventsTraceResult, bool) { - return nil, false -} - -// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsCustomMetricResult. -func (ecmr EventsCustomMetricResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) { - return nil, false -} - -// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsCustomMetricResult. -func (ecmr EventsCustomMetricResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) { - return nil, false -} - -// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsCustomMetricResult. -func (ecmr EventsCustomMetricResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) { - return nil, false -} - -// AsEventsRequestResult is the BasicEventsResultData implementation for EventsCustomMetricResult. -func (ecmr EventsCustomMetricResult) AsEventsRequestResult() (*EventsRequestResult, bool) { - return nil, false -} - -// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsCustomMetricResult. -func (ecmr EventsCustomMetricResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) { - return nil, false -} - -// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsCustomMetricResult. -func (ecmr EventsCustomMetricResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) { - return nil, false -} - -// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsCustomMetricResult. -func (ecmr EventsCustomMetricResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) { - return nil, false -} - -// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsCustomMetricResult. -func (ecmr EventsCustomMetricResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) { - return nil, false -} - -// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsCustomMetricResult. -func (ecmr EventsCustomMetricResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) { - return &ecmr, true -} - -// AsEventsResultData is the BasicEventsResultData implementation for EventsCustomMetricResult. -func (ecmr EventsCustomMetricResult) AsEventsResultData() (*EventsResultData, bool) { - return nil, false -} - -// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsCustomMetricResult. -func (ecmr EventsCustomMetricResult) AsBasicEventsResultData() (BasicEventsResultData, bool) { - return &ecmr, true -} - -// EventsDependencyInfo the dependency info -type EventsDependencyInfo struct { - // Target - The target of the dependency - Target *string `json:"target,omitempty"` - // Data - The data of the dependency - Data *string `json:"data,omitempty"` - // Success - Indicates if the dependency was successful - Success *string `json:"success,omitempty"` - // Duration - The duration of the dependency - Duration *int64 `json:"duration,omitempty"` - // PerformanceBucket - The performance bucket of the dependency - PerformanceBucket *string `json:"performanceBucket,omitempty"` - // ResultCode - The result code of the dependency - ResultCode *string `json:"resultCode,omitempty"` - // Type - The type of the dependency - Type *string `json:"type,omitempty"` - // Name - The name of the dependency - Name *string `json:"name,omitempty"` - // ID - The ID of the dependency - ID *string `json:"id,omitempty"` -} - -// EventsDependencyResult a dependency result -type EventsDependencyResult struct { - Dependency *EventsDependencyInfo `json:"dependency,omitempty"` - // ID - The unique ID for this event. - ID *string `json:"id,omitempty"` - // Count - Count of the event - Count *int64 `json:"count,omitempty"` - // Timestamp - Timestamp of the event - Timestamp *date.Time `json:"timestamp,omitempty"` - // CustomDimensions - Custom dimensions of the event - CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"` - // CustomMeasurements - Custom measurements of the event - CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"` - // Operation - Operation info of the event - Operation *EventsOperationInfo `json:"operation,omitempty"` - // Session - Session info of the event - Session *EventsSessionInfo `json:"session,omitempty"` - // User - User info of the event - User *EventsUserInfo `json:"user,omitempty"` - // Cloud - Cloud info of the event - Cloud *EventsCloudInfo `json:"cloud,omitempty"` - // Ai - AI info of the event - Ai *EventsAiInfo `json:"ai,omitempty"` - // Application - Application info of the event - Application *EventsApplicationInfo `json:"application,omitempty"` - // Client - Client info of the event - Client *EventsClientInfo `json:"client,omitempty"` - // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EventsDependencyResult. -func (edr EventsDependencyResult) MarshalJSON() ([]byte, error) { - edr.Type = TypeDependency - objectMap := make(map[string]interface{}) - if edr.Dependency != nil { - objectMap["dependency"] = edr.Dependency - } - if edr.ID != nil { - objectMap["id"] = edr.ID - } - if edr.Count != nil { - objectMap["count"] = edr.Count - } - if edr.Timestamp != nil { - objectMap["timestamp"] = edr.Timestamp - } - if edr.CustomDimensions != nil { - objectMap["customDimensions"] = edr.CustomDimensions - } - if edr.CustomMeasurements != nil { - objectMap["customMeasurements"] = edr.CustomMeasurements - } - if edr.Operation != nil { - objectMap["operation"] = edr.Operation - } - if edr.Session != nil { - objectMap["session"] = edr.Session - } - if edr.User != nil { - objectMap["user"] = edr.User - } - if edr.Cloud != nil { - objectMap["cloud"] = edr.Cloud - } - if edr.Ai != nil { - objectMap["ai"] = edr.Ai - } - if edr.Application != nil { - objectMap["application"] = edr.Application - } - if edr.Client != nil { - objectMap["client"] = edr.Client - } - if edr.Type != "" { - objectMap["type"] = edr.Type - } - return json.Marshal(objectMap) -} - -// AsEventsTraceResult is the BasicEventsResultData implementation for EventsDependencyResult. -func (edr EventsDependencyResult) AsEventsTraceResult() (*EventsTraceResult, bool) { - return nil, false -} - -// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsDependencyResult. -func (edr EventsDependencyResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) { - return nil, false -} - -// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsDependencyResult. -func (edr EventsDependencyResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) { - return nil, false -} - -// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsDependencyResult. -func (edr EventsDependencyResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) { - return nil, false -} - -// AsEventsRequestResult is the BasicEventsResultData implementation for EventsDependencyResult. -func (edr EventsDependencyResult) AsEventsRequestResult() (*EventsRequestResult, bool) { - return nil, false -} - -// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsDependencyResult. -func (edr EventsDependencyResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) { - return &edr, true -} - -// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsDependencyResult. -func (edr EventsDependencyResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) { - return nil, false -} - -// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsDependencyResult. -func (edr EventsDependencyResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) { - return nil, false -} - -// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsDependencyResult. -func (edr EventsDependencyResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) { - return nil, false -} - -// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsDependencyResult. -func (edr EventsDependencyResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) { - return nil, false -} - -// AsEventsResultData is the BasicEventsResultData implementation for EventsDependencyResult. -func (edr EventsDependencyResult) AsEventsResultData() (*EventsResultData, bool) { - return nil, false -} - -// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsDependencyResult. -func (edr EventsDependencyResult) AsBasicEventsResultData() (BasicEventsResultData, bool) { - return &edr, true -} - -// EventsExceptionDetail exception details -type EventsExceptionDetail struct { - // SeverityLevel - The severity level of the exception detail - SeverityLevel *string `json:"severityLevel,omitempty"` - // OuterID - The outer ID of the exception detail - OuterID *string `json:"outerId,omitempty"` - // Message - The message of the exception detail - Message *string `json:"message,omitempty"` - // Type - The type of the exception detail - Type *string `json:"type,omitempty"` - // ID - The ID of the exception detail - ID *string `json:"id,omitempty"` - // ParsedStack - The parsed stack - ParsedStack *[]EventsExceptionDetailsParsedStack `json:"parsedStack,omitempty"` -} - -// EventsExceptionDetailsParsedStack a parsed stack entry -type EventsExceptionDetailsParsedStack struct { - // Assembly - The assembly of the stack entry - Assembly *string `json:"assembly,omitempty"` - // Method - The method of the stack entry - Method *string `json:"method,omitempty"` - // Level - The level of the stack entry - Level *int64 `json:"level,omitempty"` - // Line - The line of the stack entry - Line *int64 `json:"line,omitempty"` -} - -// EventsExceptionInfo the exception info -type EventsExceptionInfo struct { - // SeverityLevel - The severity level of the exception - SeverityLevel *int32 `json:"severityLevel,omitempty"` - // ProblemID - The problem ID of the exception - ProblemID *string `json:"problemId,omitempty"` - // HandledAt - Indicates where the exception was handled at - HandledAt *string `json:"handledAt,omitempty"` - // Assembly - The assembly which threw the exception - Assembly *string `json:"assembly,omitempty"` - // Method - The method that threw the exception - Method *string `json:"method,omitempty"` - // Message - The message of the exception - Message *string `json:"message,omitempty"` - // Type - The type of the exception - Type *string `json:"type,omitempty"` - // OuterType - The outer type of the exception - OuterType *string `json:"outerType,omitempty"` - // OuterMethod - The outer method of the exception - OuterMethod *string `json:"outerMethod,omitempty"` - // OuterAssembly - The outer assmebly of the exception - OuterAssembly *string `json:"outerAssembly,omitempty"` - // OuterMessage - The outer message of the exception - OuterMessage *string `json:"outerMessage,omitempty"` - // InnermostType - The inner most type of the exception - InnermostType *string `json:"innermostType,omitempty"` - // InnermostMessage - The inner most message of the exception - InnermostMessage *string `json:"innermostMessage,omitempty"` - // InnermostMethod - The inner most method of the exception - InnermostMethod *string `json:"innermostMethod,omitempty"` - // InnermostAssembly - The inner most assembly of the exception - InnermostAssembly *string `json:"innermostAssembly,omitempty"` - // Details - The details of the exception - Details *[]EventsExceptionDetail `json:"details,omitempty"` -} - -// EventsExceptionResult an exception result -type EventsExceptionResult struct { - Exception *EventsExceptionInfo `json:"exception,omitempty"` - // ID - The unique ID for this event. - ID *string `json:"id,omitempty"` - // Count - Count of the event - Count *int64 `json:"count,omitempty"` - // Timestamp - Timestamp of the event - Timestamp *date.Time `json:"timestamp,omitempty"` - // CustomDimensions - Custom dimensions of the event - CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"` - // CustomMeasurements - Custom measurements of the event - CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"` - // Operation - Operation info of the event - Operation *EventsOperationInfo `json:"operation,omitempty"` - // Session - Session info of the event - Session *EventsSessionInfo `json:"session,omitempty"` - // User - User info of the event - User *EventsUserInfo `json:"user,omitempty"` - // Cloud - Cloud info of the event - Cloud *EventsCloudInfo `json:"cloud,omitempty"` - // Ai - AI info of the event - Ai *EventsAiInfo `json:"ai,omitempty"` - // Application - Application info of the event - Application *EventsApplicationInfo `json:"application,omitempty"` - // Client - Client info of the event - Client *EventsClientInfo `json:"client,omitempty"` - // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EventsExceptionResult. -func (eer EventsExceptionResult) MarshalJSON() ([]byte, error) { - eer.Type = TypeException - objectMap := make(map[string]interface{}) - if eer.Exception != nil { - objectMap["exception"] = eer.Exception - } - if eer.ID != nil { - objectMap["id"] = eer.ID - } - if eer.Count != nil { - objectMap["count"] = eer.Count - } - if eer.Timestamp != nil { - objectMap["timestamp"] = eer.Timestamp - } - if eer.CustomDimensions != nil { - objectMap["customDimensions"] = eer.CustomDimensions - } - if eer.CustomMeasurements != nil { - objectMap["customMeasurements"] = eer.CustomMeasurements - } - if eer.Operation != nil { - objectMap["operation"] = eer.Operation - } - if eer.Session != nil { - objectMap["session"] = eer.Session - } - if eer.User != nil { - objectMap["user"] = eer.User - } - if eer.Cloud != nil { - objectMap["cloud"] = eer.Cloud - } - if eer.Ai != nil { - objectMap["ai"] = eer.Ai - } - if eer.Application != nil { - objectMap["application"] = eer.Application - } - if eer.Client != nil { - objectMap["client"] = eer.Client - } - if eer.Type != "" { - objectMap["type"] = eer.Type - } - return json.Marshal(objectMap) -} - -// AsEventsTraceResult is the BasicEventsResultData implementation for EventsExceptionResult. -func (eer EventsExceptionResult) AsEventsTraceResult() (*EventsTraceResult, bool) { - return nil, false -} - -// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsExceptionResult. -func (eer EventsExceptionResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) { - return nil, false -} - -// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsExceptionResult. -func (eer EventsExceptionResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) { - return nil, false -} - -// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsExceptionResult. -func (eer EventsExceptionResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) { - return nil, false -} - -// AsEventsRequestResult is the BasicEventsResultData implementation for EventsExceptionResult. -func (eer EventsExceptionResult) AsEventsRequestResult() (*EventsRequestResult, bool) { - return nil, false -} - -// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsExceptionResult. -func (eer EventsExceptionResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) { - return nil, false -} - -// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsExceptionResult. -func (eer EventsExceptionResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) { - return &eer, true -} - -// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsExceptionResult. -func (eer EventsExceptionResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) { - return nil, false -} - -// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsExceptionResult. -func (eer EventsExceptionResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) { - return nil, false -} - -// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsExceptionResult. -func (eer EventsExceptionResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) { - return nil, false -} - -// AsEventsResultData is the BasicEventsResultData implementation for EventsExceptionResult. -func (eer EventsExceptionResult) AsEventsResultData() (*EventsResultData, bool) { - return nil, false -} - -// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsExceptionResult. -func (eer EventsExceptionResult) AsBasicEventsResultData() (BasicEventsResultData, bool) { - return &eer, true -} - -// EventsOperationInfo operation info for an event result -type EventsOperationInfo struct { - // Name - Name of the operation - Name *string `json:"name,omitempty"` - // ID - ID of the operation - ID *string `json:"id,omitempty"` - // ParentID - Parent ID of the operation - ParentID *string `json:"parentId,omitempty"` - // SyntheticSource - Synthetic source of the operation - SyntheticSource *string `json:"syntheticSource,omitempty"` -} - -// EventsPageViewInfo the page view information -type EventsPageViewInfo struct { - // Name - The name of the page - Name *string `json:"name,omitempty"` - // URL - The URL of the page - URL *string `json:"url,omitempty"` - // Duration - The duration of the page view - Duration *string `json:"duration,omitempty"` - // PerformanceBucket - The performance bucket of the page view - PerformanceBucket *string `json:"performanceBucket,omitempty"` -} - -// EventsPageViewResult a page view result -type EventsPageViewResult struct { - PageView *EventsPageViewInfo `json:"pageView,omitempty"` - // ID - The unique ID for this event. - ID *string `json:"id,omitempty"` - // Count - Count of the event - Count *int64 `json:"count,omitempty"` - // Timestamp - Timestamp of the event - Timestamp *date.Time `json:"timestamp,omitempty"` - // CustomDimensions - Custom dimensions of the event - CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"` - // CustomMeasurements - Custom measurements of the event - CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"` - // Operation - Operation info of the event - Operation *EventsOperationInfo `json:"operation,omitempty"` - // Session - Session info of the event - Session *EventsSessionInfo `json:"session,omitempty"` - // User - User info of the event - User *EventsUserInfo `json:"user,omitempty"` - // Cloud - Cloud info of the event - Cloud *EventsCloudInfo `json:"cloud,omitempty"` - // Ai - AI info of the event - Ai *EventsAiInfo `json:"ai,omitempty"` - // Application - Application info of the event - Application *EventsApplicationInfo `json:"application,omitempty"` - // Client - Client info of the event - Client *EventsClientInfo `json:"client,omitempty"` - // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EventsPageViewResult. -func (epvr EventsPageViewResult) MarshalJSON() ([]byte, error) { - epvr.Type = TypePageView - objectMap := make(map[string]interface{}) - if epvr.PageView != nil { - objectMap["pageView"] = epvr.PageView - } - if epvr.ID != nil { - objectMap["id"] = epvr.ID - } - if epvr.Count != nil { - objectMap["count"] = epvr.Count - } - if epvr.Timestamp != nil { - objectMap["timestamp"] = epvr.Timestamp - } - if epvr.CustomDimensions != nil { - objectMap["customDimensions"] = epvr.CustomDimensions - } - if epvr.CustomMeasurements != nil { - objectMap["customMeasurements"] = epvr.CustomMeasurements - } - if epvr.Operation != nil { - objectMap["operation"] = epvr.Operation - } - if epvr.Session != nil { - objectMap["session"] = epvr.Session - } - if epvr.User != nil { - objectMap["user"] = epvr.User - } - if epvr.Cloud != nil { - objectMap["cloud"] = epvr.Cloud - } - if epvr.Ai != nil { - objectMap["ai"] = epvr.Ai - } - if epvr.Application != nil { - objectMap["application"] = epvr.Application - } - if epvr.Client != nil { - objectMap["client"] = epvr.Client - } - if epvr.Type != "" { - objectMap["type"] = epvr.Type - } - return json.Marshal(objectMap) -} - -// AsEventsTraceResult is the BasicEventsResultData implementation for EventsPageViewResult. -func (epvr EventsPageViewResult) AsEventsTraceResult() (*EventsTraceResult, bool) { - return nil, false -} - -// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsPageViewResult. -func (epvr EventsPageViewResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) { - return nil, false -} - -// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsPageViewResult. -func (epvr EventsPageViewResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) { - return &epvr, true -} - -// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsPageViewResult. -func (epvr EventsPageViewResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) { - return nil, false -} - -// AsEventsRequestResult is the BasicEventsResultData implementation for EventsPageViewResult. -func (epvr EventsPageViewResult) AsEventsRequestResult() (*EventsRequestResult, bool) { - return nil, false -} - -// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsPageViewResult. -func (epvr EventsPageViewResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) { - return nil, false -} - -// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsPageViewResult. -func (epvr EventsPageViewResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) { - return nil, false -} - -// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsPageViewResult. -func (epvr EventsPageViewResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) { - return nil, false -} - -// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsPageViewResult. -func (epvr EventsPageViewResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) { - return nil, false -} - -// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsPageViewResult. -func (epvr EventsPageViewResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) { - return nil, false -} - -// AsEventsResultData is the BasicEventsResultData implementation for EventsPageViewResult. -func (epvr EventsPageViewResult) AsEventsResultData() (*EventsResultData, bool) { - return nil, false -} - -// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsPageViewResult. -func (epvr EventsPageViewResult) AsBasicEventsResultData() (BasicEventsResultData, bool) { - return &epvr, true -} - -// EventsPerformanceCounterInfo the performance counter info -type EventsPerformanceCounterInfo struct { - // Value - The value of the performance counter - Value *float64 `json:"value,omitempty"` - // Name - The name of the performance counter - Name *string `json:"name,omitempty"` - // Category - The category of the performance counter - Category *string `json:"category,omitempty"` - // Counter - The counter of the performance counter - Counter *string `json:"counter,omitempty"` - // InstanceName - The instance name of the performance counter - InstanceName *string `json:"instanceName,omitempty"` - // Instance - The instance of the performance counter - Instance *string `json:"instance,omitempty"` -} - -// EventsPerformanceCounterResult a performance counter result -type EventsPerformanceCounterResult struct { - PerformanceCounter *EventsPerformanceCounterInfo `json:"performanceCounter,omitempty"` - // ID - The unique ID for this event. - ID *string `json:"id,omitempty"` - // Count - Count of the event - Count *int64 `json:"count,omitempty"` - // Timestamp - Timestamp of the event - Timestamp *date.Time `json:"timestamp,omitempty"` - // CustomDimensions - Custom dimensions of the event - CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"` - // CustomMeasurements - Custom measurements of the event - CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"` - // Operation - Operation info of the event - Operation *EventsOperationInfo `json:"operation,omitempty"` - // Session - Session info of the event - Session *EventsSessionInfo `json:"session,omitempty"` - // User - User info of the event - User *EventsUserInfo `json:"user,omitempty"` - // Cloud - Cloud info of the event - Cloud *EventsCloudInfo `json:"cloud,omitempty"` - // Ai - AI info of the event - Ai *EventsAiInfo `json:"ai,omitempty"` - // Application - Application info of the event - Application *EventsApplicationInfo `json:"application,omitempty"` - // Client - Client info of the event - Client *EventsClientInfo `json:"client,omitempty"` - // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EventsPerformanceCounterResult. -func (epcr EventsPerformanceCounterResult) MarshalJSON() ([]byte, error) { - epcr.Type = TypePerformanceCounter - objectMap := make(map[string]interface{}) - if epcr.PerformanceCounter != nil { - objectMap["performanceCounter"] = epcr.PerformanceCounter - } - if epcr.ID != nil { - objectMap["id"] = epcr.ID - } - if epcr.Count != nil { - objectMap["count"] = epcr.Count - } - if epcr.Timestamp != nil { - objectMap["timestamp"] = epcr.Timestamp - } - if epcr.CustomDimensions != nil { - objectMap["customDimensions"] = epcr.CustomDimensions - } - if epcr.CustomMeasurements != nil { - objectMap["customMeasurements"] = epcr.CustomMeasurements - } - if epcr.Operation != nil { - objectMap["operation"] = epcr.Operation - } - if epcr.Session != nil { - objectMap["session"] = epcr.Session - } - if epcr.User != nil { - objectMap["user"] = epcr.User - } - if epcr.Cloud != nil { - objectMap["cloud"] = epcr.Cloud - } - if epcr.Ai != nil { - objectMap["ai"] = epcr.Ai - } - if epcr.Application != nil { - objectMap["application"] = epcr.Application - } - if epcr.Client != nil { - objectMap["client"] = epcr.Client - } - if epcr.Type != "" { - objectMap["type"] = epcr.Type - } - return json.Marshal(objectMap) -} - -// AsEventsTraceResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult. -func (epcr EventsPerformanceCounterResult) AsEventsTraceResult() (*EventsTraceResult, bool) { - return nil, false -} - -// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult. -func (epcr EventsPerformanceCounterResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) { - return nil, false -} - -// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult. -func (epcr EventsPerformanceCounterResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) { - return nil, false -} - -// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult. -func (epcr EventsPerformanceCounterResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) { - return nil, false -} - -// AsEventsRequestResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult. -func (epcr EventsPerformanceCounterResult) AsEventsRequestResult() (*EventsRequestResult, bool) { - return nil, false -} - -// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult. -func (epcr EventsPerformanceCounterResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) { - return nil, false -} - -// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult. -func (epcr EventsPerformanceCounterResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) { - return nil, false -} - -// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult. -func (epcr EventsPerformanceCounterResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) { - return nil, false -} - -// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult. -func (epcr EventsPerformanceCounterResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) { - return &epcr, true -} - -// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult. -func (epcr EventsPerformanceCounterResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) { - return nil, false -} - -// AsEventsResultData is the BasicEventsResultData implementation for EventsPerformanceCounterResult. -func (epcr EventsPerformanceCounterResult) AsEventsResultData() (*EventsResultData, bool) { - return nil, false -} - -// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsPerformanceCounterResult. -func (epcr EventsPerformanceCounterResult) AsBasicEventsResultData() (BasicEventsResultData, bool) { - return &epcr, true -} - -// EventsRequestInfo the request info -type EventsRequestInfo struct { - // Name - The name of the request - Name *string `json:"name,omitempty"` - // URL - The URL of the request - URL *string `json:"url,omitempty"` - // Success - Indicates if the request was successful - Success *string `json:"success,omitempty"` - // Duration - The duration of the request - Duration *float64 `json:"duration,omitempty"` - // PerformanceBucket - The performance bucket of the request - PerformanceBucket *string `json:"performanceBucket,omitempty"` - // ResultCode - The result code of the request - ResultCode *string `json:"resultCode,omitempty"` - // Source - The source of the request - Source *string `json:"source,omitempty"` - // ID - The ID of the request - ID *string `json:"id,omitempty"` -} - -// EventsRequestResult a request result -type EventsRequestResult struct { - Request *EventsRequestInfo `json:"request,omitempty"` - // ID - The unique ID for this event. - ID *string `json:"id,omitempty"` - // Count - Count of the event - Count *int64 `json:"count,omitempty"` - // Timestamp - Timestamp of the event - Timestamp *date.Time `json:"timestamp,omitempty"` - // CustomDimensions - Custom dimensions of the event - CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"` - // CustomMeasurements - Custom measurements of the event - CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"` - // Operation - Operation info of the event - Operation *EventsOperationInfo `json:"operation,omitempty"` - // Session - Session info of the event - Session *EventsSessionInfo `json:"session,omitempty"` - // User - User info of the event - User *EventsUserInfo `json:"user,omitempty"` - // Cloud - Cloud info of the event - Cloud *EventsCloudInfo `json:"cloud,omitempty"` - // Ai - AI info of the event - Ai *EventsAiInfo `json:"ai,omitempty"` - // Application - Application info of the event - Application *EventsApplicationInfo `json:"application,omitempty"` - // Client - Client info of the event - Client *EventsClientInfo `json:"client,omitempty"` - // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EventsRequestResult. -func (errVar EventsRequestResult) MarshalJSON() ([]byte, error) { - errVar.Type = TypeRequest - objectMap := make(map[string]interface{}) - if errVar.Request != nil { - objectMap["request"] = errVar.Request - } - if errVar.ID != nil { - objectMap["id"] = errVar.ID - } - if errVar.Count != nil { - objectMap["count"] = errVar.Count - } - if errVar.Timestamp != nil { - objectMap["timestamp"] = errVar.Timestamp - } - if errVar.CustomDimensions != nil { - objectMap["customDimensions"] = errVar.CustomDimensions - } - if errVar.CustomMeasurements != nil { - objectMap["customMeasurements"] = errVar.CustomMeasurements - } - if errVar.Operation != nil { - objectMap["operation"] = errVar.Operation - } - if errVar.Session != nil { - objectMap["session"] = errVar.Session - } - if errVar.User != nil { - objectMap["user"] = errVar.User - } - if errVar.Cloud != nil { - objectMap["cloud"] = errVar.Cloud - } - if errVar.Ai != nil { - objectMap["ai"] = errVar.Ai - } - if errVar.Application != nil { - objectMap["application"] = errVar.Application - } - if errVar.Client != nil { - objectMap["client"] = errVar.Client - } - if errVar.Type != "" { - objectMap["type"] = errVar.Type - } - return json.Marshal(objectMap) -} - -// AsEventsTraceResult is the BasicEventsResultData implementation for EventsRequestResult. -func (errVar EventsRequestResult) AsEventsTraceResult() (*EventsTraceResult, bool) { - return nil, false -} - -// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsRequestResult. -func (errVar EventsRequestResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) { - return nil, false -} - -// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsRequestResult. -func (errVar EventsRequestResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) { - return nil, false -} - -// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsRequestResult. -func (errVar EventsRequestResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) { - return nil, false -} - -// AsEventsRequestResult is the BasicEventsResultData implementation for EventsRequestResult. -func (errVar EventsRequestResult) AsEventsRequestResult() (*EventsRequestResult, bool) { - return &errVar, true -} - -// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsRequestResult. -func (errVar EventsRequestResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) { - return nil, false -} - -// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsRequestResult. -func (errVar EventsRequestResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) { - return nil, false -} - -// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsRequestResult. -func (errVar EventsRequestResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) { - return nil, false -} - -// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsRequestResult. -func (errVar EventsRequestResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) { - return nil, false -} - -// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsRequestResult. -func (errVar EventsRequestResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) { - return nil, false -} - -// AsEventsResultData is the BasicEventsResultData implementation for EventsRequestResult. -func (errVar EventsRequestResult) AsEventsResultData() (*EventsResultData, bool) { - return nil, false -} - -// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsRequestResult. -func (errVar EventsRequestResult) AsBasicEventsResultData() (BasicEventsResultData, bool) { - return &errVar, true -} - -// EventsResult an event query result. -type EventsResult struct { - // AiMessages - OData messages for this response. - AiMessages *[]ErrorInfo `json:"@ai.messages,omitempty"` - Value BasicEventsResultData `json:"value,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for EventsResult struct. -func (er *EventsResult) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "@ai.messages": - if v != nil { - var aiMessages []ErrorInfo - err = json.Unmarshal(*v, &aiMessages) - if err != nil { - return err - } - er.AiMessages = &aiMessages - } - case "value": - if v != nil { - value, err := unmarshalBasicEventsResultData(*v) - if err != nil { - return err - } - er.Value = value - } - } - } - - return nil -} - -// BasicEventsResultData events query result data. -type BasicEventsResultData interface { - AsEventsTraceResult() (*EventsTraceResult, bool) - AsEventsCustomEventResult() (*EventsCustomEventResult, bool) - AsEventsPageViewResult() (*EventsPageViewResult, bool) - AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) - AsEventsRequestResult() (*EventsRequestResult, bool) - AsEventsDependencyResult() (*EventsDependencyResult, bool) - AsEventsExceptionResult() (*EventsExceptionResult, bool) - AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) - AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) - AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) - AsEventsResultData() (*EventsResultData, bool) -} - -// EventsResultData events query result data. -type EventsResultData struct { - // ID - The unique ID for this event. - ID *string `json:"id,omitempty"` - // Count - Count of the event - Count *int64 `json:"count,omitempty"` - // Timestamp - Timestamp of the event - Timestamp *date.Time `json:"timestamp,omitempty"` - // CustomDimensions - Custom dimensions of the event - CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"` - // CustomMeasurements - Custom measurements of the event - CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"` - // Operation - Operation info of the event - Operation *EventsOperationInfo `json:"operation,omitempty"` - // Session - Session info of the event - Session *EventsSessionInfo `json:"session,omitempty"` - // User - User info of the event - User *EventsUserInfo `json:"user,omitempty"` - // Cloud - Cloud info of the event - Cloud *EventsCloudInfo `json:"cloud,omitempty"` - // Ai - AI info of the event - Ai *EventsAiInfo `json:"ai,omitempty"` - // Application - Application info of the event - Application *EventsApplicationInfo `json:"application,omitempty"` - // Client - Client info of the event - Client *EventsClientInfo `json:"client,omitempty"` - // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric' - Type Type `json:"type,omitempty"` -} - -func unmarshalBasicEventsResultData(body []byte) (BasicEventsResultData, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["type"] { - case string(TypeTrace): - var etr EventsTraceResult - err := json.Unmarshal(body, &etr) - return etr, err - case string(TypeCustomEvent): - var ecer EventsCustomEventResult - err := json.Unmarshal(body, &ecer) - return ecer, err - case string(TypePageView): - var epvr EventsPageViewResult - err := json.Unmarshal(body, &epvr) - return epvr, err - case string(TypeBrowserTiming): - var ebtr EventsBrowserTimingResult - err := json.Unmarshal(body, &ebtr) - return ebtr, err - case string(TypeRequest): - var errVar EventsRequestResult - err := json.Unmarshal(body, &errVar) - return errVar, err - case string(TypeDependency): - var edr EventsDependencyResult - err := json.Unmarshal(body, &edr) - return edr, err - case string(TypeException): - var eer EventsExceptionResult - err := json.Unmarshal(body, &eer) - return eer, err - case string(TypeAvailabilityResult): - var earr EventsAvailabilityResultResult - err := json.Unmarshal(body, &earr) - return earr, err - case string(TypePerformanceCounter): - var epcr EventsPerformanceCounterResult - err := json.Unmarshal(body, &epcr) - return epcr, err - case string(TypeCustomMetric): - var ecmr EventsCustomMetricResult - err := json.Unmarshal(body, &ecmr) - return ecmr, err - default: - var erd EventsResultData - err := json.Unmarshal(body, &erd) - return erd, err - } -} -func unmarshalBasicEventsResultDataArray(body []byte) ([]BasicEventsResultData, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - erdArray := make([]BasicEventsResultData, len(rawMessages)) - - for index, rawMessage := range rawMessages { - erd, err := unmarshalBasicEventsResultData(*rawMessage) - if err != nil { - return nil, err - } - erdArray[index] = erd - } - return erdArray, nil -} - -// MarshalJSON is the custom marshaler for EventsResultData. -func (erd EventsResultData) MarshalJSON() ([]byte, error) { - erd.Type = TypeEventsResultData - objectMap := make(map[string]interface{}) - if erd.ID != nil { - objectMap["id"] = erd.ID - } - if erd.Count != nil { - objectMap["count"] = erd.Count - } - if erd.Timestamp != nil { - objectMap["timestamp"] = erd.Timestamp - } - if erd.CustomDimensions != nil { - objectMap["customDimensions"] = erd.CustomDimensions - } - if erd.CustomMeasurements != nil { - objectMap["customMeasurements"] = erd.CustomMeasurements - } - if erd.Operation != nil { - objectMap["operation"] = erd.Operation - } - if erd.Session != nil { - objectMap["session"] = erd.Session - } - if erd.User != nil { - objectMap["user"] = erd.User - } - if erd.Cloud != nil { - objectMap["cloud"] = erd.Cloud - } - if erd.Ai != nil { - objectMap["ai"] = erd.Ai - } - if erd.Application != nil { - objectMap["application"] = erd.Application - } - if erd.Client != nil { - objectMap["client"] = erd.Client - } - if erd.Type != "" { - objectMap["type"] = erd.Type - } - return json.Marshal(objectMap) -} - -// AsEventsTraceResult is the BasicEventsResultData implementation for EventsResultData. -func (erd EventsResultData) AsEventsTraceResult() (*EventsTraceResult, bool) { - return nil, false -} - -// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsResultData. -func (erd EventsResultData) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) { - return nil, false -} - -// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsResultData. -func (erd EventsResultData) AsEventsPageViewResult() (*EventsPageViewResult, bool) { - return nil, false -} - -// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsResultData. -func (erd EventsResultData) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) { - return nil, false -} - -// AsEventsRequestResult is the BasicEventsResultData implementation for EventsResultData. -func (erd EventsResultData) AsEventsRequestResult() (*EventsRequestResult, bool) { - return nil, false -} - -// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsResultData. -func (erd EventsResultData) AsEventsDependencyResult() (*EventsDependencyResult, bool) { - return nil, false -} - -// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsResultData. -func (erd EventsResultData) AsEventsExceptionResult() (*EventsExceptionResult, bool) { - return nil, false -} - -// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsResultData. -func (erd EventsResultData) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) { - return nil, false -} - -// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsResultData. -func (erd EventsResultData) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) { - return nil, false -} - -// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsResultData. -func (erd EventsResultData) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) { - return nil, false -} - -// AsEventsResultData is the BasicEventsResultData implementation for EventsResultData. -func (erd EventsResultData) AsEventsResultData() (*EventsResultData, bool) { - return &erd, true -} - -// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsResultData. -func (erd EventsResultData) AsBasicEventsResultData() (BasicEventsResultData, bool) { - return &erd, true -} - -// EventsResultDataCustomDimensions custom dimensions of the event -type EventsResultDataCustomDimensions struct { - AdditionalProperties interface{} `json:"additionalProperties,omitempty"` -} - -// EventsResultDataCustomMeasurements custom measurements of the event -type EventsResultDataCustomMeasurements struct { - AdditionalProperties interface{} `json:"additionalProperties,omitempty"` -} - -// EventsResults an events query result. -type EventsResults struct { - autorest.Response `json:"-"` - // OdataContext - OData context metadata endpoint for this response - OdataContext *string `json:"@odata.context,omitempty"` - // AiMessages - OData messages for this response. - AiMessages *[]ErrorInfo `json:"@ai.messages,omitempty"` - // Value - Contents of the events query result. - Value *[]BasicEventsResultData `json:"value,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for EventsResults struct. -func (er *EventsResults) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "@odata.context": - if v != nil { - var odataContext string - err = json.Unmarshal(*v, &odataContext) - if err != nil { - return err - } - er.OdataContext = &odataContext - } - case "@ai.messages": - if v != nil { - var aiMessages []ErrorInfo - err = json.Unmarshal(*v, &aiMessages) - if err != nil { - return err - } - er.AiMessages = &aiMessages - } - case "value": - if v != nil { - value, err := unmarshalBasicEventsResultDataArray(*v) - if err != nil { - return err - } - er.Value = &value - } - } - } - - return nil -} - -// EventsSessionInfo session info for an event result -type EventsSessionInfo struct { - // ID - ID of the session - ID *string `json:"id,omitempty"` -} - -// EventsTraceInfo the trace information -type EventsTraceInfo struct { - // Message - The trace message - Message *string `json:"message,omitempty"` - // SeverityLevel - The trace severity level - SeverityLevel *int32 `json:"severityLevel,omitempty"` -} - -// EventsTraceResult a trace result -type EventsTraceResult struct { - Trace *EventsTraceInfo `json:"trace,omitempty"` - // ID - The unique ID for this event. - ID *string `json:"id,omitempty"` - // Count - Count of the event - Count *int64 `json:"count,omitempty"` - // Timestamp - Timestamp of the event - Timestamp *date.Time `json:"timestamp,omitempty"` - // CustomDimensions - Custom dimensions of the event - CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"` - // CustomMeasurements - Custom measurements of the event - CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"` - // Operation - Operation info of the event - Operation *EventsOperationInfo `json:"operation,omitempty"` - // Session - Session info of the event - Session *EventsSessionInfo `json:"session,omitempty"` - // User - User info of the event - User *EventsUserInfo `json:"user,omitempty"` - // Cloud - Cloud info of the event - Cloud *EventsCloudInfo `json:"cloud,omitempty"` - // Ai - AI info of the event - Ai *EventsAiInfo `json:"ai,omitempty"` - // Application - Application info of the event - Application *EventsApplicationInfo `json:"application,omitempty"` - // Client - Client info of the event - Client *EventsClientInfo `json:"client,omitempty"` - // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EventsTraceResult. -func (etr EventsTraceResult) MarshalJSON() ([]byte, error) { - etr.Type = TypeTrace - objectMap := make(map[string]interface{}) - if etr.Trace != nil { - objectMap["trace"] = etr.Trace - } - if etr.ID != nil { - objectMap["id"] = etr.ID - } - if etr.Count != nil { - objectMap["count"] = etr.Count - } - if etr.Timestamp != nil { - objectMap["timestamp"] = etr.Timestamp - } - if etr.CustomDimensions != nil { - objectMap["customDimensions"] = etr.CustomDimensions - } - if etr.CustomMeasurements != nil { - objectMap["customMeasurements"] = etr.CustomMeasurements - } - if etr.Operation != nil { - objectMap["operation"] = etr.Operation - } - if etr.Session != nil { - objectMap["session"] = etr.Session - } - if etr.User != nil { - objectMap["user"] = etr.User - } - if etr.Cloud != nil { - objectMap["cloud"] = etr.Cloud - } - if etr.Ai != nil { - objectMap["ai"] = etr.Ai - } - if etr.Application != nil { - objectMap["application"] = etr.Application - } - if etr.Client != nil { - objectMap["client"] = etr.Client - } - if etr.Type != "" { - objectMap["type"] = etr.Type - } - return json.Marshal(objectMap) -} - -// AsEventsTraceResult is the BasicEventsResultData implementation for EventsTraceResult. -func (etr EventsTraceResult) AsEventsTraceResult() (*EventsTraceResult, bool) { - return &etr, true -} - -// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsTraceResult. -func (etr EventsTraceResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) { - return nil, false -} - -// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsTraceResult. -func (etr EventsTraceResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) { - return nil, false -} - -// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsTraceResult. -func (etr EventsTraceResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) { - return nil, false -} - -// AsEventsRequestResult is the BasicEventsResultData implementation for EventsTraceResult. -func (etr EventsTraceResult) AsEventsRequestResult() (*EventsRequestResult, bool) { - return nil, false -} - -// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsTraceResult. -func (etr EventsTraceResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) { - return nil, false -} - -// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsTraceResult. -func (etr EventsTraceResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) { - return nil, false -} - -// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsTraceResult. -func (etr EventsTraceResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) { - return nil, false -} - -// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsTraceResult. -func (etr EventsTraceResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) { - return nil, false -} - -// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsTraceResult. -func (etr EventsTraceResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) { - return nil, false -} - -// AsEventsResultData is the BasicEventsResultData implementation for EventsTraceResult. -func (etr EventsTraceResult) AsEventsResultData() (*EventsResultData, bool) { - return nil, false -} - -// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsTraceResult. -func (etr EventsTraceResult) AsBasicEventsResultData() (BasicEventsResultData, bool) { - return &etr, true -} - -// EventsUserInfo user info for an event result -type EventsUserInfo struct { - // ID - ID of the user - ID *string `json:"id,omitempty"` - // AccountID - Account ID of the user - AccountID *string `json:"accountId,omitempty"` - // AuthenticatedID - Authenticated ID of the user - AuthenticatedID *string `json:"authenticatedId,omitempty"` -} - -// ListMetricsResultsItem ... -type ListMetricsResultsItem struct { - autorest.Response `json:"-"` - Value *[]MetricsResultsItem `json:"value,omitempty"` -} - -// MetricsPostBodySchema a metric request -type MetricsPostBodySchema struct { - // ID - An identifier for this query. Must be unique within the post body of the request. This identifier will be the 'id' property of the response object representing this query. - ID *string `json:"id,omitempty"` - // Parameters - The parameters for a single metrics query - Parameters *MetricsPostBodySchemaParameters `json:"parameters,omitempty"` -} - -// MetricsPostBodySchemaParameters the parameters for a single metrics query -type MetricsPostBodySchemaParameters struct { - // MetricID - Possible values include: 'Requestscount', 'Requestsduration', 'Requestsfailed', 'Userscount', 'Usersauthenticated', 'PageViewscount', 'PageViewsduration', 'ClientprocessingDuration', 'ClientreceiveDuration', 'ClientnetworkDuration', 'ClientsendDuration', 'ClienttotalDuration', 'Dependenciescount', 'Dependenciesfailed', 'Dependenciesduration', 'Exceptionscount', 'Exceptionsbrowser', 'Exceptionsserver', 'Sessionscount', 'PerformanceCountersrequestExecutionTime', 'PerformanceCountersrequestsPerSecond', 'PerformanceCountersrequestsInQueue', 'PerformanceCountersmemoryAvailableBytes', 'PerformanceCountersexceptionsPerSecond', 'PerformanceCountersprocessCPUPercentage', 'PerformanceCountersprocessIOBytesPerSecond', 'PerformanceCountersprocessPrivateBytes', 'PerformanceCountersprocessorCPUPercentage', 'AvailabilityResultsavailabilityPercentage', 'AvailabilityResultsduration', 'BillingtelemetryCount', 'CustomEventscount' - MetricID MetricID `json:"metricId,omitempty"` - Timespan *string `json:"timespan,omitempty"` - Aggregation *[]MetricsAggregation `json:"aggregation,omitempty"` - Interval *string `json:"interval,omitempty"` - Segment *[]MetricsSegment `json:"segment,omitempty"` - Top *int32 `json:"top,omitempty"` - Orderby *string `json:"orderby,omitempty"` - Filter *string `json:"filter,omitempty"` -} - -// MetricsResult a metric result. -type MetricsResult struct { - autorest.Response `json:"-"` - Value *MetricsResultInfo `json:"value,omitempty"` -} - -// MetricsResultInfo a metric result data. -type MetricsResultInfo struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // Start - Start time of the metric. - Start *date.Time `json:"start,omitempty"` - // End - Start time of the metric. - End *date.Time `json:"end,omitempty"` - // Interval - The interval used to segment the metric data. - Interval *string `json:"interval,omitempty"` - // Segments - Segmented metric data (if segmented). - Segments *[]MetricsSegmentInfo `json:"segments,omitempty"` -} - -// MarshalJSON is the custom marshaler for MetricsResultInfo. -func (mri MetricsResultInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mri.Start != nil { - objectMap["start"] = mri.Start - } - if mri.End != nil { - objectMap["end"] = mri.End - } - if mri.Interval != nil { - objectMap["interval"] = mri.Interval - } - if mri.Segments != nil { - objectMap["segments"] = mri.Segments - } - for k, v := range mri.AdditionalProperties { - objectMap[k] = v - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for MetricsResultInfo struct. -func (mri *MetricsResultInfo) UnmarshalJSON(body []byte) 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 mri.AdditionalProperties == nil { - mri.AdditionalProperties = make(map[string]interface{}) - } - mri.AdditionalProperties[k] = additionalProperties - } - case "start": - if v != nil { - var start date.Time - err = json.Unmarshal(*v, &start) - if err != nil { - return err - } - mri.Start = &start - } - case "end": - if v != nil { - var end date.Time - err = json.Unmarshal(*v, &end) - if err != nil { - return err - } - mri.End = &end - } - case "interval": - if v != nil { - var interval string - err = json.Unmarshal(*v, &interval) - if err != nil { - return err - } - mri.Interval = &interval - } - case "segments": - if v != nil { - var segments []MetricsSegmentInfo - err = json.Unmarshal(*v, &segments) - if err != nil { - return err - } - mri.Segments = &segments - } - } - } - - return nil -} - -// MetricsResultsItem ... -type MetricsResultsItem struct { - // ID - The specified ID for this metric. - ID *string `json:"id,omitempty"` - // Status - The HTTP status code of this metric query. - Status *int32 `json:"status,omitempty"` - // Body - The results of this metric query. - Body *MetricsResult `json:"body,omitempty"` -} - -// MetricsSegmentInfo a metric segment -type MetricsSegmentInfo struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // Start - Start time of the metric segment (only when an interval was specified). - Start *date.Time `json:"start,omitempty"` - // End - Start time of the metric segment (only when an interval was specified). - End *date.Time `json:"end,omitempty"` - // Segments - Segmented metric data (if further segmented). - Segments *[]MetricsSegmentInfo `json:"segments,omitempty"` -} - -// MarshalJSON is the custom marshaler for MetricsSegmentInfo. -func (msi MetricsSegmentInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if msi.Start != nil { - objectMap["start"] = msi.Start - } - if msi.End != nil { - objectMap["end"] = msi.End - } - if msi.Segments != nil { - objectMap["segments"] = msi.Segments - } - for k, v := range msi.AdditionalProperties { - objectMap[k] = v - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for MetricsSegmentInfo struct. -func (msi *MetricsSegmentInfo) UnmarshalJSON(body []byte) 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 msi.AdditionalProperties == nil { - msi.AdditionalProperties = make(map[string]interface{}) - } - msi.AdditionalProperties[k] = additionalProperties - } - case "start": - if v != nil { - var start date.Time - err = json.Unmarshal(*v, &start) - if err != nil { - return err - } - msi.Start = &start - } - case "end": - if v != nil { - var end date.Time - err = json.Unmarshal(*v, &end) - if err != nil { - return err - } - msi.End = &end - } - case "segments": - if v != nil { - var segments []MetricsSegmentInfo - err = json.Unmarshal(*v, &segments) - if err != nil { - return err - } - msi.Segments = &segments - } - } - } - - return nil -} - -// QueryBody the Analytics query. Learn more about the [Analytics query -// syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) -type QueryBody struct { - // Query - The query to execute. - Query *string `json:"query,omitempty"` - // Timespan - Optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression. - Timespan *string `json:"timespan,omitempty"` - // Applications - A list of Application IDs for cross-application queries. - Applications *[]string `json:"applications,omitempty"` -} - -// QueryResults contains the tables, columns & rows resulting from a query. -type QueryResults struct { - autorest.Response `json:"-"` - // Tables - The list of tables, columns and rows. - Tables *[]Table `json:"tables,omitempty"` -} - -// SetObject ... -type SetObject struct { - autorest.Response `json:"-"` - Value interface{} `json:"value,omitempty"` -} - -// Table contains the columns and rows for one table in a query response. -type Table struct { - // Name - The name of the table. - Name *string `json:"name,omitempty"` - // Columns - The list of columns in this table. - Columns *[]Column `json:"columns,omitempty"` - // Rows - The resulting rows from this query. - Rows *[][]interface{} `json:"rows,omitempty"` -} diff --git a/services/appinsights/v1/insights/query.go b/services/appinsights/v1/insights/query.go deleted file mode 100644 index ae9cd261f024..000000000000 --- a/services/appinsights/v1/insights/query.go +++ /dev/null @@ -1,123 +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/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// QueryClient is the composite Swagger for Application Insights Data Client -type QueryClient struct { - BaseClient -} - -// NewQueryClient creates an instance of the QueryClient client. -func NewQueryClient() QueryClient { - return NewQueryClientWithBaseURI(DefaultBaseURI) -} - -// NewQueryClientWithBaseURI creates an instance of the QueryClient client. -func NewQueryClientWithBaseURI(baseURI string) QueryClient { - return QueryClient{NewWithBaseURI(baseURI)} -} - -// Execute executes an Analytics query for data. -// [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) is an example for using POST with an -// Analytics query. -// Parameters: -// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure -// portal. -// body - the Analytics query. Learn more about the [Analytics query -// syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) -func (client QueryClient) Execute(ctx context.Context, appID string, body QueryBody) (result QueryResults, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QueryClient.Execute") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Query", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("insights.QueryClient", "Execute", err.Error()) - } - - req, err := client.ExecutePreparer(ctx, appID, body) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.QueryClient", "Execute", nil, "Failure preparing request") - return - } - - resp, err := client.ExecuteSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.QueryClient", "Execute", resp, "Failure sending request") - return - } - - result, err = client.ExecuteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.QueryClient", "Execute", resp, "Failure responding to request") - } - - return -} - -// ExecutePreparer prepares the Execute request. -func (client QueryClient) ExecutePreparer(ctx context.Context, appID string, body QueryBody) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/query", pathParameters), - autorest.WithJSON(body)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExecuteSender sends the Execute request. The method will close the -// http.Response Body if it receives an error. -func (client QueryClient) ExecuteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExecuteResponder handles the response to the Execute request. The method always -// closes the http.Response Body. -func (client QueryClient) ExecuteResponder(resp *http.Response) (result QueryResults, 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/automation/mgmt/2015-10-31/automation/dsccompilationjob.go b/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go index 239c0926be96..d82bca52bb16 100644 --- a/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go +++ b/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go @@ -46,7 +46,7 @@ func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string // Parameters: // resourceGroupName - name of an Azure Resource group. // automationAccountName - the name of the automation account. -// compilationJobID - the the DSC configuration Id. +// compilationJobID - the DSC configuration Id. // parameters - the parameters supplied to the create compilation job operation. func (client DscCompilationJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID, parameters DscCompilationJobCreateParameters) (result DscCompilationJob, err error) { if tracing.IsEnabled() { diff --git a/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go b/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go index 1336ef9e640c..1adb2650c6d0 100644 --- a/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go +++ b/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go @@ -405,7 +405,7 @@ func (client DscConfigurationClient) GetContentResponder(resp *http.Response) (r // automationAccountName - the name of the automation account. // filter - the filter to apply on the operation. // skip - the number of rows to skip. -// top - the the number of rows to take. +// top - the number of rows to take. // inlinecount - return total rows. func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultPage, err error) { if tracing.IsEnabled() { diff --git a/services/batch/2015-12-01.2.2/batch/application.go b/services/batch/2015-12-01.2.2/batch/application.go deleted file mode 100644 index 926b2b05a249..000000000000 --- a/services/batch/2015-12-01.2.2/batch/application.go +++ /dev/null @@ -1,240 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// ApplicationClient is the a client for issuing REST requests to the Azure Batch service. -type ApplicationClient struct { - BaseClient -} - -// NewApplicationClient creates an instance of the ApplicationClient client. -func NewApplicationClient() ApplicationClient { - return NewApplicationClientWithBaseURI(DefaultBaseURI) -} - -// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient client. -func NewApplicationClientWithBaseURI(baseURI string) ApplicationClient { - return ApplicationClient{NewWithBaseURI(baseURI)} -} - -// Get gets information about the specified application. -// -// applicationID is the id of the application. timeout is sets the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request -// identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ApplicationClient) Get(ctx context.Context, applicationID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationSummary, err error) { - req, err := client.GetPreparer(ctx, applicationID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationClient) GetPreparer(ctx context.Context, applicationID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationId": autorest.Encode("path", applicationID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/applications/{applicationId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ApplicationClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ApplicationClient) GetResponder(resp *http.Response) (result ApplicationSummary, 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 applications available in the specified account. -// -// maxResults is sets the maximum number of items to return in the response. timeout is sets the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller -// generated request identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ApplicationClient) List(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "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, "batch.ApplicationClient", "List", resp, "Failure sending request") - return - } - - result.alr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationClient) ListPreparer(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/applications"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ApplicationClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ApplicationClient) ListResponder(resp *http.Response) (result ApplicationListResult, 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 ApplicationClient) listNextResults(lastResults ApplicationListResult) (result ApplicationListResult, err error) { - req, err := lastResults.applicationListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.ApplicationClient", "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, "batch.ApplicationClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationClient) ListComplete(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultIterator, err error) { - result.page, err = client.List(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2015-12-01.2.2/batch/certificate.go b/services/batch/2015-12-01.2.2/batch/certificate.go deleted file mode 100644 index 76aa9b5d68b0..000000000000 --- a/services/batch/2015-12-01.2.2/batch/certificate.go +++ /dev/null @@ -1,518 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// CertificateClient is the a client for issuing REST requests to the Azure Batch service. -type CertificateClient struct { - BaseClient -} - -// NewCertificateClient creates an instance of the CertificateClient client. -func NewCertificateClient() CertificateClient { - return NewCertificateClientWithBaseURI(DefaultBaseURI) -} - -// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client. -func NewCertificateClientWithBaseURI(baseURI string) CertificateClient { - return CertificateClient{NewWithBaseURI(baseURI)} -} - -// Add adds a certificate to the specified account. -// -// certificate is specifies the certificate to be added. timeout is sets the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request -// identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client CertificateClient) Add(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: certificate, - Constraints: []validation.Constraint{{Target: "certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "certificate.ThumbprintAlgorithm", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "certificate.Data", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.CertificateClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, certificate, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client CertificateClient) AddPreparer(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/certificates"), - autorest.WithJSON(certificate), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// CancelDeletion cancels a failed deletion of a certificate from the specified account. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate being deleted. timeout is sets the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request -// identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client CertificateClient) CancelDeletion(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.CancelDeletionPreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", nil, "Failure preparing request") - return - } - - resp, err := client.CancelDeletionSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure sending request") - return - } - - result, err = client.CancelDeletionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure responding to request") - } - - return -} - -// CancelDeletionPreparer prepares the CancelDeletion request. -func (client CertificateClient) CancelDeletionPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CancelDeletionSender sends the CancelDeletion request. The method will close the -// http.Response Body if it receives an error. -func (client CertificateClient) CancelDeletionSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CancelDeletionResponder handles the response to the CancelDeletion request. The method always -// closes the http.Response Body. -func (client CertificateClient) CancelDeletionResponder(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 -} - -// Delete deletes a certificate from the specified account. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate to be deleted. timeout is sets the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request -// identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client CertificateClient) Delete(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CertificateClient) DeletePreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) 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 information about the specified certificate. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate to get. selectParameter is sets an OData $select clause. timeout is sets the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. -func (client CertificateClient) Get(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result Certificate, err error) { - req, err := client.GetPreparer(ctx, thumbprintAlgorithm, thumbprint, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client CertificateClient) GetPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) GetResponder(resp *http.Response) (result Certificate, 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 certificates that have been added to the specified account. -// -// filter is sets an OData $filter clause. selectParameter is sets an OData $select clause. maxResults is sets the -// maximum number of items to return in the response. timeout is sets the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request -// identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client CertificateClient) List(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "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, "batch.CertificateClient", "List", resp, "Failure sending request") - return - } - - result.clr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client CertificateClient) ListPreparer(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/certificates"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) ListResponder(resp *http.Response) (result CertificateListResult, 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 CertificateClient) listNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) { - req, err := lastResults.certificateListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.CertificateClient", "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, "batch.CertificateClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CertificateClient) ListComplete(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2015-12-01.2.2/batch/computenode.go b/services/batch/2015-12-01.2.2/batch/computenode.go deleted file mode 100644 index 58dc476b7863..000000000000 --- a/services/batch/2015-12-01.2.2/batch/computenode.go +++ /dev/null @@ -1,988 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// ComputeNodeClient is the a client for issuing REST requests to the Azure Batch service. -type ComputeNodeClient struct { - BaseClient -} - -// NewComputeNodeClient creates an instance of the ComputeNodeClient client. -func NewComputeNodeClient() ComputeNodeClient { - return NewComputeNodeClientWithBaseURI(DefaultBaseURI) -} - -// NewComputeNodeClientWithBaseURI creates an instance of the ComputeNodeClient client. -func NewComputeNodeClientWithBaseURI(baseURI string) ComputeNodeClient { - return ComputeNodeClient{NewWithBaseURI(baseURI)} -} - -// AddUser adds a user account to the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the machine on which you want -// to create a user account. userParameter is specifies the user account to be created. timeout is sets the maximum -// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is -// caller generated request identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) AddUser(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: userParameter, - Constraints: []validation.Constraint{{Target: "userParameter.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "userParameter.Password", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.ComputeNodeClient", "AddUser", err.Error()) - } - - req, err := client.AddUserPreparer(ctx, poolID, nodeID, userParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", nil, "Failure preparing request") - return - } - - resp, err := client.AddUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure sending request") - return - } - - result, err = client.AddUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure responding to request") - } - - return -} - -// AddUserPreparer prepares the AddUser request. -func (client ComputeNodeClient) AddUserPreparer(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users", pathParameters), - autorest.WithJSON(userParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddUserSender sends the AddUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) AddUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddUserResponder handles the response to the AddUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) AddUserResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteUser deletes a user account from the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the machine on which you want -// to delete a user account. userName is the name of the user account to delete. timeout is sets the maximum time -// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is -// caller generated request identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) DeleteUser(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteUserPreparer(ctx, poolID, nodeID, userName, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure sending request") - return - } - - result, err = client.DeleteUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure responding to request") - } - - return -} - -// DeleteUserPreparer prepares the DeleteUser request. -func (client ComputeNodeClient) DeleteUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - "userName": autorest.Encode("path", userName), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteUserSender sends the DeleteUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) DeleteUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteUserResponder handles the response to the DeleteUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) DeleteUserResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// DisableScheduling disable task scheduling of the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want -// to disable task scheduling. nodeDisableSchedulingParameter is the parameters for the request. timeout is sets -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) DisableScheduling(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisableSchedulingPreparer(ctx, poolID, nodeID, nodeDisableSchedulingParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSchedulingSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure sending request") - return - } - - result, err = client.DisableSchedulingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure responding to request") - } - - return -} - -// DisableSchedulingPreparer prepares the DisableScheduling request. -func (client ComputeNodeClient) DisableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/disablescheduling", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeDisableSchedulingParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeDisableSchedulingParameter)) - } - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableSchedulingSender sends the DisableScheduling request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) DisableSchedulingSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableSchedulingResponder handles the response to the DisableScheduling request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) DisableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EnableScheduling enable task scheduling of the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want -// to enable task scheduling. timeout is sets the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID -// with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is -// specifies if the server should return the client-request-id identifier in the response. ocpDate is the time the -// request was issued. If not specified, this header will be automatically populated with the current system clock -// time. -func (client ComputeNodeClient) EnableScheduling(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnableSchedulingPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSchedulingSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure sending request") - return - } - - result, err = client.EnableSchedulingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure responding to request") - } - - return -} - -// EnableSchedulingPreparer prepares the EnableScheduling request. -func (client ComputeNodeClient) EnableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/enablescheduling", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableSchedulingSender sends the EnableScheduling request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) EnableSchedulingSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableSchedulingResponder handles the response to the EnableScheduling request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) EnableSchedulingResponder(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 information about the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want -// to get information about. selectParameter is sets an OData $select clause. timeout is sets the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller -// generated request identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) Get(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNode, err error) { - req, err := client.GetPreparer(ctx, poolID, nodeID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ComputeNodeClient) GetPreparer(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ComputeNodeClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ComputeNodeClient) GetResponder(resp *http.Response) (result ComputeNode, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetRemoteDesktop gets the Remote Desktop Protocol file for the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node for which you -// want to get the Remote Desktop Protocol file. timeout is sets the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request -// identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) GetRemoteDesktop(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetRemoteDesktopPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", nil, "Failure preparing request") - return - } - - resp, err := client.GetRemoteDesktopSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure sending request") - return - } - - result, err = client.GetRemoteDesktopResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure responding to request") - } - - return -} - -// GetRemoteDesktopPreparer prepares the GetRemoteDesktop request. -func (client ComputeNodeClient) GetRemoteDesktopPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/rdp", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRemoteDesktopSender sends the GetRemoteDesktop request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) GetRemoteDesktopSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRemoteDesktopResponder handles the response to the GetRemoteDesktop request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) GetRemoteDesktopResponder(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 -} - -// List lists the compute nodes in the specified pool. -// -// poolID is the id of the pool from which you want to list nodes. filter is sets an OData $filter clause. -// selectParameter is sets an OData $select clause. maxResults is sets the maximum number of items to return in the -// response. timeout is sets the maximum time that the server can spend processing the request, in seconds. The -// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no -// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if -// the server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) List(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cnlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure sending request") - return - } - - result.cnlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ComputeNodeClient) ListPreparer(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ComputeNodeClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ComputeNodeClient) ListResponder(resp *http.Response) (result ComputeNodeListResult, 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 ComputeNodeClient) listNextResults(lastResults ComputeNodeListResult) (result ComputeNodeListResult, err error) { - req, err := lastResults.computeNodeListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "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, "batch.ComputeNodeClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ComputeNodeClient) ListComplete(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultIterator, err error) { - result.page, err = client.List(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Reboot restarts the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want -// to restart. nodeRebootParameter is the parameters for the request. timeout is sets the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller -// generated request identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) Reboot(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.RebootPreparer(ctx, poolID, nodeID, nodeRebootParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", nil, "Failure preparing request") - return - } - - resp, err := client.RebootSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure sending request") - return - } - - result, err = client.RebootResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure responding to request") - } - - return -} - -// RebootPreparer prepares the Reboot request. -func (client ComputeNodeClient) RebootPreparer(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reboot", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeRebootParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeRebootParameter)) - } - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RebootSender sends the Reboot request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) RebootSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// RebootResponder handles the response to the Reboot request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) RebootResponder(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 -} - -// Reimage reinstalls the operating system on the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want -// to restart. nodeReimageParameter is the parameters for the request. timeout is sets the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller -// generated request identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) Reimage(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ReimagePreparer(ctx, poolID, nodeID, nodeReimageParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", nil, "Failure preparing request") - return - } - - resp, err := client.ReimageSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure sending request") - return - } - - result, err = client.ReimageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure responding to request") - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client ComputeNodeClient) ReimagePreparer(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeReimageParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeReimageParameter)) - } - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) ReimageSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) ReimageResponder(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 -} - -// UpdateUser updates the password or expiration time of a user account on the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the machine on which you want -// to update a user account. userName is the name of the user account to update. nodeUpdateUserParameter is the -// parameters for the request. timeout is sets the maximum time that the server can spend processing the request, -// in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the form of a -// GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is -// specifies if the server should return the client-request-id identifier in the response. ocpDate is the time the -// request was issued. If not specified, this header will be automatically populated with the current system clock -// time. -func (client ComputeNodeClient) UpdateUser(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: nodeUpdateUserParameter, - Constraints: []validation.Constraint{{Target: "nodeUpdateUserParameter.Password", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.ComputeNodeClient", "UpdateUser", err.Error()) - } - - req, err := client.UpdateUserPreparer(ctx, poolID, nodeID, userName, nodeUpdateUserParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure sending request") - return - } - - result, err = client.UpdateUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure responding to request") - } - - return -} - -// UpdateUserPreparer prepares the UpdateUser request. -func (client ComputeNodeClient) UpdateUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - "userName": autorest.Encode("path", userName), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters), - autorest.WithJSON(nodeUpdateUserParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateUserSender sends the UpdateUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) UpdateUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateUserResponder handles the response to the UpdateUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) UpdateUserResponder(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/batch/2015-12-01.2.2/batch/file.go b/services/batch/2015-12-01.2.2/batch/file.go deleted file mode 100644 index 1e8d9600094c..000000000000 --- a/services/batch/2015-12-01.2.2/batch/file.go +++ /dev/null @@ -1,887 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// FileClient is the a client for issuing REST requests to the Azure Batch service. -type FileClient struct { - BaseClient -} - -// NewFileClient creates an instance of the FileClient client. -func NewFileClient() FileClient { - return NewFileClientWithBaseURI(DefaultBaseURI) -} - -// NewFileClientWithBaseURI creates an instance of the FileClient client. -func NewFileClientWithBaseURI(baseURI string) FileClient { - return FileClient{NewWithBaseURI(baseURI)} -} - -// DeleteFromComputeNode deletes the specified task file from the compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node from which you -// want to delete the file. fileName is the path to the file that you want to delete. recursive is sets whether to -// delete children of a directory. If the fileName parameter represents a directory instead of a file, you can set -// Recursive to true to delete the directory and all of the files and subdirectories in it. If Recursive is false -// then the directory must be empty or deletion will fail. timeout is sets the maximum time that the server can -// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request -// identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client FileClient) DeleteFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteFromComputeNodePreparer(ctx, poolID, nodeID, fileName, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteFromComputeNodeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.DeleteFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// DeleteFromComputeNodePreparer prepares the DeleteFromComputeNode request. -func (client FileClient) DeleteFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteFromComputeNodeSender sends the DeleteFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) DeleteFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteFromComputeNodeResponder handles the response to the DeleteFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) DeleteFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteFromTask deletes the specified task file from the compute node where the task ran. -// -// jobID is the id of the job that contains the task. taskID is the id of the task whose file you want to delete. -// fileName is the path to the task file that you want to delete. recursive is sets whether to delete children of a -// directory. If the fileName parameter represents a directory instead of a file, you can set Recursive to true to -// delete the directory and all of the files and subdirectories in it. If Recursive is false then the directory -// must be empty or deletion will fail. timeout is sets the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the -// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. -func (client FileClient) DeleteFromTask(ctx context.Context, jobID string, taskID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteFromTaskPreparer(ctx, jobID, taskID, fileName, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteFromTaskSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure sending request") - return - } - - result, err = client.DeleteFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure responding to request") - } - - return -} - -// DeleteFromTaskPreparer prepares the DeleteFromTask request. -func (client FileClient) DeleteFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteFromTaskSender sends the DeleteFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) DeleteFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteFromTaskResponder handles the response to the DeleteFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) DeleteFromTaskResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetFromComputeNode gets the content of the specified task file. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that contains -// the file. fileName is the path to the task file that you want to get the content of. timeout is sets the maximum -// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is -// caller generated request identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ocpRange is specifies the byte range -// to be retrieved. The default is to retrieve the entire file. The format is startRange-endRange. ifModifiedSince -// is specify this header to perform the operation only if the resource has been modified since the specified -// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been -// modified since the specified date/time. -func (client FileClient) GetFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetFromComputeNodePreparer(ctx, poolID, nodeID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.GetFromComputeNodeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.GetFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// GetFromComputeNodePreparer prepares the GetFromComputeNode request. -func (client FileClient) GetFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ocpRange) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-range", autorest.String(ocpRange))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetFromComputeNodeSender sends the GetFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetFromComputeNodeResponder handles the response to the GetFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) GetFromComputeNodeResponder(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 -} - -// GetFromTask gets the content of the specified task file. -// -// jobID is the id of the job that contains the task. taskID is the id of the task whose file you want to retrieve. -// fileName is the path to the task file that you want to get the content of. timeout is sets the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller -// generated request identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ocpRange is specifies the byte range -// to be retrieved. The default is to retrieve the entire file. The format is startRange-endRange. ifModifiedSince -// is specify this header to perform the operation only if the resource has been modified since the specified -// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been -// modified since the specified date/time. -func (client FileClient) GetFromTask(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetFromTaskPreparer(ctx, jobID, taskID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.GetFromTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure sending request") - return - } - - result, err = client.GetFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure responding to request") - } - - return -} - -// GetFromTaskPreparer prepares the GetFromTask request. -func (client FileClient) GetFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ocpRange) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-range", autorest.String(ocpRange))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetFromTaskSender sends the GetFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetFromTaskResponder handles the response to the GetFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) GetFromTaskResponder(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 -} - -// GetNodeFilePropertiesFromComputeNode gets the properties of the specified compute node file. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that contains -// the file. fileName is the path to the compute node file that you want to get the properties of. timeout is sets -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. ifModifiedSince is specify this -// header to perform the operation only if the resource has been modified since the specified date/time. -// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified -// since the specified date/time. -func (client FileClient) GetNodeFilePropertiesFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.GetNodeFilePropertiesFromComputeNodePreparer(ctx, poolID, nodeID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.GetNodeFilePropertiesFromComputeNodeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.GetNodeFilePropertiesFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// GetNodeFilePropertiesFromComputeNodePreparer prepares the GetNodeFilePropertiesFromComputeNode request. -func (client FileClient) GetNodeFilePropertiesFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetNodeFilePropertiesFromComputeNodeSender sends the GetNodeFilePropertiesFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetNodeFilePropertiesFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetNodeFilePropertiesFromComputeNodeResponder handles the response to the GetNodeFilePropertiesFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) GetNodeFilePropertiesFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetNodeFilePropertiesFromTask gets the properties of the specified task file. -// -// jobID is the id of the job that contains the task. taskID is the id of the task whose file you want to get the -// properties of. fileName is the path to the task file that you want to get the properties of. timeout is sets the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. ifModifiedSince is specify this -// header to perform the operation only if the resource has been modified since the specified date/time. -// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified -// since the specified date/time. -func (client FileClient) GetNodeFilePropertiesFromTask(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.GetNodeFilePropertiesFromTaskPreparer(ctx, jobID, taskID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.GetNodeFilePropertiesFromTaskSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", resp, "Failure sending request") - return - } - - result, err = client.GetNodeFilePropertiesFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", resp, "Failure responding to request") - } - - return -} - -// GetNodeFilePropertiesFromTaskPreparer prepares the GetNodeFilePropertiesFromTask request. -func (client FileClient) GetNodeFilePropertiesFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetNodeFilePropertiesFromTaskSender sends the GetNodeFilePropertiesFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetNodeFilePropertiesFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetNodeFilePropertiesFromTaskResponder handles the response to the GetNodeFilePropertiesFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) GetNodeFilePropertiesFromTaskResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// ListFromComputeNode lists all of the files in task directories on the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node whose files -// you want to list. filter is sets an OData $filter clause. recursive is sets whether to list children of a -// directory. maxResults is sets the maximum number of items to return in the response. timeout is sets the maximum -// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is -// caller generated request identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client FileClient) ListFromComputeNode(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) { - result.fn = client.listFromComputeNodeNextResults - req, err := client.ListFromComputeNodePreparer(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromComputeNodeSender(req) - if err != nil { - result.nflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure sending request") - return - } - - result.nflr, err = client.ListFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// ListFromComputeNodePreparer prepares the ListFromComputeNode request. -func (client FileClient) ListFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromComputeNodeSender sends the ListFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) ListFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromComputeNodeResponder handles the response to the ListFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) ListFromComputeNodeResponder(resp *http.Response) (result NodeFileListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromComputeNodeNextResults retrieves the next set of results, if any. -func (client FileClient) listFromComputeNodeNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) { - req, err := lastResults.nodeFileListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromComputeNodeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromComputeNodeComplete enumerates all values, automatically crossing page boundaries as required. -func (client FileClient) ListFromComputeNodeComplete(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) { - result.page, err = client.ListFromComputeNode(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListFromTask lists the files in a task's directory on its compute node. -// -// jobID is the id of the job that contains the task. taskID is the id of the task whose files you want to list. -// filter is sets an OData $filter clause. recursive is sets whether to list children of a directory. maxResults is -// sets the maximum number of items to return in the response. timeout is sets the maximum time that the server can -// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request -// identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client FileClient) ListFromTask(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) { - result.fn = client.listFromTaskNextResults - req, err := client.ListFromTaskPreparer(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromTaskSender(req) - if err != nil { - result.nflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure sending request") - return - } - - result.nflr, err = client.ListFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure responding to request") - } - - return -} - -// ListFromTaskPreparer prepares the ListFromTask request. -func (client FileClient) ListFromTaskPreparer(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromTaskSender sends the ListFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) ListFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromTaskResponder handles the response to the ListFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) ListFromTaskResponder(resp *http.Response) (result NodeFileListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromTaskNextResults retrieves the next set of results, if any. -func (client FileClient) listFromTaskNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) { - req, err := lastResults.nodeFileListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromTaskComplete enumerates all values, automatically crossing page boundaries as required. -func (client FileClient) ListFromTaskComplete(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) { - result.page, err = client.ListFromTask(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2015-12-01.2.2/batch/job.go b/services/batch/2015-12-01.2.2/batch/job.go deleted file mode 100644 index 36cb2d332cd5..000000000000 --- a/services/batch/2015-12-01.2.2/batch/job.go +++ /dev/null @@ -1,1336 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// JobClient is the a client for issuing REST requests to the Azure Batch service. -type JobClient struct { - BaseClient -} - -// NewJobClient creates an instance of the JobClient client. -func NewJobClient() JobClient { - return NewJobClientWithBaseURI(DefaultBaseURI) -} - -// NewJobClientWithBaseURI creates an instance of the JobClient client. -func NewJobClientWithBaseURI(baseURI string) JobClient { - return JobClient{NewWithBaseURI(baseURI)} -} - -// Add adds a job to the specified account. -// -// job is specifies the job to be added. timeout is sets the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the -// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. -func (client JobClient) Add(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: job, - Constraints: []validation.Constraint{{Target: "job.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, job, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client JobClient) AddPreparer(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobs"), - autorest.WithJSON(job), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a job. -// -// jobID is the id of the job to delete. timeout is sets the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the -// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation -// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this -// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince -// is specify this header to perform the operation only if the resource has been modified since the specified -// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been -// modified since the specified date/time. -func (client JobClient) Delete(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobClient) DeletePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) 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 -} - -// Disable disables the specified job, preventing new tasks from running. -// -// jobID is the id of the job to disable. jobDisableParameter is the parameters for the request. timeout is sets -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client JobClient) Disable(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisablePreparer(ctx, jobID, jobDisableParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure sending request") - return - } - - result, err = client.DisableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure responding to request") - } - - return -} - -// DisablePreparer prepares the Disable request. -func (client JobClient) DisablePreparer(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/disable", pathParameters), - autorest.WithJSON(jobDisableParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) DisableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableResponder handles the response to the Disable request. The method always -// closes the http.Response Body. -func (client JobClient) DisableResponder(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 -} - -// Enable enables the specified job, allowing new tasks to run. -// -// jobID is the id of the job to enable. timeout is sets the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the -// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation -// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this -// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince -// is specify this header to perform the operation only if the resource has been modified since the specified -// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been -// modified since the specified date/time. -func (client JobClient) Enable(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnablePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure sending request") - return - } - - result, err = client.EnableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure responding to request") - } - - return -} - -// EnablePreparer prepares the Enable request. -func (client JobClient) EnablePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/enable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) EnableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableResponder handles the response to the Enable request. The method always -// closes the http.Response Body. -func (client JobClient) EnableResponder(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 information about the specified job. -// -// jobID is the id of the job. selectParameter is sets an OData $select clause. expand is sets an OData $expand -// clause. timeout is sets the maximum time that the server can spend processing the request, in seconds. The -// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no -// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if -// the server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -func (client JobClient) Get(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJob, err error) { - req, err := client.GetPreparer(ctx, jobID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobClient) GetPreparer(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) GetResponder(resp *http.Response) (result CloudJob, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAllJobsLifetimeStatistics gets lifetime summary statistics for all of the jobs in the specified account. -// Statistics are aggregated across all jobs that have ever existed in the account, from account creation to the last -// update time of the statistics. -// -// timeout is sets the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as -// curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should -// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. -func (client JobClient) GetAllJobsLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result JobStatistics, err error) { - req, err := client.GetAllJobsLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", nil, "Failure preparing request") - return - } - - resp, err := client.GetAllJobsLifetimeStatisticsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", resp, "Failure sending request") - return - } - - result, err = client.GetAllJobsLifetimeStatisticsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", resp, "Failure responding to request") - } - - return -} - -// GetAllJobsLifetimeStatisticsPreparer prepares the GetAllJobsLifetimeStatistics request. -func (client JobClient) GetAllJobsLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/lifetimejobstats"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAllJobsLifetimeStatisticsSender sends the GetAllJobsLifetimeStatistics request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) GetAllJobsLifetimeStatisticsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetAllJobsLifetimeStatisticsResponder handles the response to the GetAllJobsLifetimeStatistics request. The method always -// closes the http.Response Body. -func (client JobClient) GetAllJobsLifetimeStatisticsResponder(resp *http.Response) (result JobStatistics, 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 jobs in the specified account. -// -// filter is sets an OData $filter clause. selectParameter is sets an OData $select clause. expand is sets an OData -// $expand clause. maxResults is sets the maximum number of items to return in the response. timeout is sets the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. -func (client JobClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cjlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure sending request") - return - } - - result.cjlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client JobClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobs"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) ListResponder(resp *http.Response) (result CloudJobListResult, 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 JobClient) listNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) { - req, err := lastResults.cloudJobListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "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, "batch.JobClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListFromJobSchedule lists the jobs that have been created under the specified job schedule. -// -// jobScheduleID is the id of the job schedule from which you want to get a list of jobs. filter is sets an OData -// $filter clause. selectParameter is sets an OData $select clause. expand is sets an OData $expand clause. -// maxResults is sets the maximum number of items to return in the response. timeout is sets the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller -// generated request identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client JobClient) ListFromJobSchedule(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) { - result.fn = client.listFromJobScheduleNextResults - req, err := client.ListFromJobSchedulePreparer(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromJobScheduleSender(req) - if err != nil { - result.cjlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure sending request") - return - } - - result.cjlr, err = client.ListFromJobScheduleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure responding to request") - } - - return -} - -// ListFromJobSchedulePreparer prepares the ListFromJobSchedule request. -func (client JobClient) ListFromJobSchedulePreparer(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/jobs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromJobScheduleSender sends the ListFromJobSchedule request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) ListFromJobScheduleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromJobScheduleResponder handles the response to the ListFromJobSchedule request. The method always -// closes the http.Response Body. -func (client JobClient) ListFromJobScheduleResponder(resp *http.Response) (result CloudJobListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromJobScheduleNextResults retrieves the next set of results, if any. -func (client JobClient) listFromJobScheduleNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) { - req, err := lastResults.cloudJobListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromJobScheduleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromJobScheduleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromJobScheduleComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListFromJobScheduleComplete(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) { - result.page, err = client.ListFromJobSchedule(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListPreparationAndReleaseTaskStatus lists the execution status of the Job Preparation and Job Release task for the -// specified job across the compute nodes where the job has run. -// -// jobID is the id of the job. filter is sets an OData $filter clause. selectParameter is sets an OData $select -// clause. maxResults is sets the maximum number of items to return in the response. timeout is sets the maximum -// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is -// caller generated request identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client JobClient) ListPreparationAndReleaseTaskStatus(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultPage, err error) { - result.fn = client.listPreparationAndReleaseTaskStatusNextResults - req, err := client.ListPreparationAndReleaseTaskStatusPreparer(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", nil, "Failure preparing request") - return - } - - resp, err := client.ListPreparationAndReleaseTaskStatusSender(req) - if err != nil { - result.cjlpartsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure sending request") - return - } - - result.cjlpartsr, err = client.ListPreparationAndReleaseTaskStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure responding to request") - } - - return -} - -// ListPreparationAndReleaseTaskStatusPreparer prepares the ListPreparationAndReleaseTaskStatus request. -func (client JobClient) ListPreparationAndReleaseTaskStatusPreparer(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/jobpreparationandreleasetaskstatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPreparationAndReleaseTaskStatusSender sends the ListPreparationAndReleaseTaskStatus request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) ListPreparationAndReleaseTaskStatusSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListPreparationAndReleaseTaskStatusResponder handles the response to the ListPreparationAndReleaseTaskStatus request. The method always -// closes the http.Response Body. -func (client JobClient) ListPreparationAndReleaseTaskStatusResponder(resp *http.Response) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listPreparationAndReleaseTaskStatusNextResults retrieves the next set of results, if any. -func (client JobClient) listPreparationAndReleaseTaskStatusNextResults(lastResults CloudJobListPreparationAndReleaseTaskStatusResult) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) { - req, err := lastResults.cloudJobListPreparationAndReleaseTaskStatusResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListPreparationAndReleaseTaskStatusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListPreparationAndReleaseTaskStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListPreparationAndReleaseTaskStatusComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListPreparationAndReleaseTaskStatusComplete(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultIterator, err error) { - result.page, err = client.ListPreparationAndReleaseTaskStatus(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch updates the properties of a job. -// -// jobID is the id of the job whose properties you want to update. jobPatchParameter is the parameters for the -// request. timeout is sets the maximum time that the server can spend processing the request, in seconds. The -// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no -// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if -// the server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobClient) Patch(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, jobID, jobPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client JobClient) PatchPreparer(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithJSON(jobPatchParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client JobClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Terminate terminates the specified job, marking it as completed. -// -// jobID is the id of the job to terminate. jobTerminateParameter is the parameters for the request. timeout is -// sets the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client JobClient) Terminate(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobID, jobTerminateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client JobClient) TerminatePreparer(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if jobTerminateParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(jobTerminateParameter)) - } - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client JobClient) TerminateResponder(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 -} - -// Update updates the properties of a job. -// -// jobID is the id of the job whose properties you want to update. jobUpdateParameter is the parameters for the -// request. timeout is sets the maximum time that the server can spend processing the request, in seconds. The -// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no -// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if -// the server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobClient) Update(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobUpdateParameter, - Constraints: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, jobID, jobUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client JobClient) UpdatePreparer(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithJSON(jobUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) UpdateResponder(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/batch/2015-12-01.2.2/batch/jobschedule.go b/services/batch/2015-12-01.2.2/batch/jobschedule.go deleted file mode 100644 index faf272a8ec74..000000000000 --- a/services/batch/2015-12-01.2.2/batch/jobschedule.go +++ /dev/null @@ -1,1126 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// JobScheduleClient is the a client for issuing REST requests to the Azure Batch service. -type JobScheduleClient struct { - BaseClient -} - -// NewJobScheduleClient creates an instance of the JobScheduleClient client. -func NewJobScheduleClient() JobScheduleClient { - return NewJobScheduleClientWithBaseURI(DefaultBaseURI) -} - -// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client. -func NewJobScheduleClientWithBaseURI(baseURI string) JobScheduleClient { - return JobScheduleClient{NewWithBaseURI(baseURI)} -} - -// Add adds a job schedule to the specified account. -// -// cloudJobSchedule is specifies the job schedule to be added. timeout is sets the maximum time that the server can -// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request -// identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client JobScheduleClient) Add(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: cloudJobSchedule, - Constraints: []validation.Constraint{{Target: "cloudJobSchedule.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.Schedule", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, cloudJobSchedule, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client JobScheduleClient) AddPreparer(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobschedules"), - autorest.WithJSON(cloudJobSchedule), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobScheduleClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a job schedule from the specified account. -// -// jobScheduleID is the id of the job schedule to delete. timeout is sets the maximum time that the server can -// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request -// identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Delete(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobScheduleClient) DeletePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) 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 -} - -// Disable disables a job schedule. -// -// jobScheduleID is the id of the job schedule to disable. timeout is sets the maximum time that the server can -// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request -// identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Disable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure sending request") - return - } - - result, err = client.DisableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure responding to request") - } - - return -} - -// DisablePreparer prepares the Disable request. -func (client JobScheduleClient) DisablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/disable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) DisableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableResponder handles the response to the Disable request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) DisableResponder(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 -} - -// Enable enables a job schedule. -// -// jobScheduleID is the id of the job schedule to enable. timeout is sets the maximum time that the server can -// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request -// identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Enable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure sending request") - return - } - - result, err = client.EnableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure responding to request") - } - - return -} - -// EnablePreparer prepares the Enable request. -func (client JobScheduleClient) EnablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/enable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) EnableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableResponder handles the response to the Enable request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) EnableResponder(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 -} - -// Exists checks the specified job schedule exists. -// -// jobScheduleID is the id of the job schedule which you want to check. selectParameter is sets an OData $select -// clause. timeout is sets the maximum time that the server can spend processing the request, in seconds. The -// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no -// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if -// the server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Exists(ctx context.Context, jobScheduleID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ExistsPreparer(ctx, jobScheduleID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", nil, "Failure preparing request") - return - } - - resp, err := client.ExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure sending request") - return - } - - result, err = client.ExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure responding to request") - } - - return -} - -// ExistsPreparer prepares the Exists request. -func (client JobScheduleClient) ExistsPreparer(ctx context.Context, jobScheduleID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExistsSender sends the Exists request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) ExistsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExistsResponder handles the response to the Exists request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) ExistsResponder(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 information about the specified job schedule. -// -// jobScheduleID is the id of the job schedule to get. selectParameter is sets an OData $select clause. expand is -// sets an OData $expand clause. timeout is sets the maximum time that the server can spend processing the request, -// in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the form of a -// GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is -// specifies if the server should return the client-request-id identifier in the response. ocpDate is the time the -// request was issued. If not specified, this header will be automatically populated with the current system clock -// time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the -// operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header -// to perform the operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince -// is specify this header to perform the operation only if the resource has not been modified since the specified -// date/time. -func (client JobScheduleClient) Get(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJobSchedule, err error) { - req, err := client.GetPreparer(ctx, jobScheduleID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobScheduleClient) GetPreparer(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) GetResponder(resp *http.Response) (result CloudJobSchedule, 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 job schedules in the specified account. -// -// filter is sets an OData $filter clause. selectParameter is sets an OData $select clause. expand is sets an OData -// $expand clause. maxResults is sets the maximum number of items to return in the response. timeout is sets the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. -func (client JobScheduleClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cjslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure sending request") - return - } - - result.cjslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client JobScheduleClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobschedules"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobScheduleClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) ListResponder(resp *http.Response) (result CloudJobScheduleListResult, 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 JobScheduleClient) listNextResults(lastResults CloudJobScheduleListResult) (result CloudJobScheduleListResult, err error) { - req, err := lastResults.cloudJobScheduleListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobScheduleClient", "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, "batch.JobScheduleClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobScheduleClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch updates the properties of the specified job schedule. -// -// jobScheduleID is the id of the job schedule to update. jobSchedulePatchParameter is the parameters for the -// request. timeout is sets the maximum time that the server can spend processing the request, in seconds. The -// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no -// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if -// the server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Patch(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, jobScheduleID, jobSchedulePatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client JobScheduleClient) PatchPreparer(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithJSON(jobSchedulePatchParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Terminate terminates a job schedule. -// -// jobScheduleID is the id of the job schedule to terminates. timeout is sets the maximum time that the server can -// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request -// identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Terminate(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client JobScheduleClient) TerminatePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) TerminateResponder(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 -} - -// Update updates the properties of the specified job schedule. -// -// jobScheduleID is the id of the job schedule to update. jobScheduleUpdateParameter is the parameters for the -// request. timeout is sets the maximum time that the server can spend processing the request, in seconds. The -// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no -// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if -// the server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Update(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobScheduleUpdateParameter, - Constraints: []validation.Constraint{{Target: "jobScheduleUpdateParameter.Schedule", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, jobScheduleID, jobScheduleUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client JobScheduleClient) UpdatePreparer(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithJSON(jobScheduleUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) UpdateResponder(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/batch/2015-12-01.2.2/batch/models.go b/services/batch/2015-12-01.2.2/batch/models.go deleted file mode 100644 index 17ed12b8f2fc..000000000000 --- a/services/batch/2015-12-01.2.2/batch/models.go +++ /dev/null @@ -1,2647 +0,0 @@ -package batch - -// 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" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "io" - "net/http" -) - -// AllocationState enumerates the values for allocation state. -type AllocationState string - -const ( - // Resizing ... - Resizing AllocationState = "resizing" - // Steady ... - Steady AllocationState = "steady" - // Stopping ... - Stopping AllocationState = "stopping" -) - -// CertificateFormat enumerates the values for certificate format. -type CertificateFormat string - -const ( - // Cer ... - Cer CertificateFormat = "cer" - // Pfx ... - Pfx CertificateFormat = "pfx" - // Unmapped ... - Unmapped CertificateFormat = "unmapped" -) - -// CertificateState enumerates the values for certificate state. -type CertificateState string - -const ( - // Active ... - Active CertificateState = "active" - // Deletefailed ... - Deletefailed CertificateState = "deletefailed" - // Deleting ... - Deleting CertificateState = "deleting" -) - -// CertificateStoreLocation enumerates the values for certificate store location. -type CertificateStoreLocation string - -const ( - // CertificateStoreLocationCurrentuser ... - CertificateStoreLocationCurrentuser CertificateStoreLocation = "currentuser" - // CertificateStoreLocationLocalmachine ... - CertificateStoreLocationLocalmachine CertificateStoreLocation = "localmachine" - // CertificateStoreLocationUnmapped ... - CertificateStoreLocationUnmapped CertificateStoreLocation = "unmapped" -) - -// ComputeNodeDeallocationOption enumerates the values for compute node deallocation option. -type ComputeNodeDeallocationOption string - -const ( - // Requeue ... - Requeue ComputeNodeDeallocationOption = "requeue" - // Retaineddata ... - Retaineddata ComputeNodeDeallocationOption = "retaineddata" - // Taskcompletion ... - Taskcompletion ComputeNodeDeallocationOption = "taskcompletion" - // Terminate ... - Terminate ComputeNodeDeallocationOption = "terminate" -) - -// ComputeNodeFillType enumerates the values for compute node fill type. -type ComputeNodeFillType string - -const ( - // ComputeNodeFillTypePack ... - ComputeNodeFillTypePack ComputeNodeFillType = "pack" - // ComputeNodeFillTypeSpread ... - ComputeNodeFillTypeSpread ComputeNodeFillType = "spread" - // ComputeNodeFillTypeUnmapped ... - ComputeNodeFillTypeUnmapped ComputeNodeFillType = "unmapped" -) - -// ComputeNodeRebootOption enumerates the values for compute node reboot option. -type ComputeNodeRebootOption string - -const ( - // ComputeNodeRebootOptionRequeue ... - ComputeNodeRebootOptionRequeue ComputeNodeRebootOption = "requeue" - // ComputeNodeRebootOptionRetaineddata ... - ComputeNodeRebootOptionRetaineddata ComputeNodeRebootOption = "retaineddata" - // ComputeNodeRebootOptionTaskcompletion ... - ComputeNodeRebootOptionTaskcompletion ComputeNodeRebootOption = "taskcompletion" - // ComputeNodeRebootOptionTerminate ... - ComputeNodeRebootOptionTerminate ComputeNodeRebootOption = "terminate" -) - -// ComputeNodeReimageOption enumerates the values for compute node reimage option. -type ComputeNodeReimageOption string - -const ( - // ComputeNodeReimageOptionRequeue ... - ComputeNodeReimageOptionRequeue ComputeNodeReimageOption = "requeue" - // ComputeNodeReimageOptionRetaineddata ... - ComputeNodeReimageOptionRetaineddata ComputeNodeReimageOption = "retaineddata" - // ComputeNodeReimageOptionTaskcompletion ... - ComputeNodeReimageOptionTaskcompletion ComputeNodeReimageOption = "taskcompletion" - // ComputeNodeReimageOptionTerminate ... - ComputeNodeReimageOptionTerminate ComputeNodeReimageOption = "terminate" -) - -// ComputeNodeState enumerates the values for compute node state. -type ComputeNodeState string - -const ( - // Creating ... - Creating ComputeNodeState = "creating" - // Idle ... - Idle ComputeNodeState = "idle" - // Leavingpool ... - Leavingpool ComputeNodeState = "leavingpool" - // Offline ... - Offline ComputeNodeState = "offline" - // Rebooting ... - Rebooting ComputeNodeState = "rebooting" - // Reimaging ... - Reimaging ComputeNodeState = "reimaging" - // Running ... - Running ComputeNodeState = "running" - // Starting ... - Starting ComputeNodeState = "starting" - // Starttaskfailed ... - Starttaskfailed ComputeNodeState = "starttaskfailed" - // Unknown ... - Unknown ComputeNodeState = "unknown" - // Unusable ... - Unusable ComputeNodeState = "unusable" - // Waitingforstarttask ... - Waitingforstarttask ComputeNodeState = "waitingforstarttask" -) - -// DisableComputeNodeSchedulingOption enumerates the values for disable compute node scheduling option. -type DisableComputeNodeSchedulingOption string - -const ( - // DisableComputeNodeSchedulingOptionRequeue ... - DisableComputeNodeSchedulingOptionRequeue DisableComputeNodeSchedulingOption = "requeue" - // DisableComputeNodeSchedulingOptionTaskcompletion ... - DisableComputeNodeSchedulingOptionTaskcompletion DisableComputeNodeSchedulingOption = "taskcompletion" - // DisableComputeNodeSchedulingOptionTerminate ... - DisableComputeNodeSchedulingOptionTerminate DisableComputeNodeSchedulingOption = "terminate" -) - -// DisableJobOption enumerates the values for disable job option. -type DisableJobOption string - -const ( - // DisableJobOptionRequeue ... - DisableJobOptionRequeue DisableJobOption = "requeue" - // DisableJobOptionTerminate ... - DisableJobOptionTerminate DisableJobOption = "terminate" - // DisableJobOptionWait ... - DisableJobOptionWait DisableJobOption = "wait" -) - -// JobPreparationTaskState enumerates the values for job preparation task state. -type JobPreparationTaskState string - -const ( - // JobPreparationTaskStateCompleted ... - JobPreparationTaskStateCompleted JobPreparationTaskState = "completed" - // JobPreparationTaskStateRunning ... - JobPreparationTaskStateRunning JobPreparationTaskState = "running" -) - -// JobReleaseTaskState enumerates the values for job release task state. -type JobReleaseTaskState string - -const ( - // JobReleaseTaskStateCompleted ... - JobReleaseTaskStateCompleted JobReleaseTaskState = "completed" - // JobReleaseTaskStateRunning ... - JobReleaseTaskStateRunning JobReleaseTaskState = "running" -) - -// JobScheduleState enumerates the values for job schedule state. -type JobScheduleState string - -const ( - // JobScheduleStateActive ... - JobScheduleStateActive JobScheduleState = "active" - // JobScheduleStateCompleted ... - JobScheduleStateCompleted JobScheduleState = "completed" - // JobScheduleStateDeleting ... - JobScheduleStateDeleting JobScheduleState = "deleting" - // JobScheduleStateDisabled ... - JobScheduleStateDisabled JobScheduleState = "disabled" - // JobScheduleStateTerminating ... - JobScheduleStateTerminating JobScheduleState = "terminating" -) - -// JobState enumerates the values for job state. -type JobState string - -const ( - // JobStateActive ... - JobStateActive JobState = "active" - // JobStateCompleted ... - JobStateCompleted JobState = "completed" - // JobStateDeleting ... - JobStateDeleting JobState = "deleting" - // JobStateDisabled ... - JobStateDisabled JobState = "disabled" - // JobStateDisabling ... - JobStateDisabling JobState = "disabling" - // JobStateEnabling ... - JobStateEnabling JobState = "enabling" - // JobStateTerminating ... - JobStateTerminating JobState = "terminating" -) - -// PoolLifetimeOption enumerates the values for pool lifetime option. -type PoolLifetimeOption string - -const ( - // PoolLifetimeOptionJob ... - PoolLifetimeOptionJob PoolLifetimeOption = "job" - // PoolLifetimeOptionJobschedule ... - PoolLifetimeOptionJobschedule PoolLifetimeOption = "jobschedule" - // PoolLifetimeOptionUnmapped ... - PoolLifetimeOptionUnmapped PoolLifetimeOption = "unmapped" -) - -// PoolState enumerates the values for pool state. -type PoolState string - -const ( - // PoolStateActive ... - PoolStateActive PoolState = "active" - // PoolStateDeleting ... - PoolStateDeleting PoolState = "deleting" - // PoolStateUpgrading ... - PoolStateUpgrading PoolState = "upgrading" -) - -// SchedulingErrorCategory enumerates the values for scheduling error category. -type SchedulingErrorCategory string - -const ( - // SchedulingErrorCategoryServererror ... - SchedulingErrorCategoryServererror SchedulingErrorCategory = "servererror" - // SchedulingErrorCategoryUnmapped ... - SchedulingErrorCategoryUnmapped SchedulingErrorCategory = "unmapped" - // SchedulingErrorCategoryUsererror ... - SchedulingErrorCategoryUsererror SchedulingErrorCategory = "usererror" -) - -// SchedulingState enumerates the values for scheduling state. -type SchedulingState string - -const ( - // Disabled ... - Disabled SchedulingState = "disabled" - // Enabled ... - Enabled SchedulingState = "enabled" -) - -// StartTaskState enumerates the values for start task state. -type StartTaskState string - -const ( - // StartTaskStateCompleted ... - StartTaskStateCompleted StartTaskState = "completed" - // StartTaskStateRunning ... - StartTaskStateRunning StartTaskState = "running" -) - -// TaskState enumerates the values for task state. -type TaskState string - -const ( - // TaskStateActive ... - TaskStateActive TaskState = "active" - // TaskStateCompleted ... - TaskStateCompleted TaskState = "completed" - // TaskStatePreparing ... - TaskStatePreparing TaskState = "preparing" - // TaskStateRunning ... - TaskStateRunning TaskState = "running" -) - -// AffinityInformation a locality hint that can be used by the Batch service to select a compute node on which to -// start a task. -type AffinityInformation struct { - // AffinityID - Gets or sets an opaque string representing the location of a compute node or a task that has run previously. You can pass the AffinityId of a compute node or task to indicate that this task needs to be placed close to the node or task. - AffinityID *string `json:"affinityId,omitempty"` -} - -// ApplicationListResult response to a ApplicationOperations.List request. -type ApplicationListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets the list of applications available in the account. - Value *[]ApplicationSummary `json:"value,omitempty"` - // OdataNextLink - Gets or sets the URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// ApplicationListResultIterator provides access to a complete listing of ApplicationSummary values. -type ApplicationListResultIterator struct { - i int - page ApplicationListResultPage -} - -// Next 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 *ApplicationListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationListResultIterator) 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 ApplicationListResultIterator) Response() ApplicationListResult { - 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 ApplicationListResultIterator) Value() ApplicationSummary { - if !iter.page.NotDone() { - return ApplicationSummary{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (alr ApplicationListResult) IsEmpty() bool { - return alr.Value == nil || len(*alr.Value) == 0 -} - -// applicationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alr ApplicationListResult) applicationListResultPreparer() (*http.Request, error) { - if alr.OdataNextLink == nil || len(to.String(alr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alr.OdataNextLink))) -} - -// ApplicationListResultPage contains a page of ApplicationSummary values. -type ApplicationListResultPage struct { - fn func(ApplicationListResult) (ApplicationListResult, error) - alr ApplicationListResult -} - -// 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. -func (page *ApplicationListResultPage) Next() error { - next, err := page.fn(page.alr) - if err != nil { - return err - } - page.alr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationListResultPage) NotDone() bool { - return !page.alr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationListResultPage) Response() ApplicationListResult { - return page.alr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationListResultPage) Values() []ApplicationSummary { - if page.alr.IsEmpty() { - return nil - } - return *page.alr.Value -} - -// ApplicationPackageReference a reference to an application package to be installed on compute nodes in a pool. -type ApplicationPackageReference struct { - // ApplicationID - Gets or sets the application package id. - ApplicationID *string `json:"applicationId,omitempty"` - // Version - Gets or sets the application package version. If not specified, the default is used. - Version *string `json:"version,omitempty"` -} - -// ApplicationSummary contains information about an application in an Azure Batch account. -type ApplicationSummary struct { - autorest.Response `json:"-"` - // ID - Gets or sets a string that uniquely identifies the application within the account. - ID *string `json:"id,omitempty"` - // DisplayName - Gets or sets the display name for the application. - DisplayName *string `json:"displayName,omitempty"` - Versions *[]string `json:"versions,omitempty"` -} - -// AutoPoolSpecification specifies characteristics for a temporary 'auto pool'. The Batch service will create this -// auto pool, run all the tasks for the job on it, and will delete the pool once the job has completed. -type AutoPoolSpecification struct { - // AutoPoolIDPrefix - Gets or sets a prefix to be added to the unique identifier when a pool is automatically created. The prefix can be up to 20 characters long. - AutoPoolIDPrefix *string `json:"autoPoolIdPrefix,omitempty"` - // PoolLifetimeOption - Gets or sets the minimum lifetime of created auto pools, and how multiple jobs on a schedule are assigned to pools. Possible values include: 'PoolLifetimeOptionJobschedule', 'PoolLifetimeOptionJob', 'PoolLifetimeOptionUnmapped' - PoolLifetimeOption PoolLifetimeOption `json:"poolLifetimeOption,omitempty"` - // KeepAlive - Gets or sets whether to keep an auto pool alive after its lifetime expires. - KeepAlive *bool `json:"keepAlive,omitempty"` - // Pool - Gets or sets the pool specification for the auto pool. - Pool *PoolSpecification `json:"pool,omitempty"` -} - -// AutoScaleRun the results and errors from an execution of a pool autoscale formula. -type AutoScaleRun struct { - autorest.Response `json:"-"` - // Timestamp - Gets or sets the time at which the autoscale formula was last evaluated. - Timestamp *date.Time `json:"timestamp,omitempty"` - // Results - Gets or sets the final values of all variables used in the evaluation of the autoscale formula. Each variable value is returned in the form $variable=value, and variables are separated by semicolons. - Results *string `json:"results,omitempty"` - // Error - Gets or sets details of the error encountered evaluating the autoscale formula on the pool, if the evaluation was unsuccessful. - Error *AutoScaleRunError `json:"error,omitempty"` -} - -// AutoScaleRunError an error that occurred when executing or evaluating a pool autoscale formula. -type AutoScaleRunError struct { - // Code - Gets or sets an identifier for the autoscale error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - Gets or sets a message describing the autoscale error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // Values - Gets or sets a list of additional error details related to the autoscale error. - Values *[]NameValuePair `json:"values,omitempty"` -} - -// Certificate a certificate that can be installed on compute nodes and can be used to authenticate operations on -// the machine. -type Certificate struct { - autorest.Response `json:"-"` - // Thumbprint - Get or sets the X.509 thumbprint of the certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed). - Thumbprint *string `json:"thumbprint,omitempty"` - // ThumbprintAlgorithm - Gets or sets the algorithm used to derive the thumbprint. This must be sha1. - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - // URL - Gets or sets the URL of the certificate. - URL *string `json:"url,omitempty"` - // State - Gets or sets the current state of the certificate. Possible values include: 'Active', 'Deleting', 'Deletefailed' - State CertificateState `json:"state,omitempty"` - // StateTransitionTime - Gets or sets the time at which the certificate entered its current state. - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - Gets or sets the previous state of the certificate. This property is not set if the certificate is in its initial Active state. Possible values include: 'Active', 'Deleting', 'Deletefailed' - PreviousState CertificateState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - Gets or sets the time at which the certificate entered its previous state. This property is not set if the certificate is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // PublicData - Gets or sets the public part of the certificate as a base-64 encoded .cer file. - PublicData *string `json:"publicData,omitempty"` - // DeleteCertificateError - Gets or sets the error that occurred on the last attempt to delete this certificate. This property is set only if the certificate is in the deletefailed state. - DeleteCertificateError *DeleteCertificateError `json:"deleteCertificateError,omitempty"` -} - -// CertificateAddParameter a certificate that can be installed on compute nodes and can be used to authenticate -// operations on the machine. -type CertificateAddParameter struct { - // Thumbprint - Get or sets the X.509 thumbprint of the certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed). - Thumbprint *string `json:"thumbprint,omitempty"` - // ThumbprintAlgorithm - Gets or sets the algorithm used to derive the thumbprint. This must be sha1. - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - // Data - Gets or sets the base64-encoded contents of the .pfx file containing the certificate. The maximum size is 10KB. This property is not populated by the Get Certificate operation. - Data *string `json:"data,omitempty"` - // CertificateFormat - Gets or sets the format of the certificate data. This must be pfx. Possible values include: 'Pfx', 'Cer', 'Unmapped' - CertificateFormat CertificateFormat `json:"certificateFormat,omitempty"` - // Password - Gets or sets the password to access the certificate's private key. This property is not populated by the Get Certificate operation. - Password *string `json:"password,omitempty"` -} - -// CertificateListResult response to a CertificateOperations.List request. -type CertificateListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets the list of certificates. - Value *[]Certificate `json:"value,omitempty"` - // OdataNextLink - Gets or sets the URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CertificateListResultIterator provides access to a complete listing of Certificate values. -type CertificateListResultIterator struct { - i int - page CertificateListResultPage -} - -// Next 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 *CertificateListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CertificateListResultIterator) 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 CertificateListResultIterator) Response() CertificateListResult { - 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 CertificateListResultIterator) Value() Certificate { - if !iter.page.NotDone() { - return Certificate{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (clr CertificateListResult) IsEmpty() bool { - return clr.Value == nil || len(*clr.Value) == 0 -} - -// certificateListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) { - if clr.OdataNextLink == nil || len(to.String(clr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(clr.OdataNextLink))) -} - -// CertificateListResultPage contains a page of Certificate values. -type CertificateListResultPage struct { - fn func(CertificateListResult) (CertificateListResult, error) - clr CertificateListResult -} - -// 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. -func (page *CertificateListResultPage) Next() error { - next, err := page.fn(page.clr) - if err != nil { - return err - } - page.clr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CertificateListResultPage) NotDone() bool { - return !page.clr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CertificateListResultPage) Response() CertificateListResult { - return page.clr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CertificateListResultPage) Values() []Certificate { - if page.clr.IsEmpty() { - return nil - } - return *page.clr.Value -} - -// CertificateReference a reference to a certificate to be installed on compute nodes in a pool. -type CertificateReference struct { - // Thumbprint - Gets or sets the thumbprint of the certificate. - Thumbprint *string `json:"thumbprint,omitempty"` - // ThumbprintAlgorithm - Gets or sets the algorithm with which the thumbprint is associated. This must be sha1. - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - // StoreLocation - Gets or sets the location of the certificate store on the compute node into which to install the certificate. The default value is CurrentUser. Possible values include: 'CertificateStoreLocationCurrentuser', 'CertificateStoreLocationLocalmachine', 'CertificateStoreLocationUnmapped' - StoreLocation CertificateStoreLocation `json:"storeLocation,omitempty"` - // StoreName - Gets or sets the name of the certificate store on the compute node into which to install the certificate. The default value is My. - StoreName *string `json:"storeName,omitempty"` - // Visibility - Gets or sets which user accounts on the compute node should have access to the private data of the certificate. This may be any subset of the values 'starttask', 'task' and 'rdp', separated by commas. The default is all accounts, corresponding to the string 'starttask,task,rdp'. - Visibility *string `json:"visibility,omitempty"` -} - -// CloudJob an Azure Batch job. -type CloudJob struct { - autorest.Response `json:"-"` - // ID - Gets or sets a string that uniquely identifies the job within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id. - ID *string `json:"id,omitempty"` - // DisplayName - Gets or sets the display name for the job. - DisplayName *string `json:"displayName,omitempty"` - // UsesTaskDependencies - Gets or sets the flag that determines if this job will use tasks with dependencies. - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` - // URL - Gets or sets the URL of the job. - URL *string `json:"url,omitempty"` - // ETag - Gets or sets the ETag of the job. - ETag *string `json:"eTag,omitempty"` - // LastModified - Gets or sets the last modified time of the job. - LastModified *date.Time `json:"lastModified,omitempty"` - // CreationTime - Gets or sets the creation time of the job. - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Gets or sets the current state of the job. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting' - State JobState `json:"state,omitempty"` - // StateTransitionTime - Gets or sets the time at which the job entered its current state. - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - Gets or sets the previous state of the job. This property is not set if the job is in its initial Active state. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting' - PreviousState JobState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - Gets or sets the time at which the job entered its previous state. This property is not set if the job is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // Priority - Gets or sets the priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. - Priority *int32 `json:"priority,omitempty"` - // Constraints - Gets or sets the execution constraints for the job. - Constraints *JobConstraints `json:"constraints,omitempty"` - // JobManagerTask - Gets or sets details of a Job Manager task to be launched when the job is started. - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - Gets or sets the Job Preparation task. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - Gets or sets the Job Release task. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - // CommonEnvironmentSettings - Gets or sets the list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks). - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - // PoolInfo - Gets or sets the pool on which the Batch service runs the job’s tasks. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - Gets or sets a list of name-value pairs associated with the job as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - // ExecutionInfo - Gets or sets the execution information for the job. - ExecutionInfo *JobExecutionInformation `json:"executionInfo,omitempty"` - // Stats - Gets or sets resource usage statistics for the entire lifetime of the job. - Stats *JobStatistics `json:"stats,omitempty"` -} - -// CloudJobListPreparationAndReleaseTaskStatusResult response to a -// CloudJobOperations.ListPreparationAndReleaseTaskStatus request. -type CloudJobListPreparationAndReleaseTaskStatusResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of Job Preparation and Job Release task execution information. - Value *[]JobPreparationAndReleaseTaskExecutionInformation `json:"value,omitempty"` - // OdataNextLink - Gets or sets the URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobListPreparationAndReleaseTaskStatusResultIterator provides access to a complete listing of -// JobPreparationAndReleaseTaskExecutionInformation values. -type CloudJobListPreparationAndReleaseTaskStatusResultIterator struct { - i int - page CloudJobListPreparationAndReleaseTaskStatusResultPage -} - -// Next 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 *CloudJobListPreparationAndReleaseTaskStatusResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) 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 CloudJobListPreparationAndReleaseTaskStatusResultIterator) Response() CloudJobListPreparationAndReleaseTaskStatusResult { - 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 CloudJobListPreparationAndReleaseTaskStatusResultIterator) Value() JobPreparationAndReleaseTaskExecutionInformation { - if !iter.page.NotDone() { - return JobPreparationAndReleaseTaskExecutionInformation{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) IsEmpty() bool { - return cjlpartsr.Value == nil || len(*cjlpartsr.Value) == 0 -} - -// cloudJobListPreparationAndReleaseTaskStatusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) cloudJobListPreparationAndReleaseTaskStatusResultPreparer() (*http.Request, error) { - if cjlpartsr.OdataNextLink == nil || len(to.String(cjlpartsr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjlpartsr.OdataNextLink))) -} - -// CloudJobListPreparationAndReleaseTaskStatusResultPage contains a page of -// JobPreparationAndReleaseTaskExecutionInformation values. -type CloudJobListPreparationAndReleaseTaskStatusResultPage struct { - fn func(CloudJobListPreparationAndReleaseTaskStatusResult) (CloudJobListPreparationAndReleaseTaskStatusResult, error) - cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult -} - -// 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. -func (page *CloudJobListPreparationAndReleaseTaskStatusResultPage) Next() error { - next, err := page.fn(page.cjlpartsr) - if err != nil { - return err - } - page.cjlpartsr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) NotDone() bool { - return !page.cjlpartsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Response() CloudJobListPreparationAndReleaseTaskStatusResult { - return page.cjlpartsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Values() []JobPreparationAndReleaseTaskExecutionInformation { - if page.cjlpartsr.IsEmpty() { - return nil - } - return *page.cjlpartsr.Value -} - -// CloudJobListResult response to a CloudJobOperations.List or ListFromJobSchedule request. -type CloudJobListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets the list of jobs. - Value *[]CloudJob `json:"value,omitempty"` - // OdataNextLink - Gets or sets the URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobListResultIterator provides access to a complete listing of CloudJob values. -type CloudJobListResultIterator struct { - i int - page CloudJobListResultPage -} - -// Next 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 *CloudJobListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobListResultIterator) 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 CloudJobListResultIterator) Response() CloudJobListResult { - 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 CloudJobListResultIterator) Value() CloudJob { - if !iter.page.NotDone() { - return CloudJob{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjlr CloudJobListResult) IsEmpty() bool { - return cjlr.Value == nil || len(*cjlr.Value) == 0 -} - -// cloudJobListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjlr CloudJobListResult) cloudJobListResultPreparer() (*http.Request, error) { - if cjlr.OdataNextLink == nil || len(to.String(cjlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjlr.OdataNextLink))) -} - -// CloudJobListResultPage contains a page of CloudJob values. -type CloudJobListResultPage struct { - fn func(CloudJobListResult) (CloudJobListResult, error) - cjlr CloudJobListResult -} - -// 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. -func (page *CloudJobListResultPage) Next() error { - next, err := page.fn(page.cjlr) - if err != nil { - return err - } - page.cjlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobListResultPage) NotDone() bool { - return !page.cjlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobListResultPage) Response() CloudJobListResult { - return page.cjlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobListResultPage) Values() []CloudJob { - if page.cjlr.IsEmpty() { - return nil - } - return *page.cjlr.Value -} - -// CloudJobSchedule a job schedule that allows recurring jobs by specifying when to run jobs and a specification -// used to create each job. -type CloudJobSchedule struct { - autorest.Response `json:"-"` - // ID - Gets or sets a string that uniquely identifies the schedule within the account. A GUID is recommended. - ID *string `json:"id,omitempty"` - // DisplayName - Gets or sets the display name for the schedule. - DisplayName *string `json:"displayName,omitempty"` - // URL - Gets or sets the URL of the job schedule. - URL *string `json:"url,omitempty"` - // ETag - Gets or sets the ETag of the job schedule. - ETag *string `json:"eTag,omitempty"` - // LastModified - Gets or sets the last modified time of the job schedule. - LastModified *date.Time `json:"lastModified,omitempty"` - // CreationTime - Gets or sets the creation time of the job schedule. - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Gets or sets the current state of the job schedule. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting' - State JobScheduleState `json:"state,omitempty"` - // StateTransitionTime - Gets or sets the time at which the job schedule entered the current state. - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - Gets or sets the previous state of the job schedule. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting' - PreviousState JobScheduleState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - Gets or sets the time at which the job schedule entered its previous state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // Schedule - Gets or sets the schedule according to which jobs will be created. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - Gets or sets the details of the jobs to be created on this schedule. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // ExecutionInfo - Gets or sets information about jobs that have been and will be run under this schedule. - ExecutionInfo *JobScheduleExecutionInformation `json:"executionInfo,omitempty"` - // Metadata - Gets or sets a list of name-value pairs associated with the schedule as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - // Stats - Gets or sets the lifetime resource usage statistics for the job schedule. - Stats *JobScheduleStatistics `json:"stats,omitempty"` -} - -// CloudJobScheduleListResult response to a CloudJobScheduleOperations.List request. -type CloudJobScheduleListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets the list of job schedules. - Value *[]CloudJobSchedule `json:"value,omitempty"` - // OdataNextLink - Gets or sets the URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobScheduleListResultIterator provides access to a complete listing of CloudJobSchedule values. -type CloudJobScheduleListResultIterator struct { - i int - page CloudJobScheduleListResultPage -} - -// Next 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 *CloudJobScheduleListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobScheduleListResultIterator) 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 CloudJobScheduleListResultIterator) Response() CloudJobScheduleListResult { - 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 CloudJobScheduleListResultIterator) Value() CloudJobSchedule { - if !iter.page.NotDone() { - return CloudJobSchedule{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjslr CloudJobScheduleListResult) IsEmpty() bool { - return cjslr.Value == nil || len(*cjslr.Value) == 0 -} - -// cloudJobScheduleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjslr CloudJobScheduleListResult) cloudJobScheduleListResultPreparer() (*http.Request, error) { - if cjslr.OdataNextLink == nil || len(to.String(cjslr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjslr.OdataNextLink))) -} - -// CloudJobScheduleListResultPage contains a page of CloudJobSchedule values. -type CloudJobScheduleListResultPage struct { - fn func(CloudJobScheduleListResult) (CloudJobScheduleListResult, error) - cjslr CloudJobScheduleListResult -} - -// 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. -func (page *CloudJobScheduleListResultPage) Next() error { - next, err := page.fn(page.cjslr) - if err != nil { - return err - } - page.cjslr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobScheduleListResultPage) NotDone() bool { - return !page.cjslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobScheduleListResultPage) Response() CloudJobScheduleListResult { - return page.cjslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobScheduleListResultPage) Values() []CloudJobSchedule { - if page.cjslr.IsEmpty() { - return nil - } - return *page.cjslr.Value -} - -// CloudPool a pool in the Azure Batch service. -type CloudPool struct { - autorest.Response `json:"-"` - // ID - Gets or sets a string that uniquely identifies the pool within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - Gets or sets the display name for the pool. - DisplayName *string `json:"displayName,omitempty"` - // URL - Gets or sets the URL of the pool. - URL *string `json:"url,omitempty"` - // ETag - Gets or sets the ETag of the pool. - ETag *string `json:"eTag,omitempty"` - // LastModified - Gets or sets the last modified time of the pool. - LastModified *date.Time `json:"lastModified,omitempty"` - // CreationTime - Gets or sets the creation time of the pool. - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Gets or sets the current state of the pool. Possible values include: 'PoolStateActive', 'PoolStateDeleting', 'PoolStateUpgrading' - State PoolState `json:"state,omitempty"` - // StateTransitionTime - Gets or sets the time at which the pool entered its current state. - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // AllocationState - Gets or sets whether the pool is resizing. Possible values include: 'Steady', 'Resizing', 'Stopping' - AllocationState AllocationState `json:"allocationState,omitempty"` - // AllocationStateTransitionTime - Gets or sets the time at which the pool entered its current allocation state. - AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"` - // VMSize - Gets or sets the size of virtual machines in the pool. All VMs in a pool are the same size. - VMSize *string `json:"vmSize,omitempty"` - // OsFamily - Gets or sets the Azure Guest OS family to be installed on the virtual machines in the pool. - OsFamily *string `json:"osFamily,omitempty"` - // TargetOSVersion - Gets or sets the Azure Guest OS version to be installed on the virtual machines in the pool. The default value is * which specifies the latest operating system version for the specified family. - TargetOSVersion *string `json:"targetOSVersion,omitempty"` - // CurrentOSVersion - Gets or sets the Azure Guest OS Version currently installed on the virtual machines in the pool. This may differ from TargetOSVersion if the pool state is Upgrading. - CurrentOSVersion *string `json:"currentOSVersion,omitempty"` - // ResizeTimeout - Gets or sets the timeout for allocation of compute nodes to the pool. In a Get Pool operation, this is the timeout for the most recent resize operation. The default value is 10 minutes. - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // ResizeError - Gets or sets details of any error encountered while performing the last resize on the pool. This property is set only if an error occurred during the last pool resize, and only when the pool AllocationState is Steady. - ResizeError *ResizeError `json:"resizeError,omitempty"` - // CurrentDedicated - Gets or sets the number of compute nodes currently in the pool. - CurrentDedicated *int32 `json:"currentDedicated,omitempty"` - // TargetDedicated - Gets or sets the desired number of compute nodes in the pool. This property must have the default value if EnableAutoScale is true. It is required if EnableAutoScale is false. - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // EnableAutoScale - Gets or sets whether the pool size should automatically adjust over time. If true, the AutoScaleFormula property must be set. If false, the TargetDedicated property must be set. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - Gets or sets a formula for the desired number of compute nodes in the pool. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - Gets or sets a time interval for the desired AutoScale evaluation period in the pool. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // AutoScaleRun - Gets or sets the results and errors from the last execution of the autoscale formula. - AutoScaleRun *AutoScaleRun `json:"autoScaleRun,omitempty"` - // EnableInterNodeCommunication - Gets or sets whether the pool permits direct communication between nodes. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - // StartTask - Gets or sets a task specified to run on each compute node as it joins the pool. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - Gets or sets the list of certificates to be installed on each compute node in the pool. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - Gets or sets the list of application packages to be installed on each compute node in the pool. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // MaxTasksPerNode - Gets or sets the maximum number of tasks that can run concurrently on a single compute node in the pool. - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - // TaskSchedulingPolicy - Gets or sets how the Batch service distributes tasks between compute nodes in the pool. - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - // Metadata - Gets or sets a list of name-value pairs associated with the pool as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - // Stats - Gets or sets utilization and resource usage statistics for the entire lifetime of the pool. - Stats *PoolStatistics `json:"stats,omitempty"` -} - -// CloudPoolListResult response to a CloudPoolOperations.List request. -type CloudPoolListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets the list of pools. - Value *[]CloudPool `json:"value,omitempty"` - // OdataNextLink - Gets or sets the URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudPoolListResultIterator provides access to a complete listing of CloudPool values. -type CloudPoolListResultIterator struct { - i int - page CloudPoolListResultPage -} - -// Next 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 *CloudPoolListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudPoolListResultIterator) 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 CloudPoolListResultIterator) Response() CloudPoolListResult { - 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 CloudPoolListResultIterator) Value() CloudPool { - if !iter.page.NotDone() { - return CloudPool{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cplr CloudPoolListResult) IsEmpty() bool { - return cplr.Value == nil || len(*cplr.Value) == 0 -} - -// cloudPoolListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cplr CloudPoolListResult) cloudPoolListResultPreparer() (*http.Request, error) { - if cplr.OdataNextLink == nil || len(to.String(cplr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cplr.OdataNextLink))) -} - -// CloudPoolListResultPage contains a page of CloudPool values. -type CloudPoolListResultPage struct { - fn func(CloudPoolListResult) (CloudPoolListResult, error) - cplr CloudPoolListResult -} - -// 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. -func (page *CloudPoolListResultPage) Next() error { - next, err := page.fn(page.cplr) - if err != nil { - return err - } - page.cplr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudPoolListResultPage) NotDone() bool { - return !page.cplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudPoolListResultPage) Response() CloudPoolListResult { - return page.cplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudPoolListResultPage) Values() []CloudPool { - if page.cplr.IsEmpty() { - return nil - } - return *page.cplr.Value -} - -// CloudTask an Azure Batch task. -type CloudTask struct { - autorest.Response `json:"-"` - // ID - Gets or sets a string that uniquely identifies the task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - Gets or sets a display name for the task. - DisplayName *string `json:"displayName,omitempty"` - // URL - Gets or sets the URL of the task. - URL *string `json:"url,omitempty"` - // ETag - Gets or sets the ETag of the task. - ETag *string `json:"eTag,omitempty"` - // LastModified - Gets or sets the last modified time of the task. - LastModified *date.Time `json:"lastModified,omitempty"` - // CreationTime - Gets or sets the creation time of the task. - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Gets or sets the current state of the task. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - State TaskState `json:"state,omitempty"` - // StateTransitionTime - Gets or sets the time at which the task entered its current state. - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - Gets or sets the previous state of the task. This property is not set if the task is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - PreviousState TaskState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - Gets or sets the time at which the task entered its previous state. This property is not set if the task is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // CommandLine - Gets or sets the command line of the task. For multi-instance tasks, the command line is executed on the primary subtask after all the subtasks have finished executing the coordianation command line. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Gets or sets a list of files that Batch will download to the compute node before running the command line. For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary subtask is executed. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // EnvironmentSettings - Gets or sets a list of environment variable settings for the task. - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // AffinityInfo - Gets or sets a locality hint that can be used by the Batch service to select a compute node on which to start the new task. - AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"` - // Constraints - Gets or sets the execution constraints that apply to this task. - Constraints *TaskConstraints `json:"constraints,omitempty"` - // RunElevated - Gets or sets whether to run the task in elevated mode. - RunElevated *bool `json:"runElevated,omitempty"` - // ExecutionInfo - Gets or sets information about the execution of the task. - ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"` - // NodeInfo - Gets or sets information about the compute node on which the task ran. - NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"` - // MultiInstanceSettings - Gets or sets information about how to run the multi-instance task. - MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"` - // Stats - Gets or sets resource usage statistics for the task. - Stats *TaskStatistics `json:"stats,omitempty"` - // DependsOn - Gets or sets any dependencies this task has. - DependsOn *TaskDependencies `json:"dependsOn,omitempty"` -} - -// CloudTaskListResult response to a CloudTaskOperations.List request. -type CloudTaskListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets the list of tasks. - Value *[]CloudTask `json:"value,omitempty"` - // OdataNextLink - Gets or sets the URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudTaskListResultIterator provides access to a complete listing of CloudTask values. -type CloudTaskListResultIterator struct { - i int - page CloudTaskListResultPage -} - -// Next 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 *CloudTaskListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudTaskListResultIterator) 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 CloudTaskListResultIterator) Response() CloudTaskListResult { - 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 CloudTaskListResultIterator) Value() CloudTask { - if !iter.page.NotDone() { - return CloudTask{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (ctlr CloudTaskListResult) IsEmpty() bool { - return ctlr.Value == nil || len(*ctlr.Value) == 0 -} - -// cloudTaskListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ctlr CloudTaskListResult) cloudTaskListResultPreparer() (*http.Request, error) { - if ctlr.OdataNextLink == nil || len(to.String(ctlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ctlr.OdataNextLink))) -} - -// CloudTaskListResultPage contains a page of CloudTask values. -type CloudTaskListResultPage struct { - fn func(CloudTaskListResult) (CloudTaskListResult, error) - ctlr CloudTaskListResult -} - -// 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. -func (page *CloudTaskListResultPage) Next() error { - next, err := page.fn(page.ctlr) - if err != nil { - return err - } - page.ctlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudTaskListResultPage) NotDone() bool { - return !page.ctlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudTaskListResultPage) Response() CloudTaskListResult { - return page.ctlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudTaskListResultPage) Values() []CloudTask { - if page.ctlr.IsEmpty() { - return nil - } - return *page.ctlr.Value -} - -// CloudTaskListSubtasksResult response to a CloudTaskOperations.ListSubtasks request. -type CloudTaskListSubtasksResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets the list of information of subtasks. - Value *[]SubtaskInformation `json:"value,omitempty"` -} - -// ComputeNode a compute node in the Batch service. -type ComputeNode struct { - autorest.Response `json:"-"` - // ID - Gets or sets the id of the compute node. - ID *string `json:"id,omitempty"` - // URL - Gets or sets the URL of the compute node. - URL *string `json:"url,omitempty"` - // State - Gets or sets the current state of the compute node. Possible values include: 'Idle', 'Rebooting', 'Reimaging', 'Running', 'Unusable', 'Creating', 'Starting', 'Waitingforstarttask', 'Starttaskfailed', 'Unknown', 'Leavingpool', 'Offline' - State ComputeNodeState `json:"state,omitempty"` - // SchedulingState - Gets or sets whether the compute node should be available for task scheduling. Possible values include: 'Enabled', 'Disabled' - SchedulingState SchedulingState `json:"schedulingState,omitempty"` - // StateTransitionTime - Gets or sets the time at which the compute node entered its current state. - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // LastBootTime - Gets or sets the time at which the compute node was started. - LastBootTime *date.Time `json:"lastBootTime,omitempty"` - // AllocationTime - Gets or sets the time at which this compute node was allocated to the pool. - AllocationTime *date.Time `json:"allocationTime,omitempty"` - // IPAddress - Gets or sets the IP address that other compute nodes can use to communicate with this compute node. - IPAddress *string `json:"ipAddress,omitempty"` - // AffinityID - Gets or sets an identifier which can be passed in the Add Task API to request that the task be scheduled close to this compute node. - AffinityID *string `json:"affinityId,omitempty"` - // VMSize - Gets or sets the size of the virtual machine hosting the compute node. - VMSize *string `json:"vmSize,omitempty"` - // TotalTasksRun - Gets or sets the total number of job tasks completed on the compute node. This includes Job Preparation, Job Release and Job Manager tasks, but not the pool start task. - TotalTasksRun *int32 `json:"totalTasksRun,omitempty"` - // RecentTasks - Gets or sets the list of tasks that are currently running on the compute node. - RecentTasks *[]TaskInformation `json:"recentTasks,omitempty"` - // StartTask - Gets or sets the task specified to run on the compute node as it joins the pool. - StartTask *StartTask `json:"startTask,omitempty"` - // StartTaskInfo - Gets or sets runtime information about the execution of the start task on the compute node. - StartTaskInfo *StartTaskInformation `json:"startTaskInfo,omitempty"` - // CertificateReferences - Gets or sets the list of certificates installed on the compute node. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // Errors - Gets or sets the list of errors that are currently being encountered by the compute node. - Errors *[]ComputeNodeError `json:"errors,omitempty"` -} - -// ComputeNodeError an error encountered by a compute node. -type ComputeNodeError struct { - // Code - Gets or sets an identifier for the compute node error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - Gets or sets a message describing the compute node error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // ErrorDetails - Gets or sets the list of additional error details related to the compute node error. - ErrorDetails *[]NameValuePair `json:"errorDetails,omitempty"` -} - -// ComputeNodeInformation information about the compute node on which a task ran. -type ComputeNodeInformation struct { - // AffinityID - Gets or sets an identifier for the compute node on which the task ran, which can be passed when adding a task to request that the task be scheduled close to this compute node. - AffinityID *string `json:"affinityId,omitempty"` - // NodeURL - Gets or sets the URL of the node on which the task ran. - NodeURL *string `json:"nodeUrl,omitempty"` - // PoolID - Gets or sets the id of the pool on which the task ran. - PoolID *string `json:"poolId,omitempty"` - // NodeID - Gets or sets the id of the node on which the task ran. - NodeID *string `json:"nodeId,omitempty"` - // TaskRootDirectory - Gets or sets the root directory of the task on the compute node. - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - // TaskRootDirectoryURL - Gets or sets the URL to the root directory of the task on the compute node. - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` -} - -// ComputeNodeListResult response to a ComputeNodeOperations.List request. -type ComputeNodeListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets the list of compute nodes. - Value *[]ComputeNode `json:"value,omitempty"` - // OdataNextLink - Gets or sets the URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// ComputeNodeListResultIterator provides access to a complete listing of ComputeNode values. -type ComputeNodeListResultIterator struct { - i int - page ComputeNodeListResultPage -} - -// Next 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 *ComputeNodeListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ComputeNodeListResultIterator) 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 ComputeNodeListResultIterator) Response() ComputeNodeListResult { - 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 ComputeNodeListResultIterator) Value() ComputeNode { - if !iter.page.NotDone() { - return ComputeNode{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cnlr ComputeNodeListResult) IsEmpty() bool { - return cnlr.Value == nil || len(*cnlr.Value) == 0 -} - -// computeNodeListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cnlr ComputeNodeListResult) computeNodeListResultPreparer() (*http.Request, error) { - if cnlr.OdataNextLink == nil || len(to.String(cnlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cnlr.OdataNextLink))) -} - -// ComputeNodeListResultPage contains a page of ComputeNode values. -type ComputeNodeListResultPage struct { - fn func(ComputeNodeListResult) (ComputeNodeListResult, error) - cnlr ComputeNodeListResult -} - -// 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. -func (page *ComputeNodeListResultPage) Next() error { - next, err := page.fn(page.cnlr) - if err != nil { - return err - } - page.cnlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ComputeNodeListResultPage) NotDone() bool { - return !page.cnlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ComputeNodeListResultPage) Response() ComputeNodeListResult { - return page.cnlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ComputeNodeListResultPage) Values() []ComputeNode { - if page.cnlr.IsEmpty() { - return nil - } - return *page.cnlr.Value -} - -// ComputeNodeUser an user account on a compute node. -type ComputeNodeUser struct { - // Name - Gets or sets the user name of the account. - Name *string `json:"name,omitempty"` - // IsAdmin - Gets or sets whether the account should be an administrator on the compute node. - IsAdmin *bool `json:"isAdmin,omitempty"` - // ExpiryTime - Gets or sets the time at which the account should expire. If omitted, the default is 1 day from the current time. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // Password - Gets or sets the password of the account. - Password *string `json:"password,omitempty"` -} - -// DeleteCertificateError an error encountered by the Batch service when deleting a certificate. -type DeleteCertificateError struct { - // Code - Gets or sets an identifier for the certificate deletion error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - Gets or sets a message describing the certificate deletion error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // Values - Gets or sets a list of additional error details related to the certificate deletion error. - Values *[]NameValuePair `json:"values,omitempty"` -} - -// EnvironmentSetting an environment variable to be set on a task process. -type EnvironmentSetting struct { - // Name - Gets or sets the name of the environment variable. - Name *string `json:"name,omitempty"` - // Value - Gets or sets the value of the environment variable. - Value *string `json:"value,omitempty"` -} - -// Error an error response received from the Azure Batch service. -type Error struct { - // Code - Gets or sets an identifier for the error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - Gets or sets a message describing the error, intended to be suitable for display in a user interface. - Message *ErrorMessage `json:"message,omitempty"` - // Values - Gets or sets a collection of key-value pairs containing additional details about the error. - Values *[]ErrorDetail `json:"values,omitempty"` -} - -// ErrorDetail an item of additional information included in an Azure Batch error response. -type ErrorDetail struct { - // Key - Gets or sets an identifier specifying the meaning of the Value property. - Key *string `json:"key,omitempty"` - // Value - Gets or sets the additional information included with the error response. - Value *string `json:"value,omitempty"` -} - -// ErrorMessage an error message received in an Azure Batch error response. -type ErrorMessage struct { - // Lang - Gets or sets the language code of the error message - Lang *string `json:"lang,omitempty"` - // Value - Gets or sets the text of the message. - Value *string `json:"value,omitempty"` -} - -// FileProperties the properties of a file on a compute node. -type FileProperties struct { - // CreationTime - Gets or sets the file creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModified - Gets or sets the time at which the file was last modified. - LastModified *date.Time `json:"lastModified,omitempty"` - // ContentLength - Gets or sets the length of the file. - ContentLength *int64 `json:"contentLength,omitempty"` - // ContentType - Gets or sets the content type of the file. - ContentType *string `json:"contentType,omitempty"` -} - -// JobAddParameter an Azure Batch job to add. -type JobAddParameter struct { - // ID - Gets or sets a string that uniquely identifies the job within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id. - ID *string `json:"id,omitempty"` - // DisplayName - Gets or sets the display name for the job. - DisplayName *string `json:"displayName,omitempty"` - // Priority - Gets or sets the priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. - Priority *int32 `json:"priority,omitempty"` - // Constraints - Gets or sets the execution constraints for the job. - Constraints *JobConstraints `json:"constraints,omitempty"` - // JobManagerTask - Gets or sets details of a Job Manager task to be launched when the job is started. - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - Gets or sets the Job Preparation task. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - Gets or sets the Job Release task. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - // CommonEnvironmentSettings - Gets or sets the list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks). - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - // PoolInfo - Gets or sets the pool on which the Batch service runs the job’s tasks. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - Gets or sets a list of name-value pairs associated with the job as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - // UsesTaskDependencies - Gets or sets the flag that determines if this job will use tasks with dependencies. - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` -} - -// JobConstraints specifies the execution constraints for jobs created on a schedule. -type JobConstraints struct { - // MaxWallClockTime - Gets or sets the maximum elapsed time that the job may run, measured from the time the job starts. If the job does not complete within the time limit, the Batch service terminates it and any tasks that are still running. - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // MaxTaskRetryCount - Gets or sets the maximum number of times each task may be retried. The Batch service retries a task if its exit code is nonzero. - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` -} - -// JobDisableParameter parameters for a CloudJobOperations.Disable request. -type JobDisableParameter struct { - // DisableTasks - Sets what to do with active tasks associated with the job. Possible values include: 'DisableJobOptionRequeue', 'DisableJobOptionTerminate', 'DisableJobOptionWait' - DisableTasks DisableJobOption `json:"disableTasks,omitempty"` -} - -// JobExecutionInformation contains information about the execution of a job in the Azure Batch service. -type JobExecutionInformation struct { - // StartTime - Gets or sets the start time of the job. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Gets or sets the completion time of the job. This property is set only if the job is in the completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // PoolID - Gets or sets the id of the pool to which this job is assigned. - PoolID *string `json:"poolId,omitempty"` - // SchedulingError - Gets or sets details of any error encountered by the service in starting the job. - SchedulingError *JobSchedulingError `json:"schedulingError,omitempty"` - // TerminateReason - Gets or sets a string describing the reason the job ended. - TerminateReason *string `json:"terminateReason,omitempty"` -} - -// JobManagerTask specifies details of a Job Manager task. -type JobManagerTask struct { - // ID - Gets or sets a string that uniquely identifies the Job Manager task. A GUID is recommended. - ID *string `json:"id,omitempty"` - // DisplayName - Gets or sets the display name of the Job Manager task. - DisplayName *string `json:"displayName,omitempty"` - // CommandLine - Gets or sets the command line of the Job Manager task. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Gets or sets a list of files that Batch will download to the compute node before running the command line. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // EnvironmentSettings - Gets or sets a list of environment variable settings for the Job Manager task. - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // Constraints - Gets or sets constraints that apply to the Job Manager task. - Constraints *TaskConstraints `json:"constraints,omitempty"` - // KillJobOnCompletion - Gets or sets whether completion of the Job Manager task signifies completion of the entire job. - KillJobOnCompletion *bool `json:"killJobOnCompletion,omitempty"` - // RunElevated - Gets or sets whether to run the Job Manager task in elevated mode. The default value is false. - RunElevated *bool `json:"runElevated,omitempty"` - // RunExclusive - Gets or sets whether the Job Manager task requires exclusive use of the compute node where it runs. - RunExclusive *bool `json:"runExclusive,omitempty"` -} - -// JobPatchParameter parameters for a CloudJobOperations.Patch request. -type JobPatchParameter struct { - // Priority - Sets the priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged. - Priority *int32 `json:"priority,omitempty"` - // Constraints - Sets the execution constraints for the job. If omitted, the existing execution constraints are left unchanged. - Constraints *JobConstraints `json:"constraints,omitempty"` - // PoolInfo - Sets the pool on which the Batch service runs the job's tasks. If omitted, the job continues to run on its current pool. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - Sets a list of name-value pairs associated with the job as metadata. If omitted, the existing job metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobPreparationAndReleaseTaskExecutionInformation the status of the Job Preparation and Job Release tasks on a -// particular compute node. -type JobPreparationAndReleaseTaskExecutionInformation struct { - // PoolID - Gets or sets the id of the pool containing the compute node to which this entry refers. - PoolID *string `json:"poolId,omitempty"` - // NodeID - Gets or sets the id of the compute node to which this entry refers. - NodeID *string `json:"nodeId,omitempty"` - // NodeURL - Gets or sets the URL of the compute node to which this entry refers. - NodeURL *string `json:"nodeUrl,omitempty"` - // JobPreparationTaskExecutionInfo - Gets or sets information about the execution status of the Job Preparation task on this compute node. - JobPreparationTaskExecutionInfo *JobPreparationTaskExecutionInformation `json:"jobPreparationTaskExecutionInfo,omitempty"` - // JobReleaseTaskExecutionInfo - Gets or sets information about the execution status of the Job Release task on this compute node. This property is set only if the Job Release task has run on the node. - JobReleaseTaskExecutionInfo *JobReleaseTaskExecutionInformation `json:"jobReleaseTaskExecutionInfo,omitempty"` -} - -// JobPreparationTask a Job Preparation task to run before any tasks of the job on any given compute node. -type JobPreparationTask struct { - // ID - Gets or sets a string that uniquely identifies the job preparation task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // CommandLine - Gets or sets the command line of the Job Preparation task. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Gets or sets a list of files that Batch will download to the compute node before running the command line. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // EnvironmentSettings - Gets or sets a list of environment variable settings for the Job Preparation task. - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // Constraints - Gets or sets constraints that apply to the Job Preparation task.. - Constraints *TaskConstraints `json:"constraints,omitempty"` - // WaitForSuccess - Gets or sets whether the Batch Service should wait for the Job Preparation task to complete successfully before scheduling any other tasks of the job on the compute node. - WaitForSuccess *bool `json:"waitForSuccess,omitempty"` - // RunElevated - Gets or sets whether to run the Job Preparation task in elevated mode. The default value is false. - RunElevated *bool `json:"runElevated,omitempty"` - // RerunOnNodeRebootAfterSuccess - Gets or sets whether the Batch service should rerun the Job Preparation task after a compute node reboots. The default value is true. - RerunOnNodeRebootAfterSuccess *bool `json:"rerunOnNodeRebootAfterSuccess,omitempty"` -} - -// JobPreparationTaskExecutionInformation contains information about the execution of a Job Preparation task on a -// compute node. -type JobPreparationTaskExecutionInformation struct { - // StartTime - Gets or sets the time at which the Job Preparation task started running. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Gets or sets the time at which the Job Preparation task completed. This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // State - Gets or sets the current running state of the Job Preparation task on the compute node. Possible values include: 'JobPreparationTaskStateRunning', 'JobPreparationTaskStateCompleted' - State JobPreparationTaskState `json:"state,omitempty"` - // TaskRootDirectory - Gets or sets the root directory of the Job Preparation task on the compute node. - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - // TaskRootDirectoryURL - Gets or sets the URL to the root directory of the Job Preparation task on the compute node. - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` - // ExitCode - Gets or sets the exit code of the Job Preparation task. This property is set only if the task is in the Completed state. - ExitCode *int32 `json:"exitCode,omitempty"` - // SchedulingError - Gets or sets any error starting the Job Preparation task. - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - // RetryCount - Gets or sets the number of times the Job Preparation task has been retried by the Batch service. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - Gets or sets the most recent time at which a retry of the Job Preparation task started running. This property is set only if the task was retried (i.e. retryCount is nonzero). - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` -} - -// JobReleaseTask a Job Release task to run on job completion on any compute node where the job has run. -type JobReleaseTask struct { - // ID - Gets or sets a string that uniquely identifies the Job Release task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // CommandLine - Gets or sets the command line of the Job Release task. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Gets or sets a list of files that Batch will download to the compute node before running the command line. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // EnvironmentSettings - Gets or sets a list of environment variable settings for the Job Release task. - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // MaxWallClockTime - Gets or sets the maximum elapsed time that the Job Release task may run on a given compute node, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it. The default value is 15 minutes. - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // RetentionTime - Gets or sets the minimum time to retain the working directory for the Job Release task on the compute node. After this time, the Batch service may delete the working directory and all its contents. The default is infinite. - RetentionTime *string `json:"retentionTime,omitempty"` - // RunElevated - Gets or sets whether to run the Job Release task in elevated mode. The default value is false. - RunElevated *bool `json:"runElevated,omitempty"` -} - -// JobReleaseTaskExecutionInformation contains information about the execution of a Job Release task on a compute -// node. -type JobReleaseTaskExecutionInformation struct { - // StartTime - Gets or sets the time at which the Job Release task started running. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Gets or sets the time at which the Job Release task completed. This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // State - Gets or sets the current running state of the Job Release task on the compute node. Possible values include: 'JobReleaseTaskStateRunning', 'JobReleaseTaskStateCompleted' - State JobReleaseTaskState `json:"state,omitempty"` - // TaskRootDirectory - Gets or sets the root directory of the Job Release task on the compute node. - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - // TaskRootDirectoryURL - Gets or sets the URL to the root directory of the Job Release task on the compute node. - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` - // ExitCode - Gets or sets the exit code of the Job Release task. This property is set only if the task is in the Completed state. - ExitCode *int32 `json:"exitCode,omitempty"` - // SchedulingError - Gets or sets any error starting the Job Release task. - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` -} - -// JobScheduleAddParameter a job schedule that allows recurring jobs by specifying when to run jobs and a -// specification used to create each job. -type JobScheduleAddParameter struct { - // ID - Gets or sets a string that uniquely identifies the schedule within the account. A GUID is recommended. - ID *string `json:"id,omitempty"` - // DisplayName - Gets or sets the display name for the schedule. - DisplayName *string `json:"displayName,omitempty"` - // Schedule - Gets or sets the schedule according to which jobs will be created. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - Gets or sets the details of the jobs to be created on this schedule. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - Gets or sets a list of name-value pairs associated with the schedule as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobScheduleExecutionInformation specifies how tasks should be run in a job associated with a job schedule. -type JobScheduleExecutionInformation struct { - // NextRunTime - Gets or sets the next time at which a job will be created under this schedule. - NextRunTime *date.Time `json:"nextRunTime,omitempty"` - // RecentJob - Gets or sets information about the most recent job under the job schedule. - RecentJob *RecentJob `json:"recentJob,omitempty"` - // EndTime - Gets or sets the time at which the schedule ended. This property is set only if the job schedule is in the completed state. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// JobSchedulePatchParameter parameters for a CloudJobScheduleOperations.Patch request. -type JobSchedulePatchParameter struct { - // Schedule - Sets the schedule according to which jobs will be created. If you do not specify this element, the existing schedule is not modified. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - Sets the details of the jobs to be created on this schedule. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - Sets a list of name-value pairs associated with the job schedule as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobScheduleStatistics the lifetime resource usage statistics for a job schedule. -type JobScheduleStatistics struct { - // URL - Gets or sets the URL for the statistics. - URL *string `json:"url,omitempty"` - // StartTime - Gets or sets the start time of the time range covered by the statistics. - StartTime *date.Time `json:"startTime,omitempty"` - // LastUpdateTime - Gets or sets the time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - // UserCPUTime - Gets or sets the total user mode CPU time (summed across all cores and all compute nodes) consumed by all the tasks in all the jobs created under the schedule. - UserCPUTime *string `json:"userCPUTime,omitempty"` - // KernelCPUTime - Gets or sets the total kernel mode CPU time (summed across all cores and all compute nodes) consumed by all the tasks in all the jobs created under the schedule. - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - Gets or sets the total wall clock time of all the tasks in all the jobs created under the schedule. - WallClockTime *string `json:"wallClockTime,omitempty"` - // ReadIOps - Gets or sets the total number of I/O read operations performed by all the tasks in all the jobs created under the schedule. - ReadIOps *int64 `json:"readIOps,omitempty"` - // WriteIOps - Gets or sets the total number of I/O write operations performed by all the tasks in all the jobs created under the schedule. - WriteIOps *int64 `json:"writeIOps,omitempty"` - // ReadIOGiB - Gets or sets the total amount of data in GiB of I/O read by all the tasks in all the jobs created under the schedule. - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - // WriteIOGiB - Gets or sets the total amount of data in GiB of I/O written by all the tasks in all the jobs created under the schedule. - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - // NumSucceededTasks - Gets or sets the total number of tasks successfully completed during the given time range in jobs created under the schedule. A task completes successfully if it returns exit code 0. - NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"` - // NumFailedTasks - Gets or sets the total number of tasks that failed during the given time range in jobs created under the schedule. A task fails if it exhausts its maximum retry count without returning exit code 0. - NumFailedTasks *int64 `json:"numFailedTasks,omitempty"` - // NumTaskRetries - Gets or sets the total number of retries during the given time range on all the tasks in jobs created under the schedule. - NumTaskRetries *int64 `json:"numTaskRetries,omitempty"` - // WaitTime - Gets or sets the total wait time of all the tasks in jobs created under the schedule. - WaitTime *string `json:"waitTime,omitempty"` -} - -// JobScheduleUpdateParameter parameters for a CloudJobScheduleOperations.Update request. -type JobScheduleUpdateParameter struct { - // Schedule - Sets the schedule according to which jobs will be created. If you do not specify this element, it is equivalent to passing the default schedule: that is, a single job scheduled to run immediately. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - Sets details of the jobs to be created on this schedule. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - Sets a list of name-value pairs associated with the job schedule as metadata. If you do not specify this element, it takes the default value of an empty list; in effect, any existing metadata is deleted. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobSchedulingError an error encountered by the Batch service when scheduling a job. -type JobSchedulingError struct { - // Category - Gets or sets the category of the job scheduling error. Possible values include: 'SchedulingErrorCategoryUsererror', 'SchedulingErrorCategoryServererror', 'SchedulingErrorCategoryUnmapped' - Category SchedulingErrorCategory `json:"category,omitempty"` - // Code - Gets or sets an identifier for the job scheduling error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - Gets or sets a message describing the job scheduling error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // Details - Gets or sets a list of additional error details related to the scheduling error. - Details *[]NameValuePair `json:"details,omitempty"` -} - -// JobSpecification specifies details of the jobs to be created on a schedule. -type JobSpecification struct { - // Priority - Gets or sets the priority of jobs created under this schedule. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. - Priority *int32 `json:"priority,omitempty"` - // DisplayName - Gets or sets the display name for jobs created under this schedule. It need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // UsesTaskDependencies - Gets or sets the flag that determines if this job will use tasks with dependencies. - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` - // Constraints - Gets or sets the execution constraints for jobs created under this schedule. - Constraints *JobConstraints `json:"constraints,omitempty"` - // JobManagerTask - Gets or sets the details of a Job Manager task to be launched when a job is started under this schedule. - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - Gets or sets the Job Preparation task for jobs created under this schedule. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - Gets or sets the Job Release task for jobs created under this schedule. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - // CommonEnvironmentSettings - Gets or sets a list of common environment variable settings. These environment variables are set for all tasks in jobs created under this schedule (including the Job Manager, Job Preparation and Job Release tasks). - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - // PoolInfo - Gets or sets the pool on which the Batch service runs the tasks of jobs created under this schedule. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - Gets or sets a list of name-value pairs associated with each job created under this schedule as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobStatistics resource usage statistics for a job. -type JobStatistics struct { - autorest.Response `json:"-"` - // URL - Gets or sets the URL for the statistics. - URL *string `json:"url,omitempty"` - // StartTime - Gets or sets the start time of the time range covered by the statistics. - StartTime *date.Time `json:"startTime,omitempty"` - // LastUpdateTime - Gets or sets the time at which the statistics were last updated. All statistics are limited to the range between StartTime and LastUpdateTime. - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - // UserCPUTime - Gets or sets the total user mode CPU time (summed across all cores and all compute nodes) consumed by all the tasks in the job. - UserCPUTime *string `json:"userCPUTime,omitempty"` - // KernelCPUTime - Gets or sets the total kernel mode CPU time (summed across all cores and all compute nodes) consumed by all the tasks in the job. - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - Gets or sets the total wall clock time of all the tasks in the job. - WallClockTime *string `json:"wallClockTime,omitempty"` - // ReadIOps - Gets or sets the total number of I/O read operations performed by all the tasks in the job. - ReadIOps *int64 `json:"readIOps,omitempty"` - // WriteIOps - Gets or sets the total number of I/O write operations performed by all the tasks in the job. - WriteIOps *int64 `json:"writeIOps,omitempty"` - // ReadIOGiB - Gets or sets the total amount of data in GiB of I/O read by all the tasks in the job. - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - // WriteIOGiB - Gets or sets the total amount of data in GiB of I/O written by all the tasks in the job. - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - // NumSucceededTasks - Gets or sets the total number of tasks successfully completed in the job during the given time range. - NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"` - // NumFailedTasks - Gets or sets the total number of tasks in the job that failed during the given time range. - NumFailedTasks *int64 `json:"numFailedTasks,omitempty"` - // NumTaskRetries - Gets or sets the total number of retries on all the tasks in the job during the given time range. - NumTaskRetries *int64 `json:"numTaskRetries,omitempty"` - // WaitTime - Gets or sets the total wait time of all the tasks in the job. The wait time for a task is defined as the elapsed time between the creation of the task creation and the start of task execution. This value is reported only in the account lifetime statistics; it is not included in individual job statistics. - WaitTime *string `json:"waitTime,omitempty"` -} - -// JobTerminateParameter parameters for a CloudJobOperations.Terminate request. -type JobTerminateParameter struct { - // TerminateReason - Sets the text you want to appear as the job's TerminateReason. The default is 'UserTerminate'. - TerminateReason *string `json:"terminateReason,omitempty"` -} - -// JobUpdateParameter parameters for a CloudJobOperations.Update request. -type JobUpdateParameter struct { - // Priority - Sets the priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged. - Priority *int32 `json:"priority,omitempty"` - // Constraints - Sets the execution constraints for the job. If omitted, the existing execution constraints are left unchanged. - Constraints *JobConstraints `json:"constraints,omitempty"` - // PoolInfo - Sets the pool on which the Batch service runs the job's tasks. If omitted, the job continues to run on its current pool. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - Sets a list of name-value pairs associated with the job as metadata. If omitted, the existing job metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// MetadataItem a metadata item associated with an Azure Batch resource. The Batch service does not assign any -// meaning to metadata; it is solely for the use of user code. -type MetadataItem struct { - // Name - Gets or sets the name of the metadata item. - Name *string `json:"name,omitempty"` - // Value - Gets or sets the value of the metadata item. - Value *string `json:"value,omitempty"` -} - -// MultiInstanceSettings information about the settings required for multi-instance task. -type MultiInstanceSettings struct { - // NumberOfInstances - Gets or sets the number of compute node instances used for multi-instance task. - NumberOfInstances *int32 `json:"numberOfInstances,omitempty"` - // CoordinationCommandLine - Gets or sets the command to be run on the compute node instances to setup coordination among the subtasks. - CoordinationCommandLine *string `json:"coordinationCommandLine,omitempty"` - // CommonResourceFiles - Gets or sets a list of files that Batch will download on all subtasks. - CommonResourceFiles *[]ResourceFile `json:"commonResourceFiles,omitempty"` -} - -// NameValuePair represents a name-value pair. -type NameValuePair struct { - // Name - Gets or sets the name in the name-value pair. - Name *string `json:"name,omitempty"` - // Value - Gets or sets the value in the name-value pair. - Value *string `json:"value,omitempty"` -} - -// NodeDisableSchedulingParameter parameters for a ComputeNodeOperations.DisableScheduling request. -type NodeDisableSchedulingParameter struct { - // NodeDisableSchedulingOption - Gets or sets what to do with currently running tasks when disable task scheduling on the compute node. The default value is requeue. Possible values include: 'DisableComputeNodeSchedulingOptionRequeue', 'DisableComputeNodeSchedulingOptionTerminate', 'DisableComputeNodeSchedulingOptionTaskcompletion' - NodeDisableSchedulingOption DisableComputeNodeSchedulingOption `json:"nodeDisableSchedulingOption,omitempty"` -} - -// NodeFile information about a file or directory on a compute node. -type NodeFile struct { - // Name - Gets or sets the file path. - Name *string `json:"name,omitempty"` - // URL - Gets or sets the URL of the file. - URL *string `json:"url,omitempty"` - // IsDirectory - Gets or sets whether the object represents a directory. - IsDirectory *bool `json:"isDirectory,omitempty"` - // Properties - Gets or sets the file properties. - Properties *FileProperties `json:"properties,omitempty"` -} - -// NodeFileListResult response to a NodeFileOperations.ListFromComputeNode or NodeFileOperations.ListFromTask -// request. -type NodeFileListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets the list of files. - Value *[]NodeFile `json:"value,omitempty"` - // OdataNextLink - Gets or sets the URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// NodeFileListResultIterator provides access to a complete listing of NodeFile values. -type NodeFileListResultIterator struct { - i int - page NodeFileListResultPage -} - -// Next 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 *NodeFileListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter NodeFileListResultIterator) 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 NodeFileListResultIterator) Response() NodeFileListResult { - 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 NodeFileListResultIterator) Value() NodeFile { - if !iter.page.NotDone() { - return NodeFile{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (nflr NodeFileListResult) IsEmpty() bool { - return nflr.Value == nil || len(*nflr.Value) == 0 -} - -// nodeFileListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (nflr NodeFileListResult) nodeFileListResultPreparer() (*http.Request, error) { - if nflr.OdataNextLink == nil || len(to.String(nflr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(nflr.OdataNextLink))) -} - -// NodeFileListResultPage contains a page of NodeFile values. -type NodeFileListResultPage struct { - fn func(NodeFileListResult) (NodeFileListResult, error) - nflr NodeFileListResult -} - -// 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. -func (page *NodeFileListResultPage) Next() error { - next, err := page.fn(page.nflr) - if err != nil { - return err - } - page.nflr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page NodeFileListResultPage) NotDone() bool { - return !page.nflr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page NodeFileListResultPage) Response() NodeFileListResult { - return page.nflr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page NodeFileListResultPage) Values() []NodeFile { - if page.nflr.IsEmpty() { - return nil - } - return *page.nflr.Value -} - -// NodeRebootParameter parameters for a ComputeNodeOperations.Reboot request. -type NodeRebootParameter struct { - // NodeRebootOption - Sets when to reboot the compute node and what to do with currently running tasks. The default value is requeue. Possible values include: 'ComputeNodeRebootOptionRequeue', 'ComputeNodeRebootOptionTerminate', 'ComputeNodeRebootOptionTaskcompletion', 'ComputeNodeRebootOptionRetaineddata' - NodeRebootOption ComputeNodeRebootOption `json:"nodeRebootOption,omitempty"` -} - -// NodeReimageParameter parameters for a ComputeNodeOperations.Reimage request. -type NodeReimageParameter struct { - // NodeReimageOption - Sets when to reimage the compute node and what to do with currently running tasks. The default value is requeue. Possible values include: 'ComputeNodeReimageOptionRequeue', 'ComputeNodeReimageOptionTerminate', 'ComputeNodeReimageOptionTaskcompletion', 'ComputeNodeReimageOptionRetaineddata' - NodeReimageOption ComputeNodeReimageOption `json:"nodeReimageOption,omitempty"` -} - -// NodeRemoveParameter parameters for a ComputeNodeOperations.Remove request. -type NodeRemoveParameter struct { - // NodeList - Sets a list containing the id of the compute nodes to be removed from the specified pool. - NodeList *[]string `json:"nodeList,omitempty"` - // ResizeTimeout - Sets the timeout for removal of compute nodes to the pool. The default value is 10 minutes. - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // NodeDeallocationOption - Sets when compute nodes may be removed from the pool. Possible values include: 'Requeue', 'Terminate', 'Taskcompletion', 'Retaineddata' - NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"` -} - -// NodeUpdateUserParameter parameters for a ComputeNodeOperations.UpdateUser request. -type NodeUpdateUserParameter struct { - // Password - Sets the password of the account. - Password *string `json:"password,omitempty"` - // ExpiryTime - Sets the time at which the account should expire. If omitted, the default is 1 day from the current time. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` -} - -// PoolAddParameter a pool in the Azure Batch service to add. -type PoolAddParameter struct { - // ID - Gets or sets a string that uniquely identifies the pool within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - Gets or sets the display name for the pool. - DisplayName *string `json:"displayName,omitempty"` - // VMSize - Gets or sets the size of virtual machines in the pool. All VMs in a pool are the same size. - VMSize *string `json:"vmSize,omitempty"` - // OsFamily - Gets or sets the Azure Guest OS family to be installed on the virtual machines in the pool. - OsFamily *string `json:"osFamily,omitempty"` - // TargetOSVersion - Gets or sets the Azure Guest OS version to be installed on the virtual machines in the pool. The default value is * which specifies the latest operating system version for the specified family. - TargetOSVersion *string `json:"targetOSVersion,omitempty"` - // ResizeTimeout - Gets or sets the timeout for allocation of compute nodes to the pool. In a Get Pool operation, this is the timeout for the most recent resize operation. The default value is 10 minutes. - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // TargetDedicated - Gets or sets the desired number of compute nodes in the pool. This property must have the default value if EnableAutoScale is true. It is required if EnableAutoScale is false. - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // EnableAutoScale - Gets or sets whether the pool size should automatically adjust over time. If true, the AutoScaleFormula property must be set. If false, the TargetDedicated property must be set. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - Gets or sets a formula for the desired number of compute nodes in the pool. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - Gets or sets a time interval for the desired autoscale evaluation period in the pool. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // EnableInterNodeCommunication - Gets or sets whether the pool permits direct communication between nodes. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - // StartTask - Gets or sets a task specified to run on each compute node as it joins the pool. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - Gets or sets the list of certificates to be installed on each compute node in the pool. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - Gets or sets the list of application packages to be installed on each compute node in the pool. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // MaxTasksPerNode - Gets or sets the maximum number of tasks that can run concurrently on a single compute node in the pool. - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - // TaskSchedulingPolicy - Gets or sets how the Batch service distributes tasks between compute nodes in the pool. - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - // Metadata - Gets or sets a list of name-value pairs associated with the pool as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolEnableAutoScaleParameter parameters for a CloudPoolOperations.EnableAutoScale request. -type PoolEnableAutoScaleParameter struct { - // AutoScaleFormula - Sets the formula for the desired number of compute nodes in the pool. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - Gets or sets a time interval for the desired autoscale evaluation period in the pool. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` -} - -// PoolEvaluateAutoScaleParameter parameters for a CloudJobOperations.EvaluateAutoScale request. -type PoolEvaluateAutoScaleParameter struct { - // AutoScaleFormula - Sets a formula for the desired number of compute nodes in the pool. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` -} - -// PoolInformation specifies how a job should be assigned to a pool. -type PoolInformation struct { - // PoolID - Gets or sets the id of an existing pool. All the tasks of the job will run on the specified pool. You must specify either PoolId or AutoPoolSpecification, but not both. - PoolID *string `json:"poolId,omitempty"` - // AutoPoolSpecification - Gets or sets characteristics for a temporary 'auto pool.' The Batch service will create this auto pool and run all the tasks of the job on it, and will delete the pool once the job has completed. You must specify either PoolId or AutoPoolSpecification, but not both. - AutoPoolSpecification *AutoPoolSpecification `json:"autoPoolSpecification,omitempty"` -} - -// PoolListPoolUsageMetricsResult response to an AccountOperations.ListPoolUsageMetrics request. -type PoolListPoolUsageMetricsResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets the pool usage metrics data. - Value *[]PoolUsageMetrics `json:"value,omitempty"` - // OdataNextLink - Gets or sets the URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// PoolListPoolUsageMetricsResultIterator provides access to a complete listing of PoolUsageMetrics values. -type PoolListPoolUsageMetricsResultIterator struct { - i int - page PoolListPoolUsageMetricsResultPage -} - -// Next 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 *PoolListPoolUsageMetricsResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PoolListPoolUsageMetricsResultIterator) 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 PoolListPoolUsageMetricsResultIterator) Response() PoolListPoolUsageMetricsResult { - 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 PoolListPoolUsageMetricsResultIterator) Value() PoolUsageMetrics { - if !iter.page.NotDone() { - return PoolUsageMetrics{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (plpumr PoolListPoolUsageMetricsResult) IsEmpty() bool { - return plpumr.Value == nil || len(*plpumr.Value) == 0 -} - -// poolListPoolUsageMetricsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (plpumr PoolListPoolUsageMetricsResult) poolListPoolUsageMetricsResultPreparer() (*http.Request, error) { - if plpumr.OdataNextLink == nil || len(to.String(plpumr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(plpumr.OdataNextLink))) -} - -// PoolListPoolUsageMetricsResultPage contains a page of PoolUsageMetrics values. -type PoolListPoolUsageMetricsResultPage struct { - fn func(PoolListPoolUsageMetricsResult) (PoolListPoolUsageMetricsResult, error) - plpumr PoolListPoolUsageMetricsResult -} - -// 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. -func (page *PoolListPoolUsageMetricsResultPage) Next() error { - next, err := page.fn(page.plpumr) - if err != nil { - return err - } - page.plpumr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PoolListPoolUsageMetricsResultPage) NotDone() bool { - return !page.plpumr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PoolListPoolUsageMetricsResultPage) Response() PoolListPoolUsageMetricsResult { - return page.plpumr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PoolListPoolUsageMetricsResultPage) Values() []PoolUsageMetrics { - if page.plpumr.IsEmpty() { - return nil - } - return *page.plpumr.Value -} - -// PoolPatchParameter parameters for a CloudPoolOperations.Patch request. -type PoolPatchParameter struct { - // StartTask - Sets a task to run on each compute node as it joins the pool. If omitted, any existing start task is left unchanged. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - Sets a list of certificates to be installed on each compute node in the pool. If omitted, any existing certificate references are left unchanged. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - Sets a list of application packages to be installed on each compute node in the pool. If omitted, any existing application package references are left unchanged. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - Sets a list of name-value pairs associated with the pool as metadata. If omitted, any existing metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolResizeParameter parameters for a CloudPoolOperations.Resize request. -type PoolResizeParameter struct { - // TargetDedicated - Sets the desired number of compute nodes in the pool. - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // ResizeTimeout - Sets the timeout for allocation of compute nodes to the pool or removal of compute nodes from the pool. The default value is 10 minutes. - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // NodeDeallocationOption - Sets when nodes may be removed from the pool, if the pool size is decreasing. Possible values include: 'Requeue', 'Terminate', 'Taskcompletion', 'Retaineddata' - NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"` -} - -// PoolSpecification specification for creating a new pool. -type PoolSpecification struct { - // DisplayName - Gets or sets the display name for the pool. - DisplayName *string `json:"displayName,omitempty"` - // VMSize - Gets or sets the size of the virtual machines in the pool. All VMs in a pool are the same size. - VMSize *string `json:"vmSize,omitempty"` - // OsFamily - Gets or sets the Azure Guest OS family to be installed on the virtual machines in the pool. - OsFamily *string `json:"osFamily,omitempty"` - // TargetOSVersion - Gets or sets the Azure Guest OS version to be installed on the virtual machines in the pool. - TargetOSVersion *string `json:"targetOSVersion,omitempty"` - // MaxTasksPerNode - Gets or sets the maximum number of tasks that can run concurrently on a single compute node in the pool. - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - // TaskSchedulingPolicy - Gets or sets how tasks are distributed among compute nodes in the pool. - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - // ResizeTimeout - Gets or sets the timeout for allocation of compute nodes to the pool. - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // TargetDedicated - Gets or sets the desired number of compute nodes in the pool. - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // EnableAutoScale - Gets or sets whether the pool size should automatically adjust over time. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - Gets or sets the formula for the desired number of compute nodes in the pool. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - Gets or sets a time interval for the desired AutoScale evaluation period in the pool. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // EnableInterNodeCommunication - Gets or sets whether the pool permits direct communication between nodes. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - // StartTask - Gets or sets a task to run on each compute node as it joins the pool. The task runs when the node is added to the pool or when the node is restarted. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - Gets or sets a list of certificates to be installed on each compute node in the pool. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - Gets or sets the list of application packages to be installed on each compute node in the pool. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - Gets or sets a list of name-value pairs associated with the pool as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolStatistics contains utilization and resource usage statistics for the lifetime of a pool. -type PoolStatistics struct { - autorest.Response `json:"-"` - // URL - Gets or sets the URL for the statistics. - URL *string `json:"url,omitempty"` - // StartTime - Gets or sets the start time of the time range covered by the statistics. - StartTime *date.Time `json:"startTime,omitempty"` - // LastUpdateTime - Gets or sets the time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - // UsageStats - Gets or sets statistics related to pool usage information, such as the amount of core-time used. - UsageStats *UsageStatistics `json:"usageStats,omitempty"` - // ResourceStats - Gets or sets statistics related to resource consumption by compute nodes in the pool. - ResourceStats *ResourceStatistics `json:"resourceStats,omitempty"` -} - -// PoolUpdatePropertiesParameter parameters for a CloudPoolOperations.UpdateProperties request. -type PoolUpdatePropertiesParameter struct { - // StartTask - Sets a task to run on each compute node as it joins the pool. If omitted, any existing start task is removed from the pool. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - Sets a list of certificates to be installed on each compute node in the pool. If you specify an empty collection, any existing certificate references are removed from the pool. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - Sets a list of application packages to be installed on each compute node in the pool. If you specify an empty collection, any existing application packages references are removed from the pool. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - Sets a list of name-value pairs associated with the pool as metadata. If you specify an empty collection, any existing metadata is removed from the pool. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolUpgradeOSParameter parameters for a CloudPoolOperations.UpgradeOS request. -type PoolUpgradeOSParameter struct { - // TargetOSVersion - Sets the Azure Guest OS version to be installed on the virtual machines in the pool. - TargetOSVersion *string `json:"targetOSVersion,omitempty"` -} - -// PoolUsageMetrics usage metrics for a pool across an aggregation interval. -type PoolUsageMetrics struct { - // PoolID - Gets or sets the id of the pool whose metrics are being aggregated. - PoolID *string `json:"poolId,omitempty"` - // StartTime - Gets or sets the start time of the aggregation interval. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Gets or sets the end time of the aggregation interval. - EndTime *date.Time `json:"endTime,omitempty"` - // VMSize - Gets or sets the size of virtual machines in the pool. All VMs in a pool are the same size. - VMSize *string `json:"vmSize,omitempty"` - // TotalCoreHours - Gets or sets the total core hours used in the pool during this aggregation interval. - TotalCoreHours *float64 `json:"totalCoreHours,omitempty"` - // DataIngressGiB - Gets or sets the cross data center network ingress in GiB to the pool during this interval. - DataIngressGiB *float64 `json:"dataIngressGiB,omitempty"` - // DataEgressGiB - Gets or sets the cross data center network egress in GiB from the pool during this interval. - DataEgressGiB *float64 `json:"dataEgressGiB,omitempty"` -} - -// ReadCloser ... -type ReadCloser struct { - autorest.Response `json:"-"` - Value *io.ReadCloser `json:"value,omitempty"` -} - -// RecentJob information about the most recent job to run under the job schedule. -type RecentJob struct { - // ID - Gets or sets the id of the job. - ID *string `json:"id,omitempty"` - // URL - Gets or sets the URL of the job. - URL *string `json:"url,omitempty"` -} - -// ResizeError an error that occurred when resizing a pool. -type ResizeError struct { - // Code - Gets or sets an identifier for the pool resize error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - Gets or sets a message describing the pool resize error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // Values - Gets or sets a list of additional error details related to the pool resize error. - Values *[]NameValuePair `json:"values,omitempty"` -} - -// ResourceFile a file to be downloaded from Azure blob storage to a compute node. -type ResourceFile struct { - // BlobSource - Gets or sets the URL of a blob in Azure storage. The Batch service downloads the blob to the specified file path. The URL must be readable using anonymous access. - BlobSource *string `json:"blobSource,omitempty"` - // FilePath - Gets or sets the location on the compute node to which the file should be downloaded. - FilePath *string `json:"filePath,omitempty"` -} - -// ResourceStatistics statistics related to resource consumption by compute nodes in a pool. -type ResourceStatistics struct { - // StartTime - Gets or sets the start time of the time range covered by the statistics. - StartTime *date.Time `json:"startTime,omitempty"` - // LastUpdateTime - Gets or sets the time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - // AvgCPUPercentage - Gets or sets the average CPU usage across all nodes in the pool (percentage per node). - AvgCPUPercentage *float64 `json:"avgCPUPercentage,omitempty"` - // AvgMemoryGiB - Gets or sets the average memory usage in GiB across all nodes in the pool. - AvgMemoryGiB *float64 `json:"avgMemoryGiB,omitempty"` - // PeakMemoryGiB - Gets or sets the peak memory usage in GiB across all nodes in the pool. - PeakMemoryGiB *float64 `json:"peakMemoryGiB,omitempty"` - // AvgDiskGiB - Gets or sets the average used disk space in GiB across all nodes in the pool. - AvgDiskGiB *float64 `json:"avgDiskGiB,omitempty"` - // PeakDiskGiB - Gets or sets the peak used disk space in GiB across all nodes in the pool. - PeakDiskGiB *float64 `json:"peakDiskGiB,omitempty"` - // DiskReadIOps - Gets or sets the total number of disk read operations across all nodes in the pool. - DiskReadIOps *int64 `json:"diskReadIOps,omitempty"` - // DiskWriteIOps - Gets or sets the total number of disk write operations across all nodes in the pool. - DiskWriteIOps *int64 `json:"diskWriteIOps,omitempty"` - // DiskReadGiB - Gets or sets the total amount of data in GiB of disk reads across all nodes in the pool. - DiskReadGiB *float64 `json:"diskReadGiB,omitempty"` - // DiskWriteGiB - Gets or sets the total amount of data in GiB of disk writes across all nodes in the pool. - DiskWriteGiB *float64 `json:"diskWriteGiB,omitempty"` - // NetworkReadGiB - Gets or sets the total amount of data in GiB of network reads across all nodes in the pool. - NetworkReadGiB *float64 `json:"networkReadGiB,omitempty"` - // NetworkWriteGiB - Gets or sets the total amount of data in GiB of network writes across all nodes in the pool. - NetworkWriteGiB *float64 `json:"networkWriteGiB,omitempty"` -} - -// Schedule the schedule according to which jobs will be created -type Schedule struct { - // DoNotRunUntil - Gets or sets the earliest time at which any job may be created under this job schedule. If you do not specify a doNotRunUntil time, the schedule becomes ready to create jobs immediately. - DoNotRunUntil *date.Time `json:"doNotRunUntil,omitempty"` - // DoNotRunAfter - Gets or sets a time after which no job will be created under this job schedule. The schedule will move to the completed state as soon as this deadline is past and there is no active job under this job schedule. - DoNotRunAfter *date.Time `json:"doNotRunAfter,omitempty"` - // StartWindow - Gets or sets the time interval, starting from the time at which the schedule indicates a job should be created, within which a job must be created. If a job is not created within the startWindow interval, then the 'opportunity' is lost; no job will be created until the next recurrence of the schedule. - StartWindow *string `json:"startWindow,omitempty"` - // RecurrenceInterval - Gets or sets the time interval between the start times of two successive jobs under the job schedule. A job schedule can have at most one active job under it at any given time. - RecurrenceInterval *string `json:"recurrenceInterval,omitempty"` -} - -// StartTask a task defined on a pool and run by compute nodes when they join the pool. -type StartTask struct { - // CommandLine - Gets or sets the command line of the start task. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Gets or sets a list of files that Batch will download to the compute node before running the command line. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // EnvironmentSettings - Gets or sets a list of environment variable settings for the start task. - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // RunElevated - Gets or sets whether to run the start task in elevated mode. The default value is false. - RunElevated *bool `json:"runElevated,omitempty"` - // MaxTaskRetryCount - Gets or sets the maximum number of times the task may be retried. - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` - // WaitForSuccess - Gets or sets whether the Batch Service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node. - WaitForSuccess *bool `json:"waitForSuccess,omitempty"` -} - -// StartTaskInformation information about a start task running on a compute node. -type StartTaskInformation struct { - // State - Gets or sets the state of the start task on the compute node. Possible values include: 'StartTaskStateRunning', 'StartTaskStateCompleted' - State StartTaskState `json:"state,omitempty"` - // StartTime - Gets or sets the time at which the start task started running. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Gets or sets the time at which the start task stopped running. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - Gets or sets the exit code of the start task. - ExitCode *int32 `json:"exitCode,omitempty"` - // SchedulingError - Gets or sets any error encountered scheduling the start task. - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - // RetryCount - Gets or sets the number of times the task has been retried by the Batch service. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - Gets or sets the most recent time at which a retry of the task started running. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` -} - -// SubtaskInformation information about an Azure Batch subtask. -type SubtaskInformation struct { - // ID - Gets or sets the id of the subtask. - ID *int32 `json:"id,omitempty"` - // NodeInfo - Gets or sets information about the compute node on which the subtask ran. - NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"` - // StartTime - Gets or sets the time at which the subtask started running. If the subtask has been restarted or retried, this is the most recent time at which the subtask started running. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Gets or sets the time at which the subtask completed. This property is set only if the subtask is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - Gets or sets the exit code of the subtask. This property is set only if the subtask is in the Completed state. - ExitCode *int32 `json:"exitCode,omitempty"` - // SchedulingError - Gets or sets details of any error encountered scheduling the subtask. - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - // State - Gets or sets the current state of the subtask. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - State TaskState `json:"state,omitempty"` - // StateTransitionTime - Gets or sets the time at which the subtask entered its current state. - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - Gets or sets the previous state of the subtask. This property is not set if the subtask is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - PreviousState TaskState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - Gets or sets the time at which the subtask entered its previous state. This property is not set if the subtask is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` -} - -// TaskAddParameter an Azure Batch task to add. -type TaskAddParameter struct { - // ID - Gets or sets a string that uniquely identifies the task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - Gets or sets a display name for the task. - DisplayName *string `json:"displayName,omitempty"` - // CommandLine - Gets or sets the command line of the task. For multi-instance tasks, the command line is executed on the primary subtask after all the subtasks have finished executing the coordianation command line. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Gets or sets a list of files that Batch will download to the compute node before running the command line. For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary subtask is executed. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // EnvironmentSettings - Gets or sets a list of environment variable settings for the task. - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // AffinityInfo - Gets or sets a locality hint that can be used by the Batch service to select a compute node on which to start the new task. - AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"` - // Constraints - Gets or sets the execution constraints that apply to this task. - Constraints *TaskConstraints `json:"constraints,omitempty"` - // RunElevated - Gets or sets whether to run the task in elevated mode. - RunElevated *bool `json:"runElevated,omitempty"` - // MultiInstanceSettings - Gets or sets information about how to run the multi-instance task. - MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"` - // DependsOn - Gets or sets any dependencies this task has. - DependsOn *TaskDependencies `json:"dependsOn,omitempty"` -} - -// TaskConstraints constraints to apply to the Job Manager task. -type TaskConstraints struct { - // MaxWallClockTime - Gets or sets the maximum elapsed time that the task may run, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it. - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // RetentionTime - Gets or sets the minimum time to retain the working directory for the task on the compute node where it ran. After this time, the Batch service may delete the working directory and all its contents. The default is infinite. - RetentionTime *string `json:"retentionTime,omitempty"` - // MaxTaskRetryCount - Gets or sets the maximum number of times the task may be retried. The Batch service retries a task if its exit code is nonzero. - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` -} - -// TaskDependencies specifies any dependencies of a task. Any task that is explicitly specified or within a -// dependency range must complete before the dependant task will be scheduled. -type TaskDependencies struct { - // TaskIds - Gets or sets the list of task ids that must complete before this task can be scheduled. - TaskIds *[]string `json:"taskIds,omitempty"` - // TaskIDRanges - Gets or sets the list of task ranges that must complete before this task can be scheduled. - TaskIDRanges *[]TaskIDRange `json:"taskIdRanges,omitempty"` -} - -// TaskExecutionInformation information about the execution of a task. -type TaskExecutionInformation struct { - // StartTime - Gets or sets the time at which the task started running. If the task has been restarted or retried, this is the most recent time at which the task started running. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Gets or sets the time at which the task completed. This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - Gets or sets the exit code of the task. This property is set only if the task is in completed state. - ExitCode *int32 `json:"exitCode,omitempty"` - // SchedulingError - Gets or sets details of any error encountered scheduling the task. - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - // RetryCount - Gets or sets the number of times the task has been retried by the Batch service. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - Gets or sets the most recent time at which a retry of the task started running. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` - // RequeueCount - Gets or sets the number of times the task has been requeued by the Batch service as the result of a user request. - RequeueCount *int32 `json:"requeueCount,omitempty"` - // LastRequeueTime - Gets or sets the most recent time at which the task has been requeued by the Batch service as the result of a user request. - LastRequeueTime *date.Time `json:"lastRequeueTime,omitempty"` -} - -// TaskIDRange ... -type TaskIDRange struct { - // Start - Gets or sets the first task id in the range. - Start *int32 `json:"start,omitempty"` - // End - Gets or sets the last task id in the range. - End *int32 `json:"end,omitempty"` -} - -// TaskInformation information about a task running on a compute node. -type TaskInformation struct { - // TaskURL - Gets or sets the URL of the task. - TaskURL *string `json:"taskUrl,omitempty"` - // JobID - Gets or sets the id of the job to which the task belongs. - JobID *string `json:"jobId,omitempty"` - // TaskID - Gets or sets the id of the task. - TaskID *string `json:"taskId,omitempty"` - // SubtaskID - Gets or sets the id of the subtask if the task is a multi-instance task. - SubtaskID *int32 `json:"subtaskId,omitempty"` - // TaskState - Gets or sets the current state of the task. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - TaskState TaskState `json:"taskState,omitempty"` - // ExecutionInfo - Gets or sets information about the execution of the task. - ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"` -} - -// TaskSchedulingError information about an error when scheduling a task. -type TaskSchedulingError struct { - // Category - Gets or sets the category of the task scheduling error. Possible values include: 'SchedulingErrorCategoryUsererror', 'SchedulingErrorCategoryServererror', 'SchedulingErrorCategoryUnmapped' - Category SchedulingErrorCategory `json:"category,omitempty"` - // Code - Gets or sets an identifier for the task scheduling error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - Gets or sets a message describing the task scheduling error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // Details - Gets or sets the list of additional error details related to the scheduling error. - Details *[]NameValuePair `json:"details,omitempty"` -} - -// TaskSchedulingPolicy specifies how tasks should be distributed across compute nodes. -type TaskSchedulingPolicy struct { - // NodeFillType - Gets or sets how tasks should be distributed across compute nodes. Possible values include: 'ComputeNodeFillTypeSpread', 'ComputeNodeFillTypePack', 'ComputeNodeFillTypeUnmapped' - NodeFillType ComputeNodeFillType `json:"nodeFillType,omitempty"` -} - -// TaskStatistics resource usage statistics for a task. -type TaskStatistics struct { - // URL - Gets or sets the URL for the statistics. - URL *string `json:"url,omitempty"` - // StartTime - Gets or sets the start time of the time range covered by the statistics. - StartTime *date.Time `json:"startTime,omitempty"` - // LastUpdateTime - Gets or sets the time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - // UserCPUTime - Gets or sets the total user mode CPU time (summed across all cores and all compute nodes) consumed by the task. - UserCPUTime *string `json:"userCPUTime,omitempty"` - // KernelCPUTime - Gets or sets the total kernel mode CPU time (summed across all cores and all compute nodes) consumed by the task. - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - Gets or sets the total wall clock time of the task. - WallClockTime *string `json:"wallClockTime,omitempty"` - // ReadIOps - Gets or sets the total number of I/O read operations performed by the task. - ReadIOps *int64 `json:"readIOps,omitempty"` - // WriteIOps - Gets or sets the total number of I/O write operations performed by the task. - WriteIOps *int64 `json:"writeIOps,omitempty"` - // ReadIOGiB - Gets or sets the total amount of data in GiB of I/O read by the task. - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - // WriteIOGiB - Gets or sets the total amount of data in GiB of I/O written by the task. - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - // WaitTime - Gets or sets the elapsed time between the creation of the task and the start of task execution. - WaitTime *string `json:"waitTime,omitempty"` -} - -// TaskUpdateParameter parameters for a CloudTaskOperations.Update request. -type TaskUpdateParameter struct { - // Constraints - Sets constraints that apply to this task. If omitted, the task is given the default constraints. - Constraints *TaskConstraints `json:"constraints,omitempty"` -} - -// UsageStatistics statistics related to pool usage information. -type UsageStatistics struct { - // StartTime - Gets or sets the start time of the time range covered by the statistics. - StartTime *date.Time `json:"startTime,omitempty"` - // LastUpdateTime - Gets or sets the time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - // DedicatedCoreTime - Gets or sets the aggregated wall-clock time of the dedicated compute node cores being part of the pool. - DedicatedCoreTime *string `json:"dedicatedCoreTime,omitempty"` -} diff --git a/services/batch/2015-12-01.2.2/batch/pool.go b/services/batch/2015-12-01.2.2/batch/pool.go deleted file mode 100644 index 7c8de2397578..000000000000 --- a/services/batch/2015-12-01.2.2/batch/pool.go +++ /dev/null @@ -1,1734 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// PoolClient is the a client for issuing REST requests to the Azure Batch service. -type PoolClient struct { - BaseClient -} - -// NewPoolClient creates an instance of the PoolClient client. -func NewPoolClient() PoolClient { - return NewPoolClientWithBaseURI(DefaultBaseURI) -} - -// NewPoolClientWithBaseURI creates an instance of the PoolClient client. -func NewPoolClientWithBaseURI(baseURI string) PoolClient { - return PoolClient{NewWithBaseURI(baseURI)} -} - -// Add adds a pool to the specified account. -// -// pool is specifies the pool to be added. timeout is sets the maximum time that the server can spend processing -// the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the -// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. -func (client PoolClient) Add(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: pool, - Constraints: []validation.Constraint{{Target: "pool.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, pool, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client PoolClient) AddPreparer(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/pools"), - autorest.WithJSON(pool), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 PoolClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a pool from the specified account. -// -// poolID is the id of the pool to delete. timeout is sets the maximum time that the server can spend processing -// the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the -// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation -// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this -// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince -// is specify this header to perform the operation only if the resource has been modified since the specified -// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been -// modified since the specified date/time. -func (client PoolClient) Delete(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PoolClient) DeletePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 PoolClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) 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 -} - -// DisableAutoScale disables automatic scaling for a pool. -// -// poolID is the id of the pool on which to disable automatic scaling. timeout is sets the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller -// generated request identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client PoolClient) DisableAutoScale(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisableAutoScalePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.DisableAutoScaleSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure sending request") - return - } - - result, err = client.DisableAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure responding to request") - } - - return -} - -// DisableAutoScalePreparer prepares the DisableAutoScale request. -func (client PoolClient) DisableAutoScalePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/disableautoscale", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableAutoScaleSender sends the DisableAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) DisableAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableAutoScaleResponder handles the response to the DisableAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) DisableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EnableAutoScale enables automatic scaling for a pool. -// -// poolID is the id of the pool on which to enable automatic scaling. poolEnableAutoScaleParameter is the -// parameters for the request. timeout is sets the maximum time that the server can spend processing the request, -// in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the form of a -// GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is -// specifies if the server should return the client-request-id identifier in the response. ocpDate is the time the -// request was issued. If not specified, this header will be automatically populated with the current system clock -// time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the -// operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header -// to perform the operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince -// is specify this header to perform the operation only if the resource has not been modified since the specified -// date/time. -func (client PoolClient) EnableAutoScale(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnableAutoScalePreparer(ctx, poolID, poolEnableAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.EnableAutoScaleSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure sending request") - return - } - - result, err = client.EnableAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure responding to request") - } - - return -} - -// EnableAutoScalePreparer prepares the EnableAutoScale request. -func (client PoolClient) EnableAutoScalePreparer(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/enableautoscale", pathParameters), - autorest.WithJSON(poolEnableAutoScaleParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableAutoScaleSender sends the EnableAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) EnableAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableAutoScaleResponder handles the response to the EnableAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) EnableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EvaluateAutoScale gets the result of evaluating an automatic scaling formula on the pool. -// -// poolID is the id of the pool on which to evaluate the automatic scaling formula. poolEvaluateAutoScaleParameter -// is the parameters for the request. timeout is sets the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the -// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. -func (client PoolClient) EvaluateAutoScale(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AutoScaleRun, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolEvaluateAutoScaleParameter, - Constraints: []validation.Constraint{{Target: "poolEvaluateAutoScaleParameter.AutoScaleFormula", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "EvaluateAutoScale", err.Error()) - } - - req, err := client.EvaluateAutoScalePreparer(ctx, poolID, poolEvaluateAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.EvaluateAutoScaleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure sending request") - return - } - - result, err = client.EvaluateAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure responding to request") - } - - return -} - -// EvaluateAutoScalePreparer prepares the EvaluateAutoScale request. -func (client PoolClient) EvaluateAutoScalePreparer(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/evaluateautoscale", pathParameters), - autorest.WithJSON(poolEvaluateAutoScaleParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EvaluateAutoScaleSender sends the EvaluateAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) EvaluateAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EvaluateAutoScaleResponder handles the response to the EvaluateAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) EvaluateAutoScaleResponder(resp *http.Response) (result AutoScaleRun, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Exists gets basic properties of a pool. -// -// poolID is the id of the pool to get. selectParameter is sets an OData $select clause. timeout is sets the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) Exists(ctx context.Context, poolID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ExistsPreparer(ctx, poolID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", nil, "Failure preparing request") - return - } - - resp, err := client.ExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure sending request") - return - } - - result, err = client.ExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure responding to request") - } - - return -} - -// ExistsPreparer prepares the Exists request. -func (client PoolClient) ExistsPreparer(ctx context.Context, poolID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExistsSender sends the Exists request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ExistsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExistsResponder handles the response to the Exists request. The method always -// closes the http.Response Body. -func (client PoolClient) ExistsResponder(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 information about the specified pool. -// -// poolID is the id of the pool to get. selectParameter is sets an OData $select clause. expand is sets an OData -// $expand clause. timeout is sets the maximum time that the server can spend processing the request, in seconds. -// The default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no -// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if -// the server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) Get(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudPool, err error) { - req, err := client.GetPreparer(ctx, poolID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client PoolClient) GetPreparer(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 PoolClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) GetResponder(resp *http.Response) (result CloudPool, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAllPoolsLifetimeStatistics gets lifetime summary statistics for all of the pools in the specified account. -// Statistics are aggregated across all pools that have ever existed in the account, from account creation to the last -// update time of the statistics. -// -// timeout is sets the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as -// curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should -// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. -func (client PoolClient) GetAllPoolsLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolStatistics, err error) { - req, err := client.GetAllPoolsLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", nil, "Failure preparing request") - return - } - - resp, err := client.GetAllPoolsLifetimeStatisticsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", resp, "Failure sending request") - return - } - - result, err = client.GetAllPoolsLifetimeStatisticsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", resp, "Failure responding to request") - } - - return -} - -// GetAllPoolsLifetimeStatisticsPreparer prepares the GetAllPoolsLifetimeStatistics request. -func (client PoolClient) GetAllPoolsLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/lifetimepoolstats"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAllPoolsLifetimeStatisticsSender sends the GetAllPoolsLifetimeStatistics request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) GetAllPoolsLifetimeStatisticsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetAllPoolsLifetimeStatisticsResponder handles the response to the GetAllPoolsLifetimeStatistics request. The method always -// closes the http.Response Body. -func (client PoolClient) GetAllPoolsLifetimeStatisticsResponder(resp *http.Response) (result PoolStatistics, 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 pools in the specified account. -// -// filter is sets an OData $filter clause. selectParameter is sets an OData $select clause. expand is sets an OData -// $expand clause. maxResults is sets the maximum number of items to return in the response. timeout is sets the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. -func (client PoolClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure sending request") - return - } - - result.cplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client PoolClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/pools"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 PoolClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) ListResponder(resp *http.Response) (result CloudPoolListResult, 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 PoolClient) listNextResults(lastResults CloudPoolListResult) (result CloudPoolListResult, err error) { - req, err := lastResults.cloudPoolListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "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, "batch.PoolClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PoolClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListPoolUsageMetrics lists the usage metrics, aggregated by pool across individual time intervals, for the specified -// account. -// -// startTime is the earliest time from which to include metrics. This must be at least two and a half hours before -// the current time. endTime is the latest time from which to include metrics. This must be at least two hours -// before the current time. filter is sets an OData $filter clause. maxResults is sets the maximum number of items -// to return in the response. timeout is sets the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID -// with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is -// specifies if the server should return the client-request-id identifier in the response. ocpDate is the time the -// request was issued. If not specified, this header will be automatically populated with the current system clock -// time. -func (client PoolClient) ListPoolUsageMetrics(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListPoolUsageMetricsResultPage, err error) { - result.fn = client.listPoolUsageMetricsNextResults - req, err := client.ListPoolUsageMetricsPreparer(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListPoolUsageMetricsSender(req) - if err != nil { - result.plpumr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", resp, "Failure sending request") - return - } - - result.plpumr, err = client.ListPoolUsageMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", resp, "Failure responding to request") - } - - return -} - -// ListPoolUsageMetricsPreparer prepares the ListPoolUsageMetrics request. -func (client PoolClient) ListPoolUsageMetricsPreparer(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if startTime != nil { - queryParameters["starttime"] = autorest.Encode("query", *startTime) - } - if endTime != nil { - queryParameters["endtime"] = autorest.Encode("query", *endTime) - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/poolusagemetrics"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPoolUsageMetricsSender sends the ListPoolUsageMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ListPoolUsageMetricsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListPoolUsageMetricsResponder handles the response to the ListPoolUsageMetrics request. The method always -// closes the http.Response Body. -func (client PoolClient) ListPoolUsageMetricsResponder(resp *http.Response) (result PoolListPoolUsageMetricsResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listPoolUsageMetricsNextResults retrieves the next set of results, if any. -func (client PoolClient) listPoolUsageMetricsNextResults(lastResults PoolListPoolUsageMetricsResult) (result PoolListPoolUsageMetricsResult, err error) { - req, err := lastResults.poolListPoolUsageMetricsResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListPoolUsageMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListPoolUsageMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListPoolUsageMetricsComplete enumerates all values, automatically crossing page boundaries as required. -func (client PoolClient) ListPoolUsageMetricsComplete(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListPoolUsageMetricsResultIterator, err error) { - result.page, err = client.ListPoolUsageMetrics(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch updates the properties of a pool. -// -// poolID is the id of the pool to update. poolPatchParameter is the parameters for the request. timeout is sets -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) Patch(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, poolID, poolPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client PoolClient) PatchPreparer(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithJSON(poolPatchParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client PoolClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// RemoveNodes removes compute nodes from the specified pool. -// -// poolID is the id of the pool from which you want to remove nodes. nodeRemoveParameter is the parameters for the -// request. timeout is sets the maximum time that the server can spend processing the request, in seconds. The -// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no -// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if -// the server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) RemoveNodes(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: nodeRemoveParameter, - Constraints: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "RemoveNodes", err.Error()) - } - - req, err := client.RemoveNodesPreparer(ctx, poolID, nodeRemoveParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", nil, "Failure preparing request") - return - } - - resp, err := client.RemoveNodesSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure sending request") - return - } - - result, err = client.RemoveNodesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure responding to request") - } - - return -} - -// RemoveNodesPreparer prepares the RemoveNodes request. -func (client PoolClient) RemoveNodesPreparer(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/removenodes", pathParameters), - autorest.WithJSON(nodeRemoveParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RemoveNodesSender sends the RemoveNodes request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) RemoveNodesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// RemoveNodesResponder handles the response to the RemoveNodes request. The method always -// closes the http.Response Body. -func (client PoolClient) RemoveNodesResponder(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 -} - -// Resize changes the number of compute nodes that are assigned to a pool. -// -// poolID is the id of the pool to resize. poolResizeParameter is the parameters for the request. timeout is sets -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) Resize(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolResizeParameter, - Constraints: []validation.Constraint{{Target: "poolResizeParameter.TargetDedicated", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "Resize", err.Error()) - } - - req, err := client.ResizePreparer(ctx, poolID, poolResizeParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", nil, "Failure preparing request") - return - } - - resp, err := client.ResizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure sending request") - return - } - - result, err = client.ResizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure responding to request") - } - - return -} - -// ResizePreparer prepares the Resize request. -func (client PoolClient) ResizePreparer(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/resize", pathParameters), - autorest.WithJSON(poolResizeParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResizeSender sends the Resize request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ResizeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ResizeResponder handles the response to the Resize request. The method always -// closes the http.Response Body. -func (client PoolClient) ResizeResponder(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 -} - -// StopResize stops an ongoing resize operation on the pool. This does not restore the pool to its previous state -// before the resize operation: it only stops any further changes being made, and the pool maintains its current state. -// -// poolID is the id of the pool whose resizing you want to stop. timeout is sets the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated -// request identity, in the form of a GUID with no decoration such as curly braces e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) StopResize(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.StopResizePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", nil, "Failure preparing request") - return - } - - resp, err := client.StopResizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure sending request") - return - } - - result, err = client.StopResizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure responding to request") - } - - return -} - -// StopResizePreparer prepares the StopResize request. -func (client PoolClient) StopResizePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/stopresize", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopResizeSender sends the StopResize request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) StopResizeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// StopResizeResponder handles the response to the StopResize request. The method always -// closes the http.Response Body. -func (client PoolClient) StopResizeResponder(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 -} - -// UpdateProperties updates the properties of a pool. -// -// poolID is the id of the pool to update. poolUpdatePropertiesParameter is the parameters for the request. timeout -// is sets the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as -// curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should -// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. -func (client PoolClient) UpdateProperties(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolUpdatePropertiesParameter, - Constraints: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.CertificateReferences", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.ApplicationPackageReferences", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.Metadata", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "UpdateProperties", err.Error()) - } - - req, err := client.UpdatePropertiesPreparer(ctx, poolID, poolUpdatePropertiesParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", nil, "Failure preparing request") - return - } - - resp, err := client.UpdatePropertiesSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure sending request") - return - } - - result, err = client.UpdatePropertiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure responding to request") - } - - return -} - -// UpdatePropertiesPreparer prepares the UpdateProperties request. -func (client PoolClient) UpdatePropertiesPreparer(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/updateproperties", pathParameters), - autorest.WithJSON(poolUpdatePropertiesParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdatePropertiesSender sends the UpdateProperties request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) UpdatePropertiesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdatePropertiesResponder handles the response to the UpdateProperties request. The method always -// closes the http.Response Body. -func (client PoolClient) UpdatePropertiesResponder(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 -} - -// UpgradeOS upgrades the operating system of the specified pool. -// -// poolID is the id of the pool to upgrade. poolUpgradeOSParameter is the parameters for the request. timeout is -// sets the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) UpgradeOS(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolUpgradeOSParameter, - Constraints: []validation.Constraint{{Target: "poolUpgradeOSParameter.TargetOSVersion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "UpgradeOS", err.Error()) - } - - req, err := client.UpgradeOSPreparer(ctx, poolID, poolUpgradeOSParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", nil, "Failure preparing request") - return - } - - resp, err := client.UpgradeOSSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure sending request") - return - } - - result, err = client.UpgradeOSResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure responding to request") - } - - return -} - -// UpgradeOSPreparer prepares the UpgradeOS request. -func (client PoolClient) UpgradeOSPreparer(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/upgradeos", pathParameters), - autorest.WithJSON(poolUpgradeOSParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpgradeOSSender sends the UpgradeOS request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) UpgradeOSSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpgradeOSResponder handles the response to the UpgradeOS request. The method always -// closes the http.Response Body. -func (client PoolClient) UpgradeOSResponder(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/batch/2015-12-01.2.2/batch/task.go b/services/batch/2015-12-01.2.2/batch/task.go deleted file mode 100644 index 16ee482579bd..000000000000 --- a/services/batch/2015-12-01.2.2/batch/task.go +++ /dev/null @@ -1,794 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// TaskClient is the a client for issuing REST requests to the Azure Batch service. -type TaskClient struct { - BaseClient -} - -// NewTaskClient creates an instance of the TaskClient client. -func NewTaskClient() TaskClient { - return NewTaskClientWithBaseURI(DefaultBaseURI) -} - -// NewTaskClientWithBaseURI creates an instance of the TaskClient client. -func NewTaskClientWithBaseURI(baseURI string) TaskClient { - return TaskClient{NewWithBaseURI(baseURI)} -} - -// Add adds a task to the specified job. -// -// jobID is the id of the job to which the task is to be added. task is specifies the task to be added. timeout is -// sets the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. -func (client TaskClient) Add(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: task, - Constraints: []validation.Constraint{{Target: "task.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "task.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "task.MultiInstanceSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "task.MultiInstanceSettings.NumberOfInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, jobID, task, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client TaskClient) AddPreparer(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters), - autorest.WithJSON(task), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 TaskClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a task from the specified job. -// -// jobID is the id of the job from which to delete the task. taskID is the id of the task to delete. timeout is -// sets the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client TaskClient) Delete(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client TaskClient) DeletePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) 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 information about the specified task. -// -// jobID is the id of the job that contains the task. taskID is the id of the task to get information about. -// selectParameter is sets an OData $select clause. expand is sets an OData $expand clause. timeout is sets the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client TaskClient) Get(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudTask, err error) { - req, err := client.GetPreparer(ctx, jobID, taskID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client TaskClient) GetPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) GetResponder(resp *http.Response) (result CloudTask, 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 tasks that are associated with the specified job. -// -// jobID is the id of the job. filter is sets an OData $filter clause. selectParameter is sets an OData $select -// clause. expand is sets an OData $expand clause. maxResults is sets the maximum number of items to return in the -// response. timeout is sets the maximum time that the server can spend processing the request, in seconds. The -// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no -// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if -// the server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -func (client TaskClient) List(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ctlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure sending request") - return - } - - result.ctlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client TaskClient) ListPreparer(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 TaskClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) ListResponder(resp *http.Response) (result CloudTaskListResult, 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 TaskClient) listNextResults(lastResults CloudTaskListResult) (result CloudTaskListResult, err error) { - req, err := lastResults.cloudTaskListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.TaskClient", "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, "batch.TaskClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client TaskClient) ListComplete(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultIterator, err error) { - result.page, err = client.List(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListSubtasks lists all of the subtasks that are associated with the specified multi-instance task. -// -// jobID is the id of the job. taskID is the id of the task. selectParameter is sets an OData $select clause. -// timeout is sets the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as -// curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should -// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. -func (client TaskClient) ListSubtasks(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListSubtasksResult, err error) { - req, err := client.ListSubtasksPreparer(ctx, jobID, taskID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", nil, "Failure preparing request") - return - } - - resp, err := client.ListSubtasksSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure sending request") - return - } - - result, err = client.ListSubtasksResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure responding to request") - } - - return -} - -// ListSubtasksPreparer prepares the ListSubtasks request. -func (client TaskClient) ListSubtasksPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/subtasksinfo", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSubtasksSender sends the ListSubtasks request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) ListSubtasksSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListSubtasksResponder handles the response to the ListSubtasks request. The method always -// closes the http.Response Body. -func (client TaskClient) ListSubtasksResponder(resp *http.Response) (result CloudTaskListSubtasksResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Terminate terminates the specified task. -// -// jobID is the id of the job containing the task. taskID is the id of the task to terminate. timeout is sets the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly -// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return -// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, -// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client TaskClient) Terminate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client TaskClient) TerminatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client TaskClient) TerminateResponder(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 -} - -// Update updates the properties of the specified task. -// -// jobID is the id of the job containing the task. taskID is the id of the task to update. taskUpdateParameter is -// the parameters for the request. timeout is sets the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the -// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation -// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this -// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince -// is specify this header to perform the operation only if the resource has been modified since the specified -// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been -// modified since the specified date/time. -func (client TaskClient) Update(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.UpdatePreparer(ctx, jobID, taskID, taskUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client TaskClient) UpdatePreparer(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2015-12-01.2.2" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithJSON(taskUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) UpdateResponder(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/batch/2016-02-01.3.0/batch/account.go b/services/batch/2016-02-01.3.0/batch/account.go deleted file mode 100644 index 27490de07747..000000000000 --- a/services/batch/2016-02-01.3.0/batch/account.go +++ /dev/null @@ -1,157 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// AccountClient is the a client for issuing REST requests to the Azure Batch service. -type AccountClient struct { - BaseClient -} - -// NewAccountClient creates an instance of the AccountClient client. -func NewAccountClient() AccountClient { - return NewAccountClientWithBaseURI(DefaultBaseURI) -} - -// NewAccountClientWithBaseURI creates an instance of the AccountClient client. -func NewAccountClientWithBaseURI(baseURI string) AccountClient { - return AccountClient{NewWithBaseURI(baseURI)} -} - -// ListNodeAgentSkus lists all node agent SKUs supported by the Azure Batch service. -// -// filter is an OData $filter clause. maxResults is the maximum number of items to return in the response. timeout -// is the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client AccountClient) ListNodeAgentSkus(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultPage, err error) { - result.fn = client.listNodeAgentSkusNextResults - req, err := client.ListNodeAgentSkusPreparer(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListNodeAgentSkusSender(req) - if err != nil { - result.alnasr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure sending request") - return - } - - result.alnasr, err = client.ListNodeAgentSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure responding to request") - } - - return -} - -// ListNodeAgentSkusPreparer prepares the ListNodeAgentSkus request. -func (client AccountClient) ListNodeAgentSkusPreparer(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/nodeagentskus"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListNodeAgentSkusSender sends the ListNodeAgentSkus request. The method will close the -// http.Response Body if it receives an error. -func (client AccountClient) ListNodeAgentSkusSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListNodeAgentSkusResponder handles the response to the ListNodeAgentSkus request. The method always -// closes the http.Response Body. -func (client AccountClient) ListNodeAgentSkusResponder(resp *http.Response) (result AccountListNodeAgentSkusResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNodeAgentSkusNextResults retrieves the next set of results, if any. -func (client AccountClient) listNodeAgentSkusNextResults(lastResults AccountListNodeAgentSkusResult) (result AccountListNodeAgentSkusResult, err error) { - req, err := lastResults.accountListNodeAgentSkusResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListNodeAgentSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListNodeAgentSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListNodeAgentSkusComplete enumerates all values, automatically crossing page boundaries as required. -func (client AccountClient) ListNodeAgentSkusComplete(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultIterator, err error) { - result.page, err = client.ListNodeAgentSkus(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2016-02-01.3.0/batch/application.go b/services/batch/2016-02-01.3.0/batch/application.go deleted file mode 100644 index b69f0c0a3907..000000000000 --- a/services/batch/2016-02-01.3.0/batch/application.go +++ /dev/null @@ -1,240 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// ApplicationClient is the a client for issuing REST requests to the Azure Batch service. -type ApplicationClient struct { - BaseClient -} - -// NewApplicationClient creates an instance of the ApplicationClient client. -func NewApplicationClient() ApplicationClient { - return NewApplicationClientWithBaseURI(DefaultBaseURI) -} - -// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient client. -func NewApplicationClientWithBaseURI(baseURI string) ApplicationClient { - return ApplicationClient{NewWithBaseURI(baseURI)} -} - -// Get gets information about the specified application. -// -// applicationID is the id of the application. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. -func (client ApplicationClient) Get(ctx context.Context, applicationID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationSummary, err error) { - req, err := client.GetPreparer(ctx, applicationID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationClient) GetPreparer(ctx context.Context, applicationID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationId": autorest.Encode("path", applicationID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/applications/{applicationId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ApplicationClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ApplicationClient) GetResponder(resp *http.Response) (result ApplicationSummary, 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 applications available in the specified account. -// -// maxResults is the maximum number of items to return in the response. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ApplicationClient) List(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "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, "batch.ApplicationClient", "List", resp, "Failure sending request") - return - } - - result.alr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationClient) ListPreparer(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/applications"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ApplicationClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ApplicationClient) ListResponder(resp *http.Response) (result ApplicationListResult, 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 ApplicationClient) listNextResults(lastResults ApplicationListResult) (result ApplicationListResult, err error) { - req, err := lastResults.applicationListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.ApplicationClient", "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, "batch.ApplicationClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationClient) ListComplete(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultIterator, err error) { - result.page, err = client.List(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2016-02-01.3.0/batch/certificate.go b/services/batch/2016-02-01.3.0/batch/certificate.go deleted file mode 100644 index 4cb6e2f0c218..000000000000 --- a/services/batch/2016-02-01.3.0/batch/certificate.go +++ /dev/null @@ -1,518 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// CertificateClient is the a client for issuing REST requests to the Azure Batch service. -type CertificateClient struct { - BaseClient -} - -// NewCertificateClient creates an instance of the CertificateClient client. -func NewCertificateClient() CertificateClient { - return NewCertificateClientWithBaseURI(DefaultBaseURI) -} - -// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client. -func NewCertificateClientWithBaseURI(baseURI string) CertificateClient { - return CertificateClient{NewWithBaseURI(baseURI)} -} - -// Add adds a certificate to the specified account. -// -// certificate is the certificate to be added. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. -func (client CertificateClient) Add(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: certificate, - Constraints: []validation.Constraint{{Target: "certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "certificate.ThumbprintAlgorithm", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "certificate.Data", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.CertificateClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, certificate, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client CertificateClient) AddPreparer(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/certificates"), - autorest.WithJSON(certificate), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// CancelDeletion cancels a failed deletion of a certificate from the specified account. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate being deleted. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client CertificateClient) CancelDeletion(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.CancelDeletionPreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", nil, "Failure preparing request") - return - } - - resp, err := client.CancelDeletionSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure sending request") - return - } - - result, err = client.CancelDeletionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure responding to request") - } - - return -} - -// CancelDeletionPreparer prepares the CancelDeletion request. -func (client CertificateClient) CancelDeletionPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CancelDeletionSender sends the CancelDeletion request. The method will close the -// http.Response Body if it receives an error. -func (client CertificateClient) CancelDeletionSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CancelDeletionResponder handles the response to the CancelDeletion request. The method always -// closes the http.Response Body. -func (client CertificateClient) CancelDeletionResponder(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 -} - -// Delete deletes a certificate from the specified account. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate to be deleted. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client CertificateClient) Delete(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CertificateClient) DeletePreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) 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 information about the specified certificate. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate to get. selectParameter is an OData $select clause. timeout is the maximum -// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is -// the caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client CertificateClient) Get(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result Certificate, err error) { - req, err := client.GetPreparer(ctx, thumbprintAlgorithm, thumbprint, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client CertificateClient) GetPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) GetResponder(resp *http.Response) (result Certificate, 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 certificates that have been added to the specified account. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. maxResults is the maximum number -// of items to return in the response. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. -func (client CertificateClient) List(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "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, "batch.CertificateClient", "List", resp, "Failure sending request") - return - } - - result.clr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client CertificateClient) ListPreparer(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/certificates"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) ListResponder(resp *http.Response) (result CertificateListResult, 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 CertificateClient) listNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) { - req, err := lastResults.certificateListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.CertificateClient", "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, "batch.CertificateClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CertificateClient) ListComplete(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2016-02-01.3.0/batch/client.go b/services/batch/2016-02-01.3.0/batch/client.go deleted file mode 100644 index 3a4e46951ac4..000000000000 --- a/services/batch/2016-02-01.3.0/batch/client.go +++ /dev/null @@ -1,49 +0,0 @@ -// Package batch implements the Azure ARM Batch service API version 2016-02-01.3.0. -// -// A client for issuing REST requests to the Azure Batch service. -package batch - -// 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 Batch - DefaultBaseURI = "https://batch.core.windows.net" -) - -// BaseClient is the base client for Batch. -type BaseClient struct { - autorest.Client - BaseURI string -} - -// New creates an instance of the BaseClient client. -func New() BaseClient { - return NewWithBaseURI(DefaultBaseURI) -} - -// NewWithBaseURI creates an instance of the BaseClient client. -func NewWithBaseURI(baseURI string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - } -} diff --git a/services/batch/2016-02-01.3.0/batch/computenode.go b/services/batch/2016-02-01.3.0/batch/computenode.go deleted file mode 100644 index 9960b36d80d9..000000000000 --- a/services/batch/2016-02-01.3.0/batch/computenode.go +++ /dev/null @@ -1,1069 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// ComputeNodeClient is the a client for issuing REST requests to the Azure Batch service. -type ComputeNodeClient struct { - BaseClient -} - -// NewComputeNodeClient creates an instance of the ComputeNodeClient client. -func NewComputeNodeClient() ComputeNodeClient { - return NewComputeNodeClientWithBaseURI(DefaultBaseURI) -} - -// NewComputeNodeClientWithBaseURI creates an instance of the ComputeNodeClient client. -func NewComputeNodeClientWithBaseURI(baseURI string) ComputeNodeClient { - return ComputeNodeClient{NewWithBaseURI(baseURI)} -} - -// AddUser adds a user account to the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the machine on which you want -// to create a user account. userParameter is the user account to be created. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) AddUser(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: userParameter, - Constraints: []validation.Constraint{{Target: "userParameter.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.ComputeNodeClient", "AddUser", err.Error()) - } - - req, err := client.AddUserPreparer(ctx, poolID, nodeID, userParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", nil, "Failure preparing request") - return - } - - resp, err := client.AddUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure sending request") - return - } - - result, err = client.AddUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure responding to request") - } - - return -} - -// AddUserPreparer prepares the AddUser request. -func (client ComputeNodeClient) AddUserPreparer(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users", pathParameters), - autorest.WithJSON(userParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddUserSender sends the AddUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) AddUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddUserResponder handles the response to the AddUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) AddUserResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteUser deletes a user account from the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the machine on which you want -// to delete a user account. userName is the name of the user account to delete. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) DeleteUser(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteUserPreparer(ctx, poolID, nodeID, userName, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure sending request") - return - } - - result, err = client.DeleteUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure responding to request") - } - - return -} - -// DeleteUserPreparer prepares the DeleteUser request. -func (client ComputeNodeClient) DeleteUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - "userName": autorest.Encode("path", userName), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteUserSender sends the DeleteUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) DeleteUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteUserResponder handles the response to the DeleteUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) DeleteUserResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// DisableScheduling disable task scheduling of the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want -// to disable task scheduling. nodeDisableSchedulingParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) DisableScheduling(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisableSchedulingPreparer(ctx, poolID, nodeID, nodeDisableSchedulingParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSchedulingSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure sending request") - return - } - - result, err = client.DisableSchedulingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure responding to request") - } - - return -} - -// DisableSchedulingPreparer prepares the DisableScheduling request. -func (client ComputeNodeClient) DisableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/disablescheduling", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeDisableSchedulingParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeDisableSchedulingParameter)) - } - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableSchedulingSender sends the DisableScheduling request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) DisableSchedulingSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableSchedulingResponder handles the response to the DisableScheduling request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) DisableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EnableScheduling enable task scheduling of the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want -// to enable task scheduling. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the -// request was issued. If not specified, this header will be automatically populated with the current system clock -// time. -func (client ComputeNodeClient) EnableScheduling(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnableSchedulingPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSchedulingSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure sending request") - return - } - - result, err = client.EnableSchedulingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure responding to request") - } - - return -} - -// EnableSchedulingPreparer prepares the EnableScheduling request. -func (client ComputeNodeClient) EnableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/enablescheduling", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableSchedulingSender sends the EnableScheduling request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) EnableSchedulingSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableSchedulingResponder handles the response to the EnableScheduling request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) EnableSchedulingResponder(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 information about the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want -// to get information about. selectParameter is an OData $select clause. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) Get(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNode, err error) { - req, err := client.GetPreparer(ctx, poolID, nodeID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ComputeNodeClient) GetPreparer(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ComputeNodeClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ComputeNodeClient) GetResponder(resp *http.Response) (result ComputeNode, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetRemoteDesktop gets the Remote Desktop Protocol file for the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node for which you -// want to get the Remote Desktop Protocol file. timeout is the maximum time that the server can spend processing -// the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in -// the form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. -func (client ComputeNodeClient) GetRemoteDesktop(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetRemoteDesktopPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", nil, "Failure preparing request") - return - } - - resp, err := client.GetRemoteDesktopSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure sending request") - return - } - - result, err = client.GetRemoteDesktopResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure responding to request") - } - - return -} - -// GetRemoteDesktopPreparer prepares the GetRemoteDesktop request. -func (client ComputeNodeClient) GetRemoteDesktopPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/rdp", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRemoteDesktopSender sends the GetRemoteDesktop request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) GetRemoteDesktopSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRemoteDesktopResponder handles the response to the GetRemoteDesktop request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) GetRemoteDesktopResponder(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 -} - -// GetRemoteLoginSettings gets the settings required for remote login to a compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node for which to -// obtain the remote login settings. timeout is the maximum time that the server can spend processing the request, -// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of -// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the -// request was issued. If not specified, this header will be automatically populated with the current system clock -// time. -func (client ComputeNodeClient) GetRemoteLoginSettings(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeGetRemoteLoginSettingsResult, err error) { - req, err := client.GetRemoteLoginSettingsPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", nil, "Failure preparing request") - return - } - - resp, err := client.GetRemoteLoginSettingsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure sending request") - return - } - - result, err = client.GetRemoteLoginSettingsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure responding to request") - } - - return -} - -// GetRemoteLoginSettingsPreparer prepares the GetRemoteLoginSettings request. -func (client ComputeNodeClient) GetRemoteLoginSettingsPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/remoteloginsettings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRemoteLoginSettingsSender sends the GetRemoteLoginSettings request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) GetRemoteLoginSettingsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRemoteLoginSettingsResponder handles the response to the GetRemoteLoginSettings request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) GetRemoteLoginSettingsResponder(resp *http.Response) (result ComputeNodeGetRemoteLoginSettingsResult, 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 compute nodes in the specified pool. -// -// poolID is the id of the pool from which you want to list nodes. filter is an OData $filter clause. -// selectParameter is an OData $select clause. maxResults is the maximum number of items to return in the response. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) List(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cnlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure sending request") - return - } - - result.cnlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ComputeNodeClient) ListPreparer(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ComputeNodeClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ComputeNodeClient) ListResponder(resp *http.Response) (result ComputeNodeListResult, 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 ComputeNodeClient) listNextResults(lastResults ComputeNodeListResult) (result ComputeNodeListResult, err error) { - req, err := lastResults.computeNodeListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "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, "batch.ComputeNodeClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ComputeNodeClient) ListComplete(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultIterator, err error) { - result.page, err = client.List(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Reboot restarts the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want -// to restart. nodeRebootParameter is the parameters for the request. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) Reboot(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.RebootPreparer(ctx, poolID, nodeID, nodeRebootParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", nil, "Failure preparing request") - return - } - - resp, err := client.RebootSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure sending request") - return - } - - result, err = client.RebootResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure responding to request") - } - - return -} - -// RebootPreparer prepares the Reboot request. -func (client ComputeNodeClient) RebootPreparer(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reboot", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeRebootParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeRebootParameter)) - } - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RebootSender sends the Reboot request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) RebootSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// RebootResponder handles the response to the Reboot request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) RebootResponder(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 -} - -// Reimage reinstalls the operating system on the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want -// to restart. nodeReimageParameter is the parameters for the request. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) Reimage(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ReimagePreparer(ctx, poolID, nodeID, nodeReimageParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", nil, "Failure preparing request") - return - } - - resp, err := client.ReimageSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure sending request") - return - } - - result, err = client.ReimageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure responding to request") - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client ComputeNodeClient) ReimagePreparer(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeReimageParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeReimageParameter)) - } - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) ReimageSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) ReimageResponder(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 -} - -// UpdateUser updates the password or expiration time of a user account on the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the machine on which you want -// to update a user account. userName is the name of the user account to update. nodeUpdateUserParameter is the -// parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the -// request was issued. If not specified, this header will be automatically populated with the current system clock -// time. -func (client ComputeNodeClient) UpdateUser(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.UpdateUserPreparer(ctx, poolID, nodeID, userName, nodeUpdateUserParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure sending request") - return - } - - result, err = client.UpdateUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure responding to request") - } - - return -} - -// UpdateUserPreparer prepares the UpdateUser request. -func (client ComputeNodeClient) UpdateUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - "userName": autorest.Encode("path", userName), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters), - autorest.WithJSON(nodeUpdateUserParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateUserSender sends the UpdateUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) UpdateUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateUserResponder handles the response to the UpdateUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) UpdateUserResponder(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/batch/2016-02-01.3.0/batch/file.go b/services/batch/2016-02-01.3.0/batch/file.go deleted file mode 100644 index 925425078c27..000000000000 --- a/services/batch/2016-02-01.3.0/batch/file.go +++ /dev/null @@ -1,887 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// FileClient is the a client for issuing REST requests to the Azure Batch service. -type FileClient struct { - BaseClient -} - -// NewFileClient creates an instance of the FileClient client. -func NewFileClient() FileClient { - return NewFileClientWithBaseURI(DefaultBaseURI) -} - -// NewFileClientWithBaseURI creates an instance of the FileClient client. -func NewFileClientWithBaseURI(baseURI string) FileClient { - return FileClient{NewWithBaseURI(baseURI)} -} - -// DeleteFromComputeNode deletes the specified task file from the compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node from which you -// want to delete the file. fileName is the path to the file that you want to delete. recursive is whether to -// delete children of a directory. If the fileName parameter represents a directory instead of a file, you can set -// Recursive to true to delete the directory and all of the files and subdirectories in it. If Recursive is false -// then the directory must be empty or deletion will fail. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client FileClient) DeleteFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteFromComputeNodePreparer(ctx, poolID, nodeID, fileName, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteFromComputeNodeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.DeleteFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// DeleteFromComputeNodePreparer prepares the DeleteFromComputeNode request. -func (client FileClient) DeleteFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteFromComputeNodeSender sends the DeleteFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) DeleteFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteFromComputeNodeResponder handles the response to the DeleteFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) DeleteFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteFromTask deletes the specified task file from the compute node where the task ran. -// -// jobID is the id of the job that contains the task. taskID is the id of the task whose file you want to delete. -// fileName is the path to the task file that you want to delete. recursive is whether to delete children of a -// directory. If the fileName parameter represents a directory instead of a file, you can set Recursive to true to -// delete the directory and all of the files and subdirectories in it. If Recursive is false then the directory -// must be empty or deletion will fail. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. -func (client FileClient) DeleteFromTask(ctx context.Context, jobID string, taskID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteFromTaskPreparer(ctx, jobID, taskID, fileName, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteFromTaskSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure sending request") - return - } - - result, err = client.DeleteFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure responding to request") - } - - return -} - -// DeleteFromTaskPreparer prepares the DeleteFromTask request. -func (client FileClient) DeleteFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteFromTaskSender sends the DeleteFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) DeleteFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteFromTaskResponder handles the response to the DeleteFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) DeleteFromTaskResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetFromComputeNode returns the content of the specified task file. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that contains -// the file. fileName is the path to the task file that you want to get the content of. timeout is the maximum time -// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ocpRange is the byte range to be -// retrieved. The default is to retrieve the entire file. The format is startRange-endRange. ifModifiedSince is -// specify this header to perform the operation only if the resource has been modified since the specified -// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been -// modified since the specified date/time. -func (client FileClient) GetFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetFromComputeNodePreparer(ctx, poolID, nodeID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.GetFromComputeNodeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.GetFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// GetFromComputeNodePreparer prepares the GetFromComputeNode request. -func (client FileClient) GetFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ocpRange) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-range", autorest.String(ocpRange))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetFromComputeNodeSender sends the GetFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetFromComputeNodeResponder handles the response to the GetFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) GetFromComputeNodeResponder(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 -} - -// GetFromTask returns the content of the specified task file. -// -// jobID is the id of the job that contains the task. taskID is the id of the task whose file you want to retrieve. -// fileName is the path to the task file that you want to get the content of. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ocpRange is the byte range to be -// retrieved. The default is to retrieve the entire file. The format is startRange-endRange. ifModifiedSince is -// specify this header to perform the operation only if the resource has been modified since the specified -// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been -// modified since the specified date/time. -func (client FileClient) GetFromTask(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetFromTaskPreparer(ctx, jobID, taskID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.GetFromTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure sending request") - return - } - - result, err = client.GetFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure responding to request") - } - - return -} - -// GetFromTaskPreparer prepares the GetFromTask request. -func (client FileClient) GetFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ocpRange) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-range", autorest.String(ocpRange))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetFromTaskSender sends the GetFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetFromTaskResponder handles the response to the GetFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) GetFromTaskResponder(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 -} - -// GetNodeFilePropertiesFromComputeNode gets the properties of the specified compute node file. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that contains -// the file. fileName is the path to the compute node file that you want to get the properties of. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifModifiedSince is specify this -// header to perform the operation only if the resource has been modified since the specified date/time. -// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified -// since the specified date/time. -func (client FileClient) GetNodeFilePropertiesFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.GetNodeFilePropertiesFromComputeNodePreparer(ctx, poolID, nodeID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.GetNodeFilePropertiesFromComputeNodeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.GetNodeFilePropertiesFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// GetNodeFilePropertiesFromComputeNodePreparer prepares the GetNodeFilePropertiesFromComputeNode request. -func (client FileClient) GetNodeFilePropertiesFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetNodeFilePropertiesFromComputeNodeSender sends the GetNodeFilePropertiesFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetNodeFilePropertiesFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetNodeFilePropertiesFromComputeNodeResponder handles the response to the GetNodeFilePropertiesFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) GetNodeFilePropertiesFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetNodeFilePropertiesFromTask gets the properties of the specified task file. -// -// jobID is the id of the job that contains the task. taskID is the id of the task whose file you want to get the -// properties of. fileName is the path to the task file that you want to get the properties of. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifModifiedSince is specify this -// header to perform the operation only if the resource has been modified since the specified date/time. -// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified -// since the specified date/time. -func (client FileClient) GetNodeFilePropertiesFromTask(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.GetNodeFilePropertiesFromTaskPreparer(ctx, jobID, taskID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.GetNodeFilePropertiesFromTaskSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", resp, "Failure sending request") - return - } - - result, err = client.GetNodeFilePropertiesFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", resp, "Failure responding to request") - } - - return -} - -// GetNodeFilePropertiesFromTaskPreparer prepares the GetNodeFilePropertiesFromTask request. -func (client FileClient) GetNodeFilePropertiesFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetNodeFilePropertiesFromTaskSender sends the GetNodeFilePropertiesFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetNodeFilePropertiesFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetNodeFilePropertiesFromTaskResponder handles the response to the GetNodeFilePropertiesFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) GetNodeFilePropertiesFromTaskResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// ListFromComputeNode lists all of the files in task directories on the specified compute node. -// -// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node whose files -// you want to list. filter is an OData $filter clause. recursive is whether to list children of a directory. -// maxResults is the maximum number of items to return in the response. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client FileClient) ListFromComputeNode(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) { - result.fn = client.listFromComputeNodeNextResults - req, err := client.ListFromComputeNodePreparer(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromComputeNodeSender(req) - if err != nil { - result.nflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure sending request") - return - } - - result.nflr, err = client.ListFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// ListFromComputeNodePreparer prepares the ListFromComputeNode request. -func (client FileClient) ListFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromComputeNodeSender sends the ListFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) ListFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromComputeNodeResponder handles the response to the ListFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) ListFromComputeNodeResponder(resp *http.Response) (result NodeFileListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromComputeNodeNextResults retrieves the next set of results, if any. -func (client FileClient) listFromComputeNodeNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) { - req, err := lastResults.nodeFileListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromComputeNodeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromComputeNodeComplete enumerates all values, automatically crossing page boundaries as required. -func (client FileClient) ListFromComputeNodeComplete(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) { - result.page, err = client.ListFromComputeNode(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListFromTask lists the files in a task's directory on its compute node. -// -// jobID is the id of the job that contains the task. taskID is the id of the task whose files you want to list. -// filter is an OData $filter clause. recursive is whether to list children of a directory. maxResults is the -// maximum number of items to return in the response. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client FileClient) ListFromTask(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) { - result.fn = client.listFromTaskNextResults - req, err := client.ListFromTaskPreparer(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromTaskSender(req) - if err != nil { - result.nflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure sending request") - return - } - - result.nflr, err = client.ListFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure responding to request") - } - - return -} - -// ListFromTaskPreparer prepares the ListFromTask request. -func (client FileClient) ListFromTaskPreparer(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromTaskSender sends the ListFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) ListFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromTaskResponder handles the response to the ListFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) ListFromTaskResponder(resp *http.Response) (result NodeFileListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromTaskNextResults retrieves the next set of results, if any. -func (client FileClient) listFromTaskNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) { - req, err := lastResults.nodeFileListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromTaskComplete enumerates all values, automatically crossing page boundaries as required. -func (client FileClient) ListFromTaskComplete(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) { - result.page, err = client.ListFromTask(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2016-02-01.3.0/batch/job.go b/services/batch/2016-02-01.3.0/batch/job.go deleted file mode 100644 index 936189dc2f66..000000000000 --- a/services/batch/2016-02-01.3.0/batch/job.go +++ /dev/null @@ -1,1366 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// JobClient is the a client for issuing REST requests to the Azure Batch service. -type JobClient struct { - BaseClient -} - -// NewJobClient creates an instance of the JobClient client. -func NewJobClient() JobClient { - return NewJobClientWithBaseURI(DefaultBaseURI) -} - -// NewJobClientWithBaseURI creates an instance of the JobClient client. -func NewJobClientWithBaseURI(baseURI string) JobClient { - return JobClient{NewWithBaseURI(baseURI)} -} - -// Add adds a job to the specified account. -// -// job is the job to be added. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the -// request was issued. If not specified, this header will be automatically populated with the current system clock -// time. -func (client JobClient) Add(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: job, - Constraints: []validation.Constraint{{Target: "job.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, job, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client JobClient) AddPreparer(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobs"), - autorest.WithJSON(job), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a job. -// -// jobID is the id of the job to delete. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation -// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this -// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince -// is specify this header to perform the operation only if the resource has been modified since the specified -// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been -// modified since the specified date/time. -func (client JobClient) Delete(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobClient) DeletePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) 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 -} - -// Disable disables the specified job, preventing new tasks from running. -// -// jobID is the id of the job to disable. jobDisableParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client JobClient) Disable(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisablePreparer(ctx, jobID, jobDisableParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure sending request") - return - } - - result, err = client.DisableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure responding to request") - } - - return -} - -// DisablePreparer prepares the Disable request. -func (client JobClient) DisablePreparer(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/disable", pathParameters), - autorest.WithJSON(jobDisableParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) DisableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableResponder handles the response to the Disable request. The method always -// closes the http.Response Body. -func (client JobClient) DisableResponder(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 -} - -// Enable enables the specified job, allowing new tasks to run. -// -// jobID is the id of the job to enable. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation -// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this -// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince -// is specify this header to perform the operation only if the resource has been modified since the specified -// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been -// modified since the specified date/time. -func (client JobClient) Enable(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnablePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure sending request") - return - } - - result, err = client.EnableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure responding to request") - } - - return -} - -// EnablePreparer prepares the Enable request. -func (client JobClient) EnablePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/enable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) EnableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableResponder handles the response to the Enable request. The method always -// closes the http.Response Body. -func (client JobClient) EnableResponder(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 information about the specified job. -// -// jobID is the id of the job. selectParameter is an OData $select clause. expand is an OData $expand clause. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. -func (client JobClient) Get(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJob, err error) { - req, err := client.GetPreparer(ctx, jobID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobClient) GetPreparer(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) GetResponder(resp *http.Response) (result CloudJob, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAllJobsLifetimeStatistics gets lifetime summary statistics for all of the jobs in the specified account. -// Statistics are aggregated across all jobs that have ever existed in the account, from account creation to the last -// update time of the statistics. -// -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. -func (client JobClient) GetAllJobsLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result JobStatistics, err error) { - req, err := client.GetAllJobsLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", nil, "Failure preparing request") - return - } - - resp, err := client.GetAllJobsLifetimeStatisticsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", resp, "Failure sending request") - return - } - - result, err = client.GetAllJobsLifetimeStatisticsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", resp, "Failure responding to request") - } - - return -} - -// GetAllJobsLifetimeStatisticsPreparer prepares the GetAllJobsLifetimeStatistics request. -func (client JobClient) GetAllJobsLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/lifetimejobstats"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAllJobsLifetimeStatisticsSender sends the GetAllJobsLifetimeStatistics request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) GetAllJobsLifetimeStatisticsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetAllJobsLifetimeStatisticsResponder handles the response to the GetAllJobsLifetimeStatistics request. The method always -// closes the http.Response Body. -func (client JobClient) GetAllJobsLifetimeStatisticsResponder(resp *http.Response) (result JobStatistics, 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 jobs in the specified account. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand -// clause. maxResults is the maximum number of items to return in the response. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client JobClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cjlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure sending request") - return - } - - result.cjlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client JobClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobs"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) ListResponder(resp *http.Response) (result CloudJobListResult, 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 JobClient) listNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) { - req, err := lastResults.cloudJobListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "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, "batch.JobClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListFromJobSchedule lists the jobs that have been created under the specified job schedule. -// -// jobScheduleID is the id of the job schedule from which you want to get a list of jobs. filter is an OData -// $filter clause. selectParameter is an OData $select clause. expand is an OData $expand clause. maxResults is the -// maximum number of items to return in the response. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client JobClient) ListFromJobSchedule(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) { - result.fn = client.listFromJobScheduleNextResults - req, err := client.ListFromJobSchedulePreparer(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromJobScheduleSender(req) - if err != nil { - result.cjlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure sending request") - return - } - - result.cjlr, err = client.ListFromJobScheduleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure responding to request") - } - - return -} - -// ListFromJobSchedulePreparer prepares the ListFromJobSchedule request. -func (client JobClient) ListFromJobSchedulePreparer(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/jobs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromJobScheduleSender sends the ListFromJobSchedule request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) ListFromJobScheduleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromJobScheduleResponder handles the response to the ListFromJobSchedule request. The method always -// closes the http.Response Body. -func (client JobClient) ListFromJobScheduleResponder(resp *http.Response) (result CloudJobListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromJobScheduleNextResults retrieves the next set of results, if any. -func (client JobClient) listFromJobScheduleNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) { - req, err := lastResults.cloudJobListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromJobScheduleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromJobScheduleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromJobScheduleComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListFromJobScheduleComplete(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) { - result.page, err = client.ListFromJobSchedule(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListPreparationAndReleaseTaskStatus lists the execution status of the Job Preparation and Job Release task for the -// specified job across the compute nodes where the job has run. -// -// jobID is the id of the job. filter is an OData $filter clause. selectParameter is an OData $select clause. -// maxResults is the maximum number of items to return in the response. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client JobClient) ListPreparationAndReleaseTaskStatus(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultPage, err error) { - result.fn = client.listPreparationAndReleaseTaskStatusNextResults - req, err := client.ListPreparationAndReleaseTaskStatusPreparer(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", nil, "Failure preparing request") - return - } - - resp, err := client.ListPreparationAndReleaseTaskStatusSender(req) - if err != nil { - result.cjlpartsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure sending request") - return - } - - result.cjlpartsr, err = client.ListPreparationAndReleaseTaskStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure responding to request") - } - - return -} - -// ListPreparationAndReleaseTaskStatusPreparer prepares the ListPreparationAndReleaseTaskStatus request. -func (client JobClient) ListPreparationAndReleaseTaskStatusPreparer(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/jobpreparationandreleasetaskstatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPreparationAndReleaseTaskStatusSender sends the ListPreparationAndReleaseTaskStatus request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) ListPreparationAndReleaseTaskStatusSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListPreparationAndReleaseTaskStatusResponder handles the response to the ListPreparationAndReleaseTaskStatus request. The method always -// closes the http.Response Body. -func (client JobClient) ListPreparationAndReleaseTaskStatusResponder(resp *http.Response) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listPreparationAndReleaseTaskStatusNextResults retrieves the next set of results, if any. -func (client JobClient) listPreparationAndReleaseTaskStatusNextResults(lastResults CloudJobListPreparationAndReleaseTaskStatusResult) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) { - req, err := lastResults.cloudJobListPreparationAndReleaseTaskStatusResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListPreparationAndReleaseTaskStatusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListPreparationAndReleaseTaskStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListPreparationAndReleaseTaskStatusComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListPreparationAndReleaseTaskStatusComplete(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultIterator, err error) { - result.page, err = client.ListPreparationAndReleaseTaskStatus(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch updates the properties of a job. -// -// jobID is the id of the job whose properties you want to update. jobPatchParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobClient) Patch(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, jobID, jobPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client JobClient) PatchPreparer(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithJSON(jobPatchParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client JobClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Terminate terminates the specified job, marking it as completed. -// -// jobID is the id of the job to terminate. jobTerminateParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client JobClient) Terminate(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobID, jobTerminateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client JobClient) TerminatePreparer(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if jobTerminateParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(jobTerminateParameter)) - } - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client JobClient) TerminateResponder(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 -} - -// Update updates the properties of a job. -// -// jobID is the id of the job whose properties you want to update. jobUpdateParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobClient) Update(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobUpdateParameter, - Constraints: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, jobID, jobUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client JobClient) UpdatePreparer(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithJSON(jobUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) UpdateResponder(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/batch/2016-02-01.3.0/batch/jobschedule.go b/services/batch/2016-02-01.3.0/batch/jobschedule.go deleted file mode 100644 index 65831800c3d4..000000000000 --- a/services/batch/2016-02-01.3.0/batch/jobschedule.go +++ /dev/null @@ -1,1156 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// JobScheduleClient is the a client for issuing REST requests to the Azure Batch service. -type JobScheduleClient struct { - BaseClient -} - -// NewJobScheduleClient creates an instance of the JobScheduleClient client. -func NewJobScheduleClient() JobScheduleClient { - return NewJobScheduleClientWithBaseURI(DefaultBaseURI) -} - -// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client. -func NewJobScheduleClientWithBaseURI(baseURI string) JobScheduleClient { - return JobScheduleClient{NewWithBaseURI(baseURI)} -} - -// Add adds a job schedule to the specified account. -// -// cloudJobSchedule is the job schedule to be added. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client JobScheduleClient) Add(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: cloudJobSchedule, - Constraints: []validation.Constraint{{Target: "cloudJobSchedule.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.Schedule", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, cloudJobSchedule, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client JobScheduleClient) AddPreparer(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobschedules"), - autorest.WithJSON(cloudJobSchedule), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobScheduleClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a job schedule from the specified account. -// -// jobScheduleID is the id of the job schedule to delete. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Delete(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobScheduleClient) DeletePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) 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 -} - -// Disable disables a job schedule. -// -// jobScheduleID is the id of the job schedule to disable. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Disable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure sending request") - return - } - - result, err = client.DisableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure responding to request") - } - - return -} - -// DisablePreparer prepares the Disable request. -func (client JobScheduleClient) DisablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/disable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) DisableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableResponder handles the response to the Disable request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) DisableResponder(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 -} - -// Enable enables a job schedule. -// -// jobScheduleID is the id of the job schedule to enable. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Enable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure sending request") - return - } - - result, err = client.EnableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure responding to request") - } - - return -} - -// EnablePreparer prepares the Enable request. -func (client JobScheduleClient) EnablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/enable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) EnableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableResponder handles the response to the Enable request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) EnableResponder(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 -} - -// Exists checks the specified job schedule exists. -// -// jobScheduleID is the id of the job schedule which you want to check. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Exists(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ExistsPreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", nil, "Failure preparing request") - return - } - - resp, err := client.ExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure sending request") - return - } - - result, err = client.ExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure responding to request") - } - - return -} - -// ExistsPreparer prepares the Exists request. -func (client JobScheduleClient) ExistsPreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExistsSender sends the Exists request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) ExistsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExistsResponder handles the response to the Exists request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) ExistsResponder(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 information about the specified job schedule. -// -// jobScheduleID is the id of the job schedule to get. selectParameter is an OData $select clause. expand is an -// OData $expand clause. timeout is the maximum time that the server can spend processing the request, in seconds. -// The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with -// no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether -// the server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Get(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJobSchedule, err error) { - req, err := client.GetPreparer(ctx, jobScheduleID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobScheduleClient) GetPreparer(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) GetResponder(resp *http.Response) (result CloudJobSchedule, 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 job schedules in the specified account. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand -// clause. maxResults is the maximum number of items to return in the response. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client JobScheduleClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cjslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure sending request") - return - } - - result.cjslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client JobScheduleClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobschedules"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobScheduleClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) ListResponder(resp *http.Response) (result CloudJobScheduleListResult, 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 JobScheduleClient) listNextResults(lastResults CloudJobScheduleListResult) (result CloudJobScheduleListResult, err error) { - req, err := lastResults.cloudJobScheduleListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobScheduleClient", "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, "batch.JobScheduleClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobScheduleClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch updates the properties of the specified job schedule. -// -// jobScheduleID is the id of the job schedule to update. jobSchedulePatchParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Patch(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, jobScheduleID, jobSchedulePatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client JobScheduleClient) PatchPreparer(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithJSON(jobSchedulePatchParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Terminate terminates a job schedule. -// -// jobScheduleID is the id of the job schedule to terminates. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Terminate(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client JobScheduleClient) TerminatePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) TerminateResponder(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 -} - -// Update updates the properties of the specified job schedule. -// -// jobScheduleID is the id of the job schedule to update. jobScheduleUpdateParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Update(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobScheduleUpdateParameter, - Constraints: []validation.Constraint{{Target: "jobScheduleUpdateParameter.Schedule", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, jobScheduleID, jobScheduleUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client JobScheduleClient) UpdatePreparer(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithJSON(jobScheduleUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) UpdateResponder(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/batch/2016-02-01.3.0/batch/models.go b/services/batch/2016-02-01.3.0/batch/models.go deleted file mode 100644 index 739d159e7032..000000000000 --- a/services/batch/2016-02-01.3.0/batch/models.go +++ /dev/null @@ -1,3010 +0,0 @@ -package batch - -// 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" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "io" - "net/http" -) - -// AllocationState enumerates the values for allocation state. -type AllocationState string - -const ( - // Resizing ... - Resizing AllocationState = "resizing" - // Steady ... - Steady AllocationState = "steady" - // Stopping ... - Stopping AllocationState = "stopping" -) - -// PossibleAllocationStateValues returns an array of possible values for the AllocationState const type. -func PossibleAllocationStateValues() []AllocationState { - return []AllocationState{Resizing, Steady, Stopping} -} - -// CertificateFormat enumerates the values for certificate format. -type CertificateFormat string - -const ( - // Cer ... - Cer CertificateFormat = "cer" - // Pfx ... - Pfx CertificateFormat = "pfx" - // Unmapped ... - Unmapped CertificateFormat = "unmapped" -) - -// PossibleCertificateFormatValues returns an array of possible values for the CertificateFormat const type. -func PossibleCertificateFormatValues() []CertificateFormat { - return []CertificateFormat{Cer, Pfx, Unmapped} -} - -// CertificateState enumerates the values for certificate state. -type CertificateState string - -const ( - // Active ... - Active CertificateState = "active" - // Deletefailed ... - Deletefailed CertificateState = "deletefailed" - // Deleting ... - Deleting CertificateState = "deleting" -) - -// PossibleCertificateStateValues returns an array of possible values for the CertificateState const type. -func PossibleCertificateStateValues() []CertificateState { - return []CertificateState{Active, Deletefailed, Deleting} -} - -// CertificateStoreLocation enumerates the values for certificate store location. -type CertificateStoreLocation string - -const ( - // CertificateStoreLocationCurrentuser ... - CertificateStoreLocationCurrentuser CertificateStoreLocation = "currentuser" - // CertificateStoreLocationLocalmachine ... - CertificateStoreLocationLocalmachine CertificateStoreLocation = "localmachine" - // CertificateStoreLocationUnmapped ... - CertificateStoreLocationUnmapped CertificateStoreLocation = "unmapped" -) - -// PossibleCertificateStoreLocationValues returns an array of possible values for the CertificateStoreLocation const type. -func PossibleCertificateStoreLocationValues() []CertificateStoreLocation { - return []CertificateStoreLocation{CertificateStoreLocationCurrentuser, CertificateStoreLocationLocalmachine, CertificateStoreLocationUnmapped} -} - -// CertificateVisibility enumerates the values for certificate visibility. -type CertificateVisibility string - -const ( - // CertificateVisibilityRemoteuser ... - CertificateVisibilityRemoteuser CertificateVisibility = "remoteuser" - // CertificateVisibilityStarttask ... - CertificateVisibilityStarttask CertificateVisibility = "starttask" - // CertificateVisibilityTask ... - CertificateVisibilityTask CertificateVisibility = "task" - // CertificateVisibilityUnmapped ... - CertificateVisibilityUnmapped CertificateVisibility = "unmapped" -) - -// PossibleCertificateVisibilityValues returns an array of possible values for the CertificateVisibility const type. -func PossibleCertificateVisibilityValues() []CertificateVisibility { - return []CertificateVisibility{CertificateVisibilityRemoteuser, CertificateVisibilityStarttask, CertificateVisibilityTask, CertificateVisibilityUnmapped} -} - -// ComputeNodeDeallocationOption enumerates the values for compute node deallocation option. -type ComputeNodeDeallocationOption string - -const ( - // Requeue ... - Requeue ComputeNodeDeallocationOption = "requeue" - // Retaineddata ... - Retaineddata ComputeNodeDeallocationOption = "retaineddata" - // Taskcompletion ... - Taskcompletion ComputeNodeDeallocationOption = "taskcompletion" - // Terminate ... - Terminate ComputeNodeDeallocationOption = "terminate" -) - -// PossibleComputeNodeDeallocationOptionValues returns an array of possible values for the ComputeNodeDeallocationOption const type. -func PossibleComputeNodeDeallocationOptionValues() []ComputeNodeDeallocationOption { - return []ComputeNodeDeallocationOption{Requeue, Retaineddata, Taskcompletion, Terminate} -} - -// ComputeNodeFillType enumerates the values for compute node fill type. -type ComputeNodeFillType string - -const ( - // ComputeNodeFillTypePack ... - ComputeNodeFillTypePack ComputeNodeFillType = "pack" - // ComputeNodeFillTypeSpread ... - ComputeNodeFillTypeSpread ComputeNodeFillType = "spread" - // ComputeNodeFillTypeUnmapped ... - ComputeNodeFillTypeUnmapped ComputeNodeFillType = "unmapped" -) - -// PossibleComputeNodeFillTypeValues returns an array of possible values for the ComputeNodeFillType const type. -func PossibleComputeNodeFillTypeValues() []ComputeNodeFillType { - return []ComputeNodeFillType{ComputeNodeFillTypePack, ComputeNodeFillTypeSpread, ComputeNodeFillTypeUnmapped} -} - -// ComputeNodeRebootOption enumerates the values for compute node reboot option. -type ComputeNodeRebootOption string - -const ( - // ComputeNodeRebootOptionRequeue ... - ComputeNodeRebootOptionRequeue ComputeNodeRebootOption = "requeue" - // ComputeNodeRebootOptionRetaineddata ... - ComputeNodeRebootOptionRetaineddata ComputeNodeRebootOption = "retaineddata" - // ComputeNodeRebootOptionTaskcompletion ... - ComputeNodeRebootOptionTaskcompletion ComputeNodeRebootOption = "taskcompletion" - // ComputeNodeRebootOptionTerminate ... - ComputeNodeRebootOptionTerminate ComputeNodeRebootOption = "terminate" -) - -// PossibleComputeNodeRebootOptionValues returns an array of possible values for the ComputeNodeRebootOption const type. -func PossibleComputeNodeRebootOptionValues() []ComputeNodeRebootOption { - return []ComputeNodeRebootOption{ComputeNodeRebootOptionRequeue, ComputeNodeRebootOptionRetaineddata, ComputeNodeRebootOptionTaskcompletion, ComputeNodeRebootOptionTerminate} -} - -// ComputeNodeReimageOption enumerates the values for compute node reimage option. -type ComputeNodeReimageOption string - -const ( - // ComputeNodeReimageOptionRequeue ... - ComputeNodeReimageOptionRequeue ComputeNodeReimageOption = "requeue" - // ComputeNodeReimageOptionRetaineddata ... - ComputeNodeReimageOptionRetaineddata ComputeNodeReimageOption = "retaineddata" - // ComputeNodeReimageOptionTaskcompletion ... - ComputeNodeReimageOptionTaskcompletion ComputeNodeReimageOption = "taskcompletion" - // ComputeNodeReimageOptionTerminate ... - ComputeNodeReimageOptionTerminate ComputeNodeReimageOption = "terminate" -) - -// PossibleComputeNodeReimageOptionValues returns an array of possible values for the ComputeNodeReimageOption const type. -func PossibleComputeNodeReimageOptionValues() []ComputeNodeReimageOption { - return []ComputeNodeReimageOption{ComputeNodeReimageOptionRequeue, ComputeNodeReimageOptionRetaineddata, ComputeNodeReimageOptionTaskcompletion, ComputeNodeReimageOptionTerminate} -} - -// ComputeNodeState enumerates the values for compute node state. -type ComputeNodeState string - -const ( - // Creating ... - Creating ComputeNodeState = "creating" - // Idle ... - Idle ComputeNodeState = "idle" - // Leavingpool ... - Leavingpool ComputeNodeState = "leavingpool" - // Offline ... - Offline ComputeNodeState = "offline" - // Rebooting ... - Rebooting ComputeNodeState = "rebooting" - // Reimaging ... - Reimaging ComputeNodeState = "reimaging" - // Running ... - Running ComputeNodeState = "running" - // Starting ... - Starting ComputeNodeState = "starting" - // Starttaskfailed ... - Starttaskfailed ComputeNodeState = "starttaskfailed" - // Unknown ... - Unknown ComputeNodeState = "unknown" - // Unusable ... - Unusable ComputeNodeState = "unusable" - // Waitingforstarttask ... - Waitingforstarttask ComputeNodeState = "waitingforstarttask" -) - -// PossibleComputeNodeStateValues returns an array of possible values for the ComputeNodeState const type. -func PossibleComputeNodeStateValues() []ComputeNodeState { - return []ComputeNodeState{Creating, Idle, Leavingpool, Offline, Rebooting, Reimaging, Running, Starting, Starttaskfailed, Unknown, Unusable, Waitingforstarttask} -} - -// DisableComputeNodeSchedulingOption enumerates the values for disable compute node scheduling option. -type DisableComputeNodeSchedulingOption string - -const ( - // DisableComputeNodeSchedulingOptionRequeue ... - DisableComputeNodeSchedulingOptionRequeue DisableComputeNodeSchedulingOption = "requeue" - // DisableComputeNodeSchedulingOptionTaskcompletion ... - DisableComputeNodeSchedulingOptionTaskcompletion DisableComputeNodeSchedulingOption = "taskcompletion" - // DisableComputeNodeSchedulingOptionTerminate ... - DisableComputeNodeSchedulingOptionTerminate DisableComputeNodeSchedulingOption = "terminate" -) - -// PossibleDisableComputeNodeSchedulingOptionValues returns an array of possible values for the DisableComputeNodeSchedulingOption const type. -func PossibleDisableComputeNodeSchedulingOptionValues() []DisableComputeNodeSchedulingOption { - return []DisableComputeNodeSchedulingOption{DisableComputeNodeSchedulingOptionRequeue, DisableComputeNodeSchedulingOptionTaskcompletion, DisableComputeNodeSchedulingOptionTerminate} -} - -// DisableJobOption enumerates the values for disable job option. -type DisableJobOption string - -const ( - // DisableJobOptionRequeue ... - DisableJobOptionRequeue DisableJobOption = "requeue" - // DisableJobOptionTerminate ... - DisableJobOptionTerminate DisableJobOption = "terminate" - // DisableJobOptionWait ... - DisableJobOptionWait DisableJobOption = "wait" -) - -// PossibleDisableJobOptionValues returns an array of possible values for the DisableJobOption const type. -func PossibleDisableJobOptionValues() []DisableJobOption { - return []DisableJobOption{DisableJobOptionRequeue, DisableJobOptionTerminate, DisableJobOptionWait} -} - -// JobPreparationTaskState enumerates the values for job preparation task state. -type JobPreparationTaskState string - -const ( - // JobPreparationTaskStateCompleted ... - JobPreparationTaskStateCompleted JobPreparationTaskState = "completed" - // JobPreparationTaskStateRunning ... - JobPreparationTaskStateRunning JobPreparationTaskState = "running" -) - -// PossibleJobPreparationTaskStateValues returns an array of possible values for the JobPreparationTaskState const type. -func PossibleJobPreparationTaskStateValues() []JobPreparationTaskState { - return []JobPreparationTaskState{JobPreparationTaskStateCompleted, JobPreparationTaskStateRunning} -} - -// JobReleaseTaskState enumerates the values for job release task state. -type JobReleaseTaskState string - -const ( - // JobReleaseTaskStateCompleted ... - JobReleaseTaskStateCompleted JobReleaseTaskState = "completed" - // JobReleaseTaskStateRunning ... - JobReleaseTaskStateRunning JobReleaseTaskState = "running" -) - -// PossibleJobReleaseTaskStateValues returns an array of possible values for the JobReleaseTaskState const type. -func PossibleJobReleaseTaskStateValues() []JobReleaseTaskState { - return []JobReleaseTaskState{JobReleaseTaskStateCompleted, JobReleaseTaskStateRunning} -} - -// JobScheduleState enumerates the values for job schedule state. -type JobScheduleState string - -const ( - // JobScheduleStateActive ... - JobScheduleStateActive JobScheduleState = "active" - // JobScheduleStateCompleted ... - JobScheduleStateCompleted JobScheduleState = "completed" - // JobScheduleStateDeleting ... - JobScheduleStateDeleting JobScheduleState = "deleting" - // JobScheduleStateDisabled ... - JobScheduleStateDisabled JobScheduleState = "disabled" - // JobScheduleStateTerminating ... - JobScheduleStateTerminating JobScheduleState = "terminating" -) - -// PossibleJobScheduleStateValues returns an array of possible values for the JobScheduleState const type. -func PossibleJobScheduleStateValues() []JobScheduleState { - return []JobScheduleState{JobScheduleStateActive, JobScheduleStateCompleted, JobScheduleStateDeleting, JobScheduleStateDisabled, JobScheduleStateTerminating} -} - -// JobState enumerates the values for job state. -type JobState string - -const ( - // JobStateActive ... - JobStateActive JobState = "active" - // JobStateCompleted ... - JobStateCompleted JobState = "completed" - // JobStateDeleting ... - JobStateDeleting JobState = "deleting" - // JobStateDisabled ... - JobStateDisabled JobState = "disabled" - // JobStateDisabling ... - JobStateDisabling JobState = "disabling" - // JobStateEnabling ... - JobStateEnabling JobState = "enabling" - // JobStateTerminating ... - JobStateTerminating JobState = "terminating" -) - -// PossibleJobStateValues returns an array of possible values for the JobState const type. -func PossibleJobStateValues() []JobState { - return []JobState{JobStateActive, JobStateCompleted, JobStateDeleting, JobStateDisabled, JobStateDisabling, JobStateEnabling, JobStateTerminating} -} - -// OSType enumerates the values for os type. -type OSType string - -const ( - // OSTypeLinux ... - OSTypeLinux OSType = "linux" - // OSTypeUnmapped ... - OSTypeUnmapped OSType = "unmapped" - // OSTypeWindows ... - OSTypeWindows OSType = "windows" -) - -// PossibleOSTypeValues returns an array of possible values for the OSType const type. -func PossibleOSTypeValues() []OSType { - return []OSType{OSTypeLinux, OSTypeUnmapped, OSTypeWindows} -} - -// PoolLifetimeOption enumerates the values for pool lifetime option. -type PoolLifetimeOption string - -const ( - // PoolLifetimeOptionJob ... - PoolLifetimeOptionJob PoolLifetimeOption = "job" - // PoolLifetimeOptionJobschedule ... - PoolLifetimeOptionJobschedule PoolLifetimeOption = "jobschedule" - // PoolLifetimeOptionUnmapped ... - PoolLifetimeOptionUnmapped PoolLifetimeOption = "unmapped" -) - -// PossiblePoolLifetimeOptionValues returns an array of possible values for the PoolLifetimeOption const type. -func PossiblePoolLifetimeOptionValues() []PoolLifetimeOption { - return []PoolLifetimeOption{PoolLifetimeOptionJob, PoolLifetimeOptionJobschedule, PoolLifetimeOptionUnmapped} -} - -// PoolState enumerates the values for pool state. -type PoolState string - -const ( - // PoolStateActive ... - PoolStateActive PoolState = "active" - // PoolStateDeleting ... - PoolStateDeleting PoolState = "deleting" - // PoolStateUpgrading ... - PoolStateUpgrading PoolState = "upgrading" -) - -// PossiblePoolStateValues returns an array of possible values for the PoolState const type. -func PossiblePoolStateValues() []PoolState { - return []PoolState{PoolStateActive, PoolStateDeleting, PoolStateUpgrading} -} - -// SchedulingErrorCategory enumerates the values for scheduling error category. -type SchedulingErrorCategory string - -const ( - // SchedulingErrorCategoryServererror ... - SchedulingErrorCategoryServererror SchedulingErrorCategory = "servererror" - // SchedulingErrorCategoryUnmapped ... - SchedulingErrorCategoryUnmapped SchedulingErrorCategory = "unmapped" - // SchedulingErrorCategoryUsererror ... - SchedulingErrorCategoryUsererror SchedulingErrorCategory = "usererror" -) - -// PossibleSchedulingErrorCategoryValues returns an array of possible values for the SchedulingErrorCategory const type. -func PossibleSchedulingErrorCategoryValues() []SchedulingErrorCategory { - return []SchedulingErrorCategory{SchedulingErrorCategoryServererror, SchedulingErrorCategoryUnmapped, SchedulingErrorCategoryUsererror} -} - -// SchedulingState enumerates the values for scheduling state. -type SchedulingState string - -const ( - // Disabled ... - Disabled SchedulingState = "disabled" - // Enabled ... - Enabled SchedulingState = "enabled" -) - -// PossibleSchedulingStateValues returns an array of possible values for the SchedulingState const type. -func PossibleSchedulingStateValues() []SchedulingState { - return []SchedulingState{Disabled, Enabled} -} - -// StartTaskState enumerates the values for start task state. -type StartTaskState string - -const ( - // StartTaskStateCompleted ... - StartTaskStateCompleted StartTaskState = "completed" - // StartTaskStateRunning ... - StartTaskStateRunning StartTaskState = "running" -) - -// PossibleStartTaskStateValues returns an array of possible values for the StartTaskState const type. -func PossibleStartTaskStateValues() []StartTaskState { - return []StartTaskState{StartTaskStateCompleted, StartTaskStateRunning} -} - -// TaskAddStatus enumerates the values for task add status. -type TaskAddStatus string - -const ( - // TaskAddStatusClienterror ... - TaskAddStatusClienterror TaskAddStatus = "clienterror" - // TaskAddStatusServererror ... - TaskAddStatusServererror TaskAddStatus = "servererror" - // TaskAddStatusSuccess ... - TaskAddStatusSuccess TaskAddStatus = "success" - // TaskAddStatusUnmapped ... - TaskAddStatusUnmapped TaskAddStatus = "unmapped" -) - -// PossibleTaskAddStatusValues returns an array of possible values for the TaskAddStatus const type. -func PossibleTaskAddStatusValues() []TaskAddStatus { - return []TaskAddStatus{TaskAddStatusClienterror, TaskAddStatusServererror, TaskAddStatusSuccess, TaskAddStatusUnmapped} -} - -// TaskState enumerates the values for task state. -type TaskState string - -const ( - // TaskStateActive ... - TaskStateActive TaskState = "active" - // TaskStateCompleted ... - TaskStateCompleted TaskState = "completed" - // TaskStatePreparing ... - TaskStatePreparing TaskState = "preparing" - // TaskStateRunning ... - TaskStateRunning TaskState = "running" -) - -// PossibleTaskStateValues returns an array of possible values for the TaskState const type. -func PossibleTaskStateValues() []TaskState { - return []TaskState{TaskStateActive, TaskStateCompleted, TaskStatePreparing, TaskStateRunning} -} - -// AccountListNodeAgentSkusResult response to an AccountOperation.ListNodeAgentSkus request. -type AccountListNodeAgentSkusResult struct { - autorest.Response `json:"-"` - // Value - The list of supported node agent SKUs. - Value *[]NodeAgentSku `json:"value,omitempty"` - // OdataNextLink - The URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// AccountListNodeAgentSkusResultIterator provides access to a complete listing of NodeAgentSku values. -type AccountListNodeAgentSkusResultIterator struct { - i int - page AccountListNodeAgentSkusResultPage -} - -// Next 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 *AccountListNodeAgentSkusResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AccountListNodeAgentSkusResultIterator) 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 AccountListNodeAgentSkusResultIterator) Response() AccountListNodeAgentSkusResult { - 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 AccountListNodeAgentSkusResultIterator) Value() NodeAgentSku { - if !iter.page.NotDone() { - return NodeAgentSku{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (alnasr AccountListNodeAgentSkusResult) IsEmpty() bool { - return alnasr.Value == nil || len(*alnasr.Value) == 0 -} - -// accountListNodeAgentSkusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alnasr AccountListNodeAgentSkusResult) accountListNodeAgentSkusResultPreparer() (*http.Request, error) { - if alnasr.OdataNextLink == nil || len(to.String(alnasr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alnasr.OdataNextLink))) -} - -// AccountListNodeAgentSkusResultPage contains a page of NodeAgentSku values. -type AccountListNodeAgentSkusResultPage struct { - fn func(AccountListNodeAgentSkusResult) (AccountListNodeAgentSkusResult, error) - alnasr AccountListNodeAgentSkusResult -} - -// 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. -func (page *AccountListNodeAgentSkusResultPage) Next() error { - next, err := page.fn(page.alnasr) - if err != nil { - return err - } - page.alnasr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AccountListNodeAgentSkusResultPage) NotDone() bool { - return !page.alnasr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AccountListNodeAgentSkusResultPage) Response() AccountListNodeAgentSkusResult { - return page.alnasr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AccountListNodeAgentSkusResultPage) Values() []NodeAgentSku { - if page.alnasr.IsEmpty() { - return nil - } - return *page.alnasr.Value -} - -// AffinityInformation a locality hint that can be used by the Batch service to select a compute node on which to -// start a task. -type AffinityInformation struct { - // AffinityID - An opaque string representing the location of a compute node or a task that has run previously. You can pass the AffinityId of a compute node or task to indicate that this task needs to be placed close to the node or task. - AffinityID *string `json:"affinityId,omitempty"` -} - -// ApplicationListResult response to a ApplicationOperations.List request. -type ApplicationListResult struct { - autorest.Response `json:"-"` - // Value - The list of applications available in the account. - Value *[]ApplicationSummary `json:"value,omitempty"` - // OdataNextLink - The URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// ApplicationListResultIterator provides access to a complete listing of ApplicationSummary values. -type ApplicationListResultIterator struct { - i int - page ApplicationListResultPage -} - -// Next 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 *ApplicationListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationListResultIterator) 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 ApplicationListResultIterator) Response() ApplicationListResult { - 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 ApplicationListResultIterator) Value() ApplicationSummary { - if !iter.page.NotDone() { - return ApplicationSummary{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (alr ApplicationListResult) IsEmpty() bool { - return alr.Value == nil || len(*alr.Value) == 0 -} - -// applicationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alr ApplicationListResult) applicationListResultPreparer() (*http.Request, error) { - if alr.OdataNextLink == nil || len(to.String(alr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alr.OdataNextLink))) -} - -// ApplicationListResultPage contains a page of ApplicationSummary values. -type ApplicationListResultPage struct { - fn func(ApplicationListResult) (ApplicationListResult, error) - alr ApplicationListResult -} - -// 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. -func (page *ApplicationListResultPage) Next() error { - next, err := page.fn(page.alr) - if err != nil { - return err - } - page.alr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationListResultPage) NotDone() bool { - return !page.alr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationListResultPage) Response() ApplicationListResult { - return page.alr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationListResultPage) Values() []ApplicationSummary { - if page.alr.IsEmpty() { - return nil - } - return *page.alr.Value -} - -// ApplicationPackageReference a reference to an application package to be installed on compute nodes in a pool. -type ApplicationPackageReference struct { - // ApplicationID - The id of the application to install. - ApplicationID *string `json:"applicationId,omitempty"` - // Version - The version of the application to install. If omitted, the default version is installed. - Version *string `json:"version,omitempty"` -} - -// ApplicationSummary contains information about an application in an Azure Batch account. -type ApplicationSummary struct { - autorest.Response `json:"-"` - // ID - A string that uniquely identifies the application within the account. - ID *string `json:"id,omitempty"` - // DisplayName - The display name for the application. - DisplayName *string `json:"displayName,omitempty"` - Versions *[]string `json:"versions,omitempty"` -} - -// AutoPoolSpecification specifies characteristics for a temporary 'auto pool'. The Batch service will create this -// auto pool, run all the tasks for the job on it, and will delete the pool once the job has completed. -type AutoPoolSpecification struct { - // AutoPoolIDPrefix - A prefix to be added to the unique identifier when a pool is automatically created. The prefix can be up to 20 characters long. - AutoPoolIDPrefix *string `json:"autoPoolIdPrefix,omitempty"` - // PoolLifetimeOption - The minimum lifetime of created auto pools, and how multiple jobs on a schedule are assigned to pools. Possible values include: 'PoolLifetimeOptionJobschedule', 'PoolLifetimeOptionJob', 'PoolLifetimeOptionUnmapped' - PoolLifetimeOption PoolLifetimeOption `json:"poolLifetimeOption,omitempty"` - // KeepAlive - Whether to keep an auto pool alive after its lifetime expires. - KeepAlive *bool `json:"keepAlive,omitempty"` - // Pool - The pool specification for the auto pool. - Pool *PoolSpecification `json:"pool,omitempty"` -} - -// AutoScaleRun the results and errors from an execution of a pool autoscale formula. -type AutoScaleRun struct { - autorest.Response `json:"-"` - // Timestamp - The time at which the autoscale formula was last evaluated. - Timestamp *date.Time `json:"timestamp,omitempty"` - // Results - The final values of all variables used in the evaluation of the autoscale formula. Each variable value is returned in the form $variable=value, and variables are separated by semicolons. - Results *string `json:"results,omitempty"` - // Error - Details of the error encountered evaluating the autoscale formula on the pool, if the evaluation was unsuccessful. - Error *AutoScaleRunError `json:"error,omitempty"` -} - -// AutoScaleRunError an error that occurred when executing or evaluating a pool autoscale formula. -type AutoScaleRunError struct { - // Code - An identifier for the autoscale error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - A message describing the autoscale error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // Values - A list of additional error details related to the autoscale error. - Values *[]NameValuePair `json:"values,omitempty"` -} - -// Certificate a certificate that can be installed on compute nodes and can be used to authenticate operations on -// the machine. -type Certificate struct { - autorest.Response `json:"-"` - // Thumbprint - The X.509 thumbprint of the certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed). - Thumbprint *string `json:"thumbprint,omitempty"` - // ThumbprintAlgorithm - The algorithm used to derive the thumbprint. This must be sha1. - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - // URL - The URL of the certificate. - URL *string `json:"url,omitempty"` - // State - The current state of the certificate. Possible values include: 'Active', 'Deleting', 'Deletefailed' - State CertificateState `json:"state,omitempty"` - // StateTransitionTime - The time at which the certificate entered its current state. - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - The previous state of the certificate. This property is not set if the certificate is in its initial Active state. Possible values include: 'Active', 'Deleting', 'Deletefailed' - PreviousState CertificateState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - The time at which the certificate entered its previous state. This property is not set if the certificate is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // PublicData - The public part of the certificate as a base-64 encoded .cer file. - PublicData *string `json:"publicData,omitempty"` - // DeleteCertificateError - The error that occurred on the last attempt to delete this certificate. This property is set only if the certificate is in the deletefailed state. - DeleteCertificateError *DeleteCertificateError `json:"deleteCertificateError,omitempty"` -} - -// CertificateAddParameter a certificate that can be installed on compute nodes and can be used to authenticate -// operations on the machine. -type CertificateAddParameter struct { - // Thumbprint - The X.509 thumbprint of the certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed). - Thumbprint *string `json:"thumbprint,omitempty"` - // ThumbprintAlgorithm - The algorithm used to derive the thumbprint. This must be sha1. - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - // Data - The base64-encoded contents of the certificate. The maximum size is 10KB. - Data *string `json:"data,omitempty"` - // CertificateFormat - The format of the certificate data. Possible values include: 'Pfx', 'Cer', 'Unmapped' - CertificateFormat CertificateFormat `json:"certificateFormat,omitempty"` - // Password - The password to access the certificate's private key. - Password *string `json:"password,omitempty"` -} - -// CertificateListResult response to a CertificateOperation.List request. -type CertificateListResult struct { - autorest.Response `json:"-"` - // Value - The list of certificates. - Value *[]Certificate `json:"value,omitempty"` - // OdataNextLink - The URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CertificateListResultIterator provides access to a complete listing of Certificate values. -type CertificateListResultIterator struct { - i int - page CertificateListResultPage -} - -// Next 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 *CertificateListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CertificateListResultIterator) 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 CertificateListResultIterator) Response() CertificateListResult { - 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 CertificateListResultIterator) Value() Certificate { - if !iter.page.NotDone() { - return Certificate{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (clr CertificateListResult) IsEmpty() bool { - return clr.Value == nil || len(*clr.Value) == 0 -} - -// certificateListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) { - if clr.OdataNextLink == nil || len(to.String(clr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(clr.OdataNextLink))) -} - -// CertificateListResultPage contains a page of Certificate values. -type CertificateListResultPage struct { - fn func(CertificateListResult) (CertificateListResult, error) - clr CertificateListResult -} - -// 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. -func (page *CertificateListResultPage) Next() error { - next, err := page.fn(page.clr) - if err != nil { - return err - } - page.clr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CertificateListResultPage) NotDone() bool { - return !page.clr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CertificateListResultPage) Response() CertificateListResult { - return page.clr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CertificateListResultPage) Values() []Certificate { - if page.clr.IsEmpty() { - return nil - } - return *page.clr.Value -} - -// CertificateReference a reference to a certificate to be installed on compute nodes in a pool. -type CertificateReference struct { - // Thumbprint - The thumbprint of the certificate. - Thumbprint *string `json:"thumbprint,omitempty"` - // ThumbprintAlgorithm - The algorithm with which the thumbprint is associated. This must be sha1. - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - // StoreLocation - The location of the certificate store on the compute node into which to install the certificate. The default value is CurrentUser. Possible values include: 'CertificateStoreLocationCurrentuser', 'CertificateStoreLocationLocalmachine', 'CertificateStoreLocationUnmapped' - StoreLocation CertificateStoreLocation `json:"storeLocation,omitempty"` - // StoreName - The name of the certificate store on the compute node into which to install the certificate. The default value is My. - StoreName *string `json:"storeName,omitempty"` - // Visibility - Which user accounts on the compute node should have access to the private data of the certificate. This may be any subset of the values 'starttask', 'task' and 'remoteuser', separated by commas. The default is all accounts, corresponding to the string 'starttask,task,remoteuser'. - Visibility *[]CertificateVisibility `json:"visibility,omitempty"` -} - -// CloudJob an Azure Batch job. -type CloudJob struct { - autorest.Response `json:"-"` - // ID - A string that uniquely identifies the job within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id. - ID *string `json:"id,omitempty"` - // DisplayName - The display name for the job. - DisplayName *string `json:"displayName,omitempty"` - // UsesTaskDependencies - The flag that determines if this job will use tasks with dependencies. - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` - // URL - The URL of the job. - URL *string `json:"url,omitempty"` - // ETag - The ETag of the job. - ETag *string `json:"eTag,omitempty"` - // LastModified - The last modified time of the job. - LastModified *date.Time `json:"lastModified,omitempty"` - // CreationTime - The creation time of the job. - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - The current state of the job. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting' - State JobState `json:"state,omitempty"` - // StateTransitionTime - The time at which the job entered its current state. - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - The previous state of the job. This property is not set if the job is in its initial Active state. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting' - PreviousState JobState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - The time at which the job entered its previous state. This property is not set if the job is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // Priority - The priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. - Priority *int32 `json:"priority,omitempty"` - // Constraints - The execution constraints for the job. - Constraints *JobConstraints `json:"constraints,omitempty"` - // JobManagerTask - Details of a Job Manager task to be launched when the job is started. - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - The Job Preparation task. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - The Job Release task. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - // CommonEnvironmentSettings - The list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks). - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - // PoolInfo - The pool on which the Batch service runs the job's tasks. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - A list of name-value pairs associated with the job as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - // ExecutionInfo - The execution information for the job. - ExecutionInfo *JobExecutionInformation `json:"executionInfo,omitempty"` - // Stats - Resource usage statistics for the entire lifetime of the job. - Stats *JobStatistics `json:"stats,omitempty"` -} - -// CloudJobListPreparationAndReleaseTaskStatusResult response to a -// CloudJobOperations.ListPreparationAndReleaseTaskStatus request. -type CloudJobListPreparationAndReleaseTaskStatusResult struct { - autorest.Response `json:"-"` - // Value - A list of Job Preparation and Job Release task execution information. - Value *[]JobPreparationAndReleaseTaskExecutionInformation `json:"value,omitempty"` - // OdataNextLink - The URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobListPreparationAndReleaseTaskStatusResultIterator provides access to a complete listing of -// JobPreparationAndReleaseTaskExecutionInformation values. -type CloudJobListPreparationAndReleaseTaskStatusResultIterator struct { - i int - page CloudJobListPreparationAndReleaseTaskStatusResultPage -} - -// Next 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 *CloudJobListPreparationAndReleaseTaskStatusResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) 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 CloudJobListPreparationAndReleaseTaskStatusResultIterator) Response() CloudJobListPreparationAndReleaseTaskStatusResult { - 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 CloudJobListPreparationAndReleaseTaskStatusResultIterator) Value() JobPreparationAndReleaseTaskExecutionInformation { - if !iter.page.NotDone() { - return JobPreparationAndReleaseTaskExecutionInformation{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) IsEmpty() bool { - return cjlpartsr.Value == nil || len(*cjlpartsr.Value) == 0 -} - -// cloudJobListPreparationAndReleaseTaskStatusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) cloudJobListPreparationAndReleaseTaskStatusResultPreparer() (*http.Request, error) { - if cjlpartsr.OdataNextLink == nil || len(to.String(cjlpartsr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjlpartsr.OdataNextLink))) -} - -// CloudJobListPreparationAndReleaseTaskStatusResultPage contains a page of -// JobPreparationAndReleaseTaskExecutionInformation values. -type CloudJobListPreparationAndReleaseTaskStatusResultPage struct { - fn func(CloudJobListPreparationAndReleaseTaskStatusResult) (CloudJobListPreparationAndReleaseTaskStatusResult, error) - cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult -} - -// 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. -func (page *CloudJobListPreparationAndReleaseTaskStatusResultPage) Next() error { - next, err := page.fn(page.cjlpartsr) - if err != nil { - return err - } - page.cjlpartsr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) NotDone() bool { - return !page.cjlpartsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Response() CloudJobListPreparationAndReleaseTaskStatusResult { - return page.cjlpartsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Values() []JobPreparationAndReleaseTaskExecutionInformation { - if page.cjlpartsr.IsEmpty() { - return nil - } - return *page.cjlpartsr.Value -} - -// CloudJobListResult response to a CloudJobOperation.List or ListFromJobSchedule request. -type CloudJobListResult struct { - autorest.Response `json:"-"` - // Value - The list of jobs. - Value *[]CloudJob `json:"value,omitempty"` - // OdataNextLink - The URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobListResultIterator provides access to a complete listing of CloudJob values. -type CloudJobListResultIterator struct { - i int - page CloudJobListResultPage -} - -// Next 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 *CloudJobListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobListResultIterator) 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 CloudJobListResultIterator) Response() CloudJobListResult { - 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 CloudJobListResultIterator) Value() CloudJob { - if !iter.page.NotDone() { - return CloudJob{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjlr CloudJobListResult) IsEmpty() bool { - return cjlr.Value == nil || len(*cjlr.Value) == 0 -} - -// cloudJobListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjlr CloudJobListResult) cloudJobListResultPreparer() (*http.Request, error) { - if cjlr.OdataNextLink == nil || len(to.String(cjlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjlr.OdataNextLink))) -} - -// CloudJobListResultPage contains a page of CloudJob values. -type CloudJobListResultPage struct { - fn func(CloudJobListResult) (CloudJobListResult, error) - cjlr CloudJobListResult -} - -// 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. -func (page *CloudJobListResultPage) Next() error { - next, err := page.fn(page.cjlr) - if err != nil { - return err - } - page.cjlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobListResultPage) NotDone() bool { - return !page.cjlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobListResultPage) Response() CloudJobListResult { - return page.cjlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobListResultPage) Values() []CloudJob { - if page.cjlr.IsEmpty() { - return nil - } - return *page.cjlr.Value -} - -// CloudJobSchedule a job schedule that allows recurring jobs by specifying when to run jobs and a specification -// used to create each job. -type CloudJobSchedule struct { - autorest.Response `json:"-"` - // ID - A string that uniquely identifies the schedule within the account. A GUID is recommended. - ID *string `json:"id,omitempty"` - // DisplayName - The display name for the schedule. - DisplayName *string `json:"displayName,omitempty"` - // URL - The URL of the job schedule. - URL *string `json:"url,omitempty"` - // ETag - The ETag of the job schedule. - ETag *string `json:"eTag,omitempty"` - // LastModified - The last modified time of the job schedule. - LastModified *date.Time `json:"lastModified,omitempty"` - // CreationTime - The creation time of the job schedule. - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - The current state of the job schedule. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting' - State JobScheduleState `json:"state,omitempty"` - // StateTransitionTime - The time at which the job schedule entered the current state. - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - The previous state of the job schedule. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting' - PreviousState JobScheduleState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - The time at which the job schedule entered its previous state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // Schedule - The schedule according to which jobs will be created. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - The details of the jobs to be created on this schedule. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // ExecutionInfo - Information about jobs that have been and will be run under this schedule. - ExecutionInfo *JobScheduleExecutionInformation `json:"executionInfo,omitempty"` - // Metadata - A list of name-value pairs associated with the schedule as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - // Stats - The lifetime resource usage statistics for the job schedule. - Stats *JobScheduleStatistics `json:"stats,omitempty"` -} - -// CloudJobScheduleListResult response to a CloudJobScheduleOperation.List request. -type CloudJobScheduleListResult struct { - autorest.Response `json:"-"` - // Value - The list of job schedules. - Value *[]CloudJobSchedule `json:"value,omitempty"` - // OdataNextLink - The URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobScheduleListResultIterator provides access to a complete listing of CloudJobSchedule values. -type CloudJobScheduleListResultIterator struct { - i int - page CloudJobScheduleListResultPage -} - -// Next 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 *CloudJobScheduleListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobScheduleListResultIterator) 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 CloudJobScheduleListResultIterator) Response() CloudJobScheduleListResult { - 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 CloudJobScheduleListResultIterator) Value() CloudJobSchedule { - if !iter.page.NotDone() { - return CloudJobSchedule{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjslr CloudJobScheduleListResult) IsEmpty() bool { - return cjslr.Value == nil || len(*cjslr.Value) == 0 -} - -// cloudJobScheduleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjslr CloudJobScheduleListResult) cloudJobScheduleListResultPreparer() (*http.Request, error) { - if cjslr.OdataNextLink == nil || len(to.String(cjslr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjslr.OdataNextLink))) -} - -// CloudJobScheduleListResultPage contains a page of CloudJobSchedule values. -type CloudJobScheduleListResultPage struct { - fn func(CloudJobScheduleListResult) (CloudJobScheduleListResult, error) - cjslr CloudJobScheduleListResult -} - -// 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. -func (page *CloudJobScheduleListResultPage) Next() error { - next, err := page.fn(page.cjslr) - if err != nil { - return err - } - page.cjslr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobScheduleListResultPage) NotDone() bool { - return !page.cjslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobScheduleListResultPage) Response() CloudJobScheduleListResult { - return page.cjslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobScheduleListResultPage) Values() []CloudJobSchedule { - if page.cjslr.IsEmpty() { - return nil - } - return *page.cjslr.Value -} - -// CloudPool a pool in the Azure Batch service. -type CloudPool struct { - autorest.Response `json:"-"` - // ID - A string that uniquely identifies the pool within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - The display name for the pool. - DisplayName *string `json:"displayName,omitempty"` - // URL - The URL of the pool. - URL *string `json:"url,omitempty"` - // ETag - The ETag of the pool. - ETag *string `json:"eTag,omitempty"` - // LastModified - The last modified time of the pool. - LastModified *date.Time `json:"lastModified,omitempty"` - // CreationTime - The creation time of the pool. - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - The current state of the pool. Possible values include: 'PoolStateActive', 'PoolStateDeleting', 'PoolStateUpgrading' - State PoolState `json:"state,omitempty"` - // StateTransitionTime - The time at which the pool entered its current state. - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // AllocationState - Whether the pool is resizing. Possible values include: 'Steady', 'Resizing', 'Stopping' - AllocationState AllocationState `json:"allocationState,omitempty"` - // AllocationStateTransitionTime - The time at which the pool entered its current allocation state. - AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"` - // VMSize - The size of virtual machines in the pool. All virtual machines in a pool are the same size. - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - The cloud service configuration for the pool. This property and VirtualMachineConfiguration are mutually exclusive and one of the properties must be specified. - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - The virtual machine configuration for the pool. This property and CloudServiceConfiguration are mutually exclusive and one of the properties must be specified. - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // ResizeTimeout - The timeout for allocation of compute nodes to the pool. In a Get Pool operation, this is the timeout for the most recent resize operation. The default value is 10 minutes. - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // ResizeError - Details of any error encountered while performing the last resize on the pool. This property is set only if an error occurred during the last pool resize, and only when the pool AllocationState is Steady. - ResizeError *ResizeError `json:"resizeError,omitempty"` - // CurrentDedicated - The number of compute nodes currently in the pool. - CurrentDedicated *int32 `json:"currentDedicated,omitempty"` - // TargetDedicated - The desired number of compute nodes in the pool. This property must have the default value if EnableAutoScale is true. It is required if EnableAutoScale is false. - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // EnableAutoScale - Whether the pool size should automatically adjust over time. If true, the AutoScaleFormula property must be set. If false, the TargetDedicated property must be set. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - A formula for the desired number of compute nodes in the pool. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - A time interval for the desired AutoScale evaluation period in the pool. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // AutoScaleRun - The results and errors from the last execution of the autoscale formula. - AutoScaleRun *AutoScaleRun `json:"autoScaleRun,omitempty"` - // EnableInterNodeCommunication - Whether the pool permits direct communication between nodes. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - // StartTask - A task specified to run on each compute node as it joins the pool. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - The list of certificates to be installed on each compute node in the pool. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - The list of application packages to be installed on each compute node in the pool. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // MaxTasksPerNode - The maximum number of tasks that can run concurrently on a single compute node in the pool. - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - // TaskSchedulingPolicy - How the Batch service distributes tasks between compute nodes in the pool. - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - // Metadata - A list of name-value pairs associated with the pool as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - // Stats - Utilization and resource usage statistics for the entire lifetime of the pool. - Stats *PoolStatistics `json:"stats,omitempty"` -} - -// CloudPoolListResult response to a CloudPoolOperations.List request. -type CloudPoolListResult struct { - autorest.Response `json:"-"` - // Value - The list of pools. - Value *[]CloudPool `json:"value,omitempty"` - // OdataNextLink - The URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudPoolListResultIterator provides access to a complete listing of CloudPool values. -type CloudPoolListResultIterator struct { - i int - page CloudPoolListResultPage -} - -// Next 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 *CloudPoolListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudPoolListResultIterator) 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 CloudPoolListResultIterator) Response() CloudPoolListResult { - 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 CloudPoolListResultIterator) Value() CloudPool { - if !iter.page.NotDone() { - return CloudPool{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cplr CloudPoolListResult) IsEmpty() bool { - return cplr.Value == nil || len(*cplr.Value) == 0 -} - -// cloudPoolListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cplr CloudPoolListResult) cloudPoolListResultPreparer() (*http.Request, error) { - if cplr.OdataNextLink == nil || len(to.String(cplr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cplr.OdataNextLink))) -} - -// CloudPoolListResultPage contains a page of CloudPool values. -type CloudPoolListResultPage struct { - fn func(CloudPoolListResult) (CloudPoolListResult, error) - cplr CloudPoolListResult -} - -// 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. -func (page *CloudPoolListResultPage) Next() error { - next, err := page.fn(page.cplr) - if err != nil { - return err - } - page.cplr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudPoolListResultPage) NotDone() bool { - return !page.cplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudPoolListResultPage) Response() CloudPoolListResult { - return page.cplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudPoolListResultPage) Values() []CloudPool { - if page.cplr.IsEmpty() { - return nil - } - return *page.cplr.Value -} - -// CloudServiceConfiguration the configuration for nodes in a pool based on the Azure Cloud Services platform. -type CloudServiceConfiguration struct { - // OsFamily - The Azure Guest OS family to be installed on the virtual machines in the pool. - OsFamily *string `json:"osFamily,omitempty"` - // TargetOSVersion - The Azure Guest OS version to be installed on the virtual machines in the pool. The default value is * which specifies the latest operating system version for the specified OS family. - TargetOSVersion *string `json:"targetOSVersion,omitempty"` - // CurrentOSVersion - The Azure Guest OS Version currently installed on the virtual machines in the pool. This may differ from TargetOSVersion if the pool state is Upgrading. - CurrentOSVersion *string `json:"currentOSVersion,omitempty"` -} - -// CloudTask an Azure Batch task. -type CloudTask struct { - autorest.Response `json:"-"` - // ID - A string that uniquely identifies the task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - A display name for the task. - DisplayName *string `json:"displayName,omitempty"` - // URL - The URL of the task. - URL *string `json:"url,omitempty"` - // ETag - The ETag of the task. - ETag *string `json:"eTag,omitempty"` - // LastModified - The last modified time of the task. - LastModified *date.Time `json:"lastModified,omitempty"` - // CreationTime - The creation time of the task. - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - The current state of the task. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - State TaskState `json:"state,omitempty"` - // StateTransitionTime - The time at which the task entered its current state. - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - The previous state of the task. This property is not set if the task is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - PreviousState TaskState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - The time at which the task entered its previous state. This property is not set if the task is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // CommandLine - The command line of the task. For multi-instance tasks, the command line is executed on the primary subtask after all the subtasks have finished executing the coordianation command line. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - A list of files that the Batch service will download to the compute node before running the command line. For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary subtask is executed. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // EnvironmentSettings - A list of environment variable settings for the task. - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // AffinityInfo - A locality hint that can be used by the Batch service to select a compute node on which to start the new task. - AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"` - // Constraints - The execution constraints that apply to this task. - Constraints *TaskConstraints `json:"constraints,omitempty"` - // RunElevated - Whether to run the task in elevated mode. - RunElevated *bool `json:"runElevated,omitempty"` - // ExecutionInfo - Information about the execution of the task. - ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"` - // NodeInfo - Information about the compute node on which the task ran. - NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"` - // MultiInstanceSettings - Information about how to run the multi-instance task. - MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"` - // Stats - Resource usage statistics for the task. - Stats *TaskStatistics `json:"stats,omitempty"` - // DependsOn - Any dependencies this task has. - DependsOn *TaskDependencies `json:"dependsOn,omitempty"` -} - -// CloudTaskListResult response to a CloudTaskOperations.List request. -type CloudTaskListResult struct { - autorest.Response `json:"-"` - // Value - The list of tasks. - Value *[]CloudTask `json:"value,omitempty"` - // OdataNextLink - The URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudTaskListResultIterator provides access to a complete listing of CloudTask values. -type CloudTaskListResultIterator struct { - i int - page CloudTaskListResultPage -} - -// Next 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 *CloudTaskListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudTaskListResultIterator) 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 CloudTaskListResultIterator) Response() CloudTaskListResult { - 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 CloudTaskListResultIterator) Value() CloudTask { - if !iter.page.NotDone() { - return CloudTask{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (ctlr CloudTaskListResult) IsEmpty() bool { - return ctlr.Value == nil || len(*ctlr.Value) == 0 -} - -// cloudTaskListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ctlr CloudTaskListResult) cloudTaskListResultPreparer() (*http.Request, error) { - if ctlr.OdataNextLink == nil || len(to.String(ctlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ctlr.OdataNextLink))) -} - -// CloudTaskListResultPage contains a page of CloudTask values. -type CloudTaskListResultPage struct { - fn func(CloudTaskListResult) (CloudTaskListResult, error) - ctlr CloudTaskListResult -} - -// 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. -func (page *CloudTaskListResultPage) Next() error { - next, err := page.fn(page.ctlr) - if err != nil { - return err - } - page.ctlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudTaskListResultPage) NotDone() bool { - return !page.ctlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudTaskListResultPage) Response() CloudTaskListResult { - return page.ctlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudTaskListResultPage) Values() []CloudTask { - if page.ctlr.IsEmpty() { - return nil - } - return *page.ctlr.Value -} - -// CloudTaskListSubtasksResult response to a CloudTaskOperations.ListSubtasks request. -type CloudTaskListSubtasksResult struct { - autorest.Response `json:"-"` - // Value - The list of information of subtasks. - Value *[]SubtaskInformation `json:"value,omitempty"` -} - -// ComputeNode a compute node in the Batch service. -type ComputeNode struct { - autorest.Response `json:"-"` - // ID - The id of the compute node. - ID *string `json:"id,omitempty"` - // URL - The URL of the compute node. - URL *string `json:"url,omitempty"` - // State - The current state of the compute node. Possible values include: 'Idle', 'Rebooting', 'Reimaging', 'Running', 'Unusable', 'Creating', 'Starting', 'Waitingforstarttask', 'Starttaskfailed', 'Unknown', 'Leavingpool', 'Offline' - State ComputeNodeState `json:"state,omitempty"` - // SchedulingState - Whether the compute node should be available for task scheduling. Possible values include: 'Enabled', 'Disabled' - SchedulingState SchedulingState `json:"schedulingState,omitempty"` - // StateTransitionTime - The time at which the compute node entered its current state. - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // LastBootTime - The time at which the compute node was started. - LastBootTime *date.Time `json:"lastBootTime,omitempty"` - // AllocationTime - The time at which this compute node was allocated to the pool. - AllocationTime *date.Time `json:"allocationTime,omitempty"` - // IPAddress - The IP address that other compute nodes can use to communicate with this compute node. - IPAddress *string `json:"ipAddress,omitempty"` - // AffinityID - An identifier which can be passed in the Add Task API to request that the task be scheduled close to this compute node. - AffinityID *string `json:"affinityId,omitempty"` - // VMSize - The size of the virtual machine hosting the compute node. - VMSize *string `json:"vmSize,omitempty"` - // TotalTasksRun - The total number of job tasks completed on the compute node. This includes Job Preparation, Job Release and Job Manager tasks, but not the pool start task. - TotalTasksRun *int32 `json:"totalTasksRun,omitempty"` - // RunningTasksCount - The total number of currently running job tasks on the compute node. This includes Job Preparation, Job Release, and Job Manager tasks, but not the pool start task. - RunningTasksCount *int32 `json:"runningTasksCount,omitempty"` - // TotalTasksSucceeded - The total number of job tasks which completed successfully (with exitCode 0) on the compute node. This includes Job Preparation, Job Release, and Job Manager tasks, but not the pool start task. - TotalTasksSucceeded *int32 `json:"totalTasksSucceeded,omitempty"` - // RecentTasks - The list of tasks that are currently running on the compute node. - RecentTasks *[]TaskInformation `json:"recentTasks,omitempty"` - // StartTask - The task specified to run on the compute node as it joins the pool. - StartTask *StartTask `json:"startTask,omitempty"` - // StartTaskInfo - Runtime information about the execution of the start task on the compute node. - StartTaskInfo *StartTaskInformation `json:"startTaskInfo,omitempty"` - // CertificateReferences - The list of certificates installed on the compute node. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // Errors - The list of errors that are currently being encountered by the compute node. - Errors *[]ComputeNodeError `json:"errors,omitempty"` -} - -// ComputeNodeError an error encountered by a compute node. -type ComputeNodeError struct { - // Code - An identifier for the compute node error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - A message describing the compute node error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // ErrorDetails - The list of additional error details related to the compute node error. - ErrorDetails *[]NameValuePair `json:"errorDetails,omitempty"` -} - -// ComputeNodeGetRemoteLoginSettingsResult response to a ComputeNodeOperation.GetRemoteLoginSettings request. -type ComputeNodeGetRemoteLoginSettingsResult struct { - autorest.Response `json:"-"` - // RemoteLoginIPAddress - The IP address used for remote login to the compute node. - RemoteLoginIPAddress *string `json:"remoteLoginIPAddress,omitempty"` - // RemoteLoginPort - The port used for remote login to the compute node. - RemoteLoginPort *int32 `json:"remoteLoginPort,omitempty"` -} - -// ComputeNodeInformation information about the compute node on which a task ran. -type ComputeNodeInformation struct { - // AffinityID - An identifier for the compute node on which the task ran, which can be passed when adding a task to request that the task be scheduled close to this compute node. - AffinityID *string `json:"affinityId,omitempty"` - // NodeURL - The URL of the node on which the task ran. - NodeURL *string `json:"nodeUrl,omitempty"` - // PoolID - The id of the pool on which the task ran. - PoolID *string `json:"poolId,omitempty"` - // NodeID - The id of the node on which the task ran. - NodeID *string `json:"nodeId,omitempty"` - // TaskRootDirectory - The root directory of the task on the compute node. - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - // TaskRootDirectoryURL - The URL to the root directory of the task on the compute node. - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` -} - -// ComputeNodeListResult response to a ComputeNodeOperation.List request. -type ComputeNodeListResult struct { - autorest.Response `json:"-"` - // Value - The list of compute nodes. - Value *[]ComputeNode `json:"value,omitempty"` - // OdataNextLink - The URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// ComputeNodeListResultIterator provides access to a complete listing of ComputeNode values. -type ComputeNodeListResultIterator struct { - i int - page ComputeNodeListResultPage -} - -// Next 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 *ComputeNodeListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ComputeNodeListResultIterator) 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 ComputeNodeListResultIterator) Response() ComputeNodeListResult { - 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 ComputeNodeListResultIterator) Value() ComputeNode { - if !iter.page.NotDone() { - return ComputeNode{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cnlr ComputeNodeListResult) IsEmpty() bool { - return cnlr.Value == nil || len(*cnlr.Value) == 0 -} - -// computeNodeListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cnlr ComputeNodeListResult) computeNodeListResultPreparer() (*http.Request, error) { - if cnlr.OdataNextLink == nil || len(to.String(cnlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cnlr.OdataNextLink))) -} - -// ComputeNodeListResultPage contains a page of ComputeNode values. -type ComputeNodeListResultPage struct { - fn func(ComputeNodeListResult) (ComputeNodeListResult, error) - cnlr ComputeNodeListResult -} - -// 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. -func (page *ComputeNodeListResultPage) Next() error { - next, err := page.fn(page.cnlr) - if err != nil { - return err - } - page.cnlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ComputeNodeListResultPage) NotDone() bool { - return !page.cnlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ComputeNodeListResultPage) Response() ComputeNodeListResult { - return page.cnlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ComputeNodeListResultPage) Values() []ComputeNode { - if page.cnlr.IsEmpty() { - return nil - } - return *page.cnlr.Value -} - -// ComputeNodeUser an user account on a compute node. -type ComputeNodeUser struct { - // Name - The user name of the account. - Name *string `json:"name,omitempty"` - // IsAdmin - Whether the account should be an administrator on the compute node. - IsAdmin *bool `json:"isAdmin,omitempty"` - // ExpiryTime - The time at which the account should expire. If omitted, the default is 1 day from the current time. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // Password - The password of the account. - Password *string `json:"password,omitempty"` - // SSHPublicKey - The SSH public key that can be used for remote login to the compute node. - SSHPublicKey *string `json:"sshPublicKey,omitempty"` -} - -// DeleteCertificateError an error encountered by the Batch service when deleting a certificate. -type DeleteCertificateError struct { - // Code - An identifier for the certificate deletion error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - A message describing the certificate deletion error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // Values - A list of additional error details related to the certificate deletion error. - Values *[]NameValuePair `json:"values,omitempty"` -} - -// EnvironmentSetting an environment variable to be set on a task process. -type EnvironmentSetting struct { - // Name - The name of the environment variable. - Name *string `json:"name,omitempty"` - // Value - The value of the environment variable. - Value *string `json:"value,omitempty"` -} - -// Error an error response received from the Azure Batch service. -type Error 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 *ErrorMessage `json:"message,omitempty"` - // Values - A collection of key-value pairs containing additional details about the error. - Values *[]ErrorDetail `json:"values,omitempty"` -} - -// ErrorDetail an item of additional information included in an Azure Batch error response. -type ErrorDetail struct { - // Key - An identifier specifying the meaning of the Value property. - Key *string `json:"key,omitempty"` - // Value - The additional information included with the error response. - Value *string `json:"value,omitempty"` -} - -// ErrorMessage an error message received in an Azure Batch error response. -type ErrorMessage struct { - // Lang - The language code of the error message - Lang *string `json:"lang,omitempty"` - // Value - The text of the message. - Value *string `json:"value,omitempty"` -} - -// FileProperties the properties of a file on a compute node. -type FileProperties struct { - // CreationTime - The file creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModified - The time at which the file was last modified. - LastModified *date.Time `json:"lastModified,omitempty"` - // ContentLength - The length of the file. - ContentLength *int64 `json:"contentLength,omitempty"` - // ContentType - The content type of the file. - ContentType *string `json:"contentType,omitempty"` - // FileMode - The file mode attribute in octal format. This property will be returned only from a Linux compute node. - FileMode *string `json:"fileMode,omitempty"` -} - -// ImageReference a reference to an Azure Virtual Machines Marketplace image. -type ImageReference struct { - // Publisher - The publisher of the Azure Virtual Machines Marketplace image. For example, Canonical or MicrosoftWindowsServer. - Publisher *string `json:"publisher,omitempty"` - // Offer - The offer type of the Azure Virtual Machines Marketplace image. For example, UbuntuServer or WindowsServer. - Offer *string `json:"offer,omitempty"` - // Sku - The SKU of the Azure Virtual Machines Marketplace image. For example, 14.04.0-LTS or 2012-R2-Datacenter. - Sku *string `json:"sku,omitempty"` - // Version - The version of the Azure Virtual Machines Marketplace image. A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. - Version *string `json:"version,omitempty"` -} - -// JobAddParameter an Azure Batch job to add. -type JobAddParameter struct { - // ID - A string that uniquely identifies the job within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id. - ID *string `json:"id,omitempty"` - // DisplayName - The display name for the job. - DisplayName *string `json:"displayName,omitempty"` - // Priority - The priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. - Priority *int32 `json:"priority,omitempty"` - // Constraints - The execution constraints for the job. - Constraints *JobConstraints `json:"constraints,omitempty"` - // JobManagerTask - Details of a Job Manager task to be launched when the job is started. - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - The Job Preparation task. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - The Job Release task. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - // CommonEnvironmentSettings - The list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks). - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - // PoolInfo - The pool on which the Batch service runs the job's tasks. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - A list of name-value pairs associated with the job as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - // UsesTaskDependencies - The flag that determines if this job will use tasks with dependencies. - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` -} - -// JobConstraints specifies the execution constraints for jobs created on a schedule. -type JobConstraints struct { - // MaxWallClockTime - The maximum elapsed time that the job may run, measured from the time the job starts. If the job does not complete within the time limit, the Batch service terminates it and any tasks that are still running. - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // MaxTaskRetryCount - The maximum number of times each task may be retried. The Batch service retries a task if its exit code is nonzero. - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` -} - -// JobDisableParameter parameters for a CloudJobOperations.Disable request. -type JobDisableParameter struct { - // DisableTasks - What to do with active tasks associated with the job. Possible values include: 'DisableJobOptionRequeue', 'DisableJobOptionTerminate', 'DisableJobOptionWait' - DisableTasks DisableJobOption `json:"disableTasks,omitempty"` -} - -// JobExecutionInformation contains information about the execution of a job in the Azure Batch service. -type JobExecutionInformation struct { - // StartTime - The start time of the job. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The completion time of the job. This property is set only if the job is in the completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // PoolID - The id of the pool to which this job is assigned. - PoolID *string `json:"poolId,omitempty"` - // SchedulingError - Details of any error encountered by the service in starting the job. - SchedulingError *JobSchedulingError `json:"schedulingError,omitempty"` - // TerminateReason - A string describing the reason the job ended. - TerminateReason *string `json:"terminateReason,omitempty"` -} - -// JobManagerTask specifies details of a Job Manager task. -type JobManagerTask struct { - // ID - A string that uniquely identifies the Job Manager task. A GUID is recommended. - ID *string `json:"id,omitempty"` - // DisplayName - The display name of the Job Manager task. - DisplayName *string `json:"displayName,omitempty"` - // CommandLine - The command line of the Job Manager task. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - A list of files that the Batch service will download to the compute node before running the command line. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // EnvironmentSettings - A list of environment variable settings for the Job Manager task. - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // Constraints - Constraints that apply to the Job Manager task. - Constraints *TaskConstraints `json:"constraints,omitempty"` - // KillJobOnCompletion - Whether completion of the Job Manager task signifies completion of the entire job. - KillJobOnCompletion *bool `json:"killJobOnCompletion,omitempty"` - // RunElevated - Whether to run the Job Manager task in elevated mode. The default value is false. - RunElevated *bool `json:"runElevated,omitempty"` - // RunExclusive - Whether the Job Manager task requires exclusive use of the compute node where it runs. If true, no other tasks will run on the same compute node for as long as the Job Manager is running. If false, other tasks can run simultaneously with the Job Manager on a compute node. (The Job Manager task counts normally against the node's concurrent task limit, so this is only relevant if the node allows multiple concurrent tasks.) - RunExclusive *bool `json:"runExclusive,omitempty"` -} - -// JobPatchParameter parameters for a CloudJobOperations.Patch request. -type JobPatchParameter struct { - // Priority - The priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged. - Priority *int32 `json:"priority,omitempty"` - // Constraints - The execution constraints for the job. If omitted, the existing execution constraints are left unchanged. - Constraints *JobConstraints `json:"constraints,omitempty"` - // PoolInfo - The pool on which the Batch service runs the job's tasks. If omitted, the job continues to run on its current pool. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - A list of name-value pairs associated with the job as metadata. If omitted, the existing job metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobPreparationAndReleaseTaskExecutionInformation the status of the Job Preparation and Job Release tasks on a -// compute node. -type JobPreparationAndReleaseTaskExecutionInformation struct { - // PoolID - The id of the pool containing the compute node to which this entry refers. - PoolID *string `json:"poolId,omitempty"` - // NodeID - The id of the compute node to which this entry refers. - NodeID *string `json:"nodeId,omitempty"` - // NodeURL - The URL of the compute node to which this entry refers. - NodeURL *string `json:"nodeUrl,omitempty"` - // JobPreparationTaskExecutionInfo - Information about the execution status of the Job Preparation task on this compute node. - JobPreparationTaskExecutionInfo *JobPreparationTaskExecutionInformation `json:"jobPreparationTaskExecutionInfo,omitempty"` - // JobReleaseTaskExecutionInfo - Information about the execution status of the Job Release task on this compute node. This property is set only if the Job Release task has run on the node. - JobReleaseTaskExecutionInfo *JobReleaseTaskExecutionInformation `json:"jobReleaseTaskExecutionInfo,omitempty"` -} - -// JobPreparationTask a Job Preparation task to run before any tasks of the job on any given compute node. -type JobPreparationTask struct { - // ID - A string that uniquely identifies the job preparation task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // CommandLine - The command line of the Job Preparation task. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - A list of files that the Batch service will download to the compute node before running the command line. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // EnvironmentSettings - A list of environment variable settings for the Job Preparation task. - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // Constraints - Constraints that apply to the Job Preparation task. - Constraints *TaskConstraints `json:"constraints,omitempty"` - // WaitForSuccess - Whether the Batch service should wait for the Job Preparation task to complete successfully before scheduling any other tasks of the job on the compute node. - WaitForSuccess *bool `json:"waitForSuccess,omitempty"` - // RunElevated - Whether to run the Job Preparation task in elevated mode. The default value is false. - RunElevated *bool `json:"runElevated,omitempty"` - // RerunOnNodeRebootAfterSuccess - Whether the Batch service should rerun the Job Preparation task after a compute node reboots. Note that the Job Preparation task should still be written to be idempotent because it can be rerun if the compute node is rebooted while Job Preparation task is still running. The default value is true. - RerunOnNodeRebootAfterSuccess *bool `json:"rerunOnNodeRebootAfterSuccess,omitempty"` -} - -// JobPreparationTaskExecutionInformation contains information about the execution of a Job Preparation task on a -// compute node. -type JobPreparationTaskExecutionInformation struct { - // StartTime - The time at which the task started running. Note that every time the task is restarted, this value is updated. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The time at which the Job Preparation task completed. This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // State - The current state of the Job Preparation task. Possible values include: 'JobPreparationTaskStateRunning', 'JobPreparationTaskStateCompleted' - State JobPreparationTaskState `json:"state,omitempty"` - // TaskRootDirectory - The root directory of the Job Preparation task on the compute node. You can use this path to retrieve files created by the task, such as log files. - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - // TaskRootDirectoryURL - The URL to the root directory of the Job Preparation task on the compute node. - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` - // ExitCode - The exit code of the Job Preparation task. This property is set only if the task is in the Completed state. - ExitCode *int32 `json:"exitCode,omitempty"` - // SchedulingError - The error encountered by the Batch service when starting the task. - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - // RetryCount - The number of times the task has been retried by the Batch service. Every time the task exits with a non-zero exit code, it is deemed a task failure. The Batch service will retry the task up to the limit specified by the constraints. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - The most recent time at which a retry of the Job Preparation task started running. This property is set only if the task was retried (i.e. retryCount is nonzero). - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` -} - -// JobReleaseTask a Job Release task to run on job completion on any compute node where the job has run. -type JobReleaseTask struct { - // ID - A string that uniquely identifies the Job Release task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // CommandLine - The command line of the Job Release task. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - A list of files that the Batch service will download to the compute node before running the command line. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // EnvironmentSettings - A list of environment variable settings for the Job Release task. - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // MaxWallClockTime - The maximum elapsed time that the Job Release task may run on a given compute node, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it. The default value is 15 minutes. - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // RetentionTime - The minimum time to retain the working directory for the Job Release task on the compute node. After this time, the Batch service may delete the working directory and all its contents. The default is infinite. - RetentionTime *string `json:"retentionTime,omitempty"` - // RunElevated - Whether to run the Job Release task in elevated mode. The default value is false. - RunElevated *bool `json:"runElevated,omitempty"` -} - -// JobReleaseTaskExecutionInformation contains information about the execution of a Job Release task on a compute -// node. -type JobReleaseTaskExecutionInformation struct { - // StartTime - The time at which the task started running. Note that every time the task is restarted, this value is updated. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The time at which the Job Release task completed. This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // State - The current state of the Job Release task. Possible values include: 'JobReleaseTaskStateRunning', 'JobReleaseTaskStateCompleted' - State JobReleaseTaskState `json:"state,omitempty"` - // TaskRootDirectory - The root directory of the Job Release task on the compute node. You can use this path to retrieve files created by the task, such as log files. - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - // TaskRootDirectoryURL - The URL to the root directory of the Job Release task on the compute node. - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` - // ExitCode - The exit code of the Job Release task. This property is set only if the task is in the Completed state. - ExitCode *int32 `json:"exitCode,omitempty"` - // SchedulingError - The scheduling error encountered by the Batch service when starting the task. - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` -} - -// JobScheduleAddParameter a job schedule that allows recurring jobs by specifying when to run jobs and a -// specification used to create each job. -type JobScheduleAddParameter struct { - // ID - A string that uniquely identifies the schedule within the account. A GUID is recommended. - ID *string `json:"id,omitempty"` - // DisplayName - The display name for the schedule. - DisplayName *string `json:"displayName,omitempty"` - // Schedule - The schedule according to which jobs will be created. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - The details of the jobs to be created on this schedule. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - A list of name-value pairs associated with the schedule as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobScheduleExecutionInformation specifies how tasks should be run in a job associated with a job schedule. -type JobScheduleExecutionInformation struct { - // NextRunTime - The next time at which a job will be created under this schedule. - NextRunTime *date.Time `json:"nextRunTime,omitempty"` - // RecentJob - Information about the most recent job under the job schedule. - RecentJob *RecentJob `json:"recentJob,omitempty"` - // EndTime - The time at which the schedule ended. This property is set only if the job schedule is in the completed state. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// JobSchedulePatchParameter parameters for a CloudJobScheduleOperations.Patch request. -type JobSchedulePatchParameter struct { - // Schedule - The schedule according to which jobs will be created. If you do not specify this element, the existing schedule is not modified. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - The details of the jobs to be created on this schedule. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - A list of name-value pairs associated with the job schedule as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobScheduleStatistics resource usage statistics for a job schedule. -type JobScheduleStatistics struct { - // URL - The URL of the statistics. - URL *string `json:"url,omitempty"` - // StartTime - The start time of the time range covered by the statistics. - StartTime *date.Time `json:"startTime,omitempty"` - // LastUpdateTime - The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - // UserCPUTime - The total user mode CPU time (summed across all cores and all compute nodes) consumed by all tasks in all jobs created under the schedule. - UserCPUTime *string `json:"userCPUTime,omitempty"` - // KernelCPUTime - The total kernel mode CPU time (summed across all cores and all compute nodes) consumed by all tasks in all jobs created under the schedule. - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - The total wall clock time of all the tasks in all the jobs created under the schedule. - WallClockTime *string `json:"wallClockTime,omitempty"` - // ReadIOps - The total number of disk read operations made by all tasks in all jobs created under the schedule. - ReadIOps *int64 `json:"readIOps,omitempty"` - // WriteIOps - The total number of disk write operations made by all tasks in all jobs created under the schedule. - WriteIOps *int64 `json:"writeIOps,omitempty"` - // ReadIOGiB - The total gibibytes read from disk by all tasks in all jobs created under the schedule. - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - // WriteIOGiB - The total gibibytes written to disk by all tasks in all jobs created under the schedule. - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - // NumSucceededTasks - The total number of tasks successfully completed during the given time range in jobs created under the schedule. A task completes successfully if it returns exit code 0. - NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"` - // NumFailedTasks - The total number of tasks that failed during the given time range in jobs created under the schedule. A task fails if it exhausts its maximum retry count without returning exit code 0. - NumFailedTasks *int64 `json:"numFailedTasks,omitempty"` - // NumTaskRetries - The total number of retries during the given time range on all tasks in all jobs created under the schedule. - NumTaskRetries *int64 `json:"numTaskRetries,omitempty"` - // WaitTime - The total wait time of all tasks in all jobs created under the schedule. The wait time for a task is defined as the elapsed time between the creation of the task and the start of task execution. (If the task is retried due to failures, the wait time is the time to the most recent task execution.) - WaitTime *string `json:"waitTime,omitempty"` -} - -// JobScheduleUpdateParameter parameters for a CloudJobScheduleOperations.Update request. -type JobScheduleUpdateParameter struct { - // Schedule - The schedule according to which jobs will be created. If you do not specify this element, it is equivalent to passing the default schedule: that is, a single job scheduled to run immediately. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - Details of the jobs to be created on this schedule. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - A list of name-value pairs associated with the job schedule as metadata. If you do not specify this element, it takes the default value of an empty list; in effect, any existing metadata is deleted. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobSchedulingError an error encountered by the Batch service when scheduling a job. -type JobSchedulingError struct { - // Category - The category of the job scheduling error. Possible values include: 'SchedulingErrorCategoryUsererror', 'SchedulingErrorCategoryServererror', 'SchedulingErrorCategoryUnmapped' - Category SchedulingErrorCategory `json:"category,omitempty"` - // Code - An identifier for the job scheduling error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - A message describing the job scheduling error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // Details - A list of additional error details related to the scheduling error. - Details *[]NameValuePair `json:"details,omitempty"` -} - -// JobSpecification specifies details of the jobs to be created on a schedule. -type JobSpecification struct { - // Priority - The priority of jobs created under this schedule. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. - Priority *int32 `json:"priority,omitempty"` - // DisplayName - The display name for jobs created under this schedule. It need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // UsesTaskDependencies - The flag that determines if this job will use tasks with dependencies. - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` - // Constraints - The execution constraints for jobs created under this schedule. - Constraints *JobConstraints `json:"constraints,omitempty"` - // JobManagerTask - The details of a Job Manager task to be launched when a job is started under this schedule. - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - The Job Preparation task for jobs created under this schedule. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - The Job Release task for jobs created under this schedule. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - // CommonEnvironmentSettings - A list of common environment variable settings. These environment variables are set for all tasks in jobs created under this schedule (including the Job Manager, Job Preparation and Job Release tasks). - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - // PoolInfo - The pool on which the Batch service runs the tasks of jobs created under this schedule. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - A list of name-value pairs associated with each job created under this schedule as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobStatistics resource usage statistics for a job. -type JobStatistics struct { - autorest.Response `json:"-"` - // URL - The URL of the statistics. - URL *string `json:"url,omitempty"` - // StartTime - The start time of the time range covered by the statistics. - StartTime *date.Time `json:"startTime,omitempty"` - // LastUpdateTime - The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - // UserCPUTime - The total user mode CPU time (summed across all cores and all compute nodes) consumed by all tasks in the job. - UserCPUTime *string `json:"userCPUTime,omitempty"` - // KernelCPUTime - The total kernel mode CPU time (summed across all cores and all compute nodes) consumed by all tasks in the job. - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - The total wall clock time of all tasks in the job. - WallClockTime *string `json:"wallClockTime,omitempty"` - // ReadIOps - The total number of disk read operations made by all tasks in the job. - ReadIOps *int64 `json:"readIOps,omitempty"` - // WriteIOps - The total number of disk write operations made by all tasks in the job. - WriteIOps *int64 `json:"writeIOps,omitempty"` - // ReadIOGiB - The total gibibytes read from disk by all tasks in the job. - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - // WriteIOGiB - The total gibibytes written to disk by all tasks in the job. - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - // NumSucceededTasks - The total number of tasks successfully completed in the job during the given time range. - NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"` - // NumFailedTasks - The total number of tasks in the job that failed during the given time range. - NumFailedTasks *int64 `json:"numFailedTasks,omitempty"` - // NumTaskRetries - The total number of retries on all the tasks in the job during the given time range. - NumTaskRetries *int64 `json:"numTaskRetries,omitempty"` - // WaitTime - The total wait time of all tasks in the job. The wait time for a task is defined as the elapsed time between the creation of the task and the start of task execution. (If the task is retried due to failures, the wait time is the time to the most recent task execution.) - WaitTime *string `json:"waitTime,omitempty"` -} - -// JobTerminateParameter parameters for a CloudJobOperations.Terminate request. -type JobTerminateParameter struct { - // TerminateReason - The text you want to appear as the job's TerminateReason. The default is 'UserTerminate'. - TerminateReason *string `json:"terminateReason,omitempty"` -} - -// JobUpdateParameter parameters for a CloudJobOperations.Update request. -type JobUpdateParameter struct { - // Priority - The priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged. - Priority *int32 `json:"priority,omitempty"` - // Constraints - The execution constraints for the job. If omitted, the existing execution constraints are left unchanged. - Constraints *JobConstraints `json:"constraints,omitempty"` - // PoolInfo - The pool on which the Batch service runs the job's tasks. If omitted, the job continues to run on its current pool. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - A list of name-value pairs associated with the job as metadata. If omitted, the existing job metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// MetadataItem a name-value pair associated with a Batch service resource. The Batch service does not assign any -// meaning to this metadata; it is solely for the use of user code. -type MetadataItem struct { - // Name - The name of the metadata item. - Name *string `json:"name,omitempty"` - // Value - The value of the metadata item. - Value *string `json:"value,omitempty"` -} - -// MultiInstanceSettings settings which specify how to run a multi-instance task. Multi-instance tasks are commonly -// used to support MPI tasks. -type MultiInstanceSettings struct { - // NumberOfInstances - The number of compute nodes required by the multi-instance task. - NumberOfInstances *int32 `json:"numberOfInstances,omitempty"` - // CoordinationCommandLine - The command to run on the compute node instances for coordinating among the subtasks. - CoordinationCommandLine *string `json:"coordinationCommandLine,omitempty"` - // CommonResourceFiles - A list of files that the Batch service will download before running the coordination command line. The difference between common resource files and task resource files is that common resource files are downloaded for all subtasks including the primary, whereas task resource files are downloaded only for the primary. - CommonResourceFiles *[]ResourceFile `json:"commonResourceFiles,omitempty"` -} - -// NameValuePair represents a name-value pair. -type NameValuePair struct { - // Name - The name in the name-value pair. - Name *string `json:"name,omitempty"` - // Value - The value in the name-value pair. - Value *string `json:"value,omitempty"` -} - -// NodeAgentSku a node agent SKU supported by the Batch service. The Batch node agent is a program that runs on -// each node in the pool, and provides the command-and-control interface between the node and the Batch service. -// There are different implementations of the node agent, known as SKUs, for different operating systems. -type NodeAgentSku struct { - // ID - The node agent SKU id. - ID *string `json:"id,omitempty"` - // VerifiedImageReferences - The list of images verified to be compatible with this node agent SKU. This collection is not exhaustive (the node agent may be compatible with other images). - VerifiedImageReferences *[]ImageReference `json:"verifiedImageReferences,omitempty"` - // OsType - The type of operating system compatible with the node agent SKU. Possible values include: 'OSTypeLinux', 'OSTypeWindows', 'OSTypeUnmapped' - OsType OSType `json:"osType,omitempty"` -} - -// NodeDisableSchedulingParameter parameters for a ComputeNodeOperations.DisableScheduling request. -type NodeDisableSchedulingParameter struct { - // NodeDisableSchedulingOption - What to do with currently running tasks when disable task scheduling on the compute node. The default value is requeue. Possible values include: 'DisableComputeNodeSchedulingOptionRequeue', 'DisableComputeNodeSchedulingOptionTerminate', 'DisableComputeNodeSchedulingOptionTaskcompletion' - NodeDisableSchedulingOption DisableComputeNodeSchedulingOption `json:"nodeDisableSchedulingOption,omitempty"` -} - -// NodeFile information about a file or directory on a compute node. -type NodeFile struct { - // Name - The file path. - Name *string `json:"name,omitempty"` - // URL - The URL of the file. - URL *string `json:"url,omitempty"` - // IsDirectory - Whether the object represents a directory. - IsDirectory *bool `json:"isDirectory,omitempty"` - // Properties - The file properties. - Properties *FileProperties `json:"properties,omitempty"` -} - -// NodeFileListResult response to a FileOperation.ListFromComputeNode or FileOperation.ListFromTask request. -type NodeFileListResult struct { - autorest.Response `json:"-"` - // Value - The list of files. - Value *[]NodeFile `json:"value,omitempty"` - // OdataNextLink - The URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// NodeFileListResultIterator provides access to a complete listing of NodeFile values. -type NodeFileListResultIterator struct { - i int - page NodeFileListResultPage -} - -// Next 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 *NodeFileListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter NodeFileListResultIterator) 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 NodeFileListResultIterator) Response() NodeFileListResult { - 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 NodeFileListResultIterator) Value() NodeFile { - if !iter.page.NotDone() { - return NodeFile{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (nflr NodeFileListResult) IsEmpty() bool { - return nflr.Value == nil || len(*nflr.Value) == 0 -} - -// nodeFileListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (nflr NodeFileListResult) nodeFileListResultPreparer() (*http.Request, error) { - if nflr.OdataNextLink == nil || len(to.String(nflr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(nflr.OdataNextLink))) -} - -// NodeFileListResultPage contains a page of NodeFile values. -type NodeFileListResultPage struct { - fn func(NodeFileListResult) (NodeFileListResult, error) - nflr NodeFileListResult -} - -// 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. -func (page *NodeFileListResultPage) Next() error { - next, err := page.fn(page.nflr) - if err != nil { - return err - } - page.nflr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page NodeFileListResultPage) NotDone() bool { - return !page.nflr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page NodeFileListResultPage) Response() NodeFileListResult { - return page.nflr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page NodeFileListResultPage) Values() []NodeFile { - if page.nflr.IsEmpty() { - return nil - } - return *page.nflr.Value -} - -// NodeRebootParameter parameters for a ComputeNodeOperations.Reboot request. -type NodeRebootParameter struct { - // NodeRebootOption - When to reboot the compute node and what to do with currently running tasks. The default value is requeue. Possible values include: 'ComputeNodeRebootOptionRequeue', 'ComputeNodeRebootOptionTerminate', 'ComputeNodeRebootOptionTaskcompletion', 'ComputeNodeRebootOptionRetaineddata' - NodeRebootOption ComputeNodeRebootOption `json:"nodeRebootOption,omitempty"` -} - -// NodeReimageParameter parameters for a ComputeNodeOperations.Reimage request. -type NodeReimageParameter struct { - // NodeReimageOption - When to reimage the compute node and what to do with currently running tasks. The default value is requeue. Possible values include: 'ComputeNodeReimageOptionRequeue', 'ComputeNodeReimageOptionTerminate', 'ComputeNodeReimageOptionTaskcompletion', 'ComputeNodeReimageOptionRetaineddata' - NodeReimageOption ComputeNodeReimageOption `json:"nodeReimageOption,omitempty"` -} - -// NodeRemoveParameter parameters for a ComputeNodeOperations.Remove request. -type NodeRemoveParameter struct { - // NodeList - A list containing the id of the compute nodes to be removed from the specified pool. - NodeList *[]string `json:"nodeList,omitempty"` - // ResizeTimeout - The timeout for removal of compute nodes to the pool. The default value is 10 minutes. - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // NodeDeallocationOption - When compute nodes may be removed from the pool. Possible values include: 'Requeue', 'Terminate', 'Taskcompletion', 'Retaineddata' - NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"` -} - -// NodeUpdateUserParameter parameters for a ComputeNodeOperations.UpdateUser request. -type NodeUpdateUserParameter struct { - // Password - The password of the account. - Password *string `json:"password,omitempty"` - // ExpiryTime - The time at which the account should expire. If omitted, the default is 1 day from the current time. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // SSHPublicKey - The SSH public key that can be used for remote login to the compute node. - SSHPublicKey *string `json:"sshPublicKey,omitempty"` -} - -// PoolAddParameter a pool in the Azure Batch service to add. -type PoolAddParameter struct { - // ID - A string that uniquely identifies the pool within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - The display name for the pool. - DisplayName *string `json:"displayName,omitempty"` - // VMSize - The size of virtual machines in the pool. All virtual machines in a pool are the same size. - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - The cloud service configuration for the pool. This property and VirtualMachineConfiguration are mutually exclusive and one of the properties must be specified. - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - The virtual machine configuration for the pool. This property and CloudServiceConfiguration are mutually exclusive and one of the properties must be specified. - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // ResizeTimeout - The timeout for allocation of compute nodes to the pool. In a Get Pool operation, this is the timeout for the most recent resize operation. The default value is 10 minutes. - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // TargetDedicated - The desired number of compute nodes in the pool. This property must have the default value if EnableAutoScale is true. It is required if EnableAutoScale is false. - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // EnableAutoScale - Whether the pool size should automatically adjust over time. If true, the AutoScaleFormula property must be set. If false, the TargetDedicated property must be set. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - A formula for the desired number of compute nodes in the pool. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - A time interval for the desired autoscale evaluation period in the pool. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // EnableInterNodeCommunication - Whether the pool permits direct communication between nodes. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - // StartTask - A task specified to run on each compute node as it joins the pool. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - The list of certificates to be installed on each compute node in the pool. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - The list of application packages to be installed on each compute node in the pool. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // MaxTasksPerNode - The maximum number of tasks that can run concurrently on a single compute node in the pool. - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - // TaskSchedulingPolicy - How the Batch service distributes tasks between compute nodes in the pool. - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - // Metadata - A list of name-value pairs associated with the pool as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolEnableAutoScaleParameter parameters for a CloudPoolOperations.EnableAutoScale request. -type PoolEnableAutoScaleParameter struct { - // AutoScaleFormula - The formula for the desired number of compute nodes in the pool. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - A time interval for the desired autoscale evaluation period in the pool. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` -} - -// PoolEvaluateAutoScaleParameter parameters for a CloudJobOperations.EvaluateAutoScale request. -type PoolEvaluateAutoScaleParameter struct { - // AutoScaleFormula - A formula for the desired number of compute nodes in the pool. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` -} - -// PoolInformation specifies how a job should be assigned to a pool. -type PoolInformation struct { - // PoolID - The id of an existing pool. All the tasks of the job will run on the specified pool. You must specify either PoolId or AutoPoolSpecification, but not both. - PoolID *string `json:"poolId,omitempty"` - // AutoPoolSpecification - Characteristics for a temporary 'auto pool'. The Batch service will create this auto pool and run all of the tasks of the job on it, and will delete the pool once the job has completed. You must specify either PoolId or AutoPoolSpecification, but not both. - AutoPoolSpecification *AutoPoolSpecification `json:"autoPoolSpecification,omitempty"` -} - -// PoolListPoolUsageMetricsResult response to an AccountOperation.ListPoolUsageMetrics request. -type PoolListPoolUsageMetricsResult struct { - autorest.Response `json:"-"` - // Value - The pool usage metrics data. - Value *[]PoolUsageMetrics `json:"value,omitempty"` - // OdataNextLink - The URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// PoolListPoolUsageMetricsResultIterator provides access to a complete listing of PoolUsageMetrics values. -type PoolListPoolUsageMetricsResultIterator struct { - i int - page PoolListPoolUsageMetricsResultPage -} - -// Next 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 *PoolListPoolUsageMetricsResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PoolListPoolUsageMetricsResultIterator) 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 PoolListPoolUsageMetricsResultIterator) Response() PoolListPoolUsageMetricsResult { - 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 PoolListPoolUsageMetricsResultIterator) Value() PoolUsageMetrics { - if !iter.page.NotDone() { - return PoolUsageMetrics{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (plpumr PoolListPoolUsageMetricsResult) IsEmpty() bool { - return plpumr.Value == nil || len(*plpumr.Value) == 0 -} - -// poolListPoolUsageMetricsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (plpumr PoolListPoolUsageMetricsResult) poolListPoolUsageMetricsResultPreparer() (*http.Request, error) { - if plpumr.OdataNextLink == nil || len(to.String(plpumr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(plpumr.OdataNextLink))) -} - -// PoolListPoolUsageMetricsResultPage contains a page of PoolUsageMetrics values. -type PoolListPoolUsageMetricsResultPage struct { - fn func(PoolListPoolUsageMetricsResult) (PoolListPoolUsageMetricsResult, error) - plpumr PoolListPoolUsageMetricsResult -} - -// 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. -func (page *PoolListPoolUsageMetricsResultPage) Next() error { - next, err := page.fn(page.plpumr) - if err != nil { - return err - } - page.plpumr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PoolListPoolUsageMetricsResultPage) NotDone() bool { - return !page.plpumr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PoolListPoolUsageMetricsResultPage) Response() PoolListPoolUsageMetricsResult { - return page.plpumr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PoolListPoolUsageMetricsResultPage) Values() []PoolUsageMetrics { - if page.plpumr.IsEmpty() { - return nil - } - return *page.plpumr.Value -} - -// PoolPatchParameter parameters for a CloudPoolOperations.Patch request. -type PoolPatchParameter struct { - // StartTask - A task to run on each compute node as it joins the pool. If omitted, any existing start task is left unchanged. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - A list of certificates to be installed on each compute node in the pool. If omitted, any existing certificate references are left unchanged. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - A list of application packages to be installed on each compute node in the pool. If omitted, any existing application package references are left unchanged. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - A list of name-value pairs associated with the pool as metadata. If omitted, any existing metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolResizeParameter parameters for a CloudPoolOperations.Resize request. -type PoolResizeParameter struct { - // TargetDedicated - The desired number of compute nodes in the pool. - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // ResizeTimeout - The timeout for allocation of compute nodes to the pool or removal of compute nodes from the pool. The default value is 10 minutes. - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // NodeDeallocationOption - When nodes may be removed from the pool, if the pool size is decreasing. Possible values include: 'Requeue', 'Terminate', 'Taskcompletion', 'Retaineddata' - NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"` -} - -// PoolSpecification specification for creating a new pool. -type PoolSpecification struct { - // DisplayName - The display name for the pool. - DisplayName *string `json:"displayName,omitempty"` - // VMSize - The size of the virtual machines in the pool. All virtual machines in a pool are the same size. - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - The cloud service configuration for the pool. This property and VirtualMachineConfiguration are mutually exclusive and one of the properties must be specified. - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - The virtual machine configuration for the pool. This property and CloudServiceConfiguration are mutually exclusive and one of the properties must be specified. - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // MaxTasksPerNode - The maximum number of tasks that can run concurrently on a single compute node in the pool. - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - // TaskSchedulingPolicy - How tasks are distributed among compute nodes in the pool. - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - // ResizeTimeout - The timeout for allocation of compute nodes to the pool. - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // TargetDedicated - The desired number of compute nodes in the pool. - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // EnableAutoScale - Whether the pool size should automatically adjust over time. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - The formula for the desired number of compute nodes in the pool. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - A time interval for the desired AutoScale evaluation period in the pool. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // EnableInterNodeCommunication - Whether the pool permits direct communication between nodes. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - // StartTask - A task to run on each compute node as it joins the pool. The task runs when the node is added to the pool or when the node is restarted. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - A list of certificates to be installed on each compute node in the pool. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - The list of application packages to be installed on each compute node in the pool. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - A list of name-value pairs associated with the pool as metadata. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolStatistics contains utilization and resource usage statistics for the lifetime of a pool. -type PoolStatistics struct { - autorest.Response `json:"-"` - // URL - The URL for the statistics. - URL *string `json:"url,omitempty"` - // StartTime - The start time of the time range covered by the statistics. - StartTime *date.Time `json:"startTime,omitempty"` - // LastUpdateTime - The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - // UsageStats - Statistics related to pool usage, such as the amount of core-time used. - UsageStats *UsageStatistics `json:"usageStats,omitempty"` - // ResourceStats - Statistics related to resource consumption by compute nodes in the pool. - ResourceStats *ResourceStatistics `json:"resourceStats,omitempty"` -} - -// PoolUpdatePropertiesParameter parameters for a CloudPoolOperations.UpdateProperties request. -type PoolUpdatePropertiesParameter struct { - // StartTask - A task to run on each compute node as it joins the pool. If omitted, any existing start task is removed from the pool. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - A list of certificates to be installed on each compute node in the pool. If you specify an empty collection, any existing certificate references are removed from the pool. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - A list of application packages to be installed on each compute node in the pool. If you specify an empty collection, any existing application packages references are removed from the pool. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - A list of name-value pairs associated with the pool as metadata. If you specify an empty collection, any existing metadata is removed from the pool. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolUpgradeOSParameter parameters for a CloudPoolOperations.UpgradeOS request. -type PoolUpgradeOSParameter struct { - // TargetOSVersion - The Azure Guest OS version to be installed on the virtual machines in the pool. - TargetOSVersion *string `json:"targetOSVersion,omitempty"` -} - -// PoolUsageMetrics usage metrics for a pool across an aggregation interval. -type PoolUsageMetrics struct { - // PoolID - The id of the pool whose metrics are being aggregated. - PoolID *string `json:"poolId,omitempty"` - // StartTime - The start time of the aggregation interval. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time of the aggregation interval. - EndTime *date.Time `json:"endTime,omitempty"` - // VMSize - The size of virtual machines in the pool. All VMs in a pool are the same size. - VMSize *string `json:"vmSize,omitempty"` - // TotalCoreHours - The total core hours used in the pool during this aggregation interval. - TotalCoreHours *float64 `json:"totalCoreHours,omitempty"` - // DataIngressGiB - The cross data center network ingress in GiB to the pool during this interval. - DataIngressGiB *float64 `json:"dataIngressGiB,omitempty"` - // DataEgressGiB - The cross data center network egress in GiB from the pool during this interval. - DataEgressGiB *float64 `json:"dataEgressGiB,omitempty"` -} - -// ReadCloser ... -type ReadCloser struct { - autorest.Response `json:"-"` - Value *io.ReadCloser `json:"value,omitempty"` -} - -// RecentJob information about the most recent job to run under the job schedule. -type RecentJob struct { - // ID - The id of the job. - ID *string `json:"id,omitempty"` - // URL - The URL of the job. - URL *string `json:"url,omitempty"` -} - -// ResizeError an error that occurred when resizing a pool. -type ResizeError struct { - // Code - An identifier for the pool resize error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - A message describing the pool resize error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // Values - A list of additional error details related to the pool resize error. - Values *[]NameValuePair `json:"values,omitempty"` -} - -// ResourceFile a file to be downloaded from Azure blob storage to a compute node. -type ResourceFile struct { - // BlobSource - The URL of the file within Azure Blob Storage. This URL should include a shared access signature if the blob is not publicly readable. - BlobSource *string `json:"blobSource,omitempty"` - // FilePath - The location to which to download the file, relative to the task's working directory. - FilePath *string `json:"filePath,omitempty"` - // FileMode - The file mode attribute in octal format. This property will be ignored if it is specified for a resourceFile which will be downloaded to a Windows compute node. - FileMode *string `json:"fileMode,omitempty"` -} - -// ResourceStatistics statistics related to resource consumption by compute nodes in a pool. -type ResourceStatistics struct { - // StartTime - The start time of the time range covered by the statistics. - StartTime *date.Time `json:"startTime,omitempty"` - // LastUpdateTime - The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - // AvgCPUPercentage - The average CPU usage across all nodes in the pool (percentage per node). - AvgCPUPercentage *float64 `json:"avgCPUPercentage,omitempty"` - // AvgMemoryGiB - The average memory usage in GiB across all nodes in the pool. - AvgMemoryGiB *float64 `json:"avgMemoryGiB,omitempty"` - // PeakMemoryGiB - The peak memory usage in GiB across all nodes in the pool. - PeakMemoryGiB *float64 `json:"peakMemoryGiB,omitempty"` - // AvgDiskGiB - The average used disk space in GiB across all nodes in the pool. - AvgDiskGiB *float64 `json:"avgDiskGiB,omitempty"` - // PeakDiskGiB - The peak used disk space in GiB across all nodes in the pool. - PeakDiskGiB *float64 `json:"peakDiskGiB,omitempty"` - // DiskReadIOps - The total number of disk read operations across all nodes in the pool. - DiskReadIOps *int64 `json:"diskReadIOps,omitempty"` - // DiskWriteIOps - The total number of disk write operations across all nodes in the pool. - DiskWriteIOps *int64 `json:"diskWriteIOps,omitempty"` - // DiskReadGiB - The total amount of data in GiB of disk reads across all nodes in the pool. - DiskReadGiB *float64 `json:"diskReadGiB,omitempty"` - // DiskWriteGiB - The total amount of data in GiB of disk writes across all nodes in the pool. - DiskWriteGiB *float64 `json:"diskWriteGiB,omitempty"` - // NetworkReadGiB - The total amount of data in GiB of network reads across all nodes in the pool. - NetworkReadGiB *float64 `json:"networkReadGiB,omitempty"` - // NetworkWriteGiB - The total amount of data in GiB of network writes across all nodes in the pool. - NetworkWriteGiB *float64 `json:"networkWriteGiB,omitempty"` -} - -// Schedule the schedule according to which jobs will be created -type Schedule struct { - // DoNotRunUntil - The earliest time at which any job may be created under this job schedule. If you do not specify a doNotRunUntil time, the schedule becomes ready to create jobs immediately. - DoNotRunUntil *date.Time `json:"doNotRunUntil,omitempty"` - // DoNotRunAfter - A time after which no job will be created under this job schedule. The schedule will move to the completed state as soon as this deadline is past and there is no active job under this job schedule. - DoNotRunAfter *date.Time `json:"doNotRunAfter,omitempty"` - // StartWindow - The time interval, starting from the time at which the schedule indicates a job should be created, within which a job must be created. If a job is not created within the startWindow interval, then the 'opportunity' is lost; no job will be created until the next recurrence of the schedule. - StartWindow *string `json:"startWindow,omitempty"` - // RecurrenceInterval - The time interval between the start times of two successive jobs under the job schedule. A job schedule can have at most one active job under it at any given time. - RecurrenceInterval *string `json:"recurrenceInterval,omitempty"` -} - -// StartTask a task which is run when a compute node joins a pool in the Azure Batch service, or when the compute -// node is rebooted or reimaged. -type StartTask struct { - // CommandLine - The command line of the start task. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - A list of files that the Batch service will download to the compute node before running the command line. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // EnvironmentSettings - A list of environment variable settings for the start task. - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // RunElevated - Whether to run the start task in elevated mode. The default value is false. - RunElevated *bool `json:"runElevated,omitempty"` - // MaxTaskRetryCount - The maximum number of times the task may be retried. - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` - // WaitForSuccess - Whether the Batch service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node. - WaitForSuccess *bool `json:"waitForSuccess,omitempty"` -} - -// StartTaskInformation information about a start task running on a compute node. -type StartTaskInformation struct { - // State - The state of the start task on the compute node. Possible values include: 'StartTaskStateRunning', 'StartTaskStateCompleted' - State StartTaskState `json:"state,omitempty"` - // StartTime - The time at which the start task started running. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The time at which the start task stopped running. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - The exit code of the start task. - ExitCode *int32 `json:"exitCode,omitempty"` - // SchedulingError - Any error encountered scheduling the start task. - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - // RetryCount - The number of times the task has been retried by the Batch service. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - The most recent time at which a retry of the task started running. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` -} - -// SubtaskInformation information about an Azure Batch subtask. -type SubtaskInformation struct { - // ID - The id of the subtask. - ID *int32 `json:"id,omitempty"` - // NodeInfo - Information about the compute node on which the subtask ran. - NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"` - // StartTime - The time at which the subtask started running. If the subtask has been restarted or retried, this is the most recent time at which the subtask started running. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The time at which the subtask completed. This property is set only if the subtask is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - The exit code of the subtask. This property is set only if the subtask is in the Completed state. - ExitCode *int32 `json:"exitCode,omitempty"` - // SchedulingError - Details of any error encountered scheduling the subtask. - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - // State - The current state of the subtask. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - State TaskState `json:"state,omitempty"` - // StateTransitionTime - The time at which the subtask entered its current state. - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - The previous state of the subtask. This property is not set if the subtask is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - PreviousState TaskState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - The time at which the subtask entered its previous state. This property is not set if the subtask is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` -} - -// TaskAddCollectionParameter a collection of Azure Batch tasks to add. -type TaskAddCollectionParameter struct { - // Value - The collection of tasks to add. - Value *[]TaskAddParameter `json:"value,omitempty"` -} - -// TaskAddCollectionResult response to a TaskOperations.AddCollection request. -type TaskAddCollectionResult struct { - autorest.Response `json:"-"` - // Value - The results of the add task collection operation. - Value *[]TaskAddResult `json:"value,omitempty"` -} - -// TaskAddParameter an Azure Batch task to add. -type TaskAddParameter struct { - // ID - A string that uniquely identifies the task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - A display name for the task. - DisplayName *string `json:"displayName,omitempty"` - // CommandLine - The command line of the task. For multi-instance tasks, the command line is executed on the primary subtask after all the subtasks have finished executing the coordianation command line. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - A list of files that the Batch service will download to the compute node before running the command line. For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary subtask is executed. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // EnvironmentSettings - A list of environment variable settings for the task. - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // AffinityInfo - A locality hint that can be used by the Batch service to select a compute node on which to start the new task. - AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"` - // Constraints - The execution constraints that apply to this task. - Constraints *TaskConstraints `json:"constraints,omitempty"` - // RunElevated - Whether to run the task in elevated mode. - RunElevated *bool `json:"runElevated,omitempty"` - // MultiInstanceSettings - Information about how to run the multi-instance task. - MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"` - // DependsOn - Any other tasks that this task depends on. - DependsOn *TaskDependencies `json:"dependsOn,omitempty"` -} - -// TaskAddResult result for a single task added as part of an add task collection operation. -type TaskAddResult struct { - // Status - The status of the add task request. Possible values include: 'TaskAddStatusSuccess', 'TaskAddStatusClienterror', 'TaskAddStatusServererror', 'TaskAddStatusUnmapped' - Status TaskAddStatus `json:"status,omitempty"` - // TaskID - The id of the task for which this is the result. - TaskID *string `json:"taskId,omitempty"` - // ETag - The ETag of the task, if the task was successfully added. - ETag *string `json:"eTag,omitempty"` - // LastModified - The last modified time of the task. - LastModified *date.Time `json:"lastModified,omitempty"` - // Location - The URL of the task, if the task was successfully added. - Location *string `json:"location,omitempty"` - // Error - The error encountered while attempting to add the task. - Error *Error `json:"error,omitempty"` -} - -// TaskConstraints constraints to apply to the Job Manager task. -type TaskConstraints struct { - // MaxWallClockTime - The maximum elapsed time that the task may run, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it. - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // RetentionTime - The minimum time to retain the working directory for the task on the compute node where it ran, from the time it completes execution. After this time, the Batch service may delete the working directory and all its contents. The default is infinite. - RetentionTime *string `json:"retentionTime,omitempty"` - // MaxTaskRetryCount - The maximum number of times the task may be retried. The Batch service retries a task if its exit code is nonzero. - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` -} - -// TaskDependencies specifies any dependencies of a task. Any task that is explicitly specified or within a -// dependency range must complete before the dependant task will be scheduled. -type TaskDependencies struct { - // TaskIds - The list of task ids that must complete before this task can be scheduled. - TaskIds *[]string `json:"taskIds,omitempty"` - // TaskIDRanges - The list of task ranges that must complete before this task can be scheduled. - TaskIDRanges *[]TaskIDRange `json:"taskIdRanges,omitempty"` -} - -// TaskExecutionInformation information about the execution of a task. -type TaskExecutionInformation struct { - // StartTime - The time at which the task started running. If the task has been restarted or retried, this is the most recent time at which the task started running. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The time at which the task completed. This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - The exit code of the task. This property is set only if the task is in completed state. - ExitCode *int32 `json:"exitCode,omitempty"` - // SchedulingError - Details of any error encountered scheduling the task. - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - // RetryCount - The number of times the task has been retried by the Batch service. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - The most recent time at which a retry of the task started running. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` - // RequeueCount - The number of times the task has been requeued by the Batch service as the result of a user request. - RequeueCount *int32 `json:"requeueCount,omitempty"` - // LastRequeueTime - The most recent time at which the task has been requeued by the Batch service as the result of a user request. - LastRequeueTime *date.Time `json:"lastRequeueTime,omitempty"` -} - -// TaskIDRange a range of task ids that a task can depend on. All tasks with ids in the range must complete -// successfully before the dependent task can be scheduled. -type TaskIDRange struct { - // Start - The first task id in the range. - Start *int32 `json:"start,omitempty"` - // End - The last task id in the range. - End *int32 `json:"end,omitempty"` -} - -// TaskInformation information about a task running on a compute node. -type TaskInformation struct { - // TaskURL - The URL of the task. - TaskURL *string `json:"taskUrl,omitempty"` - // JobID - The id of the job to which the task belongs. - JobID *string `json:"jobId,omitempty"` - // TaskID - The id of the task. - TaskID *string `json:"taskId,omitempty"` - // SubtaskID - The id of the subtask if the task is a multi-instance task. - SubtaskID *int32 `json:"subtaskId,omitempty"` - // TaskState - The current state of the task. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - TaskState TaskState `json:"taskState,omitempty"` - // ExecutionInfo - Information about the execution of the task. - ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"` -} - -// TaskSchedulingError information about an error when scheduling a task. -type TaskSchedulingError struct { - // Category - The category of the task scheduling error. Possible values include: 'SchedulingErrorCategoryUsererror', 'SchedulingErrorCategoryServererror', 'SchedulingErrorCategoryUnmapped' - Category SchedulingErrorCategory `json:"category,omitempty"` - // Code - An identifier for the task scheduling error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - A message describing the task scheduling error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // Details - The list of additional error details related to the scheduling error. - Details *[]NameValuePair `json:"details,omitempty"` -} - -// TaskSchedulingPolicy specifies how tasks should be distributed across compute nodes. -type TaskSchedulingPolicy struct { - // NodeFillType - How tasks should be distributed across compute nodes. Possible values include: 'ComputeNodeFillTypeSpread', 'ComputeNodeFillTypePack', 'ComputeNodeFillTypeUnmapped' - NodeFillType ComputeNodeFillType `json:"nodeFillType,omitempty"` -} - -// TaskStatistics resource usage statistics for a task. -type TaskStatistics struct { - // URL - The URL of the statistics. - URL *string `json:"url,omitempty"` - // StartTime - The start time of the time range covered by the statistics. - StartTime *date.Time `json:"startTime,omitempty"` - // LastUpdateTime - The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - // UserCPUTime - The total user mode CPU time (summed across all cores and all compute nodes) consumed by the task. - UserCPUTime *string `json:"userCPUTime,omitempty"` - // KernelCPUTime - The total kernel mode CPU time (summed across all cores and all compute nodes) consumed by the task. - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - The total wall clock time of the task. - WallClockTime *string `json:"wallClockTime,omitempty"` - // ReadIOps - The total number of disk read operations made by the task. - ReadIOps *int64 `json:"readIOps,omitempty"` - // WriteIOps - The total number of disk write operations made by the task. - WriteIOps *int64 `json:"writeIOps,omitempty"` - // ReadIOGiB - The total gibibytes read from disk by the task. - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - // WriteIOGiB - The total gibibytes written to disk by the task. - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - // WaitTime - The total wait time of the task. The wait time for a task is defined as the elapsed time between the creation of the task and the start of task execution. (If the task is retried due to failures, the wait time is the time to the most recent task execution.) - WaitTime *string `json:"waitTime,omitempty"` -} - -// TaskUpdateParameter parameters for a CloudTaskOperations.Update request. -type TaskUpdateParameter struct { - // Constraints - Constraints that apply to this task. If omitted, the task is given the default constraints. - Constraints *TaskConstraints `json:"constraints,omitempty"` -} - -// UsageStatistics statistics related to pool usage information. -type UsageStatistics struct { - // StartTime - The start time of the time range covered by the statistics. - StartTime *date.Time `json:"startTime,omitempty"` - // LastUpdateTime - The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - // DedicatedCoreTime - The aggregated wall-clock time of the dedicated compute node cores being part of the pool. - DedicatedCoreTime *string `json:"dedicatedCoreTime,omitempty"` -} - -// VirtualMachineConfiguration the configuration for compute nodes in a pool based on the Azure Virtual Machines -// infrastructure. -type VirtualMachineConfiguration struct { - // ImageReference - A reference to the Azure Virtual Machines Marketplace image to use. - ImageReference *ImageReference `json:"imageReference,omitempty"` - // NodeAgentSKUID - The SKU of Batch Node Agent to be provisioned on the compute node. The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. - NodeAgentSKUID *string `json:"nodeAgentSKUId,omitempty"` - // WindowsConfiguration - Windows operating system settings on the virtual machine. This property must not be specified if the ImageReference property specifies a Linux OS image. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` -} - -// WindowsConfiguration windows operating system settings to apply to the virtual machine. -type WindowsConfiguration struct { - // EnableAutomaticUpdates - Whether automatic updates are enabled on the virtual machine. If omitted, the default value is true. - EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` -} diff --git a/services/batch/2016-02-01.3.0/batch/pool.go b/services/batch/2016-02-01.3.0/batch/pool.go deleted file mode 100644 index 6d76f956dd84..000000000000 --- a/services/batch/2016-02-01.3.0/batch/pool.go +++ /dev/null @@ -1,1739 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// PoolClient is the a client for issuing REST requests to the Azure Batch service. -type PoolClient struct { - BaseClient -} - -// NewPoolClient creates an instance of the PoolClient client. -func NewPoolClient() PoolClient { - return NewPoolClientWithBaseURI(DefaultBaseURI) -} - -// NewPoolClientWithBaseURI creates an instance of the PoolClient client. -func NewPoolClientWithBaseURI(baseURI string) PoolClient { - return PoolClient{NewWithBaseURI(baseURI)} -} - -// Add adds a pool to the specified account. -// -// pool is the pool to be added. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the -// request was issued. If not specified, this header will be automatically populated with the current system clock -// time. -func (client PoolClient) Add(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: pool, - Constraints: []validation.Constraint{{Target: "pool.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, pool, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client PoolClient) AddPreparer(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/pools"), - autorest.WithJSON(pool), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 PoolClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a pool from the specified account. -// -// poolID is the id of the pool to delete. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation -// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this -// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince -// is specify this header to perform the operation only if the resource has been modified since the specified -// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been -// modified since the specified date/time. -func (client PoolClient) Delete(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PoolClient) DeletePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 PoolClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) 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 -} - -// DisableAutoScale disables automatic scaling for a pool. -// -// poolID is the id of the pool on which to disable automatic scaling. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client PoolClient) DisableAutoScale(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisableAutoScalePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.DisableAutoScaleSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure sending request") - return - } - - result, err = client.DisableAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure responding to request") - } - - return -} - -// DisableAutoScalePreparer prepares the DisableAutoScale request. -func (client PoolClient) DisableAutoScalePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/disableautoscale", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableAutoScaleSender sends the DisableAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) DisableAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableAutoScaleResponder handles the response to the DisableAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) DisableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EnableAutoScale enables automatic scaling for a pool. -// -// poolID is the id of the pool on which to enable automatic scaling. poolEnableAutoScaleParameter is the -// parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the -// request was issued. If not specified, this header will be automatically populated with the current system clock -// time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the -// operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header -// to perform the operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince -// is specify this header to perform the operation only if the resource has not been modified since the specified -// date/time. -func (client PoolClient) EnableAutoScale(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnableAutoScalePreparer(ctx, poolID, poolEnableAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.EnableAutoScaleSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure sending request") - return - } - - result, err = client.EnableAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure responding to request") - } - - return -} - -// EnableAutoScalePreparer prepares the EnableAutoScale request. -func (client PoolClient) EnableAutoScalePreparer(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/enableautoscale", pathParameters), - autorest.WithJSON(poolEnableAutoScaleParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableAutoScaleSender sends the EnableAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) EnableAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableAutoScaleResponder handles the response to the EnableAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) EnableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EvaluateAutoScale gets the result of evaluating an automatic scaling formula on the pool. -// -// poolID is the id of the pool on which to evaluate the automatic scaling formula. poolEvaluateAutoScaleParameter -// is the parameters for the request. timeout is the maximum time that the server can spend processing the request, -// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of -// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the -// request was issued. If not specified, this header will be automatically populated with the current system clock -// time. -func (client PoolClient) EvaluateAutoScale(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AutoScaleRun, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolEvaluateAutoScaleParameter, - Constraints: []validation.Constraint{{Target: "poolEvaluateAutoScaleParameter.AutoScaleFormula", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "EvaluateAutoScale", err.Error()) - } - - req, err := client.EvaluateAutoScalePreparer(ctx, poolID, poolEvaluateAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.EvaluateAutoScaleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure sending request") - return - } - - result, err = client.EvaluateAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure responding to request") - } - - return -} - -// EvaluateAutoScalePreparer prepares the EvaluateAutoScale request. -func (client PoolClient) EvaluateAutoScalePreparer(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/evaluateautoscale", pathParameters), - autorest.WithJSON(poolEvaluateAutoScaleParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EvaluateAutoScaleSender sends the EvaluateAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) EvaluateAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EvaluateAutoScaleResponder handles the response to the EvaluateAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) EvaluateAutoScaleResponder(resp *http.Response) (result AutoScaleRun, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Exists gets basic properties of a pool. -// -// poolID is the id of the pool to get. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id identifier in the response. -// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with -// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation -// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this -// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince -// is specify this header to perform the operation only if the resource has been modified since the specified -// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been -// modified since the specified date/time. -func (client PoolClient) Exists(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ExistsPreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", nil, "Failure preparing request") - return - } - - resp, err := client.ExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure sending request") - return - } - - result, err = client.ExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure responding to request") - } - - return -} - -// ExistsPreparer prepares the Exists request. -func (client PoolClient) ExistsPreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExistsSender sends the Exists request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ExistsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExistsResponder handles the response to the Exists request. The method always -// closes the http.Response Body. -func (client PoolClient) ExistsResponder(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 information about the specified pool. -// -// poolID is the id of the pool to get. selectParameter is an OData $select clause. expand is an OData $expand -// clause. timeout is the maximum time that the server can spend processing the request, in seconds. The default is -// 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration -// such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server -// should return the client-request-id identifier in the response. ocpDate is the time the request was issued. If -// not specified, this header will be automatically populated with the current system clock time. ifMatch is an -// ETag is specified. Specify this header to perform the operation only if the resource's ETag is an exact match as -// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the -// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) Get(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudPool, err error) { - req, err := client.GetPreparer(ctx, poolID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client PoolClient) GetPreparer(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 PoolClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) GetResponder(resp *http.Response) (result CloudPool, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAllPoolsLifetimeStatistics gets lifetime summary statistics for all of the pools in the specified account. -// Statistics are aggregated across all pools that have ever existed in the account, from account creation to the last -// update time of the statistics. -// -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. -func (client PoolClient) GetAllPoolsLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolStatistics, err error) { - req, err := client.GetAllPoolsLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", nil, "Failure preparing request") - return - } - - resp, err := client.GetAllPoolsLifetimeStatisticsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", resp, "Failure sending request") - return - } - - result, err = client.GetAllPoolsLifetimeStatisticsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", resp, "Failure responding to request") - } - - return -} - -// GetAllPoolsLifetimeStatisticsPreparer prepares the GetAllPoolsLifetimeStatistics request. -func (client PoolClient) GetAllPoolsLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/lifetimepoolstats"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAllPoolsLifetimeStatisticsSender sends the GetAllPoolsLifetimeStatistics request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) GetAllPoolsLifetimeStatisticsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetAllPoolsLifetimeStatisticsResponder handles the response to the GetAllPoolsLifetimeStatistics request. The method always -// closes the http.Response Body. -func (client PoolClient) GetAllPoolsLifetimeStatisticsResponder(resp *http.Response) (result PoolStatistics, 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 pools in the specified account. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand -// clause. maxResults is the maximum number of items to return in the response. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client PoolClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure sending request") - return - } - - result.cplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client PoolClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/pools"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 PoolClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) ListResponder(resp *http.Response) (result CloudPoolListResult, 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 PoolClient) listNextResults(lastResults CloudPoolListResult) (result CloudPoolListResult, err error) { - req, err := lastResults.cloudPoolListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "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, "batch.PoolClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PoolClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListPoolUsageMetrics lists the usage metrics, aggregated by pool across individual time intervals, for the specified -// account. -// -// startTime is the earliest time from which to include metrics. This must be at least two and a half hours before -// the current time. endTime is the latest time from which to include metrics. This must be at least two hours -// before the current time. filter is an OData $filter clause. maxResults is the maximum number of items to return -// in the response. timeout is the maximum time that the server can spend processing the request, in seconds. The -// default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -func (client PoolClient) ListPoolUsageMetrics(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListPoolUsageMetricsResultPage, err error) { - result.fn = client.listPoolUsageMetricsNextResults - req, err := client.ListPoolUsageMetricsPreparer(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListPoolUsageMetricsSender(req) - if err != nil { - result.plpumr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", resp, "Failure sending request") - return - } - - result.plpumr, err = client.ListPoolUsageMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", resp, "Failure responding to request") - } - - return -} - -// ListPoolUsageMetricsPreparer prepares the ListPoolUsageMetrics request. -func (client PoolClient) ListPoolUsageMetricsPreparer(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if startTime != nil { - queryParameters["starttime"] = autorest.Encode("query", *startTime) - } - if endTime != nil { - queryParameters["endtime"] = autorest.Encode("query", *endTime) - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/poolusagemetrics"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPoolUsageMetricsSender sends the ListPoolUsageMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ListPoolUsageMetricsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListPoolUsageMetricsResponder handles the response to the ListPoolUsageMetrics request. The method always -// closes the http.Response Body. -func (client PoolClient) ListPoolUsageMetricsResponder(resp *http.Response) (result PoolListPoolUsageMetricsResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listPoolUsageMetricsNextResults retrieves the next set of results, if any. -func (client PoolClient) listPoolUsageMetricsNextResults(lastResults PoolListPoolUsageMetricsResult) (result PoolListPoolUsageMetricsResult, err error) { - req, err := lastResults.poolListPoolUsageMetricsResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListPoolUsageMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListPoolUsageMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListPoolUsageMetricsComplete enumerates all values, automatically crossing page boundaries as required. -func (client PoolClient) ListPoolUsageMetricsComplete(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListPoolUsageMetricsResultIterator, err error) { - result.page, err = client.ListPoolUsageMetrics(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch updates the properties of a pool. -// -// poolID is the id of the pool to update. poolPatchParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) Patch(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, poolID, poolPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client PoolClient) PatchPreparer(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithJSON(poolPatchParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client PoolClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// RemoveNodes removes compute nodes from the specified pool. -// -// poolID is the id of the pool from which you want to remove nodes. nodeRemoveParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id identifier in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) RemoveNodes(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: nodeRemoveParameter, - Constraints: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "RemoveNodes", err.Error()) - } - - req, err := client.RemoveNodesPreparer(ctx, poolID, nodeRemoveParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", nil, "Failure preparing request") - return - } - - resp, err := client.RemoveNodesSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure sending request") - return - } - - result, err = client.RemoveNodesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure responding to request") - } - - return -} - -// RemoveNodesPreparer prepares the RemoveNodes request. -func (client PoolClient) RemoveNodesPreparer(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/removenodes", pathParameters), - autorest.WithJSON(nodeRemoveParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RemoveNodesSender sends the RemoveNodes request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) RemoveNodesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// RemoveNodesResponder handles the response to the RemoveNodes request. The method always -// closes the http.Response Body. -func (client PoolClient) RemoveNodesResponder(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 -} - -// Resize changes the number of compute nodes that are assigned to a pool. -// -// poolID is the id of the pool to resize. poolResizeParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) Resize(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolResizeParameter, - Constraints: []validation.Constraint{{Target: "poolResizeParameter.TargetDedicated", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "Resize", err.Error()) - } - - req, err := client.ResizePreparer(ctx, poolID, poolResizeParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", nil, "Failure preparing request") - return - } - - resp, err := client.ResizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure sending request") - return - } - - result, err = client.ResizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure responding to request") - } - - return -} - -// ResizePreparer prepares the Resize request. -func (client PoolClient) ResizePreparer(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/resize", pathParameters), - autorest.WithJSON(poolResizeParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResizeSender sends the Resize request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ResizeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ResizeResponder handles the response to the Resize request. The method always -// closes the http.Response Body. -func (client PoolClient) ResizeResponder(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 -} - -// StopResize stops an ongoing resize operation on the pool. This does not restore the pool to its previous state -// before the resize operation: it only stops any further changes being made, and the pool maintains its current state. -// -// poolID is the id of the pool whose resizing you want to stop. timeout is the maximum time that the server can -// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) StopResize(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.StopResizePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", nil, "Failure preparing request") - return - } - - resp, err := client.StopResizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure sending request") - return - } - - result, err = client.StopResizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure responding to request") - } - - return -} - -// StopResizePreparer prepares the StopResize request. -func (client PoolClient) StopResizePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/stopresize", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopResizeSender sends the StopResize request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) StopResizeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// StopResizeResponder handles the response to the StopResize request. The method always -// closes the http.Response Body. -func (client PoolClient) StopResizeResponder(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 -} - -// UpdateProperties updates the properties of a pool. -// -// poolID is the id of the pool to update. poolUpdatePropertiesParameter is the parameters for the request. timeout -// is the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client PoolClient) UpdateProperties(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolUpdatePropertiesParameter, - Constraints: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.CertificateReferences", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.ApplicationPackageReferences", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.Metadata", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "UpdateProperties", err.Error()) - } - - req, err := client.UpdatePropertiesPreparer(ctx, poolID, poolUpdatePropertiesParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", nil, "Failure preparing request") - return - } - - resp, err := client.UpdatePropertiesSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure sending request") - return - } - - result, err = client.UpdatePropertiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure responding to request") - } - - return -} - -// UpdatePropertiesPreparer prepares the UpdateProperties request. -func (client PoolClient) UpdatePropertiesPreparer(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/updateproperties", pathParameters), - autorest.WithJSON(poolUpdatePropertiesParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdatePropertiesSender sends the UpdateProperties request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) UpdatePropertiesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdatePropertiesResponder handles the response to the UpdateProperties request. The method always -// closes the http.Response Body. -func (client PoolClient) UpdatePropertiesResponder(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 -} - -// UpgradeOS upgrades the operating system of the specified pool. -// -// poolID is the id of the pool to upgrade. poolUpgradeOSParameter is the parameters for the request. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) UpgradeOS(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolUpgradeOSParameter, - Constraints: []validation.Constraint{{Target: "poolUpgradeOSParameter.TargetOSVersion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "UpgradeOS", err.Error()) - } - - req, err := client.UpgradeOSPreparer(ctx, poolID, poolUpgradeOSParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", nil, "Failure preparing request") - return - } - - resp, err := client.UpgradeOSSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure sending request") - return - } - - result, err = client.UpgradeOSResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure responding to request") - } - - return -} - -// UpgradeOSPreparer prepares the UpgradeOS request. -func (client PoolClient) UpgradeOSPreparer(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/upgradeos", pathParameters), - autorest.WithJSON(poolUpgradeOSParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpgradeOSSender sends the UpgradeOS request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) UpgradeOSSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpgradeOSResponder handles the response to the UpgradeOS request. The method always -// closes the http.Response Body. -func (client PoolClient) UpgradeOSResponder(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/batch/2016-02-01.3.0/batch/task.go b/services/batch/2016-02-01.3.0/batch/task.go deleted file mode 100644 index d658c82e2de6..000000000000 --- a/services/batch/2016-02-01.3.0/batch/task.go +++ /dev/null @@ -1,888 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// TaskClient is the a client for issuing REST requests to the Azure Batch service. -type TaskClient struct { - BaseClient -} - -// NewTaskClient creates an instance of the TaskClient client. -func NewTaskClient() TaskClient { - return NewTaskClientWithBaseURI(DefaultBaseURI) -} - -// NewTaskClientWithBaseURI creates an instance of the TaskClient client. -func NewTaskClientWithBaseURI(baseURI string) TaskClient { - return TaskClient{NewWithBaseURI(baseURI)} -} - -// Add adds a task to the specified job. -// -// jobID is the id of the job to which the task is to be added. task is the task to be added. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client TaskClient) Add(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: task, - Constraints: []validation.Constraint{{Target: "task.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "task.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "task.MultiInstanceSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "task.MultiInstanceSettings.NumberOfInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, jobID, task, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client TaskClient) AddPreparer(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters), - autorest.WithJSON(task), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 TaskClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// AddCollection adds a collection of tasks to the specified job. -// -// jobID is the id of the job to which the task collection is to be added. taskCollection is the tasks to be added. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. -func (client TaskClient) AddCollection(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result TaskAddCollectionResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: taskCollection, - Constraints: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "AddCollection", err.Error()) - } - - req, err := client.AddCollectionPreparer(ctx, jobID, taskCollection, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", nil, "Failure preparing request") - return - } - - resp, err := client.AddCollectionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure sending request") - return - } - - result, err = client.AddCollectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure responding to request") - } - - return -} - -// AddCollectionPreparer prepares the AddCollection request. -func (client TaskClient) AddCollectionPreparer(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/addtaskcollection", pathParameters), - autorest.WithJSON(taskCollection), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddCollectionSender sends the AddCollection request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) AddCollectionSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddCollectionResponder handles the response to the AddCollection request. The method always -// closes the http.Response Body. -func (client TaskClient) AddCollectionResponder(resp *http.Response) (result TaskAddCollectionResult, 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 a task from the specified job. -// -// jobID is the id of the job from which to delete the task. taskID is the id of the task to delete. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client TaskClient) Delete(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client TaskClient) DeletePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) 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 information about the specified task. -// -// jobID is the id of the job that contains the task. taskID is the id of the task to get information about. -// selectParameter is an OData $select clause. expand is an OData $expand clause. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client TaskClient) Get(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudTask, err error) { - req, err := client.GetPreparer(ctx, jobID, taskID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client TaskClient) GetPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) GetResponder(resp *http.Response) (result CloudTask, 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 tasks that are associated with the specified job. -// -// jobID is the id of the job. filter is an OData $filter clause. selectParameter is an OData $select clause. -// expand is an OData $expand clause. maxResults is the maximum number of items to return in the response. timeout -// is the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client TaskClient) List(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ctlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure sending request") - return - } - - result.ctlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client TaskClient) ListPreparer(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 TaskClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) ListResponder(resp *http.Response) (result CloudTaskListResult, 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 TaskClient) listNextResults(lastResults CloudTaskListResult) (result CloudTaskListResult, err error) { - req, err := lastResults.cloudTaskListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.TaskClient", "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, "batch.TaskClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client TaskClient) ListComplete(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultIterator, err error) { - result.page, err = client.List(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListSubtasks lists all of the subtasks that are associated with the specified multi-instance task. -// -// jobID is the id of the job. taskID is the id of the task. selectParameter is an OData $select clause. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client TaskClient) ListSubtasks(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListSubtasksResult, err error) { - req, err := client.ListSubtasksPreparer(ctx, jobID, taskID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", nil, "Failure preparing request") - return - } - - resp, err := client.ListSubtasksSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure sending request") - return - } - - result, err = client.ListSubtasksResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure responding to request") - } - - return -} - -// ListSubtasksPreparer prepares the ListSubtasks request. -func (client TaskClient) ListSubtasksPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/subtasksinfo", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSubtasksSender sends the ListSubtasks request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) ListSubtasksSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListSubtasksResponder handles the response to the ListSubtasks request. The method always -// closes the http.Response Body. -func (client TaskClient) ListSubtasksResponder(resp *http.Response) (result CloudTaskListSubtasksResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Terminate terminates the specified task. -// -// jobID is the id of the job containing the task. taskID is the id of the task to terminate. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client TaskClient) Terminate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client TaskClient) TerminatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client TaskClient) TerminateResponder(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 -} - -// Update updates the properties of the specified task. -// -// jobID is the id of the job containing the task. taskID is the id of the task to update. taskUpdateParameter is -// the parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the -// request was issued. If not specified, this header will be automatically populated with the current system clock -// time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the -// operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header -// to perform the operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince -// is specify this header to perform the operation only if the resource has not been modified since the specified -// date/time. -func (client TaskClient) Update(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.UpdatePreparer(ctx, jobID, taskID, taskUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client TaskClient) UpdatePreparer(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-02-01.3.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithJSON(taskUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) UpdateResponder(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/batch/2016-07-01.3.1/batch/account.go b/services/batch/2016-07-01.3.1/batch/account.go deleted file mode 100644 index 766be71589d4..000000000000 --- a/services/batch/2016-07-01.3.1/batch/account.go +++ /dev/null @@ -1,173 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// AccountClient is the a client for issuing REST requests to the Azure Batch service. -type AccountClient struct { - BaseClient -} - -// NewAccountClient creates an instance of the AccountClient client. -func NewAccountClient() AccountClient { - return NewAccountClientWithBaseURI(DefaultBaseURI) -} - -// NewAccountClientWithBaseURI creates an instance of the AccountClient client. -func NewAccountClientWithBaseURI(baseURI string) AccountClient { - return AccountClient{NewWithBaseURI(baseURI)} -} - -// ListNodeAgentSkus sends the list node agent skus request. -// -// filter is an OData $filter clause. maxResults is the maximum number of items to return in the response. A -// maximum of 1000 results will be returned. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. If not specified, this header will be automatically populated with the current -// system clock time. -func (client AccountClient) ListNodeAgentSkus(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.AccountClient", "ListNodeAgentSkus", err.Error()) - } - - result.fn = client.listNodeAgentSkusNextResults - req, err := client.ListNodeAgentSkusPreparer(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListNodeAgentSkusSender(req) - if err != nil { - result.alnasr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure sending request") - return - } - - result.alnasr, err = client.ListNodeAgentSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure responding to request") - } - - return -} - -// ListNodeAgentSkusPreparer prepares the ListNodeAgentSkus request. -func (client AccountClient) ListNodeAgentSkusPreparer(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/nodeagentskus"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListNodeAgentSkusSender sends the ListNodeAgentSkus request. The method will close the -// http.Response Body if it receives an error. -func (client AccountClient) ListNodeAgentSkusSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListNodeAgentSkusResponder handles the response to the ListNodeAgentSkus request. The method always -// closes the http.Response Body. -func (client AccountClient) ListNodeAgentSkusResponder(resp *http.Response) (result AccountListNodeAgentSkusResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNodeAgentSkusNextResults retrieves the next set of results, if any. -func (client AccountClient) listNodeAgentSkusNextResults(lastResults AccountListNodeAgentSkusResult) (result AccountListNodeAgentSkusResult, err error) { - req, err := lastResults.accountListNodeAgentSkusResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListNodeAgentSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListNodeAgentSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListNodeAgentSkusComplete enumerates all values, automatically crossing page boundaries as required. -func (client AccountClient) ListNodeAgentSkusComplete(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultIterator, err error) { - result.page, err = client.ListNodeAgentSkus(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2016-07-01.3.1/batch/application.go b/services/batch/2016-07-01.3.1/batch/application.go deleted file mode 100644 index 6a72e0733dc9..000000000000 --- a/services/batch/2016-07-01.3.1/batch/application.go +++ /dev/null @@ -1,260 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// ApplicationClient is the a client for issuing REST requests to the Azure Batch service. -type ApplicationClient struct { - BaseClient -} - -// NewApplicationClient creates an instance of the ApplicationClient client. -func NewApplicationClient() ApplicationClient { - return NewApplicationClientWithBaseURI(DefaultBaseURI) -} - -// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient client. -func NewApplicationClientWithBaseURI(baseURI string) ApplicationClient { - return ApplicationClient{NewWithBaseURI(baseURI)} -} - -// Get sends the get request. -// -// applicationID is the ID of the application. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. If not specified, this header will be automatically populated with the current -// system clock time. -func (client ApplicationClient) Get(ctx context.Context, applicationID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationSummary, err error) { - req, err := client.GetPreparer(ctx, applicationID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationClient) GetPreparer(ctx context.Context, applicationID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationId": autorest.Encode("path", applicationID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/applications/{applicationId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ApplicationClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ApplicationClient) GetResponder(resp *http.Response) (result ApplicationSummary, 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 operation returns only applications and versions that are available for use on compute nodes; that is, -// that can be used in an application package reference. For administrator information about applications and versions -// that are not yet available to compute nodes, use the Azure portal or the Azure Resource Manager API. -// -// maxResults is the maximum number of items to return in the response. A maximum of 1000 applications can be -// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. -func (client ApplicationClient) List(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.ApplicationClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "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, "batch.ApplicationClient", "List", resp, "Failure sending request") - return - } - - result.alr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationClient) ListPreparer(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/applications"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ApplicationClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ApplicationClient) ListResponder(resp *http.Response) (result ApplicationListResult, 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 ApplicationClient) listNextResults(lastResults ApplicationListResult) (result ApplicationListResult, err error) { - req, err := lastResults.applicationListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.ApplicationClient", "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, "batch.ApplicationClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationClient) ListComplete(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultIterator, err error) { - result.page, err = client.List(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2016-07-01.3.1/batch/certificate.go b/services/batch/2016-07-01.3.1/batch/certificate.go deleted file mode 100644 index 5498307391fd..000000000000 --- a/services/batch/2016-07-01.3.1/batch/certificate.go +++ /dev/null @@ -1,554 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// CertificateClient is the a client for issuing REST requests to the Azure Batch service. -type CertificateClient struct { - BaseClient -} - -// NewCertificateClient creates an instance of the CertificateClient client. -func NewCertificateClient() CertificateClient { - return NewCertificateClientWithBaseURI(DefaultBaseURI) -} - -// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client. -func NewCertificateClientWithBaseURI(baseURI string) CertificateClient { - return CertificateClient{NewWithBaseURI(baseURI)} -} - -// Add sends the add request. -// -// certificate is the certificate to be added. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. If not specified, this header will be automatically populated with the current -// system clock time. -func (client CertificateClient) Add(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: certificate, - Constraints: []validation.Constraint{{Target: "certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "certificate.ThumbprintAlgorithm", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "certificate.Data", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.CertificateClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, certificate, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client CertificateClient) AddPreparer(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/certificates"), - autorest.WithJSON(certificate), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// CancelDeletion if you try to delete a certificate that is being used by a pool or compute node, the status of the -// certificate changes to deletefailed. If you decide that you want to continue using the certificate, you can use this -// operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not -// need to run this operation after the deletion failed. You must make sure that the certificate is not being used by -// any resources, and then you can try again to delete the certificate. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate being deleted. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client CertificateClient) CancelDeletion(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.CancelDeletionPreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", nil, "Failure preparing request") - return - } - - resp, err := client.CancelDeletionSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure sending request") - return - } - - result, err = client.CancelDeletionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure responding to request") - } - - return -} - -// CancelDeletionPreparer prepares the CancelDeletion request. -func (client CertificateClient) CancelDeletionPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CancelDeletionSender sends the CancelDeletion request. The method will close the -// http.Response Body if it receives an error. -func (client CertificateClient) CancelDeletionSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CancelDeletionResponder handles the response to the CancelDeletion request. The method always -// closes the http.Response Body. -func (client CertificateClient) CancelDeletionResponder(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 -} - -// Delete you cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a -// certificate, you must therefore make sure that the certificate is not associated with any existing pools, the -// certificate is not installed on any compute nodes (even if you remove a certificate from a pool, it is not removed -// from existing compute nodes in that pool until they restart), and no running tasks depend on the certificate. If you -// try to delete a certificate that is in use, the deletion fails. The certificate status changes to deletefailed. You -// can use Cancel Delete Certificate to set the status back to active if you decide that you want to continue using the -// certificate. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate to be deleted. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client CertificateClient) Delete(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CertificateClient) DeletePreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) 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 information about the specified certificate. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate to get. selectParameter is an OData $select clause. timeout is the maximum -// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is -// the caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client CertificateClient) Get(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result Certificate, err error) { - req, err := client.GetPreparer(ctx, thumbprintAlgorithm, thumbprint, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client CertificateClient) GetPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) GetResponder(resp *http.Response) (result Certificate, 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. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. maxResults is the maximum number -// of items to return in the response. A maximum of 1000 certificates can be returned. timeout is the maximum time -// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client CertificateClient) List(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.CertificateClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "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, "batch.CertificateClient", "List", resp, "Failure sending request") - return - } - - result.clr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client CertificateClient) ListPreparer(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/certificates"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) ListResponder(resp *http.Response) (result CertificateListResult, 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 CertificateClient) listNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) { - req, err := lastResults.certificateListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.CertificateClient", "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, "batch.CertificateClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CertificateClient) ListComplete(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2016-07-01.3.1/batch/client.go b/services/batch/2016-07-01.3.1/batch/client.go deleted file mode 100644 index 052769b94138..000000000000 --- a/services/batch/2016-07-01.3.1/batch/client.go +++ /dev/null @@ -1,49 +0,0 @@ -// Package batch implements the Azure ARM Batch service API version 2016-07-01.3.1. -// -// A client for issuing REST requests to the Azure Batch service. -package batch - -// 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 Batch - DefaultBaseURI = "https://batch.core.windows.net" -) - -// BaseClient is the base client for Batch. -type BaseClient struct { - autorest.Client - BaseURI string -} - -// New creates an instance of the BaseClient client. -func New() BaseClient { - return NewWithBaseURI(DefaultBaseURI) -} - -// NewWithBaseURI creates an instance of the BaseClient client. -func NewWithBaseURI(baseURI string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - } -} diff --git a/services/batch/2016-07-01.3.1/batch/computenode.go b/services/batch/2016-07-01.3.1/batch/computenode.go deleted file mode 100644 index 337fba456d4a..000000000000 --- a/services/batch/2016-07-01.3.1/batch/computenode.go +++ /dev/null @@ -1,1117 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// ComputeNodeClient is the a client for issuing REST requests to the Azure Batch service. -type ComputeNodeClient struct { - BaseClient -} - -// NewComputeNodeClient creates an instance of the ComputeNodeClient client. -func NewComputeNodeClient() ComputeNodeClient { - return NewComputeNodeClientWithBaseURI(DefaultBaseURI) -} - -// NewComputeNodeClientWithBaseURI creates an instance of the ComputeNodeClient client. -func NewComputeNodeClientWithBaseURI(baseURI string) ComputeNodeClient { - return ComputeNodeClient{NewWithBaseURI(baseURI)} -} - -// AddUser you can add a user account to a node only when it is in the idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want -// to create a user account. userParameter is the user account to be created. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client ComputeNodeClient) AddUser(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: userParameter, - Constraints: []validation.Constraint{{Target: "userParameter.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.ComputeNodeClient", "AddUser", err.Error()) - } - - req, err := client.AddUserPreparer(ctx, poolID, nodeID, userParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", nil, "Failure preparing request") - return - } - - resp, err := client.AddUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure sending request") - return - } - - result, err = client.AddUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure responding to request") - } - - return -} - -// AddUserPreparer prepares the AddUser request. -func (client ComputeNodeClient) AddUserPreparer(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users", pathParameters), - autorest.WithJSON(userParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddUserSender sends the AddUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) AddUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddUserResponder handles the response to the AddUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) AddUserResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteUser you can delete a user account to a node only when it is in the idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want -// to delete a user account. userName is the name of the user account to delete. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client ComputeNodeClient) DeleteUser(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteUserPreparer(ctx, poolID, nodeID, userName, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure sending request") - return - } - - result, err = client.DeleteUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure responding to request") - } - - return -} - -// DeleteUserPreparer prepares the DeleteUser request. -func (client ComputeNodeClient) DeleteUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - "userName": autorest.Encode("path", userName), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteUserSender sends the DeleteUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) DeleteUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteUserResponder handles the response to the DeleteUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) DeleteUserResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// DisableScheduling sends the disable scheduling request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you -// want to disable task scheduling. nodeDisableSchedulingParameter is the parameters for the request. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client ComputeNodeClient) DisableScheduling(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisableSchedulingPreparer(ctx, poolID, nodeID, nodeDisableSchedulingParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSchedulingSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure sending request") - return - } - - result, err = client.DisableSchedulingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure responding to request") - } - - return -} - -// DisableSchedulingPreparer prepares the DisableScheduling request. -func (client ComputeNodeClient) DisableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/disablescheduling", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeDisableSchedulingParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeDisableSchedulingParameter)) - } - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableSchedulingSender sends the DisableScheduling request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) DisableSchedulingSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableSchedulingResponder handles the response to the DisableScheduling request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) DisableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EnableScheduling sends the enable scheduling request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you -// want to enable task scheduling. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) EnableScheduling(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnableSchedulingPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSchedulingSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure sending request") - return - } - - result, err = client.EnableSchedulingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure responding to request") - } - - return -} - -// EnableSchedulingPreparer prepares the EnableScheduling request. -func (client ComputeNodeClient) EnableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/enablescheduling", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableSchedulingSender sends the EnableScheduling request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) EnableSchedulingSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableSchedulingResponder handles the response to the EnableScheduling request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) EnableSchedulingResponder(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 sends the get request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want -// to get information about. selectParameter is an OData $select clause. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client ComputeNodeClient) Get(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNode, err error) { - req, err := client.GetPreparer(ctx, poolID, nodeID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ComputeNodeClient) GetPreparer(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ComputeNodeClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ComputeNodeClient) GetResponder(resp *http.Response) (result ComputeNode, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetRemoteDesktop before you can access a node by using the RDP file, you must create a user account on the node. -// This API can only be invoked on pools created with the cloud service configuration property. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which you -// want to get the Remote Desktop Protocol file. timeout is the maximum time that the server can spend processing -// the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in -// the form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. If not specified, this header will be automatically populated with the current -// system clock time. -func (client ComputeNodeClient) GetRemoteDesktop(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetRemoteDesktopPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", nil, "Failure preparing request") - return - } - - resp, err := client.GetRemoteDesktopSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure sending request") - return - } - - result, err = client.GetRemoteDesktopResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure responding to request") - } - - return -} - -// GetRemoteDesktopPreparer prepares the GetRemoteDesktop request. -func (client ComputeNodeClient) GetRemoteDesktopPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/rdp", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRemoteDesktopSender sends the GetRemoteDesktop request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) GetRemoteDesktopSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRemoteDesktopResponder handles the response to the GetRemoteDesktop request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) GetRemoteDesktopResponder(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 -} - -// GetRemoteLoginSettings before you can remotely login to a node using the remote login settings, you must create a -// user account on the node. This API can be invoked only on pools created with the virtual machine configuration -// property. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which to -// obtain the remote login settings. timeout is the maximum time that the server can spend processing the request, -// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of -// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) GetRemoteLoginSettings(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeGetRemoteLoginSettingsResult, err error) { - req, err := client.GetRemoteLoginSettingsPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", nil, "Failure preparing request") - return - } - - resp, err := client.GetRemoteLoginSettingsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure sending request") - return - } - - result, err = client.GetRemoteLoginSettingsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure responding to request") - } - - return -} - -// GetRemoteLoginSettingsPreparer prepares the GetRemoteLoginSettings request. -func (client ComputeNodeClient) GetRemoteLoginSettingsPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/remoteloginsettings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRemoteLoginSettingsSender sends the GetRemoteLoginSettings request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) GetRemoteLoginSettingsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRemoteLoginSettingsResponder handles the response to the GetRemoteLoginSettings request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) GetRemoteLoginSettingsResponder(resp *http.Response) (result ComputeNodeGetRemoteLoginSettingsResult, 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. -// -// poolID is the ID of the pool from which you want to list nodes. filter is an OData $filter clause.. -// selectParameter is an OData $select clause. maxResults is the maximum number of items to return in the response. -// A maximum of 1000 nodes can be returned. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. If not specified, this header will be automatically populated with the current -// system clock time. -func (client ComputeNodeClient) List(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.ComputeNodeClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cnlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure sending request") - return - } - - result.cnlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ComputeNodeClient) ListPreparer(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ComputeNodeClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ComputeNodeClient) ListResponder(resp *http.Response) (result ComputeNodeListResult, 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 ComputeNodeClient) listNextResults(lastResults ComputeNodeListResult) (result ComputeNodeListResult, err error) { - req, err := lastResults.computeNodeListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "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, "batch.ComputeNodeClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ComputeNodeClient) ListComplete(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultIterator, err error) { - result.page, err = client.List(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Reboot you can restart a node only if it is in an idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want -// to restart. nodeRebootParameter is the parameters for the request. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client ComputeNodeClient) Reboot(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.RebootPreparer(ctx, poolID, nodeID, nodeRebootParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", nil, "Failure preparing request") - return - } - - resp, err := client.RebootSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure sending request") - return - } - - result, err = client.RebootResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure responding to request") - } - - return -} - -// RebootPreparer prepares the Reboot request. -func (client ComputeNodeClient) RebootPreparer(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reboot", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeRebootParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeRebootParameter)) - } - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RebootSender sends the Reboot request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) RebootSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// RebootResponder handles the response to the Reboot request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) RebootResponder(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 -} - -// Reimage you can reinstall the operating system on a node only if it is in an idle or running state. This API can be -// invoked only on pools created with the cloud service configuration property. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want -// to restart. nodeReimageParameter is the parameters for the request. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client ComputeNodeClient) Reimage(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ReimagePreparer(ctx, poolID, nodeID, nodeReimageParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", nil, "Failure preparing request") - return - } - - resp, err := client.ReimageSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure sending request") - return - } - - result, err = client.ReimageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure responding to request") - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client ComputeNodeClient) ReimagePreparer(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeReimageParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeReimageParameter)) - } - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) ReimageSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) ReimageResponder(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 -} - -// UpdateUser this operation replaces of all the updateable properties of the account. For example, if the expiryTime -// element is not specified, the current value is replaced with the default value, not left unmodified. You can update -// a user account on a node only when it is in the idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want -// to update a user account. userName is the name of the user account to update. nodeUpdateUserParameter is the -// parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -func (client ComputeNodeClient) UpdateUser(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.UpdateUserPreparer(ctx, poolID, nodeID, userName, nodeUpdateUserParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure sending request") - return - } - - result, err = client.UpdateUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure responding to request") - } - - return -} - -// UpdateUserPreparer prepares the UpdateUser request. -func (client ComputeNodeClient) UpdateUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - "userName": autorest.Encode("path", userName), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters), - autorest.WithJSON(nodeUpdateUserParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateUserSender sends the UpdateUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) UpdateUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateUserResponder handles the response to the UpdateUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) UpdateUserResponder(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/batch/2016-07-01.3.1/batch/file.go b/services/batch/2016-07-01.3.1/batch/file.go deleted file mode 100644 index c4e3094c8ca8..000000000000 --- a/services/batch/2016-07-01.3.1/batch/file.go +++ /dev/null @@ -1,935 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// FileClient is the a client for issuing REST requests to the Azure Batch service. -type FileClient struct { - BaseClient -} - -// NewFileClient creates an instance of the FileClient client. -func NewFileClient() FileClient { - return NewFileClientWithBaseURI(DefaultBaseURI) -} - -// NewFileClientWithBaseURI creates an instance of the FileClient client. -func NewFileClientWithBaseURI(baseURI string) FileClient { - return FileClient{NewWithBaseURI(baseURI)} -} - -// DeleteFromComputeNode sends the delete from compute node request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node from which you -// want to delete the file. fileName is the path to the file that you want to delete. recursive is whether to -// delete children of a directory. If the fileName parameter represents a directory instead of a file, you can set -// recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false -// then the directory must be empty or deletion will fail. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client FileClient) DeleteFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteFromComputeNodePreparer(ctx, poolID, nodeID, fileName, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteFromComputeNodeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.DeleteFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// DeleteFromComputeNodePreparer prepares the DeleteFromComputeNode request. -func (client FileClient) DeleteFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteFromComputeNodeSender sends the DeleteFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) DeleteFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteFromComputeNodeResponder handles the response to the DeleteFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) DeleteFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteFromTask sends the delete from task request. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to delete. -// fileName is the path to the task file that you want to delete. recursive is whether to delete children of a -// directory. If the fileName parameter represents a directory instead of a file, you can set recursive to true to -// delete the directory and all of the files and subdirectories in it. If recursive is false then the directory -// must be empty or deletion will fail. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. If not specified, this header will be automatically populated with the current -// system clock time. -func (client FileClient) DeleteFromTask(ctx context.Context, jobID string, taskID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteFromTaskPreparer(ctx, jobID, taskID, fileName, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteFromTaskSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure sending request") - return - } - - result, err = client.DeleteFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure responding to request") - } - - return -} - -// DeleteFromTaskPreparer prepares the DeleteFromTask request. -func (client FileClient) DeleteFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteFromTaskSender sends the DeleteFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) DeleteFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteFromTaskResponder handles the response to the DeleteFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) DeleteFromTaskResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetFromComputeNode returns the content of the specified task file. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains -// the file. fileName is the path to the task file that you want to get the content of. timeout is the maximum time -// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ocpRange is the byte range to be retrieved. -// The default is to retrieve the entire file. The format is bytes=startRange-endRange. ifModifiedSince is specify -// this header to perform the operation only if the resource has been modified since the specified date/time. -// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified -// since the specified date/time. -func (client FileClient) GetFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetFromComputeNodePreparer(ctx, poolID, nodeID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.GetFromComputeNodeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.GetFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// GetFromComputeNodePreparer prepares the GetFromComputeNode request. -func (client FileClient) GetFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ocpRange) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-range", autorest.String(ocpRange))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetFromComputeNodeSender sends the GetFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetFromComputeNodeResponder handles the response to the GetFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) GetFromComputeNodeResponder(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 -} - -// GetFromTask returns the content of the specified task file. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to retrieve. -// fileName is the path to the task file that you want to get the content of. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ocpRange is the byte range to be retrieved. -// The default is to retrieve the entire file. The format is bytes=startRange-endRange. ifModifiedSince is specify -// this header to perform the operation only if the resource has been modified since the specified date/time. -// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified -// since the specified date/time. -func (client FileClient) GetFromTask(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetFromTaskPreparer(ctx, jobID, taskID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.GetFromTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure sending request") - return - } - - result, err = client.GetFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure responding to request") - } - - return -} - -// GetFromTaskPreparer prepares the GetFromTask request. -func (client FileClient) GetFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ocpRange) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-range", autorest.String(ocpRange))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetFromTaskSender sends the GetFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetFromTaskResponder handles the response to the GetFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) GetFromTaskResponder(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 -} - -// GetNodeFilePropertiesFromComputeNode gets the properties of the specified compute node file. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains -// the file. fileName is the path to the compute node file that you want to get the properties of. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifModifiedSince is specify this header to -// perform the operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is -// specify this header to perform the operation only if the resource has not been modified since the specified -// date/time. -func (client FileClient) GetNodeFilePropertiesFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.GetNodeFilePropertiesFromComputeNodePreparer(ctx, poolID, nodeID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.GetNodeFilePropertiesFromComputeNodeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.GetNodeFilePropertiesFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// GetNodeFilePropertiesFromComputeNodePreparer prepares the GetNodeFilePropertiesFromComputeNode request. -func (client FileClient) GetNodeFilePropertiesFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetNodeFilePropertiesFromComputeNodeSender sends the GetNodeFilePropertiesFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetNodeFilePropertiesFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetNodeFilePropertiesFromComputeNodeResponder handles the response to the GetNodeFilePropertiesFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) GetNodeFilePropertiesFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetNodeFilePropertiesFromTask gets the properties of the specified task file. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to get the -// properties of. fileName is the path to the task file that you want to get the properties of. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifModifiedSince is specify this header to -// perform the operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is -// specify this header to perform the operation only if the resource has not been modified since the specified -// date/time. -func (client FileClient) GetNodeFilePropertiesFromTask(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.GetNodeFilePropertiesFromTaskPreparer(ctx, jobID, taskID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.GetNodeFilePropertiesFromTaskSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", resp, "Failure sending request") - return - } - - result, err = client.GetNodeFilePropertiesFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", resp, "Failure responding to request") - } - - return -} - -// GetNodeFilePropertiesFromTaskPreparer prepares the GetNodeFilePropertiesFromTask request. -func (client FileClient) GetNodeFilePropertiesFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fileName": autorest.Encode("path", fileName), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetNodeFilePropertiesFromTaskSender sends the GetNodeFilePropertiesFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetNodeFilePropertiesFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetNodeFilePropertiesFromTaskResponder handles the response to the GetNodeFilePropertiesFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) GetNodeFilePropertiesFromTaskResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// ListFromComputeNode sends the list from compute node request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node whose files -// you want to list. filter is an OData $filter clause. recursive is whether to list children of a directory. -// maxResults is the maximum number of items to return in the response. A maximum of 1000 files can be returned. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client FileClient) ListFromComputeNode(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.FileClient", "ListFromComputeNode", err.Error()) - } - - result.fn = client.listFromComputeNodeNextResults - req, err := client.ListFromComputeNodePreparer(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromComputeNodeSender(req) - if err != nil { - result.nflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure sending request") - return - } - - result.nflr, err = client.ListFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// ListFromComputeNodePreparer prepares the ListFromComputeNode request. -func (client FileClient) ListFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromComputeNodeSender sends the ListFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) ListFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromComputeNodeResponder handles the response to the ListFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) ListFromComputeNodeResponder(resp *http.Response) (result NodeFileListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromComputeNodeNextResults retrieves the next set of results, if any. -func (client FileClient) listFromComputeNodeNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) { - req, err := lastResults.nodeFileListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromComputeNodeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromComputeNodeComplete enumerates all values, automatically crossing page boundaries as required. -func (client FileClient) ListFromComputeNodeComplete(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) { - result.page, err = client.ListFromComputeNode(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListFromTask sends the list from task request. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose files you want to list. -// filter is an OData $filter clause. recursive is whether to list children of a directory. This parameter can be -// used in combination with the filter parameter to list specific type of files. maxResults is the maximum number -// of items to return in the response. A maximum of 1000 files can be returned. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client FileClient) ListFromTask(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.FileClient", "ListFromTask", err.Error()) - } - - result.fn = client.listFromTaskNextResults - req, err := client.ListFromTaskPreparer(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromTaskSender(req) - if err != nil { - result.nflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure sending request") - return - } - - result.nflr, err = client.ListFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure responding to request") - } - - return -} - -// ListFromTaskPreparer prepares the ListFromTask request. -func (client FileClient) ListFromTaskPreparer(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromTaskSender sends the ListFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) ListFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromTaskResponder handles the response to the ListFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) ListFromTaskResponder(resp *http.Response) (result NodeFileListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromTaskNextResults retrieves the next set of results, if any. -func (client FileClient) listFromTaskNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) { - req, err := lastResults.nodeFileListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromTaskComplete enumerates all values, automatically crossing page boundaries as required. -func (client FileClient) ListFromTaskComplete(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) { - result.page, err = client.ListFromTask(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2016-07-01.3.1/batch/job.go b/services/batch/2016-07-01.3.1/batch/job.go deleted file mode 100644 index 2a1f5f5c3631..000000000000 --- a/services/batch/2016-07-01.3.1/batch/job.go +++ /dev/null @@ -1,1489 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// JobClient is the a client for issuing REST requests to the Azure Batch service. -type JobClient struct { - BaseClient -} - -// NewJobClient creates an instance of the JobClient client. -func NewJobClient() JobClient { - return NewJobClientWithBaseURI(DefaultBaseURI) -} - -// NewJobClientWithBaseURI creates an instance of the JobClient client. -func NewJobClientWithBaseURI(baseURI string) JobClient { - return JobClient{NewWithBaseURI(baseURI)} -} - -// Add the Batch service supports two ways to control the work done as part of a job. In the first approach, the user -// specifies a Job Manager task. The Batch service launches this task when it is ready to start the job. The Job -// Manager task controls all other tasks that run under this job, by using the Task APIs. In the second approach, the -// user directly controls the execution of tasks under an active job, by using the Task APIs. Also note: when naming -// jobs, avoid including sensitive information such as user names or secret project names. This information may appear -// in telemetry logs accessible to Microsoft Support engineers. -// -// job is the job to be added. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -func (client JobClient) Add(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: job, - Constraints: []validation.Constraint{{Target: "job.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobManagerTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "job.JobPreparationTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "job.JobReleaseTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "job.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, job, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client JobClient) AddPreparer(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobs"), - autorest.WithJSON(job), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deleting a job also deletes all tasks that are part of that job, and all job statistics. This also overrides -// the retention period for task data; that is, if the job contains tasks which are still retained on compute nodes, -// the Batch services deletes those tasks' working directories and all their contents. -// -// jobID is the ID of the job to delete. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. If not specified, this header will be automatically populated with the current -// system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the -// resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to -// perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify -// this header to perform the operation only if the resource has been modified since the specified date/time. -// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified -// since the specified date/time. -func (client JobClient) Delete(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobClient) DeletePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) 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 -} - -// Disable the Batch Service immediately moves the job to the disabling state. Batch then uses the disableTasks -// parameter to determine what to do with the currently running tasks of the job. The job remains in the disabling -// state until the disable operation is completed and all tasks have been dealt with according to the disableTasks -// option; the job then moves to the disabled state. No new tasks are started under the job until it moves back to -// active state. If you try to disable a job that is in any state other than active, disabling, or disabled, the -// request fails with status code 409. -// -// jobID is the ID of the job to disable. jobDisableParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client JobClient) Disable(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisablePreparer(ctx, jobID, jobDisableParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure sending request") - return - } - - result, err = client.DisableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure responding to request") - } - - return -} - -// DisablePreparer prepares the Disable request. -func (client JobClient) DisablePreparer(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/disable", pathParameters), - autorest.WithJSON(jobDisableParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) DisableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableResponder handles the response to the Disable request. The method always -// closes the http.Response Body. -func (client JobClient) DisableResponder(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 -} - -// Enable when you call this API, the Batch service sets a disabled job to the enabling state. After the this operation -// is completed, the job moves to the active state, and scheduling of new tasks under the job resumes. The Batch -// service does not allow a task to remain in the active state for more than 7 days. Therefore, if you enable a job -// containing active tasks which were added more than 7 days ago, those tasks will not run. -// -// jobID is the ID of the job to enable. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. If not specified, this header will be automatically populated with the current -// system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the -// resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to -// perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify -// this header to perform the operation only if the resource has been modified since the specified date/time. -// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified -// since the specified date/time. -func (client JobClient) Enable(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnablePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure sending request") - return - } - - result, err = client.EnableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure responding to request") - } - - return -} - -// EnablePreparer prepares the Enable request. -func (client JobClient) EnablePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/enable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) EnableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableResponder handles the response to the Enable request. The method always -// closes the http.Response Body. -func (client JobClient) EnableResponder(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 sends the get request. -// -// jobID is the ID of the job. selectParameter is an OData $select clause. expand is an OData $expand clause. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified. -// Specify this header to perform the operation only if the resource's ETag is an exact match as specified. -// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag -// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the -// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform -// the operation only if the resource has not been modified since the specified date/time. -func (client JobClient) Get(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJob, err error) { - req, err := client.GetPreparer(ctx, jobID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobClient) GetPreparer(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) GetResponder(resp *http.Response) (result CloudJob, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAllJobsLifetimeStatistics statistics are aggregated across all jobs that have ever existed in the account, from -// account creation to the last update time of the statistics. -// -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client JobClient) GetAllJobsLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result JobStatistics, err error) { - req, err := client.GetAllJobsLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", nil, "Failure preparing request") - return - } - - resp, err := client.GetAllJobsLifetimeStatisticsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", resp, "Failure sending request") - return - } - - result, err = client.GetAllJobsLifetimeStatisticsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", resp, "Failure responding to request") - } - - return -} - -// GetAllJobsLifetimeStatisticsPreparer prepares the GetAllJobsLifetimeStatistics request. -func (client JobClient) GetAllJobsLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/lifetimejobstats"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAllJobsLifetimeStatisticsSender sends the GetAllJobsLifetimeStatistics request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) GetAllJobsLifetimeStatisticsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetAllJobsLifetimeStatisticsResponder handles the response to the GetAllJobsLifetimeStatistics request. The method always -// closes the http.Response Body. -func (client JobClient) GetAllJobsLifetimeStatisticsResponder(resp *http.Response) (result JobStatistics, 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. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand -// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 jobs can be -// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. -func (client JobClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cjlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure sending request") - return - } - - result.cjlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client JobClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobs"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) ListResponder(resp *http.Response) (result CloudJobListResult, 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 JobClient) listNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) { - req, err := lastResults.cloudJobListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "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, "batch.JobClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListFromJobSchedule sends the list from job schedule request. -// -// jobScheduleID is the ID of the job schedule from which you want to get a list of jobs. filter is an OData -// $filter clause. selectParameter is an OData $select clause. expand is an OData $expand clause. maxResults is the -// maximum number of items to return in the response. A maximum of 1000 jobs can be returned. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client JobClient) ListFromJobSchedule(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "ListFromJobSchedule", err.Error()) - } - - result.fn = client.listFromJobScheduleNextResults - req, err := client.ListFromJobSchedulePreparer(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromJobScheduleSender(req) - if err != nil { - result.cjlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure sending request") - return - } - - result.cjlr, err = client.ListFromJobScheduleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure responding to request") - } - - return -} - -// ListFromJobSchedulePreparer prepares the ListFromJobSchedule request. -func (client JobClient) ListFromJobSchedulePreparer(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/jobs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromJobScheduleSender sends the ListFromJobSchedule request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) ListFromJobScheduleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromJobScheduleResponder handles the response to the ListFromJobSchedule request. The method always -// closes the http.Response Body. -func (client JobClient) ListFromJobScheduleResponder(resp *http.Response) (result CloudJobListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromJobScheduleNextResults retrieves the next set of results, if any. -func (client JobClient) listFromJobScheduleNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) { - req, err := lastResults.cloudJobListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromJobScheduleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromJobScheduleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromJobScheduleComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListFromJobScheduleComplete(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) { - result.page, err = client.ListFromJobSchedule(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListPreparationAndReleaseTaskStatus this API returns the Job Preparation and Job Release task status on all compute -// nodes that have run the Job Preparation or Job Release task. This includes nodes which have since been removed from -// the pool. -// -// jobID is the ID of the job. filter is an OData $filter clause. selectParameter is an OData $select clause. -// maxResults is the maximum number of items to return in the response. A maximum of 1000 tasks can be returned. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client JobClient) ListPreparationAndReleaseTaskStatus(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "ListPreparationAndReleaseTaskStatus", err.Error()) - } - - result.fn = client.listPreparationAndReleaseTaskStatusNextResults - req, err := client.ListPreparationAndReleaseTaskStatusPreparer(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", nil, "Failure preparing request") - return - } - - resp, err := client.ListPreparationAndReleaseTaskStatusSender(req) - if err != nil { - result.cjlpartsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure sending request") - return - } - - result.cjlpartsr, err = client.ListPreparationAndReleaseTaskStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure responding to request") - } - - return -} - -// ListPreparationAndReleaseTaskStatusPreparer prepares the ListPreparationAndReleaseTaskStatus request. -func (client JobClient) ListPreparationAndReleaseTaskStatusPreparer(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/jobpreparationandreleasetaskstatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPreparationAndReleaseTaskStatusSender sends the ListPreparationAndReleaseTaskStatus request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) ListPreparationAndReleaseTaskStatusSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListPreparationAndReleaseTaskStatusResponder handles the response to the ListPreparationAndReleaseTaskStatus request. The method always -// closes the http.Response Body. -func (client JobClient) ListPreparationAndReleaseTaskStatusResponder(resp *http.Response) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listPreparationAndReleaseTaskStatusNextResults retrieves the next set of results, if any. -func (client JobClient) listPreparationAndReleaseTaskStatusNextResults(lastResults CloudJobListPreparationAndReleaseTaskStatusResult) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) { - req, err := lastResults.cloudJobListPreparationAndReleaseTaskStatusResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListPreparationAndReleaseTaskStatusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListPreparationAndReleaseTaskStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListPreparationAndReleaseTaskStatusComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListPreparationAndReleaseTaskStatusComplete(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultIterator, err error) { - result.page, err = client.ListPreparationAndReleaseTaskStatus(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch this replaces only the job properties specified in the request. For example, if the job has constraints, and a -// request does not specify the constraints element, then the job keeps the existing constraints. -// -// jobID is the ID of the job whose properties you want to update. jobPatchParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. ifMatch is an ETag is -// specified. Specify this header to perform the operation only if the resource's ETag is an exact match as -// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the -// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobClient) Patch(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, jobID, jobPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client JobClient) PatchPreparer(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithJSON(jobPatchParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client JobClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Terminate when a Terminate Job request is received, the Batch service sets the job to the terminating state. The -// Batch service then terminates any active or running tasks associated with the job, and runs any required Job Release -// tasks. The job then moves into the completed state. -// -// jobID is the ID of the job to terminate. jobTerminateParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client JobClient) Terminate(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobID, jobTerminateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client JobClient) TerminatePreparer(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if jobTerminateParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(jobTerminateParameter)) - } - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client JobClient) TerminateResponder(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 -} - -// Update this fully replaces all the updateable properties of the job. For example, if the job has constraints -// associated with it and if constraints is not specified with this request, then the Batch service will remove the -// existing constraints. -// -// jobID is the ID of the job whose properties you want to update. jobUpdateParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. ifMatch is an ETag is -// specified. Specify this header to perform the operation only if the resource's ETag is an exact match as -// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the -// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobClient) Update(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobUpdateParameter, - Constraints: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, jobID, jobUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client JobClient) UpdatePreparer(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithJSON(jobUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) UpdateResponder(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/batch/2016-07-01.3.1/batch/jobschedule.go b/services/batch/2016-07-01.3.1/batch/jobschedule.go deleted file mode 100644 index 11f64efc865e..000000000000 --- a/services/batch/2016-07-01.3.1/batch/jobschedule.go +++ /dev/null @@ -1,1228 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// JobScheduleClient is the a client for issuing REST requests to the Azure Batch service. -type JobScheduleClient struct { - BaseClient -} - -// NewJobScheduleClient creates an instance of the JobScheduleClient client. -func NewJobScheduleClient() JobScheduleClient { - return NewJobScheduleClientWithBaseURI(DefaultBaseURI) -} - -// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client. -func NewJobScheduleClientWithBaseURI(baseURI string) JobScheduleClient { - return JobScheduleClient{NewWithBaseURI(baseURI)} -} - -// Add sends the add request. -// -// cloudJobSchedule is the job schedule to be added. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client JobScheduleClient) Add(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: cloudJobSchedule, - Constraints: []validation.Constraint{{Target: "cloudJobSchedule.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.Schedule", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "cloudJobSchedule.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "cloudJobSchedule.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, cloudJobSchedule, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client JobScheduleClient) AddPreparer(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobschedules"), - autorest.WithJSON(cloudJobSchedule), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobScheduleClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete when you delete a job schedule, this also deletes all jobs and tasks under that schedule. When tasks are -// deleted, all the files in their working directories on the compute nodes are also deleted (the retention period is -// ignored). The job schedule statistics are no longer accessible once the job schedule is deleted, though they are -// still counted towards account lifetime statistics. -// -// jobScheduleID is the ID of the job schedule to delete. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Delete(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobScheduleClient) DeletePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) 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 -} - -// Disable no new jobs will be created until the job schedule is enabled again. -// -// jobScheduleID is the ID of the job schedule to disable. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Disable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure sending request") - return - } - - result, err = client.DisableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure responding to request") - } - - return -} - -// DisablePreparer prepares the Disable request. -func (client JobScheduleClient) DisablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/disable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) DisableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableResponder handles the response to the Disable request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) DisableResponder(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 -} - -// Enable sends the enable request. -// -// jobScheduleID is the ID of the job schedule to enable. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Enable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure sending request") - return - } - - result, err = client.EnableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure responding to request") - } - - return -} - -// EnablePreparer prepares the Enable request. -func (client JobScheduleClient) EnablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/enable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) EnableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableResponder handles the response to the Enable request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) EnableResponder(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 -} - -// Exists sends the exists request. -// -// jobScheduleID is the ID of the job schedule which you want to check. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Exists(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ExistsPreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", nil, "Failure preparing request") - return - } - - resp, err := client.ExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure sending request") - return - } - - result, err = client.ExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure responding to request") - } - - return -} - -// ExistsPreparer prepares the Exists request. -func (client JobScheduleClient) ExistsPreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExistsSender sends the Exists request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) ExistsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExistsResponder handles the response to the Exists request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) ExistsResponder(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 information about the specified job schedule. -// -// jobScheduleID is the ID of the job schedule to get. selectParameter is an OData $select clause. expand is an -// OData $expand clause. timeout is the maximum time that the server can spend processing the request, in seconds. -// The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with -// no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether -// the server should return the client-request-id in the response. ocpDate is the time the request was issued. If -// not specified, this header will be automatically populated with the current system clock time. ifMatch is an -// ETag is specified. Specify this header to perform the operation only if the resource's ETag is an exact match as -// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the -// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Get(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJobSchedule, err error) { - req, err := client.GetPreparer(ctx, jobScheduleID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobScheduleClient) GetPreparer(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) GetResponder(resp *http.Response) (result CloudJobSchedule, 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. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand -// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 job schedules can -// be returned. timeout is the maximum time that the server can spend processing the request, in seconds. The -// default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. -func (client JobScheduleClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cjslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure sending request") - return - } - - result.cjslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client JobScheduleClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobschedules"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobScheduleClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) ListResponder(resp *http.Response) (result CloudJobScheduleListResult, 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 JobScheduleClient) listNextResults(lastResults CloudJobScheduleListResult) (result CloudJobScheduleListResult, err error) { - req, err := lastResults.cloudJobScheduleListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobScheduleClient", "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, "batch.JobScheduleClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobScheduleClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch this replaces only the job schedule properties specified in the request. For example, if the schedule property -// is not specified with this request, then the Batch service will keep the existing schedule. Changes to a job -// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are -// unaffected. -// -// jobScheduleID is the ID of the job schedule to update. jobSchedulePatchParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. ifMatch is an ETag is -// specified. Specify this header to perform the operation only if the resource's ETag is an exact match as -// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the -// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Patch(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, jobScheduleID, jobSchedulePatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client JobScheduleClient) PatchPreparer(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithJSON(jobSchedulePatchParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Terminate sends the terminate request. -// -// jobScheduleID is the ID of the job schedule to terminates. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Terminate(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client JobScheduleClient) TerminatePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) TerminateResponder(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 -} - -// Update this fully replaces all the updateable properties of the job schedule. For example, if the schedule property -// is not specified with this request, then the Batch service will remove the existing schedule. Changes to a job -// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are -// unaffected. -// -// jobScheduleID is the ID of the job schedule to update. jobScheduleUpdateParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. ifMatch is an ETag is -// specified. Specify this header to perform the operation only if the resource's ETag is an exact match as -// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the -// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client JobScheduleClient) Update(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobScheduleUpdateParameter, - Constraints: []validation.Constraint{{Target: "jobScheduleUpdateParameter.Schedule", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, jobScheduleID, jobScheduleUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client JobScheduleClient) UpdatePreparer(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithJSON(jobScheduleUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) UpdateResponder(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/batch/2016-07-01.3.1/batch/models.go b/services/batch/2016-07-01.3.1/batch/models.go deleted file mode 100644 index c7ca9252c86f..000000000000 --- a/services/batch/2016-07-01.3.1/batch/models.go +++ /dev/null @@ -1,2839 +0,0 @@ -package batch - -// 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" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "io" - "net/http" -) - -// AllocationState enumerates the values for allocation state. -type AllocationState string - -const ( - // Resizing ... - Resizing AllocationState = "resizing" - // Steady ... - Steady AllocationState = "steady" - // Stopping ... - Stopping AllocationState = "stopping" -) - -// PossibleAllocationStateValues returns an array of possible values for the AllocationState const type. -func PossibleAllocationStateValues() []AllocationState { - return []AllocationState{Resizing, Steady, Stopping} -} - -// CertificateFormat enumerates the values for certificate format. -type CertificateFormat string - -const ( - // Cer ... - Cer CertificateFormat = "cer" - // Pfx ... - Pfx CertificateFormat = "pfx" - // Unmapped ... - Unmapped CertificateFormat = "unmapped" -) - -// PossibleCertificateFormatValues returns an array of possible values for the CertificateFormat const type. -func PossibleCertificateFormatValues() []CertificateFormat { - return []CertificateFormat{Cer, Pfx, Unmapped} -} - -// CertificateState enumerates the values for certificate state. -type CertificateState string - -const ( - // Active ... - Active CertificateState = "active" - // Deletefailed ... - Deletefailed CertificateState = "deletefailed" - // Deleting ... - Deleting CertificateState = "deleting" -) - -// PossibleCertificateStateValues returns an array of possible values for the CertificateState const type. -func PossibleCertificateStateValues() []CertificateState { - return []CertificateState{Active, Deletefailed, Deleting} -} - -// CertificateStoreLocation enumerates the values for certificate store location. -type CertificateStoreLocation string - -const ( - // CertificateStoreLocationCurrentuser ... - CertificateStoreLocationCurrentuser CertificateStoreLocation = "currentuser" - // CertificateStoreLocationLocalmachine ... - CertificateStoreLocationLocalmachine CertificateStoreLocation = "localmachine" - // CertificateStoreLocationUnmapped ... - CertificateStoreLocationUnmapped CertificateStoreLocation = "unmapped" -) - -// PossibleCertificateStoreLocationValues returns an array of possible values for the CertificateStoreLocation const type. -func PossibleCertificateStoreLocationValues() []CertificateStoreLocation { - return []CertificateStoreLocation{CertificateStoreLocationCurrentuser, CertificateStoreLocationLocalmachine, CertificateStoreLocationUnmapped} -} - -// CertificateVisibility enumerates the values for certificate visibility. -type CertificateVisibility string - -const ( - // CertificateVisibilityRemoteuser ... - CertificateVisibilityRemoteuser CertificateVisibility = "remoteuser" - // CertificateVisibilityStarttask ... - CertificateVisibilityStarttask CertificateVisibility = "starttask" - // CertificateVisibilityTask ... - CertificateVisibilityTask CertificateVisibility = "task" - // CertificateVisibilityUnmapped ... - CertificateVisibilityUnmapped CertificateVisibility = "unmapped" -) - -// PossibleCertificateVisibilityValues returns an array of possible values for the CertificateVisibility const type. -func PossibleCertificateVisibilityValues() []CertificateVisibility { - return []CertificateVisibility{CertificateVisibilityRemoteuser, CertificateVisibilityStarttask, CertificateVisibilityTask, CertificateVisibilityUnmapped} -} - -// ComputeNodeDeallocationOption enumerates the values for compute node deallocation option. -type ComputeNodeDeallocationOption string - -const ( - // Requeue ... - Requeue ComputeNodeDeallocationOption = "requeue" - // Retaineddata ... - Retaineddata ComputeNodeDeallocationOption = "retaineddata" - // Taskcompletion ... - Taskcompletion ComputeNodeDeallocationOption = "taskcompletion" - // Terminate ... - Terminate ComputeNodeDeallocationOption = "terminate" -) - -// PossibleComputeNodeDeallocationOptionValues returns an array of possible values for the ComputeNodeDeallocationOption const type. -func PossibleComputeNodeDeallocationOptionValues() []ComputeNodeDeallocationOption { - return []ComputeNodeDeallocationOption{Requeue, Retaineddata, Taskcompletion, Terminate} -} - -// ComputeNodeFillType enumerates the values for compute node fill type. -type ComputeNodeFillType string - -const ( - // ComputeNodeFillTypePack ... - ComputeNodeFillTypePack ComputeNodeFillType = "pack" - // ComputeNodeFillTypeSpread ... - ComputeNodeFillTypeSpread ComputeNodeFillType = "spread" - // ComputeNodeFillTypeUnmapped ... - ComputeNodeFillTypeUnmapped ComputeNodeFillType = "unmapped" -) - -// PossibleComputeNodeFillTypeValues returns an array of possible values for the ComputeNodeFillType const type. -func PossibleComputeNodeFillTypeValues() []ComputeNodeFillType { - return []ComputeNodeFillType{ComputeNodeFillTypePack, ComputeNodeFillTypeSpread, ComputeNodeFillTypeUnmapped} -} - -// ComputeNodeRebootOption enumerates the values for compute node reboot option. -type ComputeNodeRebootOption string - -const ( - // ComputeNodeRebootOptionRequeue ... - ComputeNodeRebootOptionRequeue ComputeNodeRebootOption = "requeue" - // ComputeNodeRebootOptionRetaineddata ... - ComputeNodeRebootOptionRetaineddata ComputeNodeRebootOption = "retaineddata" - // ComputeNodeRebootOptionTaskcompletion ... - ComputeNodeRebootOptionTaskcompletion ComputeNodeRebootOption = "taskcompletion" - // ComputeNodeRebootOptionTerminate ... - ComputeNodeRebootOptionTerminate ComputeNodeRebootOption = "terminate" -) - -// PossibleComputeNodeRebootOptionValues returns an array of possible values for the ComputeNodeRebootOption const type. -func PossibleComputeNodeRebootOptionValues() []ComputeNodeRebootOption { - return []ComputeNodeRebootOption{ComputeNodeRebootOptionRequeue, ComputeNodeRebootOptionRetaineddata, ComputeNodeRebootOptionTaskcompletion, ComputeNodeRebootOptionTerminate} -} - -// ComputeNodeReimageOption enumerates the values for compute node reimage option. -type ComputeNodeReimageOption string - -const ( - // ComputeNodeReimageOptionRequeue ... - ComputeNodeReimageOptionRequeue ComputeNodeReimageOption = "requeue" - // ComputeNodeReimageOptionRetaineddata ... - ComputeNodeReimageOptionRetaineddata ComputeNodeReimageOption = "retaineddata" - // ComputeNodeReimageOptionTaskcompletion ... - ComputeNodeReimageOptionTaskcompletion ComputeNodeReimageOption = "taskcompletion" - // ComputeNodeReimageOptionTerminate ... - ComputeNodeReimageOptionTerminate ComputeNodeReimageOption = "terminate" -) - -// PossibleComputeNodeReimageOptionValues returns an array of possible values for the ComputeNodeReimageOption const type. -func PossibleComputeNodeReimageOptionValues() []ComputeNodeReimageOption { - return []ComputeNodeReimageOption{ComputeNodeReimageOptionRequeue, ComputeNodeReimageOptionRetaineddata, ComputeNodeReimageOptionTaskcompletion, ComputeNodeReimageOptionTerminate} -} - -// ComputeNodeState enumerates the values for compute node state. -type ComputeNodeState string - -const ( - // Creating ... - Creating ComputeNodeState = "creating" - // Idle ... - Idle ComputeNodeState = "idle" - // Leavingpool ... - Leavingpool ComputeNodeState = "leavingpool" - // Offline ... - Offline ComputeNodeState = "offline" - // Rebooting ... - Rebooting ComputeNodeState = "rebooting" - // Reimaging ... - Reimaging ComputeNodeState = "reimaging" - // Running ... - Running ComputeNodeState = "running" - // Starting ... - Starting ComputeNodeState = "starting" - // Starttaskfailed ... - Starttaskfailed ComputeNodeState = "starttaskfailed" - // Unknown ... - Unknown ComputeNodeState = "unknown" - // Unusable ... - Unusable ComputeNodeState = "unusable" - // Waitingforstarttask ... - Waitingforstarttask ComputeNodeState = "waitingforstarttask" -) - -// PossibleComputeNodeStateValues returns an array of possible values for the ComputeNodeState const type. -func PossibleComputeNodeStateValues() []ComputeNodeState { - return []ComputeNodeState{Creating, Idle, Leavingpool, Offline, Rebooting, Reimaging, Running, Starting, Starttaskfailed, Unknown, Unusable, Waitingforstarttask} -} - -// DisableComputeNodeSchedulingOption enumerates the values for disable compute node scheduling option. -type DisableComputeNodeSchedulingOption string - -const ( - // DisableComputeNodeSchedulingOptionRequeue ... - DisableComputeNodeSchedulingOptionRequeue DisableComputeNodeSchedulingOption = "requeue" - // DisableComputeNodeSchedulingOptionTaskcompletion ... - DisableComputeNodeSchedulingOptionTaskcompletion DisableComputeNodeSchedulingOption = "taskcompletion" - // DisableComputeNodeSchedulingOptionTerminate ... - DisableComputeNodeSchedulingOptionTerminate DisableComputeNodeSchedulingOption = "terminate" -) - -// PossibleDisableComputeNodeSchedulingOptionValues returns an array of possible values for the DisableComputeNodeSchedulingOption const type. -func PossibleDisableComputeNodeSchedulingOptionValues() []DisableComputeNodeSchedulingOption { - return []DisableComputeNodeSchedulingOption{DisableComputeNodeSchedulingOptionRequeue, DisableComputeNodeSchedulingOptionTaskcompletion, DisableComputeNodeSchedulingOptionTerminate} -} - -// DisableJobOption enumerates the values for disable job option. -type DisableJobOption string - -const ( - // DisableJobOptionRequeue ... - DisableJobOptionRequeue DisableJobOption = "requeue" - // DisableJobOptionTerminate ... - DisableJobOptionTerminate DisableJobOption = "terminate" - // DisableJobOptionWait ... - DisableJobOptionWait DisableJobOption = "wait" -) - -// PossibleDisableJobOptionValues returns an array of possible values for the DisableJobOption const type. -func PossibleDisableJobOptionValues() []DisableJobOption { - return []DisableJobOption{DisableJobOptionRequeue, DisableJobOptionTerminate, DisableJobOptionWait} -} - -// JobAction enumerates the values for job action. -type JobAction string - -const ( - // JobActionDisable ... - JobActionDisable JobAction = "disable" - // JobActionNone ... - JobActionNone JobAction = "none" - // JobActionTerminate ... - JobActionTerminate JobAction = "terminate" -) - -// PossibleJobActionValues returns an array of possible values for the JobAction const type. -func PossibleJobActionValues() []JobAction { - return []JobAction{JobActionDisable, JobActionNone, JobActionTerminate} -} - -// JobPreparationTaskState enumerates the values for job preparation task state. -type JobPreparationTaskState string - -const ( - // JobPreparationTaskStateCompleted ... - JobPreparationTaskStateCompleted JobPreparationTaskState = "completed" - // JobPreparationTaskStateRunning ... - JobPreparationTaskStateRunning JobPreparationTaskState = "running" -) - -// PossibleJobPreparationTaskStateValues returns an array of possible values for the JobPreparationTaskState const type. -func PossibleJobPreparationTaskStateValues() []JobPreparationTaskState { - return []JobPreparationTaskState{JobPreparationTaskStateCompleted, JobPreparationTaskStateRunning} -} - -// JobReleaseTaskState enumerates the values for job release task state. -type JobReleaseTaskState string - -const ( - // JobReleaseTaskStateCompleted ... - JobReleaseTaskStateCompleted JobReleaseTaskState = "completed" - // JobReleaseTaskStateRunning ... - JobReleaseTaskStateRunning JobReleaseTaskState = "running" -) - -// PossibleJobReleaseTaskStateValues returns an array of possible values for the JobReleaseTaskState const type. -func PossibleJobReleaseTaskStateValues() []JobReleaseTaskState { - return []JobReleaseTaskState{JobReleaseTaskStateCompleted, JobReleaseTaskStateRunning} -} - -// JobScheduleState enumerates the values for job schedule state. -type JobScheduleState string - -const ( - // JobScheduleStateActive ... - JobScheduleStateActive JobScheduleState = "active" - // JobScheduleStateCompleted ... - JobScheduleStateCompleted JobScheduleState = "completed" - // JobScheduleStateDeleting ... - JobScheduleStateDeleting JobScheduleState = "deleting" - // JobScheduleStateDisabled ... - JobScheduleStateDisabled JobScheduleState = "disabled" - // JobScheduleStateTerminating ... - JobScheduleStateTerminating JobScheduleState = "terminating" -) - -// PossibleJobScheduleStateValues returns an array of possible values for the JobScheduleState const type. -func PossibleJobScheduleStateValues() []JobScheduleState { - return []JobScheduleState{JobScheduleStateActive, JobScheduleStateCompleted, JobScheduleStateDeleting, JobScheduleStateDisabled, JobScheduleStateTerminating} -} - -// JobState enumerates the values for job state. -type JobState string - -const ( - // JobStateActive ... - JobStateActive JobState = "active" - // JobStateCompleted ... - JobStateCompleted JobState = "completed" - // JobStateDeleting ... - JobStateDeleting JobState = "deleting" - // JobStateDisabled ... - JobStateDisabled JobState = "disabled" - // JobStateDisabling ... - JobStateDisabling JobState = "disabling" - // JobStateEnabling ... - JobStateEnabling JobState = "enabling" - // JobStateTerminating ... - JobStateTerminating JobState = "terminating" -) - -// PossibleJobStateValues returns an array of possible values for the JobState const type. -func PossibleJobStateValues() []JobState { - return []JobState{JobStateActive, JobStateCompleted, JobStateDeleting, JobStateDisabled, JobStateDisabling, JobStateEnabling, JobStateTerminating} -} - -// OnAllTasksComplete enumerates the values for on all tasks complete. -type OnAllTasksComplete string - -const ( - // NoAction ... - NoAction OnAllTasksComplete = "noAction" - // TerminateJob ... - TerminateJob OnAllTasksComplete = "terminateJob" -) - -// PossibleOnAllTasksCompleteValues returns an array of possible values for the OnAllTasksComplete const type. -func PossibleOnAllTasksCompleteValues() []OnAllTasksComplete { - return []OnAllTasksComplete{NoAction, TerminateJob} -} - -// OnTaskFailure enumerates the values for on task failure. -type OnTaskFailure string - -const ( - // OnTaskFailureNoAction ... - OnTaskFailureNoAction OnTaskFailure = "noAction" - // OnTaskFailurePerformExitOptionsJobAction ... - OnTaskFailurePerformExitOptionsJobAction OnTaskFailure = "performExitOptionsJobAction" -) - -// PossibleOnTaskFailureValues returns an array of possible values for the OnTaskFailure const type. -func PossibleOnTaskFailureValues() []OnTaskFailure { - return []OnTaskFailure{OnTaskFailureNoAction, OnTaskFailurePerformExitOptionsJobAction} -} - -// OSType enumerates the values for os type. -type OSType string - -const ( - // OSTypeLinux ... - OSTypeLinux OSType = "linux" - // OSTypeUnmapped ... - OSTypeUnmapped OSType = "unmapped" - // OSTypeWindows ... - OSTypeWindows OSType = "windows" -) - -// PossibleOSTypeValues returns an array of possible values for the OSType const type. -func PossibleOSTypeValues() []OSType { - return []OSType{OSTypeLinux, OSTypeUnmapped, OSTypeWindows} -} - -// PoolLifetimeOption enumerates the values for pool lifetime option. -type PoolLifetimeOption string - -const ( - // PoolLifetimeOptionJob ... - PoolLifetimeOptionJob PoolLifetimeOption = "job" - // PoolLifetimeOptionJobschedule ... - PoolLifetimeOptionJobschedule PoolLifetimeOption = "jobschedule" - // PoolLifetimeOptionUnmapped ... - PoolLifetimeOptionUnmapped PoolLifetimeOption = "unmapped" -) - -// PossiblePoolLifetimeOptionValues returns an array of possible values for the PoolLifetimeOption const type. -func PossiblePoolLifetimeOptionValues() []PoolLifetimeOption { - return []PoolLifetimeOption{PoolLifetimeOptionJob, PoolLifetimeOptionJobschedule, PoolLifetimeOptionUnmapped} -} - -// PoolState enumerates the values for pool state. -type PoolState string - -const ( - // PoolStateActive ... - PoolStateActive PoolState = "active" - // PoolStateDeleting ... - PoolStateDeleting PoolState = "deleting" - // PoolStateUpgrading ... - PoolStateUpgrading PoolState = "upgrading" -) - -// PossiblePoolStateValues returns an array of possible values for the PoolState const type. -func PossiblePoolStateValues() []PoolState { - return []PoolState{PoolStateActive, PoolStateDeleting, PoolStateUpgrading} -} - -// SchedulingErrorCategory enumerates the values for scheduling error category. -type SchedulingErrorCategory string - -const ( - // SchedulingErrorCategoryServererror ... - SchedulingErrorCategoryServererror SchedulingErrorCategory = "servererror" - // SchedulingErrorCategoryUnmapped ... - SchedulingErrorCategoryUnmapped SchedulingErrorCategory = "unmapped" - // SchedulingErrorCategoryUsererror ... - SchedulingErrorCategoryUsererror SchedulingErrorCategory = "usererror" -) - -// PossibleSchedulingErrorCategoryValues returns an array of possible values for the SchedulingErrorCategory const type. -func PossibleSchedulingErrorCategoryValues() []SchedulingErrorCategory { - return []SchedulingErrorCategory{SchedulingErrorCategoryServererror, SchedulingErrorCategoryUnmapped, SchedulingErrorCategoryUsererror} -} - -// SchedulingState enumerates the values for scheduling state. -type SchedulingState string - -const ( - // Disabled ... - Disabled SchedulingState = "disabled" - // Enabled ... - Enabled SchedulingState = "enabled" -) - -// PossibleSchedulingStateValues returns an array of possible values for the SchedulingState const type. -func PossibleSchedulingStateValues() []SchedulingState { - return []SchedulingState{Disabled, Enabled} -} - -// StartTaskState enumerates the values for start task state. -type StartTaskState string - -const ( - // StartTaskStateCompleted ... - StartTaskStateCompleted StartTaskState = "completed" - // StartTaskStateRunning ... - StartTaskStateRunning StartTaskState = "running" -) - -// PossibleStartTaskStateValues returns an array of possible values for the StartTaskState const type. -func PossibleStartTaskStateValues() []StartTaskState { - return []StartTaskState{StartTaskStateCompleted, StartTaskStateRunning} -} - -// TaskAddStatus enumerates the values for task add status. -type TaskAddStatus string - -const ( - // TaskAddStatusClienterror ... - TaskAddStatusClienterror TaskAddStatus = "clienterror" - // TaskAddStatusServererror ... - TaskAddStatusServererror TaskAddStatus = "servererror" - // TaskAddStatusSuccess ... - TaskAddStatusSuccess TaskAddStatus = "success" - // TaskAddStatusUnmapped ... - TaskAddStatusUnmapped TaskAddStatus = "unmapped" -) - -// PossibleTaskAddStatusValues returns an array of possible values for the TaskAddStatus const type. -func PossibleTaskAddStatusValues() []TaskAddStatus { - return []TaskAddStatus{TaskAddStatusClienterror, TaskAddStatusServererror, TaskAddStatusSuccess, TaskAddStatusUnmapped} -} - -// TaskState enumerates the values for task state. -type TaskState string - -const ( - // TaskStateActive ... - TaskStateActive TaskState = "active" - // TaskStateCompleted ... - TaskStateCompleted TaskState = "completed" - // TaskStatePreparing ... - TaskStatePreparing TaskState = "preparing" - // TaskStateRunning ... - TaskStateRunning TaskState = "running" -) - -// PossibleTaskStateValues returns an array of possible values for the TaskState const type. -func PossibleTaskStateValues() []TaskState { - return []TaskState{TaskStateActive, TaskStateCompleted, TaskStatePreparing, TaskStateRunning} -} - -// AccountListNodeAgentSkusResult ... -type AccountListNodeAgentSkusResult struct { - autorest.Response `json:"-"` - Value *[]NodeAgentSku `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// AccountListNodeAgentSkusResultIterator provides access to a complete listing of NodeAgentSku values. -type AccountListNodeAgentSkusResultIterator struct { - i int - page AccountListNodeAgentSkusResultPage -} - -// Next 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 *AccountListNodeAgentSkusResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AccountListNodeAgentSkusResultIterator) 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 AccountListNodeAgentSkusResultIterator) Response() AccountListNodeAgentSkusResult { - 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 AccountListNodeAgentSkusResultIterator) Value() NodeAgentSku { - if !iter.page.NotDone() { - return NodeAgentSku{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (alnasr AccountListNodeAgentSkusResult) IsEmpty() bool { - return alnasr.Value == nil || len(*alnasr.Value) == 0 -} - -// accountListNodeAgentSkusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alnasr AccountListNodeAgentSkusResult) accountListNodeAgentSkusResultPreparer() (*http.Request, error) { - if alnasr.OdataNextLink == nil || len(to.String(alnasr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alnasr.OdataNextLink))) -} - -// AccountListNodeAgentSkusResultPage contains a page of NodeAgentSku values. -type AccountListNodeAgentSkusResultPage struct { - fn func(AccountListNodeAgentSkusResult) (AccountListNodeAgentSkusResult, error) - alnasr AccountListNodeAgentSkusResult -} - -// 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. -func (page *AccountListNodeAgentSkusResultPage) Next() error { - next, err := page.fn(page.alnasr) - if err != nil { - return err - } - page.alnasr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AccountListNodeAgentSkusResultPage) NotDone() bool { - return !page.alnasr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AccountListNodeAgentSkusResultPage) Response() AccountListNodeAgentSkusResult { - return page.alnasr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AccountListNodeAgentSkusResultPage) Values() []NodeAgentSku { - if page.alnasr.IsEmpty() { - return nil - } - return *page.alnasr.Value -} - -// AffinityInformation ... -type AffinityInformation struct { - // AffinityID - You can pass the affinityId of a compute node or task to indicate that this task needs to be placed close to the node or task. - AffinityID *string `json:"affinityId,omitempty"` -} - -// ApplicationListResult ... -type ApplicationListResult struct { - autorest.Response `json:"-"` - Value *[]ApplicationSummary `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// ApplicationListResultIterator provides access to a complete listing of ApplicationSummary values. -type ApplicationListResultIterator struct { - i int - page ApplicationListResultPage -} - -// Next 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 *ApplicationListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationListResultIterator) 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 ApplicationListResultIterator) Response() ApplicationListResult { - 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 ApplicationListResultIterator) Value() ApplicationSummary { - if !iter.page.NotDone() { - return ApplicationSummary{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (alr ApplicationListResult) IsEmpty() bool { - return alr.Value == nil || len(*alr.Value) == 0 -} - -// applicationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alr ApplicationListResult) applicationListResultPreparer() (*http.Request, error) { - if alr.OdataNextLink == nil || len(to.String(alr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alr.OdataNextLink))) -} - -// ApplicationListResultPage contains a page of ApplicationSummary values. -type ApplicationListResultPage struct { - fn func(ApplicationListResult) (ApplicationListResult, error) - alr ApplicationListResult -} - -// 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. -func (page *ApplicationListResultPage) Next() error { - next, err := page.fn(page.alr) - if err != nil { - return err - } - page.alr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationListResultPage) NotDone() bool { - return !page.alr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationListResultPage) Response() ApplicationListResult { - return page.alr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationListResultPage) Values() []ApplicationSummary { - if page.alr.IsEmpty() { - return nil - } - return *page.alr.Value -} - -// ApplicationPackageReference ... -type ApplicationPackageReference struct { - ApplicationID *string `json:"applicationId,omitempty"` - // Version - If this is omitted, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences. If you are calling the REST API directly, the HTTP status code is 409. - Version *string `json:"version,omitempty"` -} - -// ApplicationSummary ... -type ApplicationSummary struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Versions *[]string `json:"versions,omitempty"` -} - -// AutoPoolSpecification ... -type AutoPoolSpecification struct { - // AutoPoolIDPrefix - The Batch service assigns each auto pool a unique identifier on creation. To distinguish between pools created for different purposes, you can specify this element to add a prefix to the id that is assigned. The prefix can be up to 20 characters long. - AutoPoolIDPrefix *string `json:"autoPoolIdPrefix,omitempty"` - // PoolLifetimeOption - When the pool lifetime scope is jobschedule level, the Batch service keeps track of the last autopool created for the jobschedule, and deletes that pool when the jobschedule completes. Batch will also delete this pool if the user updates the auto pool specification in a way that changes this lifetime. Possible values include: 'PoolLifetimeOptionJobschedule', 'PoolLifetimeOptionJob', 'PoolLifetimeOptionUnmapped' - PoolLifetimeOption PoolLifetimeOption `json:"poolLifetimeOption,omitempty"` - // KeepAlive - If false, the Batch service deletes the pool once its lifetime (as determined by the poolLifetimeOption setting) expires; that is, when the job or job schedule completes. If true, the Batch service does not delete the pool automatically. It is up to the user to delete auto pools created with this option. - KeepAlive *bool `json:"keepAlive,omitempty"` - Pool *PoolSpecification `json:"pool,omitempty"` -} - -// AutoScaleRun ... -type AutoScaleRun struct { - autorest.Response `json:"-"` - Timestamp *date.Time `json:"timestamp,omitempty"` - // Results - Each variable value is returned in the form $variable=value, and variables are separated by semicolons. - Results *string `json:"results,omitempty"` - Error *AutoScaleRunError `json:"error,omitempty"` -} - -// AutoScaleRunError ... -type AutoScaleRunError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Values *[]NameValuePair `json:"values,omitempty"` -} - -// Certificate a certificate that can be installed on compute nodes and can be used to authenticate operations on -// the machine. -type Certificate struct { - autorest.Response `json:"-"` - Thumbprint *string `json:"thumbprint,omitempty"` - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - URL *string `json:"url,omitempty"` - // State - Possible values include: 'Active', 'Deleting', 'Deletefailed' - State CertificateState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the certificate is in its initial Active state. Possible values include: 'Active', 'Deleting', 'Deletefailed' - PreviousState CertificateState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the certificate is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - PublicData *string `json:"publicData,omitempty"` - // DeleteCertificateError - This property is set only if the certificate is in the DeleteFailed state. - DeleteCertificateError *DeleteCertificateError `json:"deleteCertificateError,omitempty"` -} - -// CertificateAddParameter ... -type CertificateAddParameter struct { - Thumbprint *string `json:"thumbprint,omitempty"` - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - Data *string `json:"data,omitempty"` - // CertificateFormat - Possible values include: 'Pfx', 'Cer', 'Unmapped' - CertificateFormat CertificateFormat `json:"certificateFormat,omitempty"` - // Password - This is required if the certificate format is pfx. It should be omitted if the certificate format is cer. - Password *string `json:"password,omitempty"` -} - -// CertificateListResult ... -type CertificateListResult struct { - autorest.Response `json:"-"` - Value *[]Certificate `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CertificateListResultIterator provides access to a complete listing of Certificate values. -type CertificateListResultIterator struct { - i int - page CertificateListResultPage -} - -// Next 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 *CertificateListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CertificateListResultIterator) 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 CertificateListResultIterator) Response() CertificateListResult { - 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 CertificateListResultIterator) Value() Certificate { - if !iter.page.NotDone() { - return Certificate{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (clr CertificateListResult) IsEmpty() bool { - return clr.Value == nil || len(*clr.Value) == 0 -} - -// certificateListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) { - if clr.OdataNextLink == nil || len(to.String(clr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(clr.OdataNextLink))) -} - -// CertificateListResultPage contains a page of Certificate values. -type CertificateListResultPage struct { - fn func(CertificateListResult) (CertificateListResult, error) - clr CertificateListResult -} - -// 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. -func (page *CertificateListResultPage) Next() error { - next, err := page.fn(page.clr) - if err != nil { - return err - } - page.clr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CertificateListResultPage) NotDone() bool { - return !page.clr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CertificateListResultPage) Response() CertificateListResult { - return page.clr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CertificateListResultPage) Values() []Certificate { - if page.clr.IsEmpty() { - return nil - } - return *page.clr.Value -} - -// CertificateReference ... -type CertificateReference struct { - Thumbprint *string `json:"thumbprint,omitempty"` - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - // StoreLocation - The default value is CurrentUser. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of remoteuser, a certs directory is created in the user's home directory (e.g., /home//certs) where certificates are placed. Possible values include: 'CertificateStoreLocationCurrentuser', 'CertificateStoreLocationLocalmachine', 'CertificateStoreLocationUnmapped' - StoreLocation CertificateStoreLocation `json:"storeLocation,omitempty"` - // StoreName - The default value is My. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). - StoreName *string `json:"storeName,omitempty"` - // Visibility - The default is all accounts. - Visibility *[]CertificateVisibility `json:"visibility,omitempty"` -} - -// CloudJob ... -type CloudJob struct { - autorest.Response `json:"-"` - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id. - ID *string `json:"id,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the job has changed between requests. In particular, you can be pass the ETag when updating a job to specify that your changes should take effect only if nobody else has modified the job in the meantime. - ETag *string `json:"eTag,omitempty"` - // LastModified - This is the last time at which the job level data, such as the job state or priority, changed. It does not factor in task-level changes such as adding new tasks or tasks changing state. - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting' - State JobState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the job is in its initial Active state. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting' - PreviousState JobState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the job is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. - Priority *int32 `json:"priority,omitempty"` - Constraints *JobConstraints `json:"constraints,omitempty"` - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - The Job Preparation task is a special task run on each node before any other task of the job. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - The Job Release task is a special task run at the end of the job on each node that has run any other task of the job. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // OnAllTasksComplete - Permitted values are: noaction – do nothing. The job remains active unless terminated or disabled by some other means. terminatejob – terminate the job. The job's terminateReason is set to 'AllTasksComplete'. The default is noaction. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // OnTaskFailure - Permitted values are: noaction – do nothing. performexitoptionsjobaction – take the action associated with the task exit condition in the task's exitConditions collection. (This may still result in no action being taken, if that is what the task specifies.) The default is noaction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction' - OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - ExecutionInfo *JobExecutionInformation `json:"executionInfo,omitempty"` - Stats *JobStatistics `json:"stats,omitempty"` -} - -// CloudJobListPreparationAndReleaseTaskStatusResult ... -type CloudJobListPreparationAndReleaseTaskStatusResult struct { - autorest.Response `json:"-"` - Value *[]JobPreparationAndReleaseTaskExecutionInformation `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobListPreparationAndReleaseTaskStatusResultIterator provides access to a complete listing of -// JobPreparationAndReleaseTaskExecutionInformation values. -type CloudJobListPreparationAndReleaseTaskStatusResultIterator struct { - i int - page CloudJobListPreparationAndReleaseTaskStatusResultPage -} - -// Next 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 *CloudJobListPreparationAndReleaseTaskStatusResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) 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 CloudJobListPreparationAndReleaseTaskStatusResultIterator) Response() CloudJobListPreparationAndReleaseTaskStatusResult { - 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 CloudJobListPreparationAndReleaseTaskStatusResultIterator) Value() JobPreparationAndReleaseTaskExecutionInformation { - if !iter.page.NotDone() { - return JobPreparationAndReleaseTaskExecutionInformation{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) IsEmpty() bool { - return cjlpartsr.Value == nil || len(*cjlpartsr.Value) == 0 -} - -// cloudJobListPreparationAndReleaseTaskStatusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) cloudJobListPreparationAndReleaseTaskStatusResultPreparer() (*http.Request, error) { - if cjlpartsr.OdataNextLink == nil || len(to.String(cjlpartsr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjlpartsr.OdataNextLink))) -} - -// CloudJobListPreparationAndReleaseTaskStatusResultPage contains a page of -// JobPreparationAndReleaseTaskExecutionInformation values. -type CloudJobListPreparationAndReleaseTaskStatusResultPage struct { - fn func(CloudJobListPreparationAndReleaseTaskStatusResult) (CloudJobListPreparationAndReleaseTaskStatusResult, error) - cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult -} - -// 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. -func (page *CloudJobListPreparationAndReleaseTaskStatusResultPage) Next() error { - next, err := page.fn(page.cjlpartsr) - if err != nil { - return err - } - page.cjlpartsr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) NotDone() bool { - return !page.cjlpartsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Response() CloudJobListPreparationAndReleaseTaskStatusResult { - return page.cjlpartsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Values() []JobPreparationAndReleaseTaskExecutionInformation { - if page.cjlpartsr.IsEmpty() { - return nil - } - return *page.cjlpartsr.Value -} - -// CloudJobListResult ... -type CloudJobListResult struct { - autorest.Response `json:"-"` - Value *[]CloudJob `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobListResultIterator provides access to a complete listing of CloudJob values. -type CloudJobListResultIterator struct { - i int - page CloudJobListResultPage -} - -// Next 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 *CloudJobListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobListResultIterator) 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 CloudJobListResultIterator) Response() CloudJobListResult { - 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 CloudJobListResultIterator) Value() CloudJob { - if !iter.page.NotDone() { - return CloudJob{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjlr CloudJobListResult) IsEmpty() bool { - return cjlr.Value == nil || len(*cjlr.Value) == 0 -} - -// cloudJobListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjlr CloudJobListResult) cloudJobListResultPreparer() (*http.Request, error) { - if cjlr.OdataNextLink == nil || len(to.String(cjlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjlr.OdataNextLink))) -} - -// CloudJobListResultPage contains a page of CloudJob values. -type CloudJobListResultPage struct { - fn func(CloudJobListResult) (CloudJobListResult, error) - cjlr CloudJobListResult -} - -// 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. -func (page *CloudJobListResultPage) Next() error { - next, err := page.fn(page.cjlr) - if err != nil { - return err - } - page.cjlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobListResultPage) NotDone() bool { - return !page.cjlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobListResultPage) Response() CloudJobListResult { - return page.cjlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobListResultPage) Values() []CloudJob { - if page.cjlr.IsEmpty() { - return nil - } - return *page.cjlr.Value -} - -// CloudJobSchedule ... -type CloudJobSchedule struct { - autorest.Response `json:"-"` - // ID - It is common to use a GUID for the id. - ID *string `json:"id,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the job schedule has changed between requests. In particular, you can be pass the ETag with an Update Job Schedule request to specify that your changes should take effect only if nobody else has modified the schedule in the meantime. - ETag *string `json:"eTag,omitempty"` - // LastModified - This is the last time at which the schedule level data, such as the job specification or recurrence information, changed. It does not factor in job-level changes such as new jobs being created or jobs changing state. - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting' - State JobScheduleState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not present if the job schedule is in its initial active state. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting' - PreviousState JobScheduleState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not present if the job schedule is in its initial active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - Schedule *Schedule `json:"schedule,omitempty"` - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - ExecutionInfo *JobScheduleExecutionInformation `json:"executionInfo,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - Stats *JobScheduleStatistics `json:"stats,omitempty"` -} - -// CloudJobScheduleListResult ... -type CloudJobScheduleListResult struct { - autorest.Response `json:"-"` - Value *[]CloudJobSchedule `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobScheduleListResultIterator provides access to a complete listing of CloudJobSchedule values. -type CloudJobScheduleListResultIterator struct { - i int - page CloudJobScheduleListResultPage -} - -// Next 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 *CloudJobScheduleListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobScheduleListResultIterator) 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 CloudJobScheduleListResultIterator) Response() CloudJobScheduleListResult { - 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 CloudJobScheduleListResultIterator) Value() CloudJobSchedule { - if !iter.page.NotDone() { - return CloudJobSchedule{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjslr CloudJobScheduleListResult) IsEmpty() bool { - return cjslr.Value == nil || len(*cjslr.Value) == 0 -} - -// cloudJobScheduleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjslr CloudJobScheduleListResult) cloudJobScheduleListResultPreparer() (*http.Request, error) { - if cjslr.OdataNextLink == nil || len(to.String(cjslr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjslr.OdataNextLink))) -} - -// CloudJobScheduleListResultPage contains a page of CloudJobSchedule values. -type CloudJobScheduleListResultPage struct { - fn func(CloudJobScheduleListResult) (CloudJobScheduleListResult, error) - cjslr CloudJobScheduleListResult -} - -// 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. -func (page *CloudJobScheduleListResultPage) Next() error { - next, err := page.fn(page.cjslr) - if err != nil { - return err - } - page.cjslr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobScheduleListResultPage) NotDone() bool { - return !page.cjslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobScheduleListResultPage) Response() CloudJobScheduleListResult { - return page.cjslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobScheduleListResultPage) Values() []CloudJobSchedule { - if page.cjslr.IsEmpty() { - return nil - } - return *page.cjslr.Value -} - -// CloudPool ... -type CloudPool struct { - autorest.Response `json:"-"` - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id. - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the pool has changed between requests. In particular, you can be pass the ETag when updating a pool to specify that your changes should take effect only if nobody else has modified the pool in the meantime. - ETag *string `json:"eTag,omitempty"` - // LastModified - This is the last time at which the pool level data, such as the targetDedicated or enableAutoscale settings, changed. It does not factor in node-level changes such as a compute node changing state. - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Possible values are: active – The pool is available to run tasks subject to the availability of compute nodes. deleting – The user has requested that the pool be deleted, but the delete operation has not yet completed. upgrading – The user has requested that the operating system of the pool's nodes be upgraded, but the upgrade operation has not yet completed (that is, some nodes in the pool have not yet been upgraded). While upgrading, the pool may be able to run tasks (with reduced capacity) but this is not guaranteed. Possible values include: 'PoolStateActive', 'PoolStateDeleting', 'PoolStateUpgrading' - State PoolState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // AllocationState - Possible values are: steady – The pool is not resizing. There are no changes to the number of nodes in the pool in progress. A pool enters this state when it is created and when no operations are being performed on the pool to change the number of dedicated nodes. resizing - The pool is resizing; that is, compute nodes are being added to or removed from the pool. stopping - The pool was resizing, but the user has requested that the resize be stopped, but the stop request has not yet been completed. Possible values include: 'Steady', 'Resizing', 'Stopping' - AllocationState AllocationState `json:"allocationState,omitempty"` - AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // ResizeTimeout - This is the timeout for the most recent resize operation. (The initial sizing when the pool is created counts as a resize.) The default value is 15 minutes. - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // ResizeError - This property is set only if an error occurred during the last pool resize, and only when the pool allocationState is Steady. - ResizeError *ResizeError `json:"resizeError,omitempty"` - CurrentDedicated *int32 `json:"currentDedicated,omitempty"` - // TargetDedicated - This property is not set if enableAutoScale is true. It is required if enableAutoScale is false. - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // EnableAutoScale - If true, the autoScaleFormula property must be set. If false, the targetDedicated property must be set. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - This property is set only if the pool automatically scales, i.e. enableAutoScale is true. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - This property is set only if the pool automatically scales, i.e. enableAutoScale is true. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // AutoScaleRun - This property is set only if the pool automatically scales, i.e. enableAutoScale is true. - AutoScaleRun *AutoScaleRun `json:"autoScaleRun,omitempty"` - // EnableInterNodeCommunication - This imposes restrictions on which nodes can be assigned to the pool. Specifying this value can reduce the chance of the requested number of nodes to be allocated in the pool. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of remoteuser, a certs directory is created in the user's home directory (e.g., /home//certs) where certificates are placed. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - Metadata *[]MetadataItem `json:"metadata,omitempty"` - Stats *PoolStatistics `json:"stats,omitempty"` -} - -// CloudPoolListResult ... -type CloudPoolListResult struct { - autorest.Response `json:"-"` - Value *[]CloudPool `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudPoolListResultIterator provides access to a complete listing of CloudPool values. -type CloudPoolListResultIterator struct { - i int - page CloudPoolListResultPage -} - -// Next 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 *CloudPoolListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudPoolListResultIterator) 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 CloudPoolListResultIterator) Response() CloudPoolListResult { - 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 CloudPoolListResultIterator) Value() CloudPool { - if !iter.page.NotDone() { - return CloudPool{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cplr CloudPoolListResult) IsEmpty() bool { - return cplr.Value == nil || len(*cplr.Value) == 0 -} - -// cloudPoolListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cplr CloudPoolListResult) cloudPoolListResultPreparer() (*http.Request, error) { - if cplr.OdataNextLink == nil || len(to.String(cplr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cplr.OdataNextLink))) -} - -// CloudPoolListResultPage contains a page of CloudPool values. -type CloudPoolListResultPage struct { - fn func(CloudPoolListResult) (CloudPoolListResult, error) - cplr CloudPoolListResult -} - -// 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. -func (page *CloudPoolListResultPage) Next() error { - next, err := page.fn(page.cplr) - if err != nil { - return err - } - page.cplr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudPoolListResultPage) NotDone() bool { - return !page.cplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudPoolListResultPage) Response() CloudPoolListResult { - return page.cplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudPoolListResultPage) Values() []CloudPool { - if page.cplr.IsEmpty() { - return nil - } - return *page.cplr.Value -} - -// CloudServiceConfiguration ... -type CloudServiceConfiguration struct { - // OsFamily - Possible values are: 2 – OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 – OS Family 3, equivalent to Windows Server 2012. 4 – OS Family 4, equivalent to Windows Server 2012 R2. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). - OsFamily *string `json:"osFamily,omitempty"` - // TargetOSVersion - The default value is * which specifies the latest operating system version for the specified OS family. - TargetOSVersion *string `json:"targetOSVersion,omitempty"` - // CurrentOSVersion - This may differ from targetOSVersion if the pool state is Upgrading. In this case some virtual machines may be on the targetOSVersion and some may be on the currentOSVersion during the upgrade process. Once all virtual machines have upgraded, currentOSVersion is updated to be the same as targetOSVersion. - CurrentOSVersion *string `json:"currentOSVersion,omitempty"` -} - -// CloudTask ... -type CloudTask struct { - autorest.Response `json:"-"` - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the task has changed between requests. In particular, you can be pass the ETag when updating a task to specify that your changes should take effect only if nobody else has modified the task in the meantime. - ETag *string `json:"eTag,omitempty"` - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // ExitConditions - How the Batch service should respond when the task completes. - ExitConditions *ExitConditions `json:"exitConditions,omitempty"` - // State - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - State TaskState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the task is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - PreviousState TaskState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the task is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"` - Constraints *TaskConstraints `json:"constraints,omitempty"` - RunElevated *bool `json:"runElevated,omitempty"` - ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"` - NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"` - MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"` - Stats *TaskStatistics `json:"stats,omitempty"` - // DependsOn - The task will not be scheduled until all depended-on tasks have completed successfully. (If any depended-on tasks fail and exhaust their retry counts, the task will never be scheduled.) - DependsOn *TaskDependencies `json:"dependsOn,omitempty"` - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` -} - -// CloudTaskListResult ... -type CloudTaskListResult struct { - autorest.Response `json:"-"` - Value *[]CloudTask `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudTaskListResultIterator provides access to a complete listing of CloudTask values. -type CloudTaskListResultIterator struct { - i int - page CloudTaskListResultPage -} - -// Next 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 *CloudTaskListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudTaskListResultIterator) 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 CloudTaskListResultIterator) Response() CloudTaskListResult { - 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 CloudTaskListResultIterator) Value() CloudTask { - if !iter.page.NotDone() { - return CloudTask{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (ctlr CloudTaskListResult) IsEmpty() bool { - return ctlr.Value == nil || len(*ctlr.Value) == 0 -} - -// cloudTaskListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ctlr CloudTaskListResult) cloudTaskListResultPreparer() (*http.Request, error) { - if ctlr.OdataNextLink == nil || len(to.String(ctlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ctlr.OdataNextLink))) -} - -// CloudTaskListResultPage contains a page of CloudTask values. -type CloudTaskListResultPage struct { - fn func(CloudTaskListResult) (CloudTaskListResult, error) - ctlr CloudTaskListResult -} - -// 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. -func (page *CloudTaskListResultPage) Next() error { - next, err := page.fn(page.ctlr) - if err != nil { - return err - } - page.ctlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudTaskListResultPage) NotDone() bool { - return !page.ctlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudTaskListResultPage) Response() CloudTaskListResult { - return page.ctlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudTaskListResultPage) Values() []CloudTask { - if page.ctlr.IsEmpty() { - return nil - } - return *page.ctlr.Value -} - -// CloudTaskListSubtasksResult ... -type CloudTaskListSubtasksResult struct { - autorest.Response `json:"-"` - Value *[]SubtaskInformation `json:"value,omitempty"` -} - -// ComputeNode ... -type ComputeNode struct { - autorest.Response `json:"-"` - // ID - Every node that is added to a pool is assigned a unique ID. Whenever a node is removed from a pool, all of its local files are deleted, and the ID is reclaimed and could be reused for new nodes. - ID *string `json:"id,omitempty"` - URL *string `json:"url,omitempty"` - // State - Possible values include: 'Idle', 'Rebooting', 'Reimaging', 'Running', 'Unusable', 'Creating', 'Starting', 'Waitingforstarttask', 'Starttaskfailed', 'Unknown', 'Leavingpool', 'Offline' - State ComputeNodeState `json:"state,omitempty"` - // SchedulingState - Possible values are: enabled – Tasks can be scheduled on the node. disabled – No new tasks will be scheduled on the node. Tasks already running on the node may still run to completion. All nodes start with scheduling enabled. Possible values include: 'Enabled', 'Disabled' - SchedulingState SchedulingState `json:"schedulingState,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // LastBootTime - This property may not be present if the node state is unusable. - LastBootTime *date.Time `json:"lastBootTime,omitempty"` - AllocationTime *date.Time `json:"allocationTime,omitempty"` - // IPAddress - Every node that is added to a pool is assigned a unique IP address. Whenever a node is removed from a pool, all of its local files are deleted, and the IP address is reclaimed and could be reused for new nodes. - IPAddress *string `json:"ipAddress,omitempty"` - AffinityID *string `json:"affinityId,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - TotalTasksRun *int32 `json:"totalTasksRun,omitempty"` - RunningTasksCount *int32 `json:"runningTasksCount,omitempty"` - TotalTasksSucceeded *int32 `json:"totalTasksSucceeded,omitempty"` - RecentTasks *[]TaskInformation `json:"recentTasks,omitempty"` - StartTask *StartTask `json:"startTask,omitempty"` - StartTaskInfo *StartTaskInformation `json:"startTaskInfo,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of remoteuser, a certs directory is created in the user's home directory (e.g., /home//certs) where certificates are placed. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - Errors *[]ComputeNodeError `json:"errors,omitempty"` -} - -// ComputeNodeError ... -type ComputeNodeError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - ErrorDetails *[]NameValuePair `json:"errorDetails,omitempty"` -} - -// ComputeNodeGetRemoteLoginSettingsResult ... -type ComputeNodeGetRemoteLoginSettingsResult struct { - autorest.Response `json:"-"` - RemoteLoginIPAddress *string `json:"remoteLoginIPAddress,omitempty"` - RemoteLoginPort *int32 `json:"remoteLoginPort,omitempty"` -} - -// ComputeNodeInformation ... -type ComputeNodeInformation struct { - AffinityID *string `json:"affinityId,omitempty"` - NodeURL *string `json:"nodeUrl,omitempty"` - PoolID *string `json:"poolId,omitempty"` - NodeID *string `json:"nodeId,omitempty"` - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` -} - -// ComputeNodeListResult ... -type ComputeNodeListResult struct { - autorest.Response `json:"-"` - Value *[]ComputeNode `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// ComputeNodeListResultIterator provides access to a complete listing of ComputeNode values. -type ComputeNodeListResultIterator struct { - i int - page ComputeNodeListResultPage -} - -// Next 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 *ComputeNodeListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ComputeNodeListResultIterator) 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 ComputeNodeListResultIterator) Response() ComputeNodeListResult { - 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 ComputeNodeListResultIterator) Value() ComputeNode { - if !iter.page.NotDone() { - return ComputeNode{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cnlr ComputeNodeListResult) IsEmpty() bool { - return cnlr.Value == nil || len(*cnlr.Value) == 0 -} - -// computeNodeListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cnlr ComputeNodeListResult) computeNodeListResultPreparer() (*http.Request, error) { - if cnlr.OdataNextLink == nil || len(to.String(cnlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cnlr.OdataNextLink))) -} - -// ComputeNodeListResultPage contains a page of ComputeNode values. -type ComputeNodeListResultPage struct { - fn func(ComputeNodeListResult) (ComputeNodeListResult, error) - cnlr ComputeNodeListResult -} - -// 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. -func (page *ComputeNodeListResultPage) Next() error { - next, err := page.fn(page.cnlr) - if err != nil { - return err - } - page.cnlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ComputeNodeListResultPage) NotDone() bool { - return !page.cnlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ComputeNodeListResultPage) Response() ComputeNodeListResult { - return page.cnlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ComputeNodeListResultPage) Values() []ComputeNode { - if page.cnlr.IsEmpty() { - return nil - } - return *page.cnlr.Value -} - -// ComputeNodeUser ... -type ComputeNodeUser struct { - Name *string `json:"name,omitempty"` - // IsAdmin - The default value is false. - IsAdmin *bool `json:"isAdmin,omitempty"` - // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property. - Password *string `json:"password,omitempty"` - // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - SSHPublicKey *string `json:"sshPublicKey,omitempty"` -} - -// DeleteCertificateError ... -type DeleteCertificateError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - // Values - This list includes details such as the active pools and nodes referencing this certificate. However, if a large number of resources reference the certificate, the list contains only about the first hundred. - Values *[]NameValuePair `json:"values,omitempty"` -} - -// EnvironmentSetting ... -type EnvironmentSetting struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -// Error ... -type Error struct { - Code *string `json:"code,omitempty"` - Message *ErrorMessage `json:"message,omitempty"` - Values *[]ErrorDetail `json:"values,omitempty"` -} - -// ErrorDetail ... -type ErrorDetail struct { - Key *string `json:"key,omitempty"` - Value *string `json:"value,omitempty"` -} - -// ErrorMessage ... -type ErrorMessage struct { - Lang *string `json:"lang,omitempty"` - Value *string `json:"value,omitempty"` -} - -// ExitCodeMapping ... -type ExitCodeMapping struct { - Code *int32 `json:"code,omitempty"` - ExitOptions *ExitOptions `json:"exitOptions,omitempty"` -} - -// ExitCodeRangeMapping ... -type ExitCodeRangeMapping struct { - Start *int32 `json:"start,omitempty"` - End *int32 `json:"end,omitempty"` - ExitOptions *ExitOptions `json:"exitOptions,omitempty"` -} - -// ExitConditions ... -type ExitConditions struct { - ExitCodes *[]ExitCodeMapping `json:"exitCodes,omitempty"` - ExitCodeRanges *[]ExitCodeRangeMapping `json:"exitCodeRanges,omitempty"` - SchedulingError *ExitOptions `json:"schedulingError,omitempty"` - // Default - Note that the default condition does not include exit code 0. If you want non-default behaviour on exit code 0, you must list it explicitly using the exitCodes or exitCodeRanges collection. - Default *ExitOptions `json:"default,omitempty"` -} - -// ExitOptions ... -type ExitOptions struct { - // JobAction - The default is none for exit code 0 and terminate for all other exit conditions. It is an error to specify this if the job's onTaskFailed is noaction. The add task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'JobActionNone', 'JobActionDisable', 'JobActionTerminate' - JobAction JobAction `json:"jobAction,omitempty"` -} - -// FileProperties ... -type FileProperties struct { - // CreationTime - The creation time is not returned for files on Linux compute nodes. - CreationTime *date.Time `json:"creationTime,omitempty"` - LastModified *date.Time `json:"lastModified,omitempty"` - ContentLength *int64 `json:"contentLength,omitempty"` - ContentType *string `json:"contentType,omitempty"` - // FileMode - The file mode is returned only for files on Linux compute nodes. - FileMode *string `json:"fileMode,omitempty"` -} - -// ImageReference ... -type ImageReference struct { - // Publisher - For example, Canonical or MicrosoftWindowsServer. - Publisher *string `json:"publisher,omitempty"` - // Offer - For example, UbuntuServer or WindowsServer. - Offer *string `json:"offer,omitempty"` - // Sku - For example, 14.04.0-LTS or 2012-R2-Datacenter. - Sku *string `json:"sku,omitempty"` - // Version - A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. - Version *string `json:"version,omitempty"` -} - -// JobAddParameter ... -type JobAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id. - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. - Priority *int32 `json:"priority,omitempty"` - // Constraints - The execution constraints for the job. - Constraints *JobConstraints `json:"constraints,omitempty"` - // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job. The Job Manager task's typical purpose is to control and/or monitor job execution, for example by deciding what additional tasks to run, determining when the work is complete, etc. (However, a Job Manager task is not restricted to these activities – it is a fully-fledged task in the system and perform whatever actions are required for the job.) For example, a Job Manager task might download a file specified as a parameter, analyze the contents of that file and submit additional tasks based on those contents. - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task. The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a job manager task; if you want to use automatic job termination without a job manager, you should initially set onAllTasksComplete to noaction and update the job properties to set onAllTasksComplete to terminatejob once you have finished adding tasks. Permitted values are: noaction – do nothing. The job remains active unless terminated or disabled by some other means. terminatejob – terminate the job. The job’s terminateReason is set to 'AllTasksComplete'. The default is noaction. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // OnTaskFailure - Permitted values are: noaction – do nothing. performexitoptionsjobaction – take the action associated with the task exit condition in the task's exitConditions collection. (This may still result in no action being taken, if that is what the task specifies.) The default is noaction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction' - OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` -} - -// JobConstraints ... -type JobConstraints struct { - // MaxWallClockTime - If the job does not complete within the time limit, the Batch service terminates it and any tasks that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry. If this property is not specified, there is no time limit on how long the job may run. - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try each task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry tasks. If the maximum retry count is -1, the Batch service retries tasks without limit. The default value is 0 (no retries). - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` -} - -// JobDisableParameter ... -type JobDisableParameter struct { - // DisableTasks - Possible values are: requeue – Terminate running tasks and requeue them. The tasks will run again when the job is enabled. terminate – Terminate running tasks. The tasks will not run again. wait – Allow currently running tasks to complete. Possible values include: 'DisableJobOptionRequeue', 'DisableJobOptionTerminate', 'DisableJobOptionWait' - DisableTasks DisableJobOption `json:"disableTasks,omitempty"` -} - -// JobExecutionInformation ... -type JobExecutionInformation struct { - // StartTime - This is the time at which the job was created. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the job is in the completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // PoolID - This element contains the actual pool where the job is assigned. When you get job details from the service, they also contain a poolInfo element, which contains the pool configuration data from when the job was added or updated. That poolInfo element may also contain a poolId element. If it does, the two IDs are the same. If it does not, it means the job ran on an auto pool, and this property contains the id of that auto pool. - PoolID *string `json:"poolId,omitempty"` - // SchedulingError - This property is not set if there was no error starting the job. - SchedulingError *JobSchedulingError `json:"schedulingError,omitempty"` - // TerminateReason - This property is set only if the job is in the completed state. If the Batch service terminates the job, it sets the reason as follows: JMComplete – the Job Manager task completed, and killJobOnCompletion was set to true. MaxWallClockTimeExpiry – the job reached its maxWallClockTime constraint. TerminateJobSchedule – the job ran as part of a schedule, and the schedule terminated. AllTasksComplete – the job's onAllTasksComplete attribute is set to terminatejob, and all tasks in the job are complete. TaskFailed – the job's onTaskFailure attribute is set to performexitoptionsjobaction, and a task in the job failed with an exit condition that specified a jobAction of terminatejob. Any other string is a user-defined reason specified in a call to the 'Terminate a job' operation. - TerminateReason *string `json:"terminateReason,omitempty"` -} - -// JobManagerTask ... -type JobManagerTask struct { - // ID - The id can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - It need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Files listed under this element are located in the task's working directory. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - Constraints *TaskConstraints `json:"constraints,omitempty"` - // KillJobOnCompletion - If true, when the Job Manager task completes, the Batch service marks the job as complete. If any tasks are still running at this time (other than Job Release), those tasks are terminated. If false, the completion of the Job Manager task does not affect the job status. In this case, you should either use the onAllTasksComplete attribute to terminate the job, or have a client or user terminate the job explicitly. An example of this is if the Job Manager creates a set of tasks but then takes no further role in their execution. The default value is true. If you are using the onAllTasksComplete and onTaskFailure attributes to control job lifetime, and using the job manager task only to create the tasks for the job (not to monitor progress), then it is important to set killJobOnCompletion to false. - KillJobOnCompletion *bool `json:"killJobOnCompletion,omitempty"` - RunElevated *bool `json:"runElevated,omitempty"` - // RunExclusive - If true, no other tasks will run on the same compute node for as long as the Job Manager is running. If false, other tasks can run simultaneously with the Job Manager on a compute node. The Job Manager task counts normally against the node's concurrent task limit, so this is only relevant if the node allows multiple concurrent tasks. The default value is true. - RunExclusive *bool `json:"runExclusive,omitempty"` - // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails with a scheduling error. This property is currently not supported on jobs running on pools created using the virtualMachineConfiguration (IaaS) property. If a task specifying applicationPackageReferences runs on such a pool, it fails with a scheduling error with code TaskSchedulingConstraintFailed. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` -} - -// JobPatchParameter ... -type JobPatchParameter struct { - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged. - Priority *int32 `json:"priority,omitempty"` - // OnAllTasksComplete - If omitted, the completion behavior is left unchanged. You may not change the value from terminatejob to noaction – that is, once you have engaged automatic job termination, you cannot turn it off again. If you try to do this, the request fails with an 'invalid property value' error response; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // Constraints - If omitted, the existing execution constraints are left unchanged. - Constraints *JobConstraints `json:"constraints,omitempty"` - // PoolInfo - You may change the pool for a job only when the job is disabled. The Patch Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. If omitted, the job continues to run on its current pool. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - If omitted, the existing job metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobPreparationAndReleaseTaskExecutionInformation ... -type JobPreparationAndReleaseTaskExecutionInformation struct { - PoolID *string `json:"poolId,omitempty"` - NodeID *string `json:"nodeId,omitempty"` - NodeURL *string `json:"nodeUrl,omitempty"` - JobPreparationTaskExecutionInfo *JobPreparationTaskExecutionInformation `json:"jobPreparationTaskExecutionInfo,omitempty"` - // JobReleaseTaskExecutionInfo - This property is set only if the Job Release task has run on the node. - JobReleaseTaskExecutionInfo *JobReleaseTaskExecutionInformation `json:"jobReleaseTaskExecutionInfo,omitempty"` -} - -// JobPreparationTask ... -type JobPreparationTask struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobpreparation'. No other task in the job can have the same id as the Job Preparation task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobPreparationTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). - ID *string `json:"id,omitempty"` - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Files listed under this element are located in the task's working directory. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - Constraints *TaskConstraints `json:"constraints,omitempty"` - // WaitForSuccess - If true and the Job Preparation task fails on a compute node, the Batch service retries the Job Preparation task up to its maximum retry count (as specified in the constraints element). If the task has still not completed successfully after all retries, then the Batch service will not schedule tasks of the job to the compute node. The compute node remains active and eligible to run tasks of other jobs. If false, the Batch service will not wait for the Job Preparation task to complete. In this case, other tasks of the job can start executing on the compute node while the Job Preparation task is still running; and even if the Job Preparation task fails, new tasks will continue to be scheduled on the node. The default value is true. - WaitForSuccess *bool `json:"waitForSuccess,omitempty"` - RunElevated *bool `json:"runElevated,omitempty"` - // RerunOnNodeRebootAfterSuccess - The Job Preparation task is always rerun if a compute node is reimaged, or if the Job Preparation task did not complete (e.g. because the reboot occurred while the task was running). Therefore, you should always write a Job Preparation task to be idempotent and to behave correctly if run multiple times. The default value is true. - RerunOnNodeRebootAfterSuccess *bool `json:"rerunOnNodeRebootAfterSuccess,omitempty"` -} - -// JobPreparationTaskExecutionInformation ... -type JobPreparationTaskExecutionInformation struct { - // StartTime - Note that every time the task is restarted, this value is updated. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // State - Possible values are: running – the task is currently running (including retrying). completed – the task has exited with exit code 0, or the task has exhausted its retry limit, or the Batch service was unable to start the task due to scheduling errors. Possible values include: 'JobPreparationTaskStateRunning', 'JobPreparationTaskStateCompleted' - State JobPreparationTaskState `json:"state,omitempty"` - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` - // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated. - ExitCode *int32 `json:"exitCode,omitempty"` - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - This property is set only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` -} - -// JobReleaseTask ... -type JobReleaseTask struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other task in the job can have the same id as the Job Release task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). - ID *string `json:"id,omitempty"` - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Files listed under this element are located in the task's working directory. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged. - RetentionTime *string `json:"retentionTime,omitempty"` - // RunElevated - The default value is false. - RunElevated *bool `json:"runElevated,omitempty"` -} - -// JobReleaseTaskExecutionInformation ... -type JobReleaseTaskExecutionInformation struct { - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // State - Possible values are: running – the task is currently running (including retrying). completed – the task has exited, or the Batch service was unable to start the task due to scheduling errors. Possible values include: 'JobReleaseTaskStateRunning', 'JobReleaseTaskStateCompleted' - State JobReleaseTaskState `json:"state,omitempty"` - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` - // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated. - ExitCode *int32 `json:"exitCode,omitempty"` - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` -} - -// JobScheduleAddParameter ... -type JobScheduleAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The id is case-preserving and case-insensitive (that is, you may not have two ids within an account that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - Schedule *Schedule `json:"schedule,omitempty"` - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobScheduleExecutionInformation ... -type JobScheduleExecutionInformation struct { - // NextRunTime - This property is meaningful only if the schedule is in the active state when the time comes around. For example, if the schedule is disabled, no job will be created at nextRunTime unless the job is enabled before then. - NextRunTime *date.Time `json:"nextRunTime,omitempty"` - // RecentJob - This property is present only if the at least one job has run under the schedule. - RecentJob *RecentJob `json:"recentJob,omitempty"` - // EndTime - This property is set only if the job schedule is in the completed state. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// JobSchedulePatchParameter ... -type JobSchedulePatchParameter struct { - // Schedule - If you do not specify this element, the existing schedule is left unchanged. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - If you do not specify this element, existing metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobScheduleStatistics ... -type JobScheduleStatistics struct { - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UserCPUTime *string `json:"userCPUTime,omitempty"` - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If a task was retried, this includes the wall clock time of all the task retries. - WallClockTime *string `json:"wallClockTime,omitempty"` - ReadIOps *int64 `json:"readIOps,omitempty"` - WriteIOps *int64 `json:"writeIOps,omitempty"` - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"` - NumFailedTasks *int64 `json:"numFailedTasks,omitempty"` - NumTaskRetries *int64 `json:"numTaskRetries,omitempty"` - // WaitTime - This value is only reported in the account lifetime statistics; it is not included in the job statistics. - WaitTime *string `json:"waitTime,omitempty"` -} - -// JobScheduleUpdateParameter ... -type JobScheduleUpdateParameter struct { - // Schedule - If you do not specify this element, it is equivalent to passing the default schedule: that is, a single job scheduled to run immediately. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - If you do not specify this element, it takes the default value of an empty list; in effect, any existing metadata is deleted. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobSchedulingError ... -type JobSchedulingError struct { - // Category - Possible values include: 'SchedulingErrorCategoryUsererror', 'SchedulingErrorCategoryServererror', 'SchedulingErrorCategoryUnmapped' - Category SchedulingErrorCategory `json:"category,omitempty"` - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Details *[]NameValuePair `json:"details,omitempty"` -} - -// JobSpecification ... -type JobSpecification struct { - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. This priority is used as the default for all jobs under the job schedule. You can update a job's priority after it has been created using by using the update job API. - Priority *int32 `json:"priority,omitempty"` - // DisplayName - The name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` - // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a job manager task; if you want to use automatic job termination without a job manager, you should initially set onAllTasksComplete to noaction and update the job properties to set onAllTasksComplete to terminatejob once you have finished adding tasks. The default is noaction. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // OnTaskFailure - The default is noaction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction' - OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"` - Constraints *JobConstraints `json:"constraints,omitempty"` - // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job using the Task API. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job. - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation. A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value. - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobStatistics ... -type JobStatistics struct { - autorest.Response `json:"-"` - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UserCPUTime *string `json:"userCPUTime,omitempty"` - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - WallClockTime *string `json:"wallClockTime,omitempty"` - ReadIOps *int64 `json:"readIOps,omitempty"` - WriteIOps *int64 `json:"writeIOps,omitempty"` - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - // NumSucceededTasks - A task completes successfully if it returns exit code 0. - NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"` - // NumFailedTasks - A task fails if it exhausts its maximum retry count without returning exit code 0. - NumFailedTasks *int64 `json:"numFailedTasks,omitempty"` - NumTaskRetries *int64 `json:"numTaskRetries,omitempty"` - // WaitTime - The wait time for a task is defined as the elapsed time between the creation of the task and the start of task execution. (If the task is retried due to failures, the wait time is the time to the most recent task execution.) This value is only reported in the account lifetime statistics; it is not included in the job statistics. - WaitTime *string `json:"waitTime,omitempty"` -} - -// JobTerminateParameter ... -type JobTerminateParameter struct { - TerminateReason *string `json:"terminateReason,omitempty"` -} - -// JobUpdateParameter ... -type JobUpdateParameter struct { - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, it is set to the default value 0. - Priority *int32 `json:"priority,omitempty"` - // Constraints - If omitted, the constraints are cleared. - Constraints *JobConstraints `json:"constraints,omitempty"` - // PoolInfo - You may change the pool for a job only when the job is disabled. The Update Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - If omitted, it takes the default value of an empty list; in effect, any existing metadata is deleted. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - // OnAllTasksComplete - If omitted, the completion behavior is set to noaction. If the current value is terminatejob, this is an error because a job's completion behavior may not be changed from terminatejob to noaction. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` -} - -// MetadataItem the Batch service does not assign any meaning to this metadata; it is solely for the use of user -// code. -type MetadataItem struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -// MultiInstanceSettings multi-instance tasks are commonly used to support MPI tasks. -type MultiInstanceSettings struct { - NumberOfInstances *int32 `json:"numberOfInstances,omitempty"` - // CoordinationCommandLine - A typical coordination command line launches a background service and verifies that the service is ready to process inter-node messages. - CoordinationCommandLine *string `json:"coordinationCommandLine,omitempty"` - // CommonResourceFiles - The difference between common resource files and task resource files is that common resource files are downloaded for all subtasks including the primary, whereas task resource files are downloaded only for the primary. - CommonResourceFiles *[]ResourceFile `json:"commonResourceFiles,omitempty"` -} - -// NameValuePair ... -type NameValuePair struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -// NetworkConfiguration the network configuration for a pool. -type NetworkConfiguration struct { - // SubnetID - The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. This property can only be specified for pools created with a cloudServiceConfiguration. - SubnetID *string `json:"subnetId,omitempty"` -} - -// NodeAgentSku the Batch node agent is a program that runs on each node in the pool, and provides the -// command-and-control interface between the node and the Batch service. There are different implementations of the -// node agent, known as SKUs, for different operating systems. -type NodeAgentSku struct { - ID *string `json:"id,omitempty"` - // VerifiedImageReferences - This collection is not exhaustive (the node agent may be compatible with other images). - VerifiedImageReferences *[]ImageReference `json:"verifiedImageReferences,omitempty"` - // OsType - Possible values include: 'OSTypeLinux', 'OSTypeWindows', 'OSTypeUnmapped' - OsType OSType `json:"osType,omitempty"` -} - -// NodeDisableSchedulingParameter ... -type NodeDisableSchedulingParameter struct { - // NodeDisableSchedulingOption - The default value is requeue. Possible values include: 'DisableComputeNodeSchedulingOptionRequeue', 'DisableComputeNodeSchedulingOptionTerminate', 'DisableComputeNodeSchedulingOptionTaskcompletion' - NodeDisableSchedulingOption DisableComputeNodeSchedulingOption `json:"nodeDisableSchedulingOption,omitempty"` -} - -// NodeFile ... -type NodeFile struct { - Name *string `json:"name,omitempty"` - URL *string `json:"url,omitempty"` - IsDirectory *bool `json:"isDirectory,omitempty"` - Properties *FileProperties `json:"properties,omitempty"` -} - -// NodeFileListResult ... -type NodeFileListResult struct { - autorest.Response `json:"-"` - Value *[]NodeFile `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// NodeFileListResultIterator provides access to a complete listing of NodeFile values. -type NodeFileListResultIterator struct { - i int - page NodeFileListResultPage -} - -// Next 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 *NodeFileListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter NodeFileListResultIterator) 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 NodeFileListResultIterator) Response() NodeFileListResult { - 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 NodeFileListResultIterator) Value() NodeFile { - if !iter.page.NotDone() { - return NodeFile{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (nflr NodeFileListResult) IsEmpty() bool { - return nflr.Value == nil || len(*nflr.Value) == 0 -} - -// nodeFileListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (nflr NodeFileListResult) nodeFileListResultPreparer() (*http.Request, error) { - if nflr.OdataNextLink == nil || len(to.String(nflr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(nflr.OdataNextLink))) -} - -// NodeFileListResultPage contains a page of NodeFile values. -type NodeFileListResultPage struct { - fn func(NodeFileListResult) (NodeFileListResult, error) - nflr NodeFileListResult -} - -// 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. -func (page *NodeFileListResultPage) Next() error { - next, err := page.fn(page.nflr) - if err != nil { - return err - } - page.nflr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page NodeFileListResultPage) NotDone() bool { - return !page.nflr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page NodeFileListResultPage) Response() NodeFileListResult { - return page.nflr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page NodeFileListResultPage) Values() []NodeFile { - if page.nflr.IsEmpty() { - return nil - } - return *page.nflr.Value -} - -// NodeRebootParameter ... -type NodeRebootParameter struct { - // NodeRebootOption - The default value is requeue. Possible values include: 'ComputeNodeRebootOptionRequeue', 'ComputeNodeRebootOptionTerminate', 'ComputeNodeRebootOptionTaskcompletion', 'ComputeNodeRebootOptionRetaineddata' - NodeRebootOption ComputeNodeRebootOption `json:"nodeRebootOption,omitempty"` -} - -// NodeReimageParameter ... -type NodeReimageParameter struct { - // NodeReimageOption - The default value is requeue. Possible values include: 'ComputeNodeReimageOptionRequeue', 'ComputeNodeReimageOptionTerminate', 'ComputeNodeReimageOptionTaskcompletion', 'ComputeNodeReimageOptionRetaineddata' - NodeReimageOption ComputeNodeReimageOption `json:"nodeReimageOption,omitempty"` -} - -// NodeRemoveParameter ... -type NodeRemoveParameter struct { - NodeList *[]string `json:"nodeList,omitempty"` - // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'Taskcompletion', 'Retaineddata' - NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"` -} - -// NodeUpdateUserParameter ... -type NodeUpdateUserParameter struct { - // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is removed. - Password *string `json:"password,omitempty"` - // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If omitted, any existing SSH public key is removed. - SSHPublicKey *string `json:"sshPublicKey,omitempty"` -} - -// PoolAddParameter ... -type PoolAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two pool IDs within an account that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // TargetDedicated - This property must have the default value if enableAutoScale is true. It is required if enableAutoScale is false. - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // EnableAutoScale - If true, the autoScaleFormula property must be set. If false, the targetDedicated property must be set. The default value is false. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale compute nodes in an Azure Batch pool' (https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/). - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` - // StartTask - The task runs when the node is added to the pool or when the node is restarted. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of remoteuser, a certs directory is created in the user's home directory (e.g., /home//certs) where certificates are placed. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - This property is currently not supported on pools created using the virtualMachineConfiguration (IaaS) property. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting). - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolEnableAutoScaleParameter ... -type PoolEnableAutoScaleParameter struct { - // AutoScaleFormula - The formula is checked for validity before it is applied to the pool. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` -} - -// PoolEvaluateAutoScaleParameter ... -type PoolEvaluateAutoScaleParameter struct { - // AutoScaleFormula - The formula is validated and its results calculated, but it is not applied to the pool. To apply the formula to the pool, 'Enable automatic scaling on a pool'. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` -} - -// PoolInformation ... -type PoolInformation struct { - // PoolID - You must ensure that the pool referenced by this property exists. If the pool does not exist at the time the Batch service tries to schedule a job, no tasks for the job will run until you create a pool with that id. Note that the Batch service will not reject the job request; it will simply not run tasks until the pool exists. You must specify either the pool ID or the auto pool specification, but not both. - PoolID *string `json:"poolId,omitempty"` - // AutoPoolSpecification - If auto pool creation fails, the Batch service moves the job to a completed state, and the pool creation error is set in the job's scheduling error property. The Batch service manages the lifetime (both creation and, unless keepAlive is specified, deletion) of the auto pool. Any user actions that affect the lifetime of the auto pool while the job is active will result in unexpected behavior. You must specify either the pool ID or the auto pool specification, but not both. - AutoPoolSpecification *AutoPoolSpecification `json:"autoPoolSpecification,omitempty"` -} - -// PoolListPoolUsageMetricsResult ... -type PoolListPoolUsageMetricsResult struct { - autorest.Response `json:"-"` - Value *[]PoolUsageMetrics `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// PoolListPoolUsageMetricsResultIterator provides access to a complete listing of PoolUsageMetrics values. -type PoolListPoolUsageMetricsResultIterator struct { - i int - page PoolListPoolUsageMetricsResultPage -} - -// Next 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 *PoolListPoolUsageMetricsResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PoolListPoolUsageMetricsResultIterator) 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 PoolListPoolUsageMetricsResultIterator) Response() PoolListPoolUsageMetricsResult { - 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 PoolListPoolUsageMetricsResultIterator) Value() PoolUsageMetrics { - if !iter.page.NotDone() { - return PoolUsageMetrics{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (plpumr PoolListPoolUsageMetricsResult) IsEmpty() bool { - return plpumr.Value == nil || len(*plpumr.Value) == 0 -} - -// poolListPoolUsageMetricsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (plpumr PoolListPoolUsageMetricsResult) poolListPoolUsageMetricsResultPreparer() (*http.Request, error) { - if plpumr.OdataNextLink == nil || len(to.String(plpumr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(plpumr.OdataNextLink))) -} - -// PoolListPoolUsageMetricsResultPage contains a page of PoolUsageMetrics values. -type PoolListPoolUsageMetricsResultPage struct { - fn func(PoolListPoolUsageMetricsResult) (PoolListPoolUsageMetricsResult, error) - plpumr PoolListPoolUsageMetricsResult -} - -// 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. -func (page *PoolListPoolUsageMetricsResultPage) Next() error { - next, err := page.fn(page.plpumr) - if err != nil { - return err - } - page.plpumr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PoolListPoolUsageMetricsResultPage) NotDone() bool { - return !page.plpumr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PoolListPoolUsageMetricsResultPage) Response() PoolListPoolUsageMetricsResult { - return page.plpumr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PoolListPoolUsageMetricsResultPage) Values() []PoolUsageMetrics { - if page.plpumr.IsEmpty() { - return nil - } - return *page.plpumr.Value -} - -// PoolPatchParameter ... -type PoolPatchParameter struct { - // StartTask - If omitted, any existing start task is left unchanged. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - If omitted, any existing certificate references are left unchanged. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of remoteuser, a certs directory is created in the user's home directory (e.g., /home//certs) where certificates are placed. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. If this element is present, it replaces any existing application package references. If you specify an empty collection, then all application package references are removed from the pool. If omitted, any existing application package references are left unchanged. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - If this element is present, it replaces any existing metadata configured on the pool. If you specify an empty collection, any metadata is removed from the pool. If omitted, any existing metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolResizeParameter ... -type PoolResizeParameter struct { - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'Taskcompletion', 'Retaineddata' - NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"` -} - -// PoolSpecification ... -type PoolSpecification struct { - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - This property must be specified if the pool needs to be created with Azure PaaS VMs. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - This property must be specified if the pool needs to be created with Azure IaaS VMs. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting). - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - // TaskSchedulingPolicy - How tasks are distributed among compute nodes in the pool. - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // TargetDedicated - This property must not be specified if enableAutoScale is set to true. It is required if enableAutoScale is set to false. - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // EnableAutoScale - If false, the targetDedicated element is required. If true, the autoScaleFormula element is required. The pool automatically resizes according to the formula. The default value is false. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of remoteuser, a certs directory is created in the user's home directory (e.g., /home//certs) where certificates are placed. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - This property is currently not supported on auto pools created with the virtualMachineConfiguration (IaaS) property. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolStatistics ... -type PoolStatistics struct { - autorest.Response `json:"-"` - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UsageStats *UsageStatistics `json:"usageStats,omitempty"` - ResourceStats *ResourceStatistics `json:"resourceStats,omitempty"` -} - -// PoolUpdatePropertiesParameter ... -type PoolUpdatePropertiesParameter struct { - // StartTask - If this element is present, it overwrites any existing start task. If omitted, any existing start task is removed from the pool. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - If you specify an empty collection, any existing certificate references are removed from the pool. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of remoteuser, a certs directory is created in the user's home directory (e.g., /home//certs) where certificates are placed. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. The list replaces any existing application package references. If omitted, or if you specify an empty collection, any existing application packages references are removed from the pool. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - This list replaces any existing metadata configured on the pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the pool. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolUpgradeOSParameter ... -type PoolUpgradeOSParameter struct { - TargetOSVersion *string `json:"targetOSVersion,omitempty"` -} - -// PoolUsageMetrics ... -type PoolUsageMetrics struct { - PoolID *string `json:"poolId,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - EndTime *date.Time `json:"endTime,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - TotalCoreHours *float64 `json:"totalCoreHours,omitempty"` - DataIngressGiB *float64 `json:"dataIngressGiB,omitempty"` - DataEgressGiB *float64 `json:"dataEgressGiB,omitempty"` -} - -// ReadCloser ... -type ReadCloser struct { - autorest.Response `json:"-"` - Value *io.ReadCloser `json:"value,omitempty"` -} - -// RecentJob ... -type RecentJob struct { - ID *string `json:"id,omitempty"` - URL *string `json:"url,omitempty"` -} - -// ResizeError ... -type ResizeError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Values *[]NameValuePair `json:"values,omitempty"` -} - -// ResourceFile ... -type ResourceFile struct { - // BlobSource - This URL must be readable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, or set the ACL for the blob or its container to allow public access. - BlobSource *string `json:"blobSource,omitempty"` - FilePath *string `json:"filePath,omitempty"` - // FileMode - This property applies only to files being downloaded to Linux compute nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows node. If this property is not specified for a Linux node, then a default value of 0770 is applied to the file. - FileMode *string `json:"fileMode,omitempty"` -} - -// ResourceStatistics ... -type ResourceStatistics struct { - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - AvgCPUPercentage *float64 `json:"avgCPUPercentage,omitempty"` - AvgMemoryGiB *float64 `json:"avgMemoryGiB,omitempty"` - PeakMemoryGiB *float64 `json:"peakMemoryGiB,omitempty"` - AvgDiskGiB *float64 `json:"avgDiskGiB,omitempty"` - PeakDiskGiB *float64 `json:"peakDiskGiB,omitempty"` - DiskReadIOps *int64 `json:"diskReadIOps,omitempty"` - DiskWriteIOps *int64 `json:"diskWriteIOps,omitempty"` - DiskReadGiB *float64 `json:"diskReadGiB,omitempty"` - DiskWriteGiB *float64 `json:"diskWriteGiB,omitempty"` - NetworkReadGiB *float64 `json:"networkReadGiB,omitempty"` - NetworkWriteGiB *float64 `json:"networkWriteGiB,omitempty"` -} - -// Schedule ... -type Schedule struct { - // DoNotRunUntil - If you do not specify a doNotRunUntil time, the schedule becomes ready to create jobs immediately. - DoNotRunUntil *date.Time `json:"doNotRunUntil,omitempty"` - // DoNotRunAfter - If you do not specify a doNotRunAfter time, and you are creating a recurring job schedule, the job schedule will remain active until you explicitly terminate it. - DoNotRunAfter *date.Time `json:"doNotRunAfter,omitempty"` - // StartWindow - If a job is not created within the startWindow interval, then the 'opportunity' is lost; no job will be created until the next recurrence of the schedule. If the schedule is recurring, and the startWindow is longer than the recurrence interval, then this is equivalent to an infinite startWindow, because the job that is 'due' in one recurrenceInterval is not carried forward into the next recurrence interval. The default is infinite. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - StartWindow *string `json:"startWindow,omitempty"` - // RecurrenceInterval - Because a job schedule can have at most one active job under it at any given time, if it is time to create a new job under a job schedule, but the previous job is still running, the Batch service will not create the new job until the previous job finishes. If the previous job does not finish within the startWindow period of the new recurrenceInterval, then no new job will be scheduled for that interval. For recurring jobs, you should normally specify a jobManagerTask in the jobSpecification. If you do not use jobManagerTask, you will need an external process to monitor when jobs are created, add tasks to the jobs and terminate the jobs ready for the next recurrence. The default is that the schedule does not recur: one job is created, within the startWindow after the doNotRunUntil time, and the schedule is complete as soon as that job finishes. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - RecurrenceInterval *string `json:"recurrenceInterval,omitempty"` -} - -// StartTask ... -type StartTask struct { - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - RunElevated *bool `json:"runElevated,omitempty"` - // MaxTaskRetryCount - The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` - // WaitForSuccess - If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and scheduling error detail. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is false. - WaitForSuccess *bool `json:"waitForSuccess,omitempty"` -} - -// StartTaskInformation ... -type StartTaskInformation struct { - // State - Possible values are: running – The start task is currently running. completed – The start task has exited with exit code 0, or the start task has failed and the retry limit has reached, or the start task process did not run due to scheduling errors. Possible values include: 'StartTaskStateRunning', 'StartTaskStateCompleted' - State StartTaskState `json:"state,omitempty"` - // StartTime - This value is reset every time the task is restarted or retried (that is, this is the most recent time at which the start task started running). - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This is the end time of the most recent run of the start task, if that run has completed (even if that run failed and a retry is pending). This element is not present if the start task is currently running. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - This property is set only if the start task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the start task (due to timeout, or user termination via the API) you may see an operating system-defined exit code. - ExitCode *int32 `json:"exitCode,omitempty"` - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - // RetryCount - The task is retried if it exits with a nonzero exit code, up to the specified MaxTaskRetryCount. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` -} - -// SubtaskInformation ... -type SubtaskInformation struct { - ID *int32 `json:"id,omitempty"` - NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the subtask is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - This property is set only if the subtask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the subtask (due to timeout, or user termination via the API) you may see an operating system-defined exit code. - ExitCode *int32 `json:"exitCode,omitempty"` - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - // State - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - State TaskState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the subtask is in its initial running state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - PreviousState TaskState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the subtask is in its initial running state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` -} - -// TaskAddCollectionParameter ... -type TaskAddCollectionParameter struct { - Value *[]TaskAddParameter `json:"value,omitempty"` -} - -// TaskAddCollectionResult ... -type TaskAddCollectionResult struct { - autorest.Response `json:"-"` - Value *[]TaskAddResult `json:"value,omitempty"` -} - -// TaskAddParameter ... -type TaskAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a job that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ExitConditions - How the Batch service should respond when the task completes. - ExitConditions *ExitConditions `json:"exitConditions,omitempty"` - // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"` - // Constraints - If you do not specify constraints, the maxTaskRetryCount is the maxTaskRetryCount specified for the job, and the maxWallClockTime and retentionTime are infinite. - Constraints *TaskConstraints `json:"constraints,omitempty"` - // RunElevated - The default value is false. - RunElevated *bool `json:"runElevated,omitempty"` - MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"` - // DependsOn - The task will not be scheduled until all depended-on tasks have completed successfully. (If any depended-on tasks fail and exhaust their retry counts, the task will never be scheduled.) If the job does not have usesTaskDependencies set to true, and this element is present, the request fails with error code TaskDependenciesNotSpecifiedOnJob. - DependsOn *TaskDependencies `json:"dependsOn,omitempty"` - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` -} - -// TaskAddResult ... -type TaskAddResult struct { - // Status - Possible values include: 'TaskAddStatusSuccess', 'TaskAddStatusClienterror', 'TaskAddStatusServererror', 'TaskAddStatusUnmapped' - Status TaskAddStatus `json:"status,omitempty"` - TaskID *string `json:"taskId,omitempty"` - ETag *string `json:"eTag,omitempty"` - LastModified *date.Time `json:"lastModified,omitempty"` - Location *string `json:"location,omitempty"` - Error *Error `json:"error,omitempty"` -} - -// TaskConstraints ... -type TaskConstraints struct { - // MaxWallClockTime - If this is not specified, there is no time limit on how long the task may run. - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged. - RetentionTime *string `json:"retentionTime,omitempty"` - // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` -} - -// TaskDependencies ... -type TaskDependencies struct { - TaskIds *[]string `json:"taskIds,omitempty"` - TaskIDRanges *[]TaskIDRange `json:"taskIdRanges,omitempty"` -} - -// TaskExecutionInformation ... -type TaskExecutionInformation struct { - // StartTime - 'Running' corresponds to the running state, so if the task specifies resource files or application packages, then the start time reflects the time at which the task started downloading or deploying these. If the task has been restarted or retried, this is the most recent time at which the task started running. This property is present only for tasks that are in the running or completed state. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - This property is set only if the task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the task (due to timeout, or user termination via the API) you may see an operating system-defined exit code. - ExitCode *int32 `json:"exitCode,omitempty"` - // SchedulingError - This property is set only if the task is in the completed state. - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - // RetryCount - The task is retried if it exits with a nonzero exit code, up to the specified maxTaskRetryCount. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` - // RequeueCount - When the user removes nodes from a pool (by resizing/shrinking the pool) or when the job is being disabled, the user can specify that running tasks on the nodes be requeued for execution. This count tracks how many times the task has been requeued for these reasons. - RequeueCount *int32 `json:"requeueCount,omitempty"` - // LastRequeueTime - This property is set only if the requeueCount is nonzero. - LastRequeueTime *date.Time `json:"lastRequeueTime,omitempty"` -} - -// TaskIDRange the start and end of the range are inclusive. For example, if a range has start 9 and end 12, then -// it represents tasks '9', '10', '11' and '12'. -type TaskIDRange struct { - Start *int32 `json:"start,omitempty"` - End *int32 `json:"end,omitempty"` -} - -// TaskInformation ... -type TaskInformation struct { - TaskURL *string `json:"taskUrl,omitempty"` - JobID *string `json:"jobId,omitempty"` - TaskID *string `json:"taskId,omitempty"` - SubtaskID *int32 `json:"subtaskId,omitempty"` - // TaskState - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - TaskState TaskState `json:"taskState,omitempty"` - ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"` -} - -// TaskSchedulingError ... -type TaskSchedulingError struct { - // Category - Possible values include: 'SchedulingErrorCategoryUsererror', 'SchedulingErrorCategoryServererror', 'SchedulingErrorCategoryUnmapped' - Category SchedulingErrorCategory `json:"category,omitempty"` - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Details *[]NameValuePair `json:"details,omitempty"` -} - -// TaskSchedulingPolicy ... -type TaskSchedulingPolicy struct { - // NodeFillType - Possible values include: 'ComputeNodeFillTypeSpread', 'ComputeNodeFillTypePack', 'ComputeNodeFillTypeUnmapped' - NodeFillType ComputeNodeFillType `json:"nodeFillType,omitempty"` -} - -// TaskStatistics ... -type TaskStatistics struct { - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UserCPUTime *string `json:"userCPUTime,omitempty"` - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If the task was retried, this includes the wall clock time of all the task retries. - WallClockTime *string `json:"wallClockTime,omitempty"` - ReadIOps *int64 `json:"readIOps,omitempty"` - WriteIOps *int64 `json:"writeIOps,omitempty"` - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - WaitTime *string `json:"waitTime,omitempty"` -} - -// TaskUpdateParameter ... -type TaskUpdateParameter struct { - // Constraints - If omitted, the task is given the default constraints. - Constraints *TaskConstraints `json:"constraints,omitempty"` -} - -// UsageStatistics ... -type UsageStatistics struct { - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - DedicatedCoreTime *string `json:"dedicatedCoreTime,omitempty"` -} - -// VirtualMachineConfiguration ... -type VirtualMachineConfiguration struct { - ImageReference *ImageReference `json:"imageReference,omitempty"` - // NodeAgentSKUID - The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation. - NodeAgentSKUID *string `json:"nodeAgentSKUId,omitempty"` - // WindowsConfiguration - This property must not be specified if the imageReference property specifies a Linux OS image. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` -} - -// WindowsConfiguration ... -type WindowsConfiguration struct { - // EnableAutomaticUpdates - If omitted, the default value is true. - EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` -} diff --git a/services/batch/2016-07-01.3.1/batch/pool.go b/services/batch/2016-07-01.3.1/batch/pool.go deleted file mode 100644 index a7f5f70c77bd..000000000000 --- a/services/batch/2016-07-01.3.1/batch/pool.go +++ /dev/null @@ -1,1842 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// PoolClient is the a client for issuing REST requests to the Azure Batch service. -type PoolClient struct { - BaseClient -} - -// NewPoolClient creates an instance of the PoolClient client. -func NewPoolClient() PoolClient { - return NewPoolClientWithBaseURI(DefaultBaseURI) -} - -// NewPoolClientWithBaseURI creates an instance of the PoolClient client. -func NewPoolClientWithBaseURI(baseURI string) PoolClient { - return PoolClient{NewWithBaseURI(baseURI)} -} - -// Add when naming pools, avoid including sensitive information such as user names or secret project names. This -// information may appear in telemetry logs accessible to Microsoft Support engineers. -// -// pool is the pool to be added. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -func (client PoolClient) Add(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: pool, - Constraints: []validation.Constraint{{Target: "pool.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, pool, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client PoolClient) AddPreparer(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/pools"), - autorest.WithJSON(pool), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 PoolClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete when you request that a pool be deleted, the following actions occur: the pool state is set to deleting; any -// ongoing resize operation on the pool are stopped; the Batch service starts resizing the pool to zero nodes; any -// tasks running on existing nodes are terminated and requeued (as if a resize pool operation had been requested with -// the default requeue option); finally, the pool is removed from the system. Because running tasks are requeued, the -// user can rerun these tasks by updating their job to target a different pool. The tasks can then run on the new pool. -// If you want to override the requeue behavior, then you should call resize pool explicitly to shrink the pool to zero -// size before deleting the pool. If you call an Update, Patch or Delete API on a pool in the deleting state, it will -// fail with HTTP status code 409 with error code PoolBeingDeleted. -// -// poolID is the ID of the pool to delete. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. If not specified, this header will be automatically populated with the current -// system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the -// resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to -// perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify -// this header to perform the operation only if the resource has been modified since the specified date/time. -// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified -// since the specified date/time. -func (client PoolClient) Delete(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PoolClient) DeletePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 PoolClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) 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 -} - -// DisableAutoScale sends the disable auto scale request. -// -// poolID is the ID of the pool on which to disable automatic scaling. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client PoolClient) DisableAutoScale(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisableAutoScalePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.DisableAutoScaleSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure sending request") - return - } - - result, err = client.DisableAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure responding to request") - } - - return -} - -// DisableAutoScalePreparer prepares the DisableAutoScale request. -func (client PoolClient) DisableAutoScalePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/disableautoscale", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableAutoScaleSender sends the DisableAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) DisableAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableAutoScaleResponder handles the response to the DisableAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) DisableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EnableAutoScale you cannot enable automatic scaling on a pool if a resize operation is in progress on the pool. If -// automatic scaling of the pool is currently disabled, you must specify a valid autoscale formula as part of the -// request. If automatic scaling of the pool is already enabled, you may specify a new autoscale formula and/or a new -// evaluation interval. You cannot call this API for the same pool more than once every 30 seconds. -// -// poolID is the ID of the pool on which to enable automatic scaling. poolEnableAutoScaleParameter is the -// parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) EnableAutoScale(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnableAutoScalePreparer(ctx, poolID, poolEnableAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.EnableAutoScaleSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure sending request") - return - } - - result, err = client.EnableAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure responding to request") - } - - return -} - -// EnableAutoScalePreparer prepares the EnableAutoScale request. -func (client PoolClient) EnableAutoScalePreparer(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/enableautoscale", pathParameters), - autorest.WithJSON(poolEnableAutoScaleParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableAutoScaleSender sends the EnableAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) EnableAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableAutoScaleResponder handles the response to the EnableAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) EnableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EvaluateAutoScale this API is primarily for validating an autoscale formula, as it simply returns the result without -// applying the formula to the pool. -// -// poolID is the ID of the pool on which to evaluate the automatic scaling formula. poolEvaluateAutoScaleParameter -// is the parameters for the request. timeout is the maximum time that the server can spend processing the request, -// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of -// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -func (client PoolClient) EvaluateAutoScale(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AutoScaleRun, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolEvaluateAutoScaleParameter, - Constraints: []validation.Constraint{{Target: "poolEvaluateAutoScaleParameter.AutoScaleFormula", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "EvaluateAutoScale", err.Error()) - } - - req, err := client.EvaluateAutoScalePreparer(ctx, poolID, poolEvaluateAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.EvaluateAutoScaleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure sending request") - return - } - - result, err = client.EvaluateAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure responding to request") - } - - return -} - -// EvaluateAutoScalePreparer prepares the EvaluateAutoScale request. -func (client PoolClient) EvaluateAutoScalePreparer(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/evaluateautoscale", pathParameters), - autorest.WithJSON(poolEvaluateAutoScaleParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EvaluateAutoScaleSender sends the EvaluateAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) EvaluateAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EvaluateAutoScaleResponder handles the response to the EvaluateAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) EvaluateAutoScaleResponder(resp *http.Response) (result AutoScaleRun, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Exists gets basic properties of a pool. -// -// poolID is the ID of the pool to get. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. If not specified, this header will be automatically populated with the current -// system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the -// resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to -// perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify -// this header to perform the operation only if the resource has been modified since the specified date/time. -// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified -// since the specified date/time. -func (client PoolClient) Exists(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ExistsPreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", nil, "Failure preparing request") - return - } - - resp, err := client.ExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure sending request") - return - } - - result, err = client.ExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure responding to request") - } - - return -} - -// ExistsPreparer prepares the Exists request. -func (client PoolClient) ExistsPreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExistsSender sends the Exists request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ExistsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExistsResponder handles the response to the Exists request. The method always -// closes the http.Response Body. -func (client PoolClient) ExistsResponder(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 information about the specified pool. -// -// poolID is the ID of the pool to get. selectParameter is an OData $select clause. expand is an OData $expand -// clause. timeout is the maximum time that the server can spend processing the request, in seconds. The default is -// 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration -// such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server -// should return the client-request-id in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. ifMatch is an ETag is -// specified. Specify this header to perform the operation only if the resource's ETag is an exact match as -// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the -// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) Get(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudPool, err error) { - req, err := client.GetPreparer(ctx, poolID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client PoolClient) GetPreparer(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 PoolClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) GetResponder(resp *http.Response) (result CloudPool, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAllPoolsLifetimeStatistics statistics are aggregated across all pools that have ever existed in the account, from -// account creation to the last update time of the statistics. -// -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client PoolClient) GetAllPoolsLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolStatistics, err error) { - req, err := client.GetAllPoolsLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", nil, "Failure preparing request") - return - } - - resp, err := client.GetAllPoolsLifetimeStatisticsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", resp, "Failure sending request") - return - } - - result, err = client.GetAllPoolsLifetimeStatisticsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", resp, "Failure responding to request") - } - - return -} - -// GetAllPoolsLifetimeStatisticsPreparer prepares the GetAllPoolsLifetimeStatistics request. -func (client PoolClient) GetAllPoolsLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/lifetimepoolstats"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAllPoolsLifetimeStatisticsSender sends the GetAllPoolsLifetimeStatistics request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) GetAllPoolsLifetimeStatisticsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetAllPoolsLifetimeStatisticsResponder handles the response to the GetAllPoolsLifetimeStatistics request. The method always -// closes the http.Response Body. -func (client PoolClient) GetAllPoolsLifetimeStatisticsResponder(resp *http.Response) (result PoolStatistics, 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. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand -// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 pools can be -// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. -func (client PoolClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure sending request") - return - } - - result.cplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client PoolClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/pools"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 PoolClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) ListResponder(resp *http.Response) (result CloudPoolListResult, 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 PoolClient) listNextResults(lastResults CloudPoolListResult) (result CloudPoolListResult, err error) { - req, err := lastResults.cloudPoolListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "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, "batch.PoolClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PoolClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListPoolUsageMetrics if you do not specify a $filter clause including a poolId, the response includes all pools that -// existed in the account in the time range of the returned aggregation intervals. -// -// startTime is the earliest time from which to include metrics. This must be at least two and a half hours before -// the current time. If not specified this defaults to the start time of the last aggregation interval currently -// available. endTime is the latest time from which to include metrics. This must be at least two hours before the -// current time. If not specified this defaults to the end time of the last aggregation interval currently -// available. filter is an OData $filter clause. If this is not specified the response includes all pools that -// existed in the account in the time range of the returned aggregation intervals. maxResults is the maximum number -// of items to return in the response. A maximum of 1000 results will be returned. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client PoolClient) ListPoolUsageMetrics(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListPoolUsageMetricsResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "ListPoolUsageMetrics", err.Error()) - } - - result.fn = client.listPoolUsageMetricsNextResults - req, err := client.ListPoolUsageMetricsPreparer(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListPoolUsageMetricsSender(req) - if err != nil { - result.plpumr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", resp, "Failure sending request") - return - } - - result.plpumr, err = client.ListPoolUsageMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", resp, "Failure responding to request") - } - - return -} - -// ListPoolUsageMetricsPreparer prepares the ListPoolUsageMetrics request. -func (client PoolClient) ListPoolUsageMetricsPreparer(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if startTime != nil { - queryParameters["starttime"] = autorest.Encode("query", *startTime) - } - if endTime != nil { - queryParameters["endtime"] = autorest.Encode("query", *endTime) - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/poolusagemetrics"), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPoolUsageMetricsSender sends the ListPoolUsageMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ListPoolUsageMetricsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListPoolUsageMetricsResponder handles the response to the ListPoolUsageMetrics request. The method always -// closes the http.Response Body. -func (client PoolClient) ListPoolUsageMetricsResponder(resp *http.Response) (result PoolListPoolUsageMetricsResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listPoolUsageMetricsNextResults retrieves the next set of results, if any. -func (client PoolClient) listPoolUsageMetricsNextResults(lastResults PoolListPoolUsageMetricsResult) (result PoolListPoolUsageMetricsResult, err error) { - req, err := lastResults.poolListPoolUsageMetricsResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListPoolUsageMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListPoolUsageMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListPoolUsageMetricsComplete enumerates all values, automatically crossing page boundaries as required. -func (client PoolClient) ListPoolUsageMetricsComplete(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListPoolUsageMetricsResultIterator, err error) { - result.page, err = client.ListPoolUsageMetrics(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch this only replaces the pool properties specified in the request. For example, if the pool has a start task -// associated with it, and a request does not specify a start task element, then the pool keeps the existing start -// task. -// -// poolID is the ID of the pool to update. poolPatchParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client PoolClient) Patch(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, poolID, poolPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client PoolClient) PatchPreparer(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithJSON(poolPatchParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client PoolClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// RemoveNodes this operation can only run when the allocation state of the pool is steady. When this operation runs, -// the allocation state changes from steady to resizing. -// -// poolID is the ID of the pool from which you want to remove nodes. nodeRemoveParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not -// specified, this header will be automatically populated with the current system clock time. ifMatch is an ETag is -// specified. Specify this header to perform the operation only if the resource's ETag is an exact match as -// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the -// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client PoolClient) RemoveNodes(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: nodeRemoveParameter, - Constraints: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "RemoveNodes", err.Error()) - } - - req, err := client.RemoveNodesPreparer(ctx, poolID, nodeRemoveParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", nil, "Failure preparing request") - return - } - - resp, err := client.RemoveNodesSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure sending request") - return - } - - result, err = client.RemoveNodesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure responding to request") - } - - return -} - -// RemoveNodesPreparer prepares the RemoveNodes request. -func (client PoolClient) RemoveNodesPreparer(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/removenodes", pathParameters), - autorest.WithJSON(nodeRemoveParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RemoveNodesSender sends the RemoveNodes request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) RemoveNodesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// RemoveNodesResponder handles the response to the RemoveNodes request. The method always -// closes the http.Response Body. -func (client PoolClient) RemoveNodesResponder(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 -} - -// Resize you can only resize a pool when its allocation state is steady. If the pool is already resizing, the request -// fails with status code 409. When you resize a pool, the pool's allocation state changes from steady to resizing. You -// cannot resize pools which are configured for automatic scaling. If you try to do this, the Batch service returns an -// error 409. If you resize a pool downwards, the Batch service chooses which nodes to remove. To remove specific -// nodes, use the pool remove nodes API instead. -// -// poolID is the ID of the pool to resize. poolResizeParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client PoolClient) Resize(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolResizeParameter, - Constraints: []validation.Constraint{{Target: "poolResizeParameter.TargetDedicated", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "Resize", err.Error()) - } - - req, err := client.ResizePreparer(ctx, poolID, poolResizeParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", nil, "Failure preparing request") - return - } - - resp, err := client.ResizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure sending request") - return - } - - result, err = client.ResizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure responding to request") - } - - return -} - -// ResizePreparer prepares the Resize request. -func (client PoolClient) ResizePreparer(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/resize", pathParameters), - autorest.WithJSON(poolResizeParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResizeSender sends the Resize request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ResizeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ResizeResponder handles the response to the Resize request. The method always -// closes the http.Response Body. -func (client PoolClient) ResizeResponder(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 -} - -// StopResize this does not restore the pool to its previous state before the resize operation: it only stops any -// further changes being made, and the pool maintains its current state. A resize operation need not be an explicit -// resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. -// -// poolID is the ID of the pool whose resizing you want to stop. timeout is the maximum time that the server can -// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client PoolClient) StopResize(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.StopResizePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", nil, "Failure preparing request") - return - } - - resp, err := client.StopResizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure sending request") - return - } - - result, err = client.StopResizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure responding to request") - } - - return -} - -// StopResizePreparer prepares the StopResize request. -func (client PoolClient) StopResizePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/stopresize", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopResizeSender sends the StopResize request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) StopResizeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// StopResizeResponder handles the response to the StopResize request. The method always -// closes the http.Response Body. -func (client PoolClient) StopResizeResponder(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 -} - -// UpdateProperties this fully replaces all the updateable properties of the pool. For example, if the pool has a start -// task associated with it and if start task is not specified with this request, then the Batch service will remove the -// existing start task. -// -// poolID is the ID of the pool to update. poolUpdatePropertiesParameter is the parameters for the request. timeout -// is the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client PoolClient) UpdateProperties(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolUpdatePropertiesParameter, - Constraints: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "poolUpdatePropertiesParameter.CertificateReferences", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.ApplicationPackageReferences", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.Metadata", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "UpdateProperties", err.Error()) - } - - req, err := client.UpdatePropertiesPreparer(ctx, poolID, poolUpdatePropertiesParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", nil, "Failure preparing request") - return - } - - resp, err := client.UpdatePropertiesSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure sending request") - return - } - - result, err = client.UpdatePropertiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure responding to request") - } - - return -} - -// UpdatePropertiesPreparer prepares the UpdateProperties request. -func (client PoolClient) UpdatePropertiesPreparer(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/updateproperties", pathParameters), - autorest.WithJSON(poolUpdatePropertiesParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdatePropertiesSender sends the UpdateProperties request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) UpdatePropertiesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdatePropertiesResponder handles the response to the UpdateProperties request. The method always -// closes the http.Response Body. -func (client PoolClient) UpdatePropertiesResponder(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 -} - -// UpgradeOS during an upgrade, the Batch service upgrades each compute node in the pool. When a compute node is chosen -// for upgrade, any tasks running on that node are removed from the node and returned to the queue to be rerun later -// (or on a different compute node). The node will be unavailable until the upgrade is complete. This operation results -// in temporarily reduced pool capacity as nodes are taken out of service to be upgraded. Although the Batch service -// tries to avoid upgrading all compute nodes at the same time, it does not guarantee to do this (particularly on small -// pools); therefore, the pool may be temporarily unavailable to run tasks. When this operation runs, the pool state -// changes to upgrading. When all compute nodes have finished upgrading, the pool state returns to active. -// -// poolID is the ID of the pool to upgrade. poolUpgradeOSParameter is the parameters for the request. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client PoolClient) UpgradeOS(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolUpgradeOSParameter, - Constraints: []validation.Constraint{{Target: "poolUpgradeOSParameter.TargetOSVersion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "UpgradeOS", err.Error()) - } - - req, err := client.UpgradeOSPreparer(ctx, poolID, poolUpgradeOSParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", nil, "Failure preparing request") - return - } - - resp, err := client.UpgradeOSSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure sending request") - return - } - - result, err = client.UpgradeOSResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure responding to request") - } - - return -} - -// UpgradeOSPreparer prepares the UpgradeOS request. -func (client PoolClient) UpgradeOSPreparer(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/upgradeos", pathParameters), - autorest.WithJSON(poolUpgradeOSParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpgradeOSSender sends the UpgradeOS request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) UpgradeOSSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpgradeOSResponder handles the response to the UpgradeOS request. The method always -// closes the http.Response Body. -func (client PoolClient) UpgradeOSResponder(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/batch/2016-07-01.3.1/batch/task.go b/services/batch/2016-07-01.3.1/batch/task.go deleted file mode 100644 index add2cd69a295..000000000000 --- a/services/batch/2016-07-01.3.1/batch/task.go +++ /dev/null @@ -1,1051 +0,0 @@ -package batch - -// 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" - "net/http" -) - -// TaskClient is the a client for issuing REST requests to the Azure Batch service. -type TaskClient struct { - BaseClient -} - -// NewTaskClient creates an instance of the TaskClient client. -func NewTaskClient() TaskClient { - return NewTaskClientWithBaseURI(DefaultBaseURI) -} - -// NewTaskClientWithBaseURI creates an instance of the TaskClient client. -func NewTaskClientWithBaseURI(baseURI string) TaskClient { - return TaskClient{NewWithBaseURI(baseURI)} -} - -// Add sends the add request. -// -// jobID is the ID of the job to which the task is to be added. task is the task to be added. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client TaskClient) Add(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: task, - Constraints: []validation.Constraint{{Target: "task.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "task.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "task.AffinityInfo", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "task.AffinityInfo.AffinityID", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "task.MultiInstanceSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "task.MultiInstanceSettings.NumberOfInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, jobID, task, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client TaskClient) AddPreparer(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters), - autorest.WithJSON(task), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 TaskClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// AddCollection note that each task must have a unique ID. The Batch service may not return the results for each task -// in the same order the tasks were submitted in this request. If the server times out or the connection is closed -// during the request, the request may have been partially or fully processed, or not at all. In such cases, the user -// should re-issue the request. Note that it is up to the user to correctly handle failures when re-issuing a request. -// For example, you should use the same task ids during a retry so that if the prior operation succeeded, the retry -// will not create extra tasks unexpectedly. -// -// jobID is the ID of the job to which the task collection is to be added. taskCollection is the tasks to be added. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. If not specified, this -// header will be automatically populated with the current system clock time. -func (client TaskClient) AddCollection(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result TaskAddCollectionResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: taskCollection, - Constraints: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "AddCollection", err.Error()) - } - - req, err := client.AddCollectionPreparer(ctx, jobID, taskCollection, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", nil, "Failure preparing request") - return - } - - resp, err := client.AddCollectionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure sending request") - return - } - - result, err = client.AddCollectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure responding to request") - } - - return -} - -// AddCollectionPreparer prepares the AddCollection request. -func (client TaskClient) AddCollectionPreparer(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/addtaskcollection", pathParameters), - autorest.WithJSON(taskCollection), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddCollectionSender sends the AddCollection request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) AddCollectionSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddCollectionResponder handles the response to the AddCollection request. The method always -// closes the http.Response Body. -func (client TaskClient) AddCollectionResponder(resp *http.Response) (result TaskAddCollectionResult, 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 when a task is deleted, all of the files in its directory on the compute node where it ran are also deleted -// (regardless of the retention time). For multi-instance tasks, the delete task operation applies synchronously to the -// primary task; subtasks and their files are then deleted asynchronously in the background. -// -// jobID is the ID of the job from which to delete the task. taskID is the ID of the task to delete. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client TaskClient) Delete(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client TaskClient) DeletePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) 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 for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. -// Use the list subtasks API to retrieve information about subtasks. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task to get information about. -// selectParameter is an OData $select clause. expand is an OData $expand clause. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client TaskClient) Get(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudTask, err error) { - req, err := client.GetPreparer(ctx, jobID, taskID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client TaskClient) GetPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) GetResponder(resp *http.Response) (result CloudTask, 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 for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. -// Use the list subtasks API to retrieve information about subtasks. -// -// jobID is the ID of the job. filter is an OData $filter clause. selectParameter is an OData $select clause. -// expand is an OData $expand clause. maxResults is the maximum number of items to return in the response. A -// maximum of 1000 tasks can be returned. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. If not specified, this header will be automatically populated with the current -// system clock time. -func (client TaskClient) List(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ctlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure sending request") - return - } - - result.ctlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client TaskClient) ListPreparer(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 TaskClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) ListResponder(resp *http.Response) (result CloudTaskListResult, 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 TaskClient) listNextResults(lastResults CloudTaskListResult) (result CloudTaskListResult, err error) { - req, err := lastResults.cloudTaskListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.TaskClient", "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, "batch.TaskClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client TaskClient) ListComplete(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultIterator, err error) { - result.page, err = client.List(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListSubtasks if the task is not a multi-instance task then this returns an empty collection. -// -// jobID is the ID of the job. taskID is the ID of the task. selectParameter is an OData $select clause. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. -func (client TaskClient) ListSubtasks(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListSubtasksResult, err error) { - req, err := client.ListSubtasksPreparer(ctx, jobID, taskID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", nil, "Failure preparing request") - return - } - - resp, err := client.ListSubtasksSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure sending request") - return - } - - result, err = client.ListSubtasksResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure responding to request") - } - - return -} - -// ListSubtasksPreparer prepares the ListSubtasks request. -func (client TaskClient) ListSubtasksPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/subtasksinfo", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSubtasksSender sends the ListSubtasks request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) ListSubtasksSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListSubtasksResponder handles the response to the ListSubtasks request. The method always -// closes the http.Response Body. -func (client TaskClient) ListSubtasksResponder(resp *http.Response) (result CloudTaskListSubtasksResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Reactivate reactivation makes a task eligible to be retried again up to its maximum retry count. The task's state is -// changed to active. As the task is no longer in the completed state, any previous exit code or scheduling error is no -// longer available after reactivation. This will fail for tasks that are not completed or that previously completed -// successfully (with an exit code of 0). Additionally, this will fail if the job has completed (or is terminating or -// deleting). -// -// jobID is the ID of the job containing the task. taskID is the ID of the task to reactivate. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client TaskClient) Reactivate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ReactivatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", nil, "Failure preparing request") - return - } - - resp, err := client.ReactivateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure sending request") - return - } - - result, err = client.ReactivateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure responding to request") - } - - return -} - -// ReactivatePreparer prepares the Reactivate request. -func (client TaskClient) ReactivatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/reactivate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReactivateSender sends the Reactivate request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) ReactivateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ReactivateResponder handles the response to the Reactivate request. The method always -// closes the http.Response Body. -func (client TaskClient) ReactivateResponder(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 -} - -// Terminate when the task has been terminated, it moves to the completed state. For multi-instance tasks, the -// terminate task operation applies synchronously to the primary task; subtasks are then terminated asynchronously in -// the background. -// -// jobID is the ID of the job containing the task. taskID is the ID of the task to terminate. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header -// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify -// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is -// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match -// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has -// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation -// only if the resource has not been modified since the specified date/time. -func (client TaskClient) Terminate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client TaskClient) TerminatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client TaskClient) TerminateResponder(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 -} - -// Update updates the properties of the specified task. -// -// jobID is the ID of the job containing the task. taskID is the ID of the task to update. taskUpdateParameter is -// the parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. If not specified, this header will be automatically populated with the current system clock time. -// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an -// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only -// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the -// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify -// this header to perform the operation only if the resource has not been modified since the specified date/time. -func (client TaskClient) Update(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.UpdatePreparer(ctx, jobID, taskID, taskUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client TaskClient) UpdatePreparer(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2016-07-01.3.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithJSON(taskUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) UpdateResponder(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/batch/2017-01-01.4.0/batch/account.go b/services/batch/2017-01-01.4.0/batch/account.go deleted file mode 100644 index 0c3f3b055069..000000000000 --- a/services/batch/2017-01-01.4.0/batch/account.go +++ /dev/null @@ -1,174 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// AccountClient is the a client for issuing REST requests to the Azure Batch service. -type AccountClient struct { - BaseClient -} - -// NewAccountClient creates an instance of the AccountClient client. -func NewAccountClient() AccountClient { - return NewAccountClientWithBaseURI(DefaultBaseURI) -} - -// NewAccountClientWithBaseURI creates an instance of the AccountClient client. -func NewAccountClientWithBaseURI(baseURI string) AccountClient { - return AccountClient{NewWithBaseURI(baseURI)} -} - -// ListNodeAgentSkus sends the list node agent skus request. -// -// filter is an OData $filter clause. maxResults is the maximum number of items to return in the response. A -// maximum of 1000 results will be returned. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client AccountClient) ListNodeAgentSkus(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.AccountClient", "ListNodeAgentSkus", err.Error()) - } - - result.fn = client.listNodeAgentSkusNextResults - req, err := client.ListNodeAgentSkusPreparer(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListNodeAgentSkusSender(req) - if err != nil { - result.alnasr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure sending request") - return - } - - result.alnasr, err = client.ListNodeAgentSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure responding to request") - } - - return -} - -// ListNodeAgentSkusPreparer prepares the ListNodeAgentSkus request. -func (client AccountClient) ListNodeAgentSkusPreparer(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/nodeagentskus"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListNodeAgentSkusSender sends the ListNodeAgentSkus request. The method will close the -// http.Response Body if it receives an error. -func (client AccountClient) ListNodeAgentSkusSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListNodeAgentSkusResponder handles the response to the ListNodeAgentSkus request. The method always -// closes the http.Response Body. -func (client AccountClient) ListNodeAgentSkusResponder(resp *http.Response) (result AccountListNodeAgentSkusResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNodeAgentSkusNextResults retrieves the next set of results, if any. -func (client AccountClient) listNodeAgentSkusNextResults(lastResults AccountListNodeAgentSkusResult) (result AccountListNodeAgentSkusResult, err error) { - req, err := lastResults.accountListNodeAgentSkusResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListNodeAgentSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListNodeAgentSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListNodeAgentSkusComplete enumerates all values, automatically crossing page boundaries as required. -func (client AccountClient) ListNodeAgentSkusComplete(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultIterator, err error) { - result.page, err = client.ListNodeAgentSkus(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2017-01-01.4.0/batch/application.go b/services/batch/2017-01-01.4.0/batch/application.go deleted file mode 100644 index 4a444aa78ab3..000000000000 --- a/services/batch/2017-01-01.4.0/batch/application.go +++ /dev/null @@ -1,262 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// ApplicationClient is the a client for issuing REST requests to the Azure Batch service. -type ApplicationClient struct { - BaseClient -} - -// NewApplicationClient creates an instance of the ApplicationClient client. -func NewApplicationClient() ApplicationClient { - return NewApplicationClientWithBaseURI(DefaultBaseURI) -} - -// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient client. -func NewApplicationClientWithBaseURI(baseURI string) ApplicationClient { - return ApplicationClient{NewWithBaseURI(baseURI)} -} - -// Get sends the get request. -// -// applicationID is the ID of the application. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client ApplicationClient) Get(ctx context.Context, applicationID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationSummary, err error) { - req, err := client.GetPreparer(ctx, applicationID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationClient) GetPreparer(ctx context.Context, applicationID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationId": autorest.Encode("path", applicationID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/applications/{applicationId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ApplicationClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ApplicationClient) GetResponder(resp *http.Response) (result ApplicationSummary, 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 operation returns only applications and versions that are available for use on compute nodes; that is, -// that can be used in an application package reference. For administrator information about applications and versions -// that are not yet available to compute nodes, use the Azure portal or the Azure Resource Manager API. -// -// maxResults is the maximum number of items to return in the response. A maximum of 1000 applications can be -// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. -func (client ApplicationClient) List(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.ApplicationClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "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, "batch.ApplicationClient", "List", resp, "Failure sending request") - return - } - - result.alr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationClient) ListPreparer(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/applications"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ApplicationClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ApplicationClient) ListResponder(resp *http.Response) (result ApplicationListResult, 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 ApplicationClient) listNextResults(lastResults ApplicationListResult) (result ApplicationListResult, err error) { - req, err := lastResults.applicationListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.ApplicationClient", "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, "batch.ApplicationClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationClient) ListComplete(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultIterator, err error) { - result.page, err = client.List(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2017-01-01.4.0/batch/certificate.go b/services/batch/2017-01-01.4.0/batch/certificate.go deleted file mode 100644 index 83f1dddd501e..000000000000 --- a/services/batch/2017-01-01.4.0/batch/certificate.go +++ /dev/null @@ -1,555 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// CertificateClient is the a client for issuing REST requests to the Azure Batch service. -type CertificateClient struct { - BaseClient -} - -// NewCertificateClient creates an instance of the CertificateClient client. -func NewCertificateClient() CertificateClient { - return NewCertificateClientWithBaseURI(DefaultBaseURI) -} - -// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client. -func NewCertificateClientWithBaseURI(baseURI string) CertificateClient { - return CertificateClient{NewWithBaseURI(baseURI)} -} - -// Add sends the add request. -// -// certificate is the certificate to be added. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client CertificateClient) Add(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: certificate, - Constraints: []validation.Constraint{{Target: "certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "certificate.ThumbprintAlgorithm", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "certificate.Data", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.CertificateClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, certificate, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client CertificateClient) AddPreparer(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/certificates"), - autorest.WithJSON(certificate), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// CancelDeletion if you try to delete a certificate that is being used by a pool or compute node, the status of the -// certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this -// operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not -// need to run this operation after the deletion failed. You must make sure that the certificate is not being used by -// any resources, and then you can try again to delete the certificate. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate being deleted. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client CertificateClient) CancelDeletion(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.CancelDeletionPreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", nil, "Failure preparing request") - return - } - - resp, err := client.CancelDeletionSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure sending request") - return - } - - result, err = client.CancelDeletionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure responding to request") - } - - return -} - -// CancelDeletionPreparer prepares the CancelDeletion request. -func (client CertificateClient) CancelDeletionPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CancelDeletionSender sends the CancelDeletion request. The method will close the -// http.Response Body if it receives an error. -func (client CertificateClient) CancelDeletionSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CancelDeletionResponder handles the response to the CancelDeletion request. The method always -// closes the http.Response Body. -func (client CertificateClient) CancelDeletionResponder(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 -} - -// Delete you cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a -// certificate, you must therefore make sure that the certificate is not associated with any existing pools, the -// certificate is not installed on any compute nodes (even if you remove a certificate from a pool, it is not removed -// from existing compute nodes in that pool until they restart), and no running tasks depend on the certificate. If you -// try to delete a certificate that is in use, the deletion fails. The certificate status changes to deleteFailed. You -// can use Cancel Delete Certificate to set the status back to active if you decide that you want to continue using the -// certificate. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate to be deleted. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client CertificateClient) Delete(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CertificateClient) DeletePreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) 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 information about the specified certificate. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate to get. selectParameter is an OData $select clause. timeout is the maximum -// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is -// the caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client CertificateClient) Get(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result Certificate, err error) { - req, err := client.GetPreparer(ctx, thumbprintAlgorithm, thumbprint, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client CertificateClient) GetPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) GetResponder(resp *http.Response) (result Certificate, 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. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. maxResults is the maximum number -// of items to return in the response. A maximum of 1000 certificates can be returned. timeout is the maximum time -// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client CertificateClient) List(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.CertificateClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "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, "batch.CertificateClient", "List", resp, "Failure sending request") - return - } - - result.clr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client CertificateClient) ListPreparer(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/certificates"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) ListResponder(resp *http.Response) (result CertificateListResult, 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 CertificateClient) listNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) { - req, err := lastResults.certificateListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.CertificateClient", "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, "batch.CertificateClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CertificateClient) ListComplete(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2017-01-01.4.0/batch/client.go b/services/batch/2017-01-01.4.0/batch/client.go deleted file mode 100644 index 6412d400441d..000000000000 --- a/services/batch/2017-01-01.4.0/batch/client.go +++ /dev/null @@ -1,49 +0,0 @@ -// Package batch implements the Azure ARM Batch service API version 2017-01-01.4.0. -// -// A client for issuing REST requests to the Azure Batch service. -package batch - -// 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 Batch - DefaultBaseURI = "https://batch.core.windows.net" -) - -// BaseClient is the base client for Batch. -type BaseClient struct { - autorest.Client - BaseURI string -} - -// New creates an instance of the BaseClient client. -func New() BaseClient { - return NewWithBaseURI(DefaultBaseURI) -} - -// NewWithBaseURI creates an instance of the BaseClient client. -func NewWithBaseURI(baseURI string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - } -} diff --git a/services/batch/2017-01-01.4.0/batch/computenode.go b/services/batch/2017-01-01.4.0/batch/computenode.go deleted file mode 100644 index ea4a9afffd81..000000000000 --- a/services/batch/2017-01-01.4.0/batch/computenode.go +++ /dev/null @@ -1,1121 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// ComputeNodeClient is the a client for issuing REST requests to the Azure Batch service. -type ComputeNodeClient struct { - BaseClient -} - -// NewComputeNodeClient creates an instance of the ComputeNodeClient client. -func NewComputeNodeClient() ComputeNodeClient { - return NewComputeNodeClientWithBaseURI(DefaultBaseURI) -} - -// NewComputeNodeClientWithBaseURI creates an instance of the ComputeNodeClient client. -func NewComputeNodeClientWithBaseURI(baseURI string) ComputeNodeClient { - return ComputeNodeClient{NewWithBaseURI(baseURI)} -} - -// AddUser you can add a user account to a node only when it is in the idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want -// to create a user account. userParameter is the user account to be created. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) AddUser(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: userParameter, - Constraints: []validation.Constraint{{Target: "userParameter.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.ComputeNodeClient", "AddUser", err.Error()) - } - - req, err := client.AddUserPreparer(ctx, poolID, nodeID, userParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", nil, "Failure preparing request") - return - } - - resp, err := client.AddUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure sending request") - return - } - - result, err = client.AddUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure responding to request") - } - - return -} - -// AddUserPreparer prepares the AddUser request. -func (client ComputeNodeClient) AddUserPreparer(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users", pathParameters), - autorest.WithJSON(userParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddUserSender sends the AddUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) AddUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddUserResponder handles the response to the AddUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) AddUserResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteUser you can delete a user account to a node only when it is in the idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want -// to delete a user account. userName is the name of the user account to delete. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) DeleteUser(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteUserPreparer(ctx, poolID, nodeID, userName, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure sending request") - return - } - - result, err = client.DeleteUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure responding to request") - } - - return -} - -// DeleteUserPreparer prepares the DeleteUser request. -func (client ComputeNodeClient) DeleteUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - "userName": autorest.Encode("path", userName), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteUserSender sends the DeleteUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) DeleteUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteUserResponder handles the response to the DeleteUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) DeleteUserResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// DisableScheduling sends the disable scheduling request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you -// want to disable task scheduling. nodeDisableSchedulingParameter is the parameters for the request. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) DisableScheduling(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisableSchedulingPreparer(ctx, poolID, nodeID, nodeDisableSchedulingParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSchedulingSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure sending request") - return - } - - result, err = client.DisableSchedulingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure responding to request") - } - - return -} - -// DisableSchedulingPreparer prepares the DisableScheduling request. -func (client ComputeNodeClient) DisableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/disablescheduling", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeDisableSchedulingParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeDisableSchedulingParameter)) - } - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableSchedulingSender sends the DisableScheduling request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) DisableSchedulingSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableSchedulingResponder handles the response to the DisableScheduling request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) DisableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EnableScheduling sends the enable scheduling request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you -// want to enable task scheduling. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client ComputeNodeClient) EnableScheduling(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnableSchedulingPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSchedulingSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure sending request") - return - } - - result, err = client.EnableSchedulingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure responding to request") - } - - return -} - -// EnableSchedulingPreparer prepares the EnableScheduling request. -func (client ComputeNodeClient) EnableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/enablescheduling", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableSchedulingSender sends the EnableScheduling request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) EnableSchedulingSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableSchedulingResponder handles the response to the EnableScheduling request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) EnableSchedulingResponder(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 sends the get request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want -// to get information about. selectParameter is an OData $select clause. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) Get(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNode, err error) { - req, err := client.GetPreparer(ctx, poolID, nodeID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ComputeNodeClient) GetPreparer(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ComputeNodeClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ComputeNodeClient) GetResponder(resp *http.Response) (result ComputeNode, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetRemoteDesktop before you can access a node by using the RDP file, you must create a user account on the node. -// This API can only be invoked on pools created with the cloud service configuration property. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which you -// want to get the Remote Desktop Protocol file. timeout is the maximum time that the server can spend processing -// the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in -// the form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) GetRemoteDesktop(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetRemoteDesktopPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", nil, "Failure preparing request") - return - } - - resp, err := client.GetRemoteDesktopSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure sending request") - return - } - - result, err = client.GetRemoteDesktopResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure responding to request") - } - - return -} - -// GetRemoteDesktopPreparer prepares the GetRemoteDesktop request. -func (client ComputeNodeClient) GetRemoteDesktopPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/rdp", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRemoteDesktopSender sends the GetRemoteDesktop request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) GetRemoteDesktopSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRemoteDesktopResponder handles the response to the GetRemoteDesktop request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) GetRemoteDesktopResponder(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 -} - -// GetRemoteLoginSettings before you can remotely login to a node using the remote login settings, you must create a -// user account on the node. This API can be invoked only on pools created with the virtual machine configuration -// property. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which to -// obtain the remote login settings. timeout is the maximum time that the server can spend processing the request, -// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of -// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client ComputeNodeClient) GetRemoteLoginSettings(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeGetRemoteLoginSettingsResult, err error) { - req, err := client.GetRemoteLoginSettingsPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", nil, "Failure preparing request") - return - } - - resp, err := client.GetRemoteLoginSettingsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure sending request") - return - } - - result, err = client.GetRemoteLoginSettingsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure responding to request") - } - - return -} - -// GetRemoteLoginSettingsPreparer prepares the GetRemoteLoginSettings request. -func (client ComputeNodeClient) GetRemoteLoginSettingsPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/remoteloginsettings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRemoteLoginSettingsSender sends the GetRemoteLoginSettings request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) GetRemoteLoginSettingsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRemoteLoginSettingsResponder handles the response to the GetRemoteLoginSettings request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) GetRemoteLoginSettingsResponder(resp *http.Response) (result ComputeNodeGetRemoteLoginSettingsResult, 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. -// -// poolID is the ID of the pool from which you want to list nodes. filter is an OData $filter clause.. -// selectParameter is an OData $select clause. maxResults is the maximum number of items to return in the response. -// A maximum of 1000 nodes can be returned. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) List(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.ComputeNodeClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cnlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure sending request") - return - } - - result.cnlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ComputeNodeClient) ListPreparer(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ComputeNodeClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ComputeNodeClient) ListResponder(resp *http.Response) (result ComputeNodeListResult, 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 ComputeNodeClient) listNextResults(lastResults ComputeNodeListResult) (result ComputeNodeListResult, err error) { - req, err := lastResults.computeNodeListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "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, "batch.ComputeNodeClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ComputeNodeClient) ListComplete(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultIterator, err error) { - result.page, err = client.List(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Reboot you can restart a node only if it is in an idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want -// to restart. nodeRebootParameter is the parameters for the request. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) Reboot(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.RebootPreparer(ctx, poolID, nodeID, nodeRebootParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", nil, "Failure preparing request") - return - } - - resp, err := client.RebootSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure sending request") - return - } - - result, err = client.RebootResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure responding to request") - } - - return -} - -// RebootPreparer prepares the Reboot request. -func (client ComputeNodeClient) RebootPreparer(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reboot", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeRebootParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeRebootParameter)) - } - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RebootSender sends the Reboot request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) RebootSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// RebootResponder handles the response to the Reboot request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) RebootResponder(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 -} - -// Reimage you can reinstall the operating system on a node only if it is in an idle or running state. This API can be -// invoked only on pools created with the cloud service configuration property. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want -// to restart. nodeReimageParameter is the parameters for the request. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) Reimage(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ReimagePreparer(ctx, poolID, nodeID, nodeReimageParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", nil, "Failure preparing request") - return - } - - resp, err := client.ReimageSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure sending request") - return - } - - result, err = client.ReimageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure responding to request") - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client ComputeNodeClient) ReimagePreparer(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeReimageParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeReimageParameter)) - } - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) ReimageSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) ReimageResponder(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 -} - -// UpdateUser this operation replaces of all the updateable properties of the account. For example, if the expiryTime -// element is not specified, the current value is replaced with the default value, not left unmodified. You can update -// a user account on a node only when it is in the idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want -// to update a user account. userName is the name of the user account to update. nodeUpdateUserParameter is the -// parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client ComputeNodeClient) UpdateUser(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.UpdateUserPreparer(ctx, poolID, nodeID, userName, nodeUpdateUserParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure sending request") - return - } - - result, err = client.UpdateUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure responding to request") - } - - return -} - -// UpdateUserPreparer prepares the UpdateUser request. -func (client ComputeNodeClient) UpdateUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - "userName": autorest.Encode("path", userName), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters), - autorest.WithJSON(nodeUpdateUserParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateUserSender sends the UpdateUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) UpdateUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateUserResponder handles the response to the UpdateUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) UpdateUserResponder(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/batch/2017-01-01.4.0/batch/file.go b/services/batch/2017-01-01.4.0/batch/file.go deleted file mode 100644 index f5aebe769c6a..000000000000 --- a/services/batch/2017-01-01.4.0/batch/file.go +++ /dev/null @@ -1,942 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// FileClient is the a client for issuing REST requests to the Azure Batch service. -type FileClient struct { - BaseClient -} - -// NewFileClient creates an instance of the FileClient client. -func NewFileClient() FileClient { - return NewFileClientWithBaseURI(DefaultBaseURI) -} - -// NewFileClientWithBaseURI creates an instance of the FileClient client. -func NewFileClientWithBaseURI(baseURI string) FileClient { - return FileClient{NewWithBaseURI(baseURI)} -} - -// DeleteFromComputeNode sends the delete from compute node request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node from which you -// want to delete the file. filePath is the path to the file that you want to delete. recursive is whether to -// delete children of a directory. If the filePath parameter represents a directory instead of a file, you can set -// recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false -// then the directory must be empty or deletion will fail. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client FileClient) DeleteFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteFromComputeNodePreparer(ctx, poolID, nodeID, filePath, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteFromComputeNodeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.DeleteFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// DeleteFromComputeNodePreparer prepares the DeleteFromComputeNode request. -func (client FileClient) DeleteFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteFromComputeNodeSender sends the DeleteFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) DeleteFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteFromComputeNodeResponder handles the response to the DeleteFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) DeleteFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteFromTask sends the delete from task request. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to delete. -// filePath is the path to the task file that you want to delete. recursive is whether to delete children of a -// directory. If the filePath parameter represents a directory instead of a file, you can set recursive to true to -// delete the directory and all of the files and subdirectories in it. If recursive is false then the directory -// must be empty or deletion will fail. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client FileClient) DeleteFromTask(ctx context.Context, jobID string, taskID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteFromTaskPreparer(ctx, jobID, taskID, filePath, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteFromTaskSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure sending request") - return - } - - result, err = client.DeleteFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure responding to request") - } - - return -} - -// DeleteFromTaskPreparer prepares the DeleteFromTask request. -func (client FileClient) DeleteFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteFromTaskSender sends the DeleteFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) DeleteFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteFromTaskResponder handles the response to the DeleteFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) DeleteFromTaskResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetFromComputeNode returns the content of the specified compute node file. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains -// the file. filePath is the path to the compute node file that you want to get the content of. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ocpRange is -// the byte range to be retrieved. The default is to retrieve the entire file. The format is -// bytes=startRange-endRange. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client FileClient) GetFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetFromComputeNodePreparer(ctx, poolID, nodeID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.GetFromComputeNodeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.GetFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// GetFromComputeNodePreparer prepares the GetFromComputeNode request. -func (client FileClient) GetFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ocpRange) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-range", autorest.String(ocpRange))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetFromComputeNodeSender sends the GetFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetFromComputeNodeResponder handles the response to the GetFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) GetFromComputeNodeResponder(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 -} - -// GetFromTask returns the content of the specified task file. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to retrieve. -// filePath is the path to the task file that you want to get the content of. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ocpRange is -// the byte range to be retrieved. The default is to retrieve the entire file. The format is -// bytes=startRange-endRange. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client FileClient) GetFromTask(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetFromTaskPreparer(ctx, jobID, taskID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.GetFromTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure sending request") - return - } - - result, err = client.GetFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure responding to request") - } - - return -} - -// GetFromTaskPreparer prepares the GetFromTask request. -func (client FileClient) GetFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ocpRange) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-range", autorest.String(ocpRange))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetFromTaskSender sends the GetFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetFromTaskResponder handles the response to the GetFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) GetFromTaskResponder(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 -} - -// GetPropertiesFromComputeNode gets the properties of the specified compute node file. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains -// the file. filePath is the path to the compute node file that you want to get the properties of. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client FileClient) GetPropertiesFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.GetPropertiesFromComputeNodePreparer(ctx, poolID, nodeID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.GetPropertiesFromComputeNodeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.GetPropertiesFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// GetPropertiesFromComputeNodePreparer prepares the GetPropertiesFromComputeNode request. -func (client FileClient) GetPropertiesFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPropertiesFromComputeNodeSender sends the GetPropertiesFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetPropertiesFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPropertiesFromComputeNodeResponder handles the response to the GetPropertiesFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) GetPropertiesFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetPropertiesFromTask gets the properties of the specified task file. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to get the -// properties of. filePath is the path to the task file that you want to get the properties of. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client FileClient) GetPropertiesFromTask(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.GetPropertiesFromTaskPreparer(ctx, jobID, taskID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.GetPropertiesFromTaskSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", resp, "Failure sending request") - return - } - - result, err = client.GetPropertiesFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", resp, "Failure responding to request") - } - - return -} - -// GetPropertiesFromTaskPreparer prepares the GetPropertiesFromTask request. -func (client FileClient) GetPropertiesFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPropertiesFromTaskSender sends the GetPropertiesFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetPropertiesFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPropertiesFromTaskResponder handles the response to the GetPropertiesFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) GetPropertiesFromTaskResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// ListFromComputeNode sends the list from compute node request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node whose files -// you want to list. filter is an OData $filter clause. recursive is whether to list children of a directory. -// maxResults is the maximum number of items to return in the response. A maximum of 1000 files can be returned. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client FileClient) ListFromComputeNode(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.FileClient", "ListFromComputeNode", err.Error()) - } - - result.fn = client.listFromComputeNodeNextResults - req, err := client.ListFromComputeNodePreparer(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromComputeNodeSender(req) - if err != nil { - result.nflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure sending request") - return - } - - result.nflr, err = client.ListFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// ListFromComputeNodePreparer prepares the ListFromComputeNode request. -func (client FileClient) ListFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromComputeNodeSender sends the ListFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) ListFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromComputeNodeResponder handles the response to the ListFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) ListFromComputeNodeResponder(resp *http.Response) (result NodeFileListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromComputeNodeNextResults retrieves the next set of results, if any. -func (client FileClient) listFromComputeNodeNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) { - req, err := lastResults.nodeFileListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromComputeNodeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromComputeNodeComplete enumerates all values, automatically crossing page boundaries as required. -func (client FileClient) ListFromComputeNodeComplete(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) { - result.page, err = client.ListFromComputeNode(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListFromTask sends the list from task request. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose files you want to list. -// filter is an OData $filter clause. recursive is whether to list children of a directory. This parameter can be -// used in combination with the filter parameter to list specific type of files. maxResults is the maximum number -// of items to return in the response. A maximum of 1000 files can be returned. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client FileClient) ListFromTask(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.FileClient", "ListFromTask", err.Error()) - } - - result.fn = client.listFromTaskNextResults - req, err := client.ListFromTaskPreparer(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromTaskSender(req) - if err != nil { - result.nflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure sending request") - return - } - - result.nflr, err = client.ListFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure responding to request") - } - - return -} - -// ListFromTaskPreparer prepares the ListFromTask request. -func (client FileClient) ListFromTaskPreparer(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromTaskSender sends the ListFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) ListFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromTaskResponder handles the response to the ListFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) ListFromTaskResponder(resp *http.Response) (result NodeFileListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromTaskNextResults retrieves the next set of results, if any. -func (client FileClient) listFromTaskNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) { - req, err := lastResults.nodeFileListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromTaskComplete enumerates all values, automatically crossing page boundaries as required. -func (client FileClient) ListFromTaskComplete(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) { - result.page, err = client.ListFromTask(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2017-01-01.4.0/batch/job.go b/services/batch/2017-01-01.4.0/batch/job.go deleted file mode 100644 index 77ac65a2f627..000000000000 --- a/services/batch/2017-01-01.4.0/batch/job.go +++ /dev/null @@ -1,1519 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// JobClient is the a client for issuing REST requests to the Azure Batch service. -type JobClient struct { - BaseClient -} - -// NewJobClient creates an instance of the JobClient client. -func NewJobClient() JobClient { - return NewJobClientWithBaseURI(DefaultBaseURI) -} - -// NewJobClientWithBaseURI creates an instance of the JobClient client. -func NewJobClientWithBaseURI(baseURI string) JobClient { - return JobClient{NewWithBaseURI(baseURI)} -} - -// Add the Batch service supports two ways to control the work done as part of a job. In the first approach, the user -// specifies a Job Manager task. The Batch service launches this task when it is ready to start the job. The Job -// Manager task controls all other tasks that run under this job, by using the Task APIs. In the second approach, the -// user directly controls the execution of tasks under an active job, by using the Task APIs. Also note: when naming -// jobs, avoid including sensitive information such as user names or secret project names. This information may appear -// in telemetry logs accessible to Microsoft Support engineers. -// -// job is the job to be added. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client JobClient) Add(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: job, - Constraints: []validation.Constraint{{Target: "job.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobManagerTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "job.JobPreparationTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "job.JobReleaseTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "job.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, job, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client JobClient) AddPreparer(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobs"), - autorest.WithJSON(job), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deleting a job also deletes all tasks that are part of that job, and all job statistics. This also overrides -// the retention period for task data; that is, if the job contains tasks which are still retained on compute nodes, -// the Batch services deletes those tasks' working directories and all their contents. -// -// jobID is the ID of the job to delete. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the -// resource known to the client. The operation will be performed only if the resource's current ETag on the service -// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of -// the resource known to the client. The operation will be performed only if the resource's current ETag on the -// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has not been modified since the specified time. -func (client JobClient) Delete(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobClient) DeletePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) 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 -} - -// Disable the Batch Service immediately moves the job to the disabling state. Batch then uses the disableTasks -// parameter to determine what to do with the currently running tasks of the job. The job remains in the disabling -// state until the disable operation is completed and all tasks have been dealt with according to the disableTasks -// option; the job then moves to the disabled state. No new tasks are started under the job until it moves back to -// active state. If you try to disable a job that is in any state other than active, disabling, or disabled, the -// request fails with status code 409. -// -// jobID is the ID of the job to disable. jobDisableParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobClient) Disable(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisablePreparer(ctx, jobID, jobDisableParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure sending request") - return - } - - result, err = client.DisableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure responding to request") - } - - return -} - -// DisablePreparer prepares the Disable request. -func (client JobClient) DisablePreparer(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/disable", pathParameters), - autorest.WithJSON(jobDisableParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) DisableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableResponder handles the response to the Disable request. The method always -// closes the http.Response Body. -func (client JobClient) DisableResponder(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 -} - -// Enable when you call this API, the Batch service sets a disabled job to the enabling state. After the this operation -// is completed, the job moves to the active state, and scheduling of new tasks under the job resumes. The Batch -// service does not allow a task to remain in the active state for more than 7 days. Therefore, if you enable a job -// containing active tasks which were added more than 7 days ago, those tasks will not run. -// -// jobID is the ID of the job to enable. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the -// resource known to the client. The operation will be performed only if the resource's current ETag on the service -// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of -// the resource known to the client. The operation will be performed only if the resource's current ETag on the -// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has not been modified since the specified time. -func (client JobClient) Enable(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnablePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure sending request") - return - } - - result, err = client.EnableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure responding to request") - } - - return -} - -// EnablePreparer prepares the Enable request. -func (client JobClient) EnablePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/enable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) EnableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableResponder handles the response to the Enable request. The method always -// closes the http.Response Body. -func (client JobClient) EnableResponder(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 sends the get request. -// -// jobID is the ID of the job. selectParameter is an OData $select clause. expand is an OData $expand clause. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -// ifMatch is an ETag value associated with the version of the resource known to the client. The operation will be -// performed only if the resource's current ETag on the service exactly matches the value specified by the client. -// ifNoneMatch is an ETag value associated with the version of the resource known to the client. The operation will -// be performed only if the resource's current ETag on the service does not match the value specified by the -// client. ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. -// The operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobClient) Get(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJob, err error) { - req, err := client.GetPreparer(ctx, jobID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobClient) GetPreparer(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) GetResponder(resp *http.Response) (result CloudJob, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAllLifetimeStatistics statistics are aggregated across all jobs that have ever existed in the account, from -// account creation to the last update time of the statistics. -// -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client JobClient) GetAllLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result JobStatistics, err error) { - req, err := client.GetAllLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", nil, "Failure preparing request") - return - } - - resp, err := client.GetAllLifetimeStatisticsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", resp, "Failure sending request") - return - } - - result, err = client.GetAllLifetimeStatisticsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", resp, "Failure responding to request") - } - - return -} - -// GetAllLifetimeStatisticsPreparer prepares the GetAllLifetimeStatistics request. -func (client JobClient) GetAllLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/lifetimejobstats"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAllLifetimeStatisticsSender sends the GetAllLifetimeStatistics request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) GetAllLifetimeStatisticsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetAllLifetimeStatisticsResponder handles the response to the GetAllLifetimeStatistics request. The method always -// closes the http.Response Body. -func (client JobClient) GetAllLifetimeStatisticsResponder(resp *http.Response) (result JobStatistics, 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. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand -// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 jobs can be -// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. -func (client JobClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cjlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure sending request") - return - } - - result.cjlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client JobClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobs"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) ListResponder(resp *http.Response) (result CloudJobListResult, 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 JobClient) listNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) { - req, err := lastResults.cloudJobListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "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, "batch.JobClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListFromJobSchedule sends the list from job schedule request. -// -// jobScheduleID is the ID of the job schedule from which you want to get a list of jobs. filter is an OData -// $filter clause. selectParameter is an OData $select clause. expand is an OData $expand clause. maxResults is the -// maximum number of items to return in the response. A maximum of 1000 jobs can be returned. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client JobClient) ListFromJobSchedule(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "ListFromJobSchedule", err.Error()) - } - - result.fn = client.listFromJobScheduleNextResults - req, err := client.ListFromJobSchedulePreparer(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromJobScheduleSender(req) - if err != nil { - result.cjlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure sending request") - return - } - - result.cjlr, err = client.ListFromJobScheduleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure responding to request") - } - - return -} - -// ListFromJobSchedulePreparer prepares the ListFromJobSchedule request. -func (client JobClient) ListFromJobSchedulePreparer(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/jobs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromJobScheduleSender sends the ListFromJobSchedule request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) ListFromJobScheduleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromJobScheduleResponder handles the response to the ListFromJobSchedule request. The method always -// closes the http.Response Body. -func (client JobClient) ListFromJobScheduleResponder(resp *http.Response) (result CloudJobListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromJobScheduleNextResults retrieves the next set of results, if any. -func (client JobClient) listFromJobScheduleNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) { - req, err := lastResults.cloudJobListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromJobScheduleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromJobScheduleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromJobScheduleComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListFromJobScheduleComplete(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) { - result.page, err = client.ListFromJobSchedule(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListPreparationAndReleaseTaskStatus this API returns the Job Preparation and Job Release task status on all compute -// nodes that have run the Job Preparation or Job Release task. This includes nodes which have since been removed from -// the pool. -// -// jobID is the ID of the job. filter is an OData $filter clause. selectParameter is an OData $select clause. -// maxResults is the maximum number of items to return in the response. A maximum of 1000 tasks can be returned. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client JobClient) ListPreparationAndReleaseTaskStatus(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "ListPreparationAndReleaseTaskStatus", err.Error()) - } - - result.fn = client.listPreparationAndReleaseTaskStatusNextResults - req, err := client.ListPreparationAndReleaseTaskStatusPreparer(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", nil, "Failure preparing request") - return - } - - resp, err := client.ListPreparationAndReleaseTaskStatusSender(req) - if err != nil { - result.cjlpartsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure sending request") - return - } - - result.cjlpartsr, err = client.ListPreparationAndReleaseTaskStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure responding to request") - } - - return -} - -// ListPreparationAndReleaseTaskStatusPreparer prepares the ListPreparationAndReleaseTaskStatus request. -func (client JobClient) ListPreparationAndReleaseTaskStatusPreparer(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/jobpreparationandreleasetaskstatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPreparationAndReleaseTaskStatusSender sends the ListPreparationAndReleaseTaskStatus request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) ListPreparationAndReleaseTaskStatusSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListPreparationAndReleaseTaskStatusResponder handles the response to the ListPreparationAndReleaseTaskStatus request. The method always -// closes the http.Response Body. -func (client JobClient) ListPreparationAndReleaseTaskStatusResponder(resp *http.Response) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listPreparationAndReleaseTaskStatusNextResults retrieves the next set of results, if any. -func (client JobClient) listPreparationAndReleaseTaskStatusNextResults(lastResults CloudJobListPreparationAndReleaseTaskStatusResult) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) { - req, err := lastResults.cloudJobListPreparationAndReleaseTaskStatusResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListPreparationAndReleaseTaskStatusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListPreparationAndReleaseTaskStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListPreparationAndReleaseTaskStatusComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListPreparationAndReleaseTaskStatusComplete(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultIterator, err error) { - result.page, err = client.ListPreparationAndReleaseTaskStatus(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch this replaces only the job properties specified in the request. For example, if the job has constraints, and a -// request does not specify the constraints element, then the job keeps the existing constraints. -// -// jobID is the ID of the job whose properties you want to update. jobPatchParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobClient) Patch(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, jobID, jobPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client JobClient) PatchPreparer(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithJSON(jobPatchParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client JobClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Terminate when a Terminate Job request is received, the Batch service sets the job to the terminating state. The -// Batch service then terminates any active or running tasks associated with the job, and runs any required Job Release -// tasks. The job then moves into the completed state. -// -// jobID is the ID of the job to terminate. jobTerminateParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobClient) Terminate(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobID, jobTerminateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client JobClient) TerminatePreparer(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if jobTerminateParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(jobTerminateParameter)) - } - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client JobClient) TerminateResponder(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 -} - -// Update this fully replaces all the updateable properties of the job. For example, if the job has constraints -// associated with it and if constraints is not specified with this request, then the Batch service will remove the -// existing constraints. -// -// jobID is the ID of the job whose properties you want to update. jobUpdateParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobClient) Update(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobUpdateParameter, - Constraints: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, jobID, jobUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client JobClient) UpdatePreparer(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithJSON(jobUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) UpdateResponder(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/batch/2017-01-01.4.0/batch/jobschedule.go b/services/batch/2017-01-01.4.0/batch/jobschedule.go deleted file mode 100644 index 317390eb4d5d..000000000000 --- a/services/batch/2017-01-01.4.0/batch/jobschedule.go +++ /dev/null @@ -1,1261 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// JobScheduleClient is the a client for issuing REST requests to the Azure Batch service. -type JobScheduleClient struct { - BaseClient -} - -// NewJobScheduleClient creates an instance of the JobScheduleClient client. -func NewJobScheduleClient() JobScheduleClient { - return NewJobScheduleClientWithBaseURI(DefaultBaseURI) -} - -// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client. -func NewJobScheduleClientWithBaseURI(baseURI string) JobScheduleClient { - return JobScheduleClient{NewWithBaseURI(baseURI)} -} - -// Add sends the add request. -// -// cloudJobSchedule is the job schedule to be added. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client JobScheduleClient) Add(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: cloudJobSchedule, - Constraints: []validation.Constraint{{Target: "cloudJobSchedule.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.Schedule", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "cloudJobSchedule.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "cloudJobSchedule.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, cloudJobSchedule, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client JobScheduleClient) AddPreparer(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobschedules"), - autorest.WithJSON(cloudJobSchedule), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobScheduleClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete when you delete a job schedule, this also deletes all jobs and tasks under that schedule. When tasks are -// deleted, all the files in their working directories on the compute nodes are also deleted (the retention period is -// ignored). The job schedule statistics are no longer accessible once the job schedule is deleted, though they are -// still counted towards account lifetime statistics. -// -// jobScheduleID is the ID of the job schedule to delete. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Delete(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobScheduleClient) DeletePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) 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 -} - -// Disable no new jobs will be created until the job schedule is enabled again. -// -// jobScheduleID is the ID of the job schedule to disable. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Disable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure sending request") - return - } - - result, err = client.DisableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure responding to request") - } - - return -} - -// DisablePreparer prepares the Disable request. -func (client JobScheduleClient) DisablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/disable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) DisableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableResponder handles the response to the Disable request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) DisableResponder(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 -} - -// Enable sends the enable request. -// -// jobScheduleID is the ID of the job schedule to enable. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Enable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure sending request") - return - } - - result, err = client.EnableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure responding to request") - } - - return -} - -// EnablePreparer prepares the Enable request. -func (client JobScheduleClient) EnablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/enable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) EnableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableResponder handles the response to the Enable request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) EnableResponder(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 -} - -// Exists sends the exists request. -// -// jobScheduleID is the ID of the job schedule which you want to check. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Exists(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ExistsPreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", nil, "Failure preparing request") - return - } - - resp, err := client.ExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure sending request") - return - } - - result, err = client.ExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure responding to request") - } - - return -} - -// ExistsPreparer prepares the Exists request. -func (client JobScheduleClient) ExistsPreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExistsSender sends the Exists request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) ExistsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExistsResponder handles the response to the Exists request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) ExistsResponder(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 information about the specified job schedule. -// -// jobScheduleID is the ID of the job schedule to get. selectParameter is an OData $select clause. expand is an -// OData $expand clause. timeout is the maximum time that the server can spend processing the request, in seconds. -// The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with -// no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether -// the server should return the client-request-id in the response. ocpDate is the time the request was issued. -// Client libraries typically set this to the current system clock time; set it explicitly if you are calling the -// REST API directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobScheduleClient) Get(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJobSchedule, err error) { - req, err := client.GetPreparer(ctx, jobScheduleID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobScheduleClient) GetPreparer(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) GetResponder(resp *http.Response) (result CloudJobSchedule, 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. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand -// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 job schedules can -// be returned. timeout is the maximum time that the server can spend processing the request, in seconds. The -// default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. -func (client JobScheduleClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cjslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure sending request") - return - } - - result.cjslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client JobScheduleClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobschedules"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobScheduleClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) ListResponder(resp *http.Response) (result CloudJobScheduleListResult, 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 JobScheduleClient) listNextResults(lastResults CloudJobScheduleListResult) (result CloudJobScheduleListResult, err error) { - req, err := lastResults.cloudJobScheduleListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobScheduleClient", "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, "batch.JobScheduleClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobScheduleClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch this replaces only the job schedule properties specified in the request. For example, if the schedule property -// is not specified with this request, then the Batch service will keep the existing schedule. Changes to a job -// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are -// unaffected. -// -// jobScheduleID is the ID of the job schedule to update. jobSchedulePatchParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobScheduleClient) Patch(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, jobScheduleID, jobSchedulePatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client JobScheduleClient) PatchPreparer(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithJSON(jobSchedulePatchParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Terminate sends the terminate request. -// -// jobScheduleID is the ID of the job schedule to terminates. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Terminate(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client JobScheduleClient) TerminatePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) TerminateResponder(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 -} - -// Update this fully replaces all the updateable properties of the job schedule. For example, if the schedule property -// is not specified with this request, then the Batch service will remove the existing schedule. Changes to a job -// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are -// unaffected. -// -// jobScheduleID is the ID of the job schedule to update. jobScheduleUpdateParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobScheduleClient) Update(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobScheduleUpdateParameter, - Constraints: []validation.Constraint{{Target: "jobScheduleUpdateParameter.Schedule", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, jobScheduleID, jobScheduleUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client JobScheduleClient) UpdatePreparer(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithJSON(jobScheduleUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) UpdateResponder(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/batch/2017-01-01.4.0/batch/models.go b/services/batch/2017-01-01.4.0/batch/models.go deleted file mode 100644 index b2ed4b95987d..000000000000 --- a/services/batch/2017-01-01.4.0/batch/models.go +++ /dev/null @@ -1,2989 +0,0 @@ -package batch - -// 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" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "io" - "net/http" -) - -// AccessScope enumerates the values for access scope. -type AccessScope string - -const ( - // Job ... - Job AccessScope = "job" -) - -// PossibleAccessScopeValues returns an array of possible values for the AccessScope const type. -func PossibleAccessScopeValues() []AccessScope { - return []AccessScope{Job} -} - -// AllocationState enumerates the values for allocation state. -type AllocationState string - -const ( - // Resizing ... - Resizing AllocationState = "resizing" - // Steady ... - Steady AllocationState = "steady" - // Stopping ... - Stopping AllocationState = "stopping" -) - -// PossibleAllocationStateValues returns an array of possible values for the AllocationState const type. -func PossibleAllocationStateValues() []AllocationState { - return []AllocationState{Resizing, Steady, Stopping} -} - -// AutoUserScope enumerates the values for auto user scope. -type AutoUserScope string - -const ( - // Pool ... - Pool AutoUserScope = "pool" - // Task ... - Task AutoUserScope = "task" -) - -// PossibleAutoUserScopeValues returns an array of possible values for the AutoUserScope const type. -func PossibleAutoUserScopeValues() []AutoUserScope { - return []AutoUserScope{Pool, Task} -} - -// CachingType enumerates the values for caching type. -type CachingType string - -const ( - // None ... - None CachingType = "none" - // ReadOnly ... - ReadOnly CachingType = "readOnly" - // ReadWrite ... - ReadWrite CachingType = "readWrite" -) - -// PossibleCachingTypeValues returns an array of possible values for the CachingType const type. -func PossibleCachingTypeValues() []CachingType { - return []CachingType{None, ReadOnly, ReadWrite} -} - -// CertificateFormat enumerates the values for certificate format. -type CertificateFormat string - -const ( - // Cer ... - Cer CertificateFormat = "cer" - // Pfx ... - Pfx CertificateFormat = "pfx" - // Unmapped ... - Unmapped CertificateFormat = "unmapped" -) - -// PossibleCertificateFormatValues returns an array of possible values for the CertificateFormat const type. -func PossibleCertificateFormatValues() []CertificateFormat { - return []CertificateFormat{Cer, Pfx, Unmapped} -} - -// CertificateState enumerates the values for certificate state. -type CertificateState string - -const ( - // Active ... - Active CertificateState = "active" - // DeleteFailed ... - DeleteFailed CertificateState = "deleteFailed" - // Deleting ... - Deleting CertificateState = "deleting" -) - -// PossibleCertificateStateValues returns an array of possible values for the CertificateState const type. -func PossibleCertificateStateValues() []CertificateState { - return []CertificateState{Active, DeleteFailed, Deleting} -} - -// CertificateStoreLocation enumerates the values for certificate store location. -type CertificateStoreLocation string - -const ( - // CertificateStoreLocationCurrentUser ... - CertificateStoreLocationCurrentUser CertificateStoreLocation = "currentUser" - // CertificateStoreLocationLocalMachine ... - CertificateStoreLocationLocalMachine CertificateStoreLocation = "localMachine" - // CertificateStoreLocationUnmapped ... - CertificateStoreLocationUnmapped CertificateStoreLocation = "unmapped" -) - -// PossibleCertificateStoreLocationValues returns an array of possible values for the CertificateStoreLocation const type. -func PossibleCertificateStoreLocationValues() []CertificateStoreLocation { - return []CertificateStoreLocation{CertificateStoreLocationCurrentUser, CertificateStoreLocationLocalMachine, CertificateStoreLocationUnmapped} -} - -// CertificateVisibility enumerates the values for certificate visibility. -type CertificateVisibility string - -const ( - // CertificateVisibilityRemoteUser ... - CertificateVisibilityRemoteUser CertificateVisibility = "remoteUser" - // CertificateVisibilityStartTask ... - CertificateVisibilityStartTask CertificateVisibility = "startTask" - // CertificateVisibilityTask ... - CertificateVisibilityTask CertificateVisibility = "task" - // CertificateVisibilityUnmapped ... - CertificateVisibilityUnmapped CertificateVisibility = "unmapped" -) - -// PossibleCertificateVisibilityValues returns an array of possible values for the CertificateVisibility const type. -func PossibleCertificateVisibilityValues() []CertificateVisibility { - return []CertificateVisibility{CertificateVisibilityRemoteUser, CertificateVisibilityStartTask, CertificateVisibilityTask, CertificateVisibilityUnmapped} -} - -// ComputeNodeDeallocationOption enumerates the values for compute node deallocation option. -type ComputeNodeDeallocationOption string - -const ( - // Requeue ... - Requeue ComputeNodeDeallocationOption = "requeue" - // RetainedData ... - RetainedData ComputeNodeDeallocationOption = "retainedData" - // TaskCompletion ... - TaskCompletion ComputeNodeDeallocationOption = "taskCompletion" - // Terminate ... - Terminate ComputeNodeDeallocationOption = "terminate" -) - -// PossibleComputeNodeDeallocationOptionValues returns an array of possible values for the ComputeNodeDeallocationOption const type. -func PossibleComputeNodeDeallocationOptionValues() []ComputeNodeDeallocationOption { - return []ComputeNodeDeallocationOption{Requeue, RetainedData, TaskCompletion, Terminate} -} - -// ComputeNodeFillType enumerates the values for compute node fill type. -type ComputeNodeFillType string - -const ( - // ComputeNodeFillTypePack ... - ComputeNodeFillTypePack ComputeNodeFillType = "pack" - // ComputeNodeFillTypeSpread ... - ComputeNodeFillTypeSpread ComputeNodeFillType = "spread" - // ComputeNodeFillTypeUnmapped ... - ComputeNodeFillTypeUnmapped ComputeNodeFillType = "unmapped" -) - -// PossibleComputeNodeFillTypeValues returns an array of possible values for the ComputeNodeFillType const type. -func PossibleComputeNodeFillTypeValues() []ComputeNodeFillType { - return []ComputeNodeFillType{ComputeNodeFillTypePack, ComputeNodeFillTypeSpread, ComputeNodeFillTypeUnmapped} -} - -// ComputeNodeRebootOption enumerates the values for compute node reboot option. -type ComputeNodeRebootOption string - -const ( - // ComputeNodeRebootOptionRequeue ... - ComputeNodeRebootOptionRequeue ComputeNodeRebootOption = "requeue" - // ComputeNodeRebootOptionRetainedData ... - ComputeNodeRebootOptionRetainedData ComputeNodeRebootOption = "retainedData" - // ComputeNodeRebootOptionTaskCompletion ... - ComputeNodeRebootOptionTaskCompletion ComputeNodeRebootOption = "taskCompletion" - // ComputeNodeRebootOptionTerminate ... - ComputeNodeRebootOptionTerminate ComputeNodeRebootOption = "terminate" -) - -// PossibleComputeNodeRebootOptionValues returns an array of possible values for the ComputeNodeRebootOption const type. -func PossibleComputeNodeRebootOptionValues() []ComputeNodeRebootOption { - return []ComputeNodeRebootOption{ComputeNodeRebootOptionRequeue, ComputeNodeRebootOptionRetainedData, ComputeNodeRebootOptionTaskCompletion, ComputeNodeRebootOptionTerminate} -} - -// ComputeNodeReimageOption enumerates the values for compute node reimage option. -type ComputeNodeReimageOption string - -const ( - // ComputeNodeReimageOptionRequeue ... - ComputeNodeReimageOptionRequeue ComputeNodeReimageOption = "requeue" - // ComputeNodeReimageOptionRetainedData ... - ComputeNodeReimageOptionRetainedData ComputeNodeReimageOption = "retainedData" - // ComputeNodeReimageOptionTaskCompletion ... - ComputeNodeReimageOptionTaskCompletion ComputeNodeReimageOption = "taskCompletion" - // ComputeNodeReimageOptionTerminate ... - ComputeNodeReimageOptionTerminate ComputeNodeReimageOption = "terminate" -) - -// PossibleComputeNodeReimageOptionValues returns an array of possible values for the ComputeNodeReimageOption const type. -func PossibleComputeNodeReimageOptionValues() []ComputeNodeReimageOption { - return []ComputeNodeReimageOption{ComputeNodeReimageOptionRequeue, ComputeNodeReimageOptionRetainedData, ComputeNodeReimageOptionTaskCompletion, ComputeNodeReimageOptionTerminate} -} - -// ComputeNodeState enumerates the values for compute node state. -type ComputeNodeState string - -const ( - // Creating ... - Creating ComputeNodeState = "creating" - // Idle ... - Idle ComputeNodeState = "idle" - // LeavingPool ... - LeavingPool ComputeNodeState = "leavingPool" - // Offline ... - Offline ComputeNodeState = "offline" - // Rebooting ... - Rebooting ComputeNodeState = "rebooting" - // Reimaging ... - Reimaging ComputeNodeState = "reimaging" - // Running ... - Running ComputeNodeState = "running" - // Starting ... - Starting ComputeNodeState = "starting" - // StartTaskFailed ... - StartTaskFailed ComputeNodeState = "startTaskFailed" - // Unknown ... - Unknown ComputeNodeState = "unknown" - // Unusable ... - Unusable ComputeNodeState = "unusable" - // WaitingForStartTask ... - WaitingForStartTask ComputeNodeState = "waitingForStartTask" -) - -// PossibleComputeNodeStateValues returns an array of possible values for the ComputeNodeState const type. -func PossibleComputeNodeStateValues() []ComputeNodeState { - return []ComputeNodeState{Creating, Idle, LeavingPool, Offline, Rebooting, Reimaging, Running, Starting, StartTaskFailed, Unknown, Unusable, WaitingForStartTask} -} - -// DependencyAction enumerates the values for dependency action. -type DependencyAction string - -const ( - // Block ... - Block DependencyAction = "block" - // Satisfy ... - Satisfy DependencyAction = "satisfy" -) - -// PossibleDependencyActionValues returns an array of possible values for the DependencyAction const type. -func PossibleDependencyActionValues() []DependencyAction { - return []DependencyAction{Block, Satisfy} -} - -// DisableComputeNodeSchedulingOption enumerates the values for disable compute node scheduling option. -type DisableComputeNodeSchedulingOption string - -const ( - // DisableComputeNodeSchedulingOptionRequeue ... - DisableComputeNodeSchedulingOptionRequeue DisableComputeNodeSchedulingOption = "requeue" - // DisableComputeNodeSchedulingOptionTaskCompletion ... - DisableComputeNodeSchedulingOptionTaskCompletion DisableComputeNodeSchedulingOption = "taskCompletion" - // DisableComputeNodeSchedulingOptionTerminate ... - DisableComputeNodeSchedulingOptionTerminate DisableComputeNodeSchedulingOption = "terminate" -) - -// PossibleDisableComputeNodeSchedulingOptionValues returns an array of possible values for the DisableComputeNodeSchedulingOption const type. -func PossibleDisableComputeNodeSchedulingOptionValues() []DisableComputeNodeSchedulingOption { - return []DisableComputeNodeSchedulingOption{DisableComputeNodeSchedulingOptionRequeue, DisableComputeNodeSchedulingOptionTaskCompletion, DisableComputeNodeSchedulingOptionTerminate} -} - -// DisableJobOption enumerates the values for disable job option. -type DisableJobOption string - -const ( - // DisableJobOptionRequeue ... - DisableJobOptionRequeue DisableJobOption = "requeue" - // DisableJobOptionTerminate ... - DisableJobOptionTerminate DisableJobOption = "terminate" - // DisableJobOptionWait ... - DisableJobOptionWait DisableJobOption = "wait" -) - -// PossibleDisableJobOptionValues returns an array of possible values for the DisableJobOption const type. -func PossibleDisableJobOptionValues() []DisableJobOption { - return []DisableJobOption{DisableJobOptionRequeue, DisableJobOptionTerminate, DisableJobOptionWait} -} - -// ElevationLevel enumerates the values for elevation level. -type ElevationLevel string - -const ( - // Admin ... - Admin ElevationLevel = "admin" - // NonAdmin ... - NonAdmin ElevationLevel = "nonAdmin" -) - -// PossibleElevationLevelValues returns an array of possible values for the ElevationLevel const type. -func PossibleElevationLevelValues() []ElevationLevel { - return []ElevationLevel{Admin, NonAdmin} -} - -// JobAction enumerates the values for job action. -type JobAction string - -const ( - // JobActionDisable ... - JobActionDisable JobAction = "disable" - // JobActionNone ... - JobActionNone JobAction = "none" - // JobActionTerminate ... - JobActionTerminate JobAction = "terminate" -) - -// PossibleJobActionValues returns an array of possible values for the JobAction const type. -func PossibleJobActionValues() []JobAction { - return []JobAction{JobActionDisable, JobActionNone, JobActionTerminate} -} - -// JobPreparationTaskState enumerates the values for job preparation task state. -type JobPreparationTaskState string - -const ( - // JobPreparationTaskStateCompleted ... - JobPreparationTaskStateCompleted JobPreparationTaskState = "completed" - // JobPreparationTaskStateRunning ... - JobPreparationTaskStateRunning JobPreparationTaskState = "running" -) - -// PossibleJobPreparationTaskStateValues returns an array of possible values for the JobPreparationTaskState const type. -func PossibleJobPreparationTaskStateValues() []JobPreparationTaskState { - return []JobPreparationTaskState{JobPreparationTaskStateCompleted, JobPreparationTaskStateRunning} -} - -// JobReleaseTaskState enumerates the values for job release task state. -type JobReleaseTaskState string - -const ( - // JobReleaseTaskStateCompleted ... - JobReleaseTaskStateCompleted JobReleaseTaskState = "completed" - // JobReleaseTaskStateRunning ... - JobReleaseTaskStateRunning JobReleaseTaskState = "running" -) - -// PossibleJobReleaseTaskStateValues returns an array of possible values for the JobReleaseTaskState const type. -func PossibleJobReleaseTaskStateValues() []JobReleaseTaskState { - return []JobReleaseTaskState{JobReleaseTaskStateCompleted, JobReleaseTaskStateRunning} -} - -// JobScheduleState enumerates the values for job schedule state. -type JobScheduleState string - -const ( - // JobScheduleStateActive ... - JobScheduleStateActive JobScheduleState = "active" - // JobScheduleStateCompleted ... - JobScheduleStateCompleted JobScheduleState = "completed" - // JobScheduleStateDeleting ... - JobScheduleStateDeleting JobScheduleState = "deleting" - // JobScheduleStateDisabled ... - JobScheduleStateDisabled JobScheduleState = "disabled" - // JobScheduleStateTerminating ... - JobScheduleStateTerminating JobScheduleState = "terminating" -) - -// PossibleJobScheduleStateValues returns an array of possible values for the JobScheduleState const type. -func PossibleJobScheduleStateValues() []JobScheduleState { - return []JobScheduleState{JobScheduleStateActive, JobScheduleStateCompleted, JobScheduleStateDeleting, JobScheduleStateDisabled, JobScheduleStateTerminating} -} - -// JobState enumerates the values for job state. -type JobState string - -const ( - // JobStateActive ... - JobStateActive JobState = "active" - // JobStateCompleted ... - JobStateCompleted JobState = "completed" - // JobStateDeleting ... - JobStateDeleting JobState = "deleting" - // JobStateDisabled ... - JobStateDisabled JobState = "disabled" - // JobStateDisabling ... - JobStateDisabling JobState = "disabling" - // JobStateEnabling ... - JobStateEnabling JobState = "enabling" - // JobStateTerminating ... - JobStateTerminating JobState = "terminating" -) - -// PossibleJobStateValues returns an array of possible values for the JobState const type. -func PossibleJobStateValues() []JobState { - return []JobState{JobStateActive, JobStateCompleted, JobStateDeleting, JobStateDisabled, JobStateDisabling, JobStateEnabling, JobStateTerminating} -} - -// OnAllTasksComplete enumerates the values for on all tasks complete. -type OnAllTasksComplete string - -const ( - // NoAction ... - NoAction OnAllTasksComplete = "noAction" - // TerminateJob ... - TerminateJob OnAllTasksComplete = "terminateJob" -) - -// PossibleOnAllTasksCompleteValues returns an array of possible values for the OnAllTasksComplete const type. -func PossibleOnAllTasksCompleteValues() []OnAllTasksComplete { - return []OnAllTasksComplete{NoAction, TerminateJob} -} - -// OnTaskFailure enumerates the values for on task failure. -type OnTaskFailure string - -const ( - // OnTaskFailureNoAction ... - OnTaskFailureNoAction OnTaskFailure = "noAction" - // OnTaskFailurePerformExitOptionsJobAction ... - OnTaskFailurePerformExitOptionsJobAction OnTaskFailure = "performExitOptionsJobAction" -) - -// PossibleOnTaskFailureValues returns an array of possible values for the OnTaskFailure const type. -func PossibleOnTaskFailureValues() []OnTaskFailure { - return []OnTaskFailure{OnTaskFailureNoAction, OnTaskFailurePerformExitOptionsJobAction} -} - -// OSType enumerates the values for os type. -type OSType string - -const ( - // OSTypeLinux ... - OSTypeLinux OSType = "linux" - // OSTypeUnmapped ... - OSTypeUnmapped OSType = "unmapped" - // OSTypeWindows ... - OSTypeWindows OSType = "windows" -) - -// PossibleOSTypeValues returns an array of possible values for the OSType const type. -func PossibleOSTypeValues() []OSType { - return []OSType{OSTypeLinux, OSTypeUnmapped, OSTypeWindows} -} - -// PoolLifetimeOption enumerates the values for pool lifetime option. -type PoolLifetimeOption string - -const ( - // PoolLifetimeOptionJob ... - PoolLifetimeOptionJob PoolLifetimeOption = "job" - // PoolLifetimeOptionJobSchedule ... - PoolLifetimeOptionJobSchedule PoolLifetimeOption = "jobSchedule" - // PoolLifetimeOptionUnmapped ... - PoolLifetimeOptionUnmapped PoolLifetimeOption = "unmapped" -) - -// PossiblePoolLifetimeOptionValues returns an array of possible values for the PoolLifetimeOption const type. -func PossiblePoolLifetimeOptionValues() []PoolLifetimeOption { - return []PoolLifetimeOption{PoolLifetimeOptionJob, PoolLifetimeOptionJobSchedule, PoolLifetimeOptionUnmapped} -} - -// PoolState enumerates the values for pool state. -type PoolState string - -const ( - // PoolStateActive ... - PoolStateActive PoolState = "active" - // PoolStateDeleting ... - PoolStateDeleting PoolState = "deleting" - // PoolStateUpgrading ... - PoolStateUpgrading PoolState = "upgrading" -) - -// PossiblePoolStateValues returns an array of possible values for the PoolState const type. -func PossiblePoolStateValues() []PoolState { - return []PoolState{PoolStateActive, PoolStateDeleting, PoolStateUpgrading} -} - -// SchedulingErrorCategory enumerates the values for scheduling error category. -type SchedulingErrorCategory string - -const ( - // SchedulingErrorCategoryServerError ... - SchedulingErrorCategoryServerError SchedulingErrorCategory = "serverError" - // SchedulingErrorCategoryUnmapped ... - SchedulingErrorCategoryUnmapped SchedulingErrorCategory = "unmapped" - // SchedulingErrorCategoryUserError ... - SchedulingErrorCategoryUserError SchedulingErrorCategory = "userError" -) - -// PossibleSchedulingErrorCategoryValues returns an array of possible values for the SchedulingErrorCategory const type. -func PossibleSchedulingErrorCategoryValues() []SchedulingErrorCategory { - return []SchedulingErrorCategory{SchedulingErrorCategoryServerError, SchedulingErrorCategoryUnmapped, SchedulingErrorCategoryUserError} -} - -// SchedulingState enumerates the values for scheduling state. -type SchedulingState string - -const ( - // Disabled ... - Disabled SchedulingState = "disabled" - // Enabled ... - Enabled SchedulingState = "enabled" -) - -// PossibleSchedulingStateValues returns an array of possible values for the SchedulingState const type. -func PossibleSchedulingStateValues() []SchedulingState { - return []SchedulingState{Disabled, Enabled} -} - -// StartTaskState enumerates the values for start task state. -type StartTaskState string - -const ( - // StartTaskStateCompleted ... - StartTaskStateCompleted StartTaskState = "completed" - // StartTaskStateRunning ... - StartTaskStateRunning StartTaskState = "running" -) - -// PossibleStartTaskStateValues returns an array of possible values for the StartTaskState const type. -func PossibleStartTaskStateValues() []StartTaskState { - return []StartTaskState{StartTaskStateCompleted, StartTaskStateRunning} -} - -// SubtaskState enumerates the values for subtask state. -type SubtaskState string - -const ( - // SubtaskStateCompleted ... - SubtaskStateCompleted SubtaskState = "completed" - // SubtaskStatePreparing ... - SubtaskStatePreparing SubtaskState = "preparing" - // SubtaskStateRunning ... - SubtaskStateRunning SubtaskState = "running" -) - -// PossibleSubtaskStateValues returns an array of possible values for the SubtaskState const type. -func PossibleSubtaskStateValues() []SubtaskState { - return []SubtaskState{SubtaskStateCompleted, SubtaskStatePreparing, SubtaskStateRunning} -} - -// TaskAddStatus enumerates the values for task add status. -type TaskAddStatus string - -const ( - // TaskAddStatusClientError ... - TaskAddStatusClientError TaskAddStatus = "clientError" - // TaskAddStatusServerError ... - TaskAddStatusServerError TaskAddStatus = "serverError" - // TaskAddStatusSuccess ... - TaskAddStatusSuccess TaskAddStatus = "success" - // TaskAddStatusUnmapped ... - TaskAddStatusUnmapped TaskAddStatus = "unmapped" -) - -// PossibleTaskAddStatusValues returns an array of possible values for the TaskAddStatus const type. -func PossibleTaskAddStatusValues() []TaskAddStatus { - return []TaskAddStatus{TaskAddStatusClientError, TaskAddStatusServerError, TaskAddStatusSuccess, TaskAddStatusUnmapped} -} - -// TaskState enumerates the values for task state. -type TaskState string - -const ( - // TaskStateActive ... - TaskStateActive TaskState = "active" - // TaskStateCompleted ... - TaskStateCompleted TaskState = "completed" - // TaskStatePreparing ... - TaskStatePreparing TaskState = "preparing" - // TaskStateRunning ... - TaskStateRunning TaskState = "running" -) - -// PossibleTaskStateValues returns an array of possible values for the TaskState const type. -func PossibleTaskStateValues() []TaskState { - return []TaskState{TaskStateActive, TaskStateCompleted, TaskStatePreparing, TaskStateRunning} -} - -// AccountListNodeAgentSkusResult ... -type AccountListNodeAgentSkusResult struct { - autorest.Response `json:"-"` - Value *[]NodeAgentSku `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// AccountListNodeAgentSkusResultIterator provides access to a complete listing of NodeAgentSku values. -type AccountListNodeAgentSkusResultIterator struct { - i int - page AccountListNodeAgentSkusResultPage -} - -// Next 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 *AccountListNodeAgentSkusResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AccountListNodeAgentSkusResultIterator) 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 AccountListNodeAgentSkusResultIterator) Response() AccountListNodeAgentSkusResult { - 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 AccountListNodeAgentSkusResultIterator) Value() NodeAgentSku { - if !iter.page.NotDone() { - return NodeAgentSku{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (alnasr AccountListNodeAgentSkusResult) IsEmpty() bool { - return alnasr.Value == nil || len(*alnasr.Value) == 0 -} - -// accountListNodeAgentSkusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alnasr AccountListNodeAgentSkusResult) accountListNodeAgentSkusResultPreparer() (*http.Request, error) { - if alnasr.OdataNextLink == nil || len(to.String(alnasr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alnasr.OdataNextLink))) -} - -// AccountListNodeAgentSkusResultPage contains a page of NodeAgentSku values. -type AccountListNodeAgentSkusResultPage struct { - fn func(AccountListNodeAgentSkusResult) (AccountListNodeAgentSkusResult, error) - alnasr AccountListNodeAgentSkusResult -} - -// 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. -func (page *AccountListNodeAgentSkusResultPage) Next() error { - next, err := page.fn(page.alnasr) - if err != nil { - return err - } - page.alnasr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AccountListNodeAgentSkusResultPage) NotDone() bool { - return !page.alnasr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AccountListNodeAgentSkusResultPage) Response() AccountListNodeAgentSkusResult { - return page.alnasr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AccountListNodeAgentSkusResultPage) Values() []NodeAgentSku { - if page.alnasr.IsEmpty() { - return nil - } - return *page.alnasr.Value -} - -// AffinityInformation ... -type AffinityInformation struct { - // AffinityID - You can pass the affinityId of a compute node or task to indicate that this task needs to be placed close to the node or task. - AffinityID *string `json:"affinityId,omitempty"` -} - -// ApplicationListResult ... -type ApplicationListResult struct { - autorest.Response `json:"-"` - Value *[]ApplicationSummary `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// ApplicationListResultIterator provides access to a complete listing of ApplicationSummary values. -type ApplicationListResultIterator struct { - i int - page ApplicationListResultPage -} - -// Next 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 *ApplicationListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationListResultIterator) 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 ApplicationListResultIterator) Response() ApplicationListResult { - 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 ApplicationListResultIterator) Value() ApplicationSummary { - if !iter.page.NotDone() { - return ApplicationSummary{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (alr ApplicationListResult) IsEmpty() bool { - return alr.Value == nil || len(*alr.Value) == 0 -} - -// applicationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alr ApplicationListResult) applicationListResultPreparer() (*http.Request, error) { - if alr.OdataNextLink == nil || len(to.String(alr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alr.OdataNextLink))) -} - -// ApplicationListResultPage contains a page of ApplicationSummary values. -type ApplicationListResultPage struct { - fn func(ApplicationListResult) (ApplicationListResult, error) - alr ApplicationListResult -} - -// 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. -func (page *ApplicationListResultPage) Next() error { - next, err := page.fn(page.alr) - if err != nil { - return err - } - page.alr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationListResultPage) NotDone() bool { - return !page.alr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationListResultPage) Response() ApplicationListResult { - return page.alr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationListResultPage) Values() []ApplicationSummary { - if page.alr.IsEmpty() { - return nil - } - return *page.alr.Value -} - -// ApplicationPackageReference ... -type ApplicationPackageReference struct { - ApplicationID *string `json:"applicationId,omitempty"` - // Version - If this is omitted, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences. If you are calling the REST API directly, the HTTP status code is 409. - Version *string `json:"version,omitempty"` -} - -// ApplicationSummary ... -type ApplicationSummary struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Versions *[]string `json:"versions,omitempty"` -} - -// AuthenticationTokenSettings ... -type AuthenticationTokenSettings struct { - // Access - The authentication token grants access to a limited set of Batch service operations. Currently the only supported value for the access property is 'job', which grants access to all operations related to the job which contains the task. - Access *[]AccessScope `json:"access,omitempty"` -} - -// AutoPoolSpecification ... -type AutoPoolSpecification struct { - // AutoPoolIDPrefix - The Batch service assigns each auto pool a unique identifier on creation. To distinguish between pools created for different purposes, you can specify this element to add a prefix to the id that is assigned. The prefix can be up to 20 characters long. - AutoPoolIDPrefix *string `json:"autoPoolIdPrefix,omitempty"` - // PoolLifetimeOption - When the pool lifetime scope is jobSchedule level, the Batch service keeps track of the last autopool created for the job schedule, and deletes that pool when the job schedule completes. Batch will also delete this pool if the user updates the auto pool specification in a way that changes this lifetime. Possible values include: 'PoolLifetimeOptionJobSchedule', 'PoolLifetimeOptionJob', 'PoolLifetimeOptionUnmapped' - PoolLifetimeOption PoolLifetimeOption `json:"poolLifetimeOption,omitempty"` - // KeepAlive - If false, the Batch service deletes the pool once its lifetime (as determined by the poolLifetimeOption setting) expires; that is, when the job or job schedule completes. If true, the Batch service does not delete the pool automatically. It is up to the user to delete auto pools created with this option. - KeepAlive *bool `json:"keepAlive,omitempty"` - Pool *PoolSpecification `json:"pool,omitempty"` -} - -// AutoScaleRun ... -type AutoScaleRun struct { - autorest.Response `json:"-"` - Timestamp *date.Time `json:"timestamp,omitempty"` - // Results - Each variable value is returned in the form $variable=value, and variables are separated by semicolons. - Results *string `json:"results,omitempty"` - Error *AutoScaleRunError `json:"error,omitempty"` -} - -// AutoScaleRunError ... -type AutoScaleRunError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Values *[]NameValuePair `json:"values,omitempty"` -} - -// AutoUserSpecification ... -type AutoUserSpecification struct { - // Scope - pool - specifies that the task runs as the common auto user account which is created on every node in a pool. task - specifies that the service should create a new user for the task. The default value is task. Possible values include: 'Task', 'Pool' - Scope AutoUserScope `json:"scope,omitempty"` - // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin' - ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"` -} - -// Certificate a certificate that can be installed on compute nodes and can be used to authenticate operations on -// the machine. -type Certificate struct { - autorest.Response `json:"-"` - Thumbprint *string `json:"thumbprint,omitempty"` - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - URL *string `json:"url,omitempty"` - // State - Possible values include: 'Active', 'Deleting', 'DeleteFailed' - State CertificateState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the certificate is in its initial active state. Possible values include: 'Active', 'Deleting', 'DeleteFailed' - PreviousState CertificateState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the certificate is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - PublicData *string `json:"publicData,omitempty"` - // DeleteCertificateError - This property is set only if the certificate is in the DeleteFailed state. - DeleteCertificateError *DeleteCertificateError `json:"deleteCertificateError,omitempty"` -} - -// CertificateAddParameter ... -type CertificateAddParameter struct { - Thumbprint *string `json:"thumbprint,omitempty"` - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - Data *string `json:"data,omitempty"` - // CertificateFormat - Possible values include: 'Pfx', 'Cer', 'Unmapped' - CertificateFormat CertificateFormat `json:"certificateFormat,omitempty"` - // Password - This is required if the certificate format is pfx. It should be omitted if the certificate format is cer. - Password *string `json:"password,omitempty"` -} - -// CertificateListResult ... -type CertificateListResult struct { - autorest.Response `json:"-"` - Value *[]Certificate `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CertificateListResultIterator provides access to a complete listing of Certificate values. -type CertificateListResultIterator struct { - i int - page CertificateListResultPage -} - -// Next 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 *CertificateListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CertificateListResultIterator) 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 CertificateListResultIterator) Response() CertificateListResult { - 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 CertificateListResultIterator) Value() Certificate { - if !iter.page.NotDone() { - return Certificate{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (clr CertificateListResult) IsEmpty() bool { - return clr.Value == nil || len(*clr.Value) == 0 -} - -// certificateListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) { - if clr.OdataNextLink == nil || len(to.String(clr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(clr.OdataNextLink))) -} - -// CertificateListResultPage contains a page of Certificate values. -type CertificateListResultPage struct { - fn func(CertificateListResult) (CertificateListResult, error) - clr CertificateListResult -} - -// 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. -func (page *CertificateListResultPage) Next() error { - next, err := page.fn(page.clr) - if err != nil { - return err - } - page.clr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CertificateListResultPage) NotDone() bool { - return !page.clr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CertificateListResultPage) Response() CertificateListResult { - return page.clr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CertificateListResultPage) Values() []Certificate { - if page.clr.IsEmpty() { - return nil - } - return *page.clr.Value -} - -// CertificateReference ... -type CertificateReference struct { - Thumbprint *string `json:"thumbprint,omitempty"` - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - // StoreLocation - The default value is currentUser. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. Possible values include: 'CertificateStoreLocationCurrentUser', 'CertificateStoreLocationLocalMachine', 'CertificateStoreLocationUnmapped' - StoreLocation CertificateStoreLocation `json:"storeLocation,omitempty"` - // StoreName - The default value is My. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). - StoreName *string `json:"storeName,omitempty"` - // Visibility - The default is all accounts. - Visibility *[]CertificateVisibility `json:"visibility,omitempty"` -} - -// CloudJob ... -type CloudJob struct { - autorest.Response `json:"-"` - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id. - ID *string `json:"id,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the job has changed between requests. In particular, you can be pass the ETag when updating a job to specify that your changes should take effect only if nobody else has modified the job in the meantime. - ETag *string `json:"eTag,omitempty"` - // LastModified - This is the last time at which the job level data, such as the job state or priority, changed. It does not factor in task-level changes such as adding new tasks or tasks changing state. - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting' - State JobState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the job is in its initial Active state. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting' - PreviousState JobState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the job is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. - Priority *int32 `json:"priority,omitempty"` - Constraints *JobConstraints `json:"constraints,omitempty"` - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - The Job Preparation task is a special task run on each node before any other task of the job. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - The Job Release task is a special task run at the end of the job on each node that has run any other task of the job. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // OnAllTasksComplete - noAction - do nothing. The job remains active unless terminated or disabled by some other means. terminateJob - terminate the job. The job's terminateReason is set to 'AllTasksComplete'. The default is noAction. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // OnTaskFailure - noAction - do nothing. performExitOptionsJobAction - take the action associated with the task exit condition in the task's exitConditions collection. (This may still result in no action being taken, if that is what the task specifies.) The default is noAction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction' - OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - ExecutionInfo *JobExecutionInformation `json:"executionInfo,omitempty"` - Stats *JobStatistics `json:"stats,omitempty"` -} - -// CloudJobListPreparationAndReleaseTaskStatusResult ... -type CloudJobListPreparationAndReleaseTaskStatusResult struct { - autorest.Response `json:"-"` - Value *[]JobPreparationAndReleaseTaskExecutionInformation `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobListPreparationAndReleaseTaskStatusResultIterator provides access to a complete listing of -// JobPreparationAndReleaseTaskExecutionInformation values. -type CloudJobListPreparationAndReleaseTaskStatusResultIterator struct { - i int - page CloudJobListPreparationAndReleaseTaskStatusResultPage -} - -// Next 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 *CloudJobListPreparationAndReleaseTaskStatusResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) 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 CloudJobListPreparationAndReleaseTaskStatusResultIterator) Response() CloudJobListPreparationAndReleaseTaskStatusResult { - 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 CloudJobListPreparationAndReleaseTaskStatusResultIterator) Value() JobPreparationAndReleaseTaskExecutionInformation { - if !iter.page.NotDone() { - return JobPreparationAndReleaseTaskExecutionInformation{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) IsEmpty() bool { - return cjlpartsr.Value == nil || len(*cjlpartsr.Value) == 0 -} - -// cloudJobListPreparationAndReleaseTaskStatusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) cloudJobListPreparationAndReleaseTaskStatusResultPreparer() (*http.Request, error) { - if cjlpartsr.OdataNextLink == nil || len(to.String(cjlpartsr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjlpartsr.OdataNextLink))) -} - -// CloudJobListPreparationAndReleaseTaskStatusResultPage contains a page of -// JobPreparationAndReleaseTaskExecutionInformation values. -type CloudJobListPreparationAndReleaseTaskStatusResultPage struct { - fn func(CloudJobListPreparationAndReleaseTaskStatusResult) (CloudJobListPreparationAndReleaseTaskStatusResult, error) - cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult -} - -// 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. -func (page *CloudJobListPreparationAndReleaseTaskStatusResultPage) Next() error { - next, err := page.fn(page.cjlpartsr) - if err != nil { - return err - } - page.cjlpartsr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) NotDone() bool { - return !page.cjlpartsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Response() CloudJobListPreparationAndReleaseTaskStatusResult { - return page.cjlpartsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Values() []JobPreparationAndReleaseTaskExecutionInformation { - if page.cjlpartsr.IsEmpty() { - return nil - } - return *page.cjlpartsr.Value -} - -// CloudJobListResult ... -type CloudJobListResult struct { - autorest.Response `json:"-"` - Value *[]CloudJob `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobListResultIterator provides access to a complete listing of CloudJob values. -type CloudJobListResultIterator struct { - i int - page CloudJobListResultPage -} - -// Next 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 *CloudJobListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobListResultIterator) 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 CloudJobListResultIterator) Response() CloudJobListResult { - 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 CloudJobListResultIterator) Value() CloudJob { - if !iter.page.NotDone() { - return CloudJob{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjlr CloudJobListResult) IsEmpty() bool { - return cjlr.Value == nil || len(*cjlr.Value) == 0 -} - -// cloudJobListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjlr CloudJobListResult) cloudJobListResultPreparer() (*http.Request, error) { - if cjlr.OdataNextLink == nil || len(to.String(cjlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjlr.OdataNextLink))) -} - -// CloudJobListResultPage contains a page of CloudJob values. -type CloudJobListResultPage struct { - fn func(CloudJobListResult) (CloudJobListResult, error) - cjlr CloudJobListResult -} - -// 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. -func (page *CloudJobListResultPage) Next() error { - next, err := page.fn(page.cjlr) - if err != nil { - return err - } - page.cjlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobListResultPage) NotDone() bool { - return !page.cjlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobListResultPage) Response() CloudJobListResult { - return page.cjlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobListResultPage) Values() []CloudJob { - if page.cjlr.IsEmpty() { - return nil - } - return *page.cjlr.Value -} - -// CloudJobSchedule ... -type CloudJobSchedule struct { - autorest.Response `json:"-"` - // ID - It is common to use a GUID for the id. - ID *string `json:"id,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the job schedule has changed between requests. In particular, you can be pass the ETag with an Update Job Schedule request to specify that your changes should take effect only if nobody else has modified the schedule in the meantime. - ETag *string `json:"eTag,omitempty"` - // LastModified - This is the last time at which the schedule level data, such as the job specification or recurrence information, changed. It does not factor in job-level changes such as new jobs being created or jobs changing state. - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting' - State JobScheduleState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not present if the job schedule is in its initial active state. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting' - PreviousState JobScheduleState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not present if the job schedule is in its initial active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - Schedule *Schedule `json:"schedule,omitempty"` - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - ExecutionInfo *JobScheduleExecutionInformation `json:"executionInfo,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - Stats *JobScheduleStatistics `json:"stats,omitempty"` -} - -// CloudJobScheduleListResult ... -type CloudJobScheduleListResult struct { - autorest.Response `json:"-"` - Value *[]CloudJobSchedule `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobScheduleListResultIterator provides access to a complete listing of CloudJobSchedule values. -type CloudJobScheduleListResultIterator struct { - i int - page CloudJobScheduleListResultPage -} - -// Next 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 *CloudJobScheduleListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobScheduleListResultIterator) 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 CloudJobScheduleListResultIterator) Response() CloudJobScheduleListResult { - 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 CloudJobScheduleListResultIterator) Value() CloudJobSchedule { - if !iter.page.NotDone() { - return CloudJobSchedule{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjslr CloudJobScheduleListResult) IsEmpty() bool { - return cjslr.Value == nil || len(*cjslr.Value) == 0 -} - -// cloudJobScheduleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjslr CloudJobScheduleListResult) cloudJobScheduleListResultPreparer() (*http.Request, error) { - if cjslr.OdataNextLink == nil || len(to.String(cjslr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjslr.OdataNextLink))) -} - -// CloudJobScheduleListResultPage contains a page of CloudJobSchedule values. -type CloudJobScheduleListResultPage struct { - fn func(CloudJobScheduleListResult) (CloudJobScheduleListResult, error) - cjslr CloudJobScheduleListResult -} - -// 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. -func (page *CloudJobScheduleListResultPage) Next() error { - next, err := page.fn(page.cjslr) - if err != nil { - return err - } - page.cjslr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobScheduleListResultPage) NotDone() bool { - return !page.cjslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobScheduleListResultPage) Response() CloudJobScheduleListResult { - return page.cjslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobScheduleListResultPage) Values() []CloudJobSchedule { - if page.cjslr.IsEmpty() { - return nil - } - return *page.cjslr.Value -} - -// CloudPool ... -type CloudPool struct { - autorest.Response `json:"-"` - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id. - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the pool has changed between requests. In particular, you can be pass the ETag when updating a pool to specify that your changes should take effect only if nobody else has modified the pool in the meantime. - ETag *string `json:"eTag,omitempty"` - // LastModified - This is the last time at which the pool level data, such as the targetDedicated or enableAutoscale settings, changed. It does not factor in node-level changes such as a compute node changing state. - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - active - The pool is available to run tasks subject to the availability of compute nodes. deleting - The user has requested that the pool be deleted, but the delete operation has not yet completed. upgrading - The user has requested that the operating system of the pool's nodes be upgraded, but the upgrade operation has not yet completed (that is, some nodes in the pool have not yet been upgraded). While upgrading, the pool may be able to run tasks (with reduced capacity) but this is not guaranteed. Possible values include: 'PoolStateActive', 'PoolStateDeleting', 'PoolStateUpgrading' - State PoolState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // AllocationState - steady - The pool is not resizing. There are no changes to the number of nodes in the pool in progress. A pool enters this state when it is created and when no operations are being performed on the pool to change the number of dedicated nodes. resizing - The pool is resizing; that is, compute nodes are being added to or removed from the pool. stopping - The pool was resizing, but the user has requested that the resize be stopped, but the stop request has not yet been completed. Possible values include: 'Steady', 'Resizing', 'Stopping' - AllocationState AllocationState `json:"allocationState,omitempty"` - AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // ResizeTimeout - This is the timeout for the most recent resize operation. (The initial sizing when the pool is created counts as a resize.) The default value is 15 minutes. - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // ResizeError - This property is set only if an error occurred during the last pool resize, and only when the pool allocationState is Steady. - ResizeError *ResizeError `json:"resizeError,omitempty"` - CurrentDedicated *int32 `json:"currentDedicated,omitempty"` - // TargetDedicated - This property is not set if enableAutoScale is true. It is required if enableAutoScale is false. - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // EnableAutoScale - If true, the autoScaleFormula property must be set. If false, the targetDedicated property must be set. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - This property is set only if the pool automatically scales, i.e. enableAutoScale is true. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - This property is set only if the pool automatically scales, i.e. enableAutoScale is true. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // AutoScaleRun - This property is set only if the pool automatically scales, i.e. enableAutoScale is true. - AutoScaleRun *AutoScaleRun `json:"autoScaleRun,omitempty"` - // EnableInterNodeCommunication - This imposes restrictions on which nodes can be assigned to the pool. Specifying this value can reduce the chance of the requested number of nodes to be allocated in the pool. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - UserAccounts *[]UserAccount `json:"userAccounts,omitempty"` - Metadata *[]MetadataItem `json:"metadata,omitempty"` - Stats *PoolStatistics `json:"stats,omitempty"` -} - -// CloudPoolListResult ... -type CloudPoolListResult struct { - autorest.Response `json:"-"` - Value *[]CloudPool `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudPoolListResultIterator provides access to a complete listing of CloudPool values. -type CloudPoolListResultIterator struct { - i int - page CloudPoolListResultPage -} - -// Next 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 *CloudPoolListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudPoolListResultIterator) 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 CloudPoolListResultIterator) Response() CloudPoolListResult { - 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 CloudPoolListResultIterator) Value() CloudPool { - if !iter.page.NotDone() { - return CloudPool{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cplr CloudPoolListResult) IsEmpty() bool { - return cplr.Value == nil || len(*cplr.Value) == 0 -} - -// cloudPoolListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cplr CloudPoolListResult) cloudPoolListResultPreparer() (*http.Request, error) { - if cplr.OdataNextLink == nil || len(to.String(cplr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cplr.OdataNextLink))) -} - -// CloudPoolListResultPage contains a page of CloudPool values. -type CloudPoolListResultPage struct { - fn func(CloudPoolListResult) (CloudPoolListResult, error) - cplr CloudPoolListResult -} - -// 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. -func (page *CloudPoolListResultPage) Next() error { - next, err := page.fn(page.cplr) - if err != nil { - return err - } - page.cplr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudPoolListResultPage) NotDone() bool { - return !page.cplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudPoolListResultPage) Response() CloudPoolListResult { - return page.cplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudPoolListResultPage) Values() []CloudPool { - if page.cplr.IsEmpty() { - return nil - } - return *page.cplr.Value -} - -// CloudServiceConfiguration ... -type CloudServiceConfiguration struct { - // OsFamily - Possible values are: 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 - OS Family 3, equivalent to Windows Server 2012. 4 - OS Family 4, equivalent to Windows Server 2012 R2. 5 - OS Family 5, equivalent to Windows Server 2016. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). - OsFamily *string `json:"osFamily,omitempty"` - // TargetOSVersion - The default value is * which specifies the latest operating system version for the specified OS family. - TargetOSVersion *string `json:"targetOSVersion,omitempty"` - // CurrentOSVersion - This may differ from targetOSVersion if the pool state is Upgrading. In this case some virtual machines may be on the targetOSVersion and some may be on the currentOSVersion during the upgrade process. Once all virtual machines have upgraded, currentOSVersion is updated to be the same as targetOSVersion. - CurrentOSVersion *string `json:"currentOSVersion,omitempty"` -} - -// CloudTask ... -type CloudTask struct { - autorest.Response `json:"-"` - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the task has changed between requests. In particular, you can be pass the ETag when updating a task to specify that your changes should take effect only if nobody else has modified the task in the meantime. - ETag *string `json:"eTag,omitempty"` - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // ExitConditions - How the Batch service should respond when the task completes. - ExitConditions *ExitConditions `json:"exitConditions,omitempty"` - // State - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - State TaskState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the task is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - PreviousState TaskState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the task is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"` - Constraints *TaskConstraints `json:"constraints,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"` - NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"` - MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"` - Stats *TaskStatistics `json:"stats,omitempty"` - // DependsOn - This task will not be scheduled until all tasks that it depends on have completed successfully. If any of those tasks fail and exhaust their retry counts, this task will never be scheduled. - DependsOn *TaskDependencies `json:"dependsOn,omitempty"` - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job. - AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"` -} - -// CloudTaskListResult ... -type CloudTaskListResult struct { - autorest.Response `json:"-"` - Value *[]CloudTask `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudTaskListResultIterator provides access to a complete listing of CloudTask values. -type CloudTaskListResultIterator struct { - i int - page CloudTaskListResultPage -} - -// Next 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 *CloudTaskListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudTaskListResultIterator) 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 CloudTaskListResultIterator) Response() CloudTaskListResult { - 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 CloudTaskListResultIterator) Value() CloudTask { - if !iter.page.NotDone() { - return CloudTask{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (ctlr CloudTaskListResult) IsEmpty() bool { - return ctlr.Value == nil || len(*ctlr.Value) == 0 -} - -// cloudTaskListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ctlr CloudTaskListResult) cloudTaskListResultPreparer() (*http.Request, error) { - if ctlr.OdataNextLink == nil || len(to.String(ctlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ctlr.OdataNextLink))) -} - -// CloudTaskListResultPage contains a page of CloudTask values. -type CloudTaskListResultPage struct { - fn func(CloudTaskListResult) (CloudTaskListResult, error) - ctlr CloudTaskListResult -} - -// 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. -func (page *CloudTaskListResultPage) Next() error { - next, err := page.fn(page.ctlr) - if err != nil { - return err - } - page.ctlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudTaskListResultPage) NotDone() bool { - return !page.ctlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudTaskListResultPage) Response() CloudTaskListResult { - return page.ctlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudTaskListResultPage) Values() []CloudTask { - if page.ctlr.IsEmpty() { - return nil - } - return *page.ctlr.Value -} - -// CloudTaskListSubtasksResult ... -type CloudTaskListSubtasksResult struct { - autorest.Response `json:"-"` - Value *[]SubtaskInformation `json:"value,omitempty"` -} - -// ComputeNode ... -type ComputeNode struct { - autorest.Response `json:"-"` - // ID - Every node that is added to a pool is assigned a unique ID. Whenever a node is removed from a pool, all of its local files are deleted, and the ID is reclaimed and could be reused for new nodes. - ID *string `json:"id,omitempty"` - URL *string `json:"url,omitempty"` - // State - Possible values include: 'Idle', 'Rebooting', 'Reimaging', 'Running', 'Unusable', 'Creating', 'Starting', 'WaitingForStartTask', 'StartTaskFailed', 'Unknown', 'LeavingPool', 'Offline' - State ComputeNodeState `json:"state,omitempty"` - // SchedulingState - enabled - Tasks can be scheduled on the node. disabled - No new tasks will be scheduled on the node. Tasks already running on the node may still run to completion. All nodes start with scheduling enabled. Possible values include: 'Enabled', 'Disabled' - SchedulingState SchedulingState `json:"schedulingState,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // LastBootTime - This property may not be present if the node state is unusable. - LastBootTime *date.Time `json:"lastBootTime,omitempty"` - AllocationTime *date.Time `json:"allocationTime,omitempty"` - // IPAddress - Every node that is added to a pool is assigned a unique IP address. Whenever a node is removed from a pool, all of its local files are deleted, and the IP address is reclaimed and could be reused for new nodes. - IPAddress *string `json:"ipAddress,omitempty"` - AffinityID *string `json:"affinityId,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - TotalTasksRun *int32 `json:"totalTasksRun,omitempty"` - RunningTasksCount *int32 `json:"runningTasksCount,omitempty"` - TotalTasksSucceeded *int32 `json:"totalTasksSucceeded,omitempty"` - RecentTasks *[]TaskInformation `json:"recentTasks,omitempty"` - StartTask *StartTask `json:"startTask,omitempty"` - StartTaskInfo *StartTaskInformation `json:"startTaskInfo,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - Errors *[]ComputeNodeError `json:"errors,omitempty"` -} - -// ComputeNodeError ... -type ComputeNodeError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - ErrorDetails *[]NameValuePair `json:"errorDetails,omitempty"` -} - -// ComputeNodeGetRemoteLoginSettingsResult ... -type ComputeNodeGetRemoteLoginSettingsResult struct { - autorest.Response `json:"-"` - RemoteLoginIPAddress *string `json:"remoteLoginIPAddress,omitempty"` - RemoteLoginPort *int32 `json:"remoteLoginPort,omitempty"` -} - -// ComputeNodeInformation ... -type ComputeNodeInformation struct { - AffinityID *string `json:"affinityId,omitempty"` - NodeURL *string `json:"nodeUrl,omitempty"` - PoolID *string `json:"poolId,omitempty"` - NodeID *string `json:"nodeId,omitempty"` - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` -} - -// ComputeNodeListResult ... -type ComputeNodeListResult struct { - autorest.Response `json:"-"` - Value *[]ComputeNode `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// ComputeNodeListResultIterator provides access to a complete listing of ComputeNode values. -type ComputeNodeListResultIterator struct { - i int - page ComputeNodeListResultPage -} - -// Next 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 *ComputeNodeListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ComputeNodeListResultIterator) 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 ComputeNodeListResultIterator) Response() ComputeNodeListResult { - 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 ComputeNodeListResultIterator) Value() ComputeNode { - if !iter.page.NotDone() { - return ComputeNode{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cnlr ComputeNodeListResult) IsEmpty() bool { - return cnlr.Value == nil || len(*cnlr.Value) == 0 -} - -// computeNodeListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cnlr ComputeNodeListResult) computeNodeListResultPreparer() (*http.Request, error) { - if cnlr.OdataNextLink == nil || len(to.String(cnlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cnlr.OdataNextLink))) -} - -// ComputeNodeListResultPage contains a page of ComputeNode values. -type ComputeNodeListResultPage struct { - fn func(ComputeNodeListResult) (ComputeNodeListResult, error) - cnlr ComputeNodeListResult -} - -// 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. -func (page *ComputeNodeListResultPage) Next() error { - next, err := page.fn(page.cnlr) - if err != nil { - return err - } - page.cnlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ComputeNodeListResultPage) NotDone() bool { - return !page.cnlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ComputeNodeListResultPage) Response() ComputeNodeListResult { - return page.cnlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ComputeNodeListResultPage) Values() []ComputeNode { - if page.cnlr.IsEmpty() { - return nil - } - return *page.cnlr.Value -} - -// ComputeNodeUser ... -type ComputeNodeUser struct { - Name *string `json:"name,omitempty"` - // IsAdmin - The default value is false. - IsAdmin *bool `json:"isAdmin,omitempty"` - // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property. - Password *string `json:"password,omitempty"` - // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - SSHPublicKey *string `json:"sshPublicKey,omitempty"` -} - -// DeleteCertificateError ... -type DeleteCertificateError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - // Values - This list includes details such as the active pools and nodes referencing this certificate. However, if a large number of resources reference the certificate, the list contains only about the first hundred. - Values *[]NameValuePair `json:"values,omitempty"` -} - -// EnvironmentSetting ... -type EnvironmentSetting struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -// Error ... -type Error struct { - Code *string `json:"code,omitempty"` - Message *ErrorMessage `json:"message,omitempty"` - Values *[]ErrorDetail `json:"values,omitempty"` -} - -// ErrorDetail ... -type ErrorDetail struct { - Key *string `json:"key,omitempty"` - Value *string `json:"value,omitempty"` -} - -// ErrorMessage ... -type ErrorMessage struct { - Lang *string `json:"lang,omitempty"` - Value *string `json:"value,omitempty"` -} - -// ExitCodeMapping ... -type ExitCodeMapping struct { - Code *int32 `json:"code,omitempty"` - ExitOptions *ExitOptions `json:"exitOptions,omitempty"` -} - -// ExitCodeRangeMapping ... -type ExitCodeRangeMapping struct { - Start *int32 `json:"start,omitempty"` - End *int32 `json:"end,omitempty"` - ExitOptions *ExitOptions `json:"exitOptions,omitempty"` -} - -// ExitConditions ... -type ExitConditions struct { - ExitCodes *[]ExitCodeMapping `json:"exitCodes,omitempty"` - ExitCodeRanges *[]ExitCodeRangeMapping `json:"exitCodeRanges,omitempty"` - SchedulingError *ExitOptions `json:"schedulingError,omitempty"` - // Default - Note that the default condition does not include exit code 0. If you want non-default behaviour on exit code 0, you must list it explicitly using the exitCodes or exitCodeRanges collection. - Default *ExitOptions `json:"default,omitempty"` -} - -// ExitOptions ... -type ExitOptions struct { - // JobAction - The default is none for exit code 0 and terminate for all other exit conditions. If the job's onTaskFailed property is noAction, then specify this property returns an error. The add task request fails with an invalid property value error;; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'JobActionNone', 'JobActionDisable', 'JobActionTerminate' - JobAction JobAction `json:"jobAction,omitempty"` - // DependencyAction - The default is 'satisfy' for exit code 0, and 'block' for all other exit conditions. If the job's usesTaskDependencies property is set to false, then specifying the dependencyAction property returns an error. The add task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'Satisfy', 'Block' - DependencyAction DependencyAction `json:"dependencyAction,omitempty"` -} - -// FileProperties ... -type FileProperties struct { - // CreationTime - The creation time is not returned for files on Linux compute nodes. - CreationTime *date.Time `json:"creationTime,omitempty"` - LastModified *date.Time `json:"lastModified,omitempty"` - ContentLength *int64 `json:"contentLength,omitempty"` - ContentType *string `json:"contentType,omitempty"` - // FileMode - The file mode is returned only for files on Linux compute nodes. - FileMode *string `json:"fileMode,omitempty"` -} - -// ImageReference ... -type ImageReference struct { - // Publisher - For example, Canonical or MicrosoftWindowsServer. - Publisher *string `json:"publisher,omitempty"` - // Offer - For example, UbuntuServer or WindowsServer. - Offer *string `json:"offer,omitempty"` - // Sku - For example, 14.04.0-LTS or 2012-R2-Datacenter. - Sku *string `json:"sku,omitempty"` - // Version - A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. - Version *string `json:"version,omitempty"` -} - -// JobAddParameter ... -type JobAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id. - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. - Priority *int32 `json:"priority,omitempty"` - // Constraints - The execution constraints for the job. - Constraints *JobConstraints `json:"constraints,omitempty"` - // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job. The Job Manager task's typical purpose is to control and/or monitor job execution, for example by deciding what additional tasks to run, determining when the work is complete, etc. (However, a Job Manager task is not restricted to these activities - it is a fully-fledged task in the system and perform whatever actions are required for the job.) For example, a Job Manager task might download a file specified as a parameter, analyze the contents of that file and submit additional tasks based on those contents. - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task. The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic job termination without a Job Manager, you should initially set onAllTasksComplete to noAction and update the job properties to set onAllTasksComplete to terminateJob once you have finished adding tasks. Permitted values are: noAction - do nothing. The job remains active unless terminated or disabled by some other means. terminateJob - terminate the job. The job's terminateReason is set to 'AllTasksComplete'. The default is noAction. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // OnTaskFailure - noAction - do nothing. performExitOptionsJobAction - take the action associated with the task exit condition in the task's exitConditions collection. (This may still result in no action being taken, if that is what the task specifies.) The default is noAction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction' - OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` -} - -// JobConstraints ... -type JobConstraints struct { - // MaxWallClockTime - If the job does not complete within the time limit, the Batch service terminates it and any tasks that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry. If this property is not specified, there is no time limit on how long the job may run. - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try each task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry tasks. If the maximum retry count is -1, the Batch service retries tasks without limit. The default value is 0 (no retries). - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` -} - -// JobDisableParameter ... -type JobDisableParameter struct { - // DisableTasks - requeue - Terminate running tasks and requeue them. The tasks will run again when the job is enabled. terminate - Terminate running tasks. The tasks will not run again. wait - Allow currently running tasks to complete. Possible values include: 'DisableJobOptionRequeue', 'DisableJobOptionTerminate', 'DisableJobOptionWait' - DisableTasks DisableJobOption `json:"disableTasks,omitempty"` -} - -// JobExecutionInformation ... -type JobExecutionInformation struct { - // StartTime - This is the time at which the job was created. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the job is in the completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // PoolID - This element contains the actual pool where the job is assigned. When you get job details from the service, they also contain a poolInfo element, which contains the pool configuration data from when the job was added or updated. That poolInfo element may also contain a poolId element. If it does, the two IDs are the same. If it does not, it means the job ran on an auto pool, and this property contains the id of that auto pool. - PoolID *string `json:"poolId,omitempty"` - // SchedulingError - This property is not set if there was no error starting the job. - SchedulingError *JobSchedulingError `json:"schedulingError,omitempty"` - // TerminateReason - This property is set only if the job is in the completed state. If the Batch service terminates the job, it sets the reason as follows: JMComplete - the Job Manager task completed, and killJobOnCompletion was set to true. MaxWallClockTimeExpiry - the job reached its maxWallClockTime constraint. TerminateJobSchedule - the job ran as part of a schedule, and the schedule terminated. AllTasksComplete - the job's onAllTasksComplete attribute is set to terminateJob, and all tasks in the job are complete. TaskFailed - the job's onTaskFailure attribute is set to performExitOptionsJobAction, and a task in the job failed with an exit condition that specified a jobAction of terminateJob. Any other string is a user-defined reason specified in a call to the 'Terminate a job' operation. - TerminateReason *string `json:"terminateReason,omitempty"` -} - -// JobManagerTask ... -type JobManagerTask struct { - // ID - The id can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - It need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Files listed under this element are located in the task's working directory. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - Constraints *TaskConstraints `json:"constraints,omitempty"` - // KillJobOnCompletion - If true, when the Job Manager task completes, the Batch service marks the job as complete. If any tasks are still running at this time (other than Job Release), those tasks are terminated. If false, the completion of the Job Manager task does not affect the job status. In this case, you should either use the onAllTasksComplete attribute to terminate the job, or have a client or user terminate the job explicitly. An example of this is if the Job Manager creates a set of tasks but then takes no further role in their execution. The default value is true. If you are using the onAllTasksComplete and onTaskFailure attributes to control job lifetime, and using the Job Manager task only to create the tasks for the job (not to monitor progress), then it is important to set killJobOnCompletion to false. - KillJobOnCompletion *bool `json:"killJobOnCompletion,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - // RunExclusive - If true, no other tasks will run on the same compute node for as long as the Job Manager is running. If false, other tasks can run simultaneously with the Job Manager on a compute node. The Job Manager task counts normally against the node's concurrent task limit, so this is only relevant if the node allows multiple concurrent tasks. The default value is true. - RunExclusive *bool `json:"runExclusive,omitempty"` - // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails with a scheduling error. This property is currently not supported on jobs running on pools created using the virtualMachineConfiguration (IaaS) property. If a task specifying applicationPackageReferences runs on such a pool, it fails with a scheduling error with code TaskSchedulingConstraintFailed. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job. - AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"` -} - -// JobPatchParameter ... -type JobPatchParameter struct { - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged. - Priority *int32 `json:"priority,omitempty"` - // OnAllTasksComplete - If omitted, the completion behavior is left unchanged. You may not change the value from terminateJob to noAction - that is, once you have engaged automatic job termination, you cannot turn it off again. If you try to do this, the request fails with an 'invalid property value' error response; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // Constraints - If omitted, the existing execution constraints are left unchanged. - Constraints *JobConstraints `json:"constraints,omitempty"` - // PoolInfo - You may change the pool for a job only when the job is disabled. The Patch Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. If omitted, the job continues to run on its current pool. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - If omitted, the existing job metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobPreparationAndReleaseTaskExecutionInformation ... -type JobPreparationAndReleaseTaskExecutionInformation struct { - PoolID *string `json:"poolId,omitempty"` - NodeID *string `json:"nodeId,omitempty"` - NodeURL *string `json:"nodeUrl,omitempty"` - JobPreparationTaskExecutionInfo *JobPreparationTaskExecutionInformation `json:"jobPreparationTaskExecutionInfo,omitempty"` - // JobReleaseTaskExecutionInfo - This property is set only if the Job Release task has run on the node. - JobReleaseTaskExecutionInfo *JobReleaseTaskExecutionInformation `json:"jobReleaseTaskExecutionInfo,omitempty"` -} - -// JobPreparationTask ... -type JobPreparationTask struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobpreparation'. No other task in the job can have the same id as the Job Preparation task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobPreparationTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). - ID *string `json:"id,omitempty"` - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Files listed under this element are located in the task's working directory. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - Constraints *TaskConstraints `json:"constraints,omitempty"` - // WaitForSuccess - If true and the Job Preparation task fails on a compute node, the Batch service retries the Job Preparation task up to its maximum retry count (as specified in the constraints element). If the task has still not completed successfully after all retries, then the Batch service will not schedule tasks of the job to the compute node. The compute node remains active and eligible to run tasks of other jobs. If false, the Batch service will not wait for the Job Preparation task to complete. In this case, other tasks of the job can start executing on the compute node while the Job Preparation task is still running; and even if the Job Preparation task fails, new tasks will continue to be scheduled on the node. The default value is true. - WaitForSuccess *bool `json:"waitForSuccess,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - // RerunOnNodeRebootAfterSuccess - The Job Preparation task is always rerun if a compute node is reimaged, or if the Job Preparation task did not complete (e.g. because the reboot occurred while the task was running). Therefore, you should always write a Job Preparation task to be idempotent and to behave correctly if run multiple times. The default value is true. - RerunOnNodeRebootAfterSuccess *bool `json:"rerunOnNodeRebootAfterSuccess,omitempty"` -} - -// JobPreparationTaskExecutionInformation ... -type JobPreparationTaskExecutionInformation struct { - // StartTime - Note that every time the task is restarted, this value is updated. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // State - running - the task is currently running (including retrying). completed - the task has exited with exit code 0, or the task has exhausted its retry limit, or the Batch service was unable to start the task due to scheduling errors. Possible values include: 'JobPreparationTaskStateRunning', 'JobPreparationTaskStateCompleted' - State JobPreparationTaskState `json:"state,omitempty"` - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` - // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated. - ExitCode *int32 `json:"exitCode,omitempty"` - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - This property is set only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` -} - -// JobReleaseTask ... -type JobReleaseTask struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other task in the job can have the same id as the Job Release task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). - ID *string `json:"id,omitempty"` - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Files listed under this element are located in the task's working directory. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged. - RetentionTime *string `json:"retentionTime,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` -} - -// JobReleaseTaskExecutionInformation ... -type JobReleaseTaskExecutionInformation struct { - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // State - running - the task is currently running (including retrying). completed - the task has exited, or the Batch service was unable to start the task due to scheduling errors. Possible values include: 'JobReleaseTaskStateRunning', 'JobReleaseTaskStateCompleted' - State JobReleaseTaskState `json:"state,omitempty"` - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` - // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated. - ExitCode *int32 `json:"exitCode,omitempty"` - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` -} - -// JobScheduleAddParameter ... -type JobScheduleAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The id is case-preserving and case-insensitive (that is, you may not have two ids within an account that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - Schedule *Schedule `json:"schedule,omitempty"` - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobScheduleExecutionInformation ... -type JobScheduleExecutionInformation struct { - // NextRunTime - This property is meaningful only if the schedule is in the active state when the time comes around. For example, if the schedule is disabled, no job will be created at nextRunTime unless the job is enabled before then. - NextRunTime *date.Time `json:"nextRunTime,omitempty"` - // RecentJob - This property is present only if the at least one job has run under the schedule. - RecentJob *RecentJob `json:"recentJob,omitempty"` - // EndTime - This property is set only if the job schedule is in the completed state. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// JobSchedulePatchParameter ... -type JobSchedulePatchParameter struct { - // Schedule - If you do not specify this element, the existing schedule is left unchanged. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - If you do not specify this element, existing metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobScheduleStatistics ... -type JobScheduleStatistics struct { - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UserCPUTime *string `json:"userCPUTime,omitempty"` - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If a task was retried, this includes the wall clock time of all the task retries. - WallClockTime *string `json:"wallClockTime,omitempty"` - ReadIOps *int64 `json:"readIOps,omitempty"` - WriteIOps *int64 `json:"writeIOps,omitempty"` - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"` - NumFailedTasks *int64 `json:"numFailedTasks,omitempty"` - NumTaskRetries *int64 `json:"numTaskRetries,omitempty"` - // WaitTime - This value is only reported in the account lifetime statistics; it is not included in the job statistics. - WaitTime *string `json:"waitTime,omitempty"` -} - -// JobScheduleUpdateParameter ... -type JobScheduleUpdateParameter struct { - // Schedule - If you do not specify this element, it is equivalent to passing the default schedule: that is, a single job scheduled to run immediately. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - If you do not specify this element, it takes the default value of an empty list; in effect, any existing metadata is deleted. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobSchedulingError ... -type JobSchedulingError struct { - // Category - Possible values include: 'SchedulingErrorCategoryUserError', 'SchedulingErrorCategoryServerError', 'SchedulingErrorCategoryUnmapped' - Category SchedulingErrorCategory `json:"category,omitempty"` - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Details *[]NameValuePair `json:"details,omitempty"` -} - -// JobSpecification ... -type JobSpecification struct { - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. This priority is used as the default for all jobs under the job schedule. You can update a job's priority after it has been created using by using the update job API. - Priority *int32 `json:"priority,omitempty"` - // DisplayName - The name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` - // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic job termination without a Job Manager, you should initially set onAllTasksComplete to noAction and update the job properties to set onAllTasksComplete to terminateJob once you have finished adding tasks. The default is noAction. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // OnTaskFailure - The default is noAction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction' - OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"` - Constraints *JobConstraints `json:"constraints,omitempty"` - // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job using the Task API. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job. - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation. A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value. - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobStatistics ... -type JobStatistics struct { - autorest.Response `json:"-"` - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UserCPUTime *string `json:"userCPUTime,omitempty"` - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - WallClockTime *string `json:"wallClockTime,omitempty"` - ReadIOps *int64 `json:"readIOps,omitempty"` - WriteIOps *int64 `json:"writeIOps,omitempty"` - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - // NumSucceededTasks - A task completes successfully if it returns exit code 0. - NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"` - // NumFailedTasks - A task fails if it exhausts its maximum retry count without returning exit code 0. - NumFailedTasks *int64 `json:"numFailedTasks,omitempty"` - NumTaskRetries *int64 `json:"numTaskRetries,omitempty"` - // WaitTime - The wait time for a task is defined as the elapsed time between the creation of the task and the start of task execution. (If the task is retried due to failures, the wait time is the time to the most recent task execution.) This value is only reported in the account lifetime statistics; it is not included in the job statistics. - WaitTime *string `json:"waitTime,omitempty"` -} - -// JobTerminateParameter ... -type JobTerminateParameter struct { - TerminateReason *string `json:"terminateReason,omitempty"` -} - -// JobUpdateParameter ... -type JobUpdateParameter struct { - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, it is set to the default value 0. - Priority *int32 `json:"priority,omitempty"` - // Constraints - If omitted, the constraints are cleared. - Constraints *JobConstraints `json:"constraints,omitempty"` - // PoolInfo - You may change the pool for a job only when the job is disabled. The Update Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - If omitted, it takes the default value of an empty list; in effect, any existing metadata is deleted. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - // OnAllTasksComplete - If omitted, the completion behavior is set to noAction. If the current value is terminateJob, this is an error because a job's completion behavior may not be changed from terminateJob to noAction. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` -} - -// MetadataItem the Batch service does not assign any meaning to this metadata; it is solely for the use of user -// code. -type MetadataItem struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -// MultiInstanceSettings multi-instance tasks are commonly used to support MPI tasks. -type MultiInstanceSettings struct { - NumberOfInstances *int32 `json:"numberOfInstances,omitempty"` - // CoordinationCommandLine - A typical coordination command line launches a background service and verifies that the service is ready to process inter-node messages. - CoordinationCommandLine *string `json:"coordinationCommandLine,omitempty"` - // CommonResourceFiles - The difference between common resource files and task resource files is that common resource files are downloaded for all subtasks including the primary, whereas task resource files are downloaded only for the primary. - CommonResourceFiles *[]ResourceFile `json:"commonResourceFiles,omitempty"` -} - -// NameValuePair ... -type NameValuePair struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -// NetworkConfiguration the network configuration for a pool. -type NetworkConfiguration struct { - // SubnetID - The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. This property can only be specified for pools created with a cloudServiceConfiguration. - SubnetID *string `json:"subnetId,omitempty"` -} - -// NodeAgentSku the Batch node agent is a program that runs on each node in the pool, and provides the -// command-and-control interface between the node and the Batch service. There are different implementations of the -// node agent, known as SKUs, for different operating systems. -type NodeAgentSku struct { - ID *string `json:"id,omitempty"` - // VerifiedImageReferences - This collection is not exhaustive (the node agent may be compatible with other images). - VerifiedImageReferences *[]ImageReference `json:"verifiedImageReferences,omitempty"` - // OsType - Possible values include: 'OSTypeLinux', 'OSTypeWindows', 'OSTypeUnmapped' - OsType OSType `json:"osType,omitempty"` -} - -// NodeDisableSchedulingParameter ... -type NodeDisableSchedulingParameter struct { - // NodeDisableSchedulingOption - The default value is requeue. Possible values include: 'DisableComputeNodeSchedulingOptionRequeue', 'DisableComputeNodeSchedulingOptionTerminate', 'DisableComputeNodeSchedulingOptionTaskCompletion' - NodeDisableSchedulingOption DisableComputeNodeSchedulingOption `json:"nodeDisableSchedulingOption,omitempty"` -} - -// NodeFile ... -type NodeFile struct { - Name *string `json:"name,omitempty"` - URL *string `json:"url,omitempty"` - IsDirectory *bool `json:"isDirectory,omitempty"` - Properties *FileProperties `json:"properties,omitempty"` -} - -// NodeFileListResult ... -type NodeFileListResult struct { - autorest.Response `json:"-"` - Value *[]NodeFile `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// NodeFileListResultIterator provides access to a complete listing of NodeFile values. -type NodeFileListResultIterator struct { - i int - page NodeFileListResultPage -} - -// Next 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 *NodeFileListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter NodeFileListResultIterator) 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 NodeFileListResultIterator) Response() NodeFileListResult { - 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 NodeFileListResultIterator) Value() NodeFile { - if !iter.page.NotDone() { - return NodeFile{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (nflr NodeFileListResult) IsEmpty() bool { - return nflr.Value == nil || len(*nflr.Value) == 0 -} - -// nodeFileListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (nflr NodeFileListResult) nodeFileListResultPreparer() (*http.Request, error) { - if nflr.OdataNextLink == nil || len(to.String(nflr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(nflr.OdataNextLink))) -} - -// NodeFileListResultPage contains a page of NodeFile values. -type NodeFileListResultPage struct { - fn func(NodeFileListResult) (NodeFileListResult, error) - nflr NodeFileListResult -} - -// 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. -func (page *NodeFileListResultPage) Next() error { - next, err := page.fn(page.nflr) - if err != nil { - return err - } - page.nflr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page NodeFileListResultPage) NotDone() bool { - return !page.nflr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page NodeFileListResultPage) Response() NodeFileListResult { - return page.nflr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page NodeFileListResultPage) Values() []NodeFile { - if page.nflr.IsEmpty() { - return nil - } - return *page.nflr.Value -} - -// NodeRebootParameter ... -type NodeRebootParameter struct { - // NodeRebootOption - The default value is requeue. Possible values include: 'ComputeNodeRebootOptionRequeue', 'ComputeNodeRebootOptionTerminate', 'ComputeNodeRebootOptionTaskCompletion', 'ComputeNodeRebootOptionRetainedData' - NodeRebootOption ComputeNodeRebootOption `json:"nodeRebootOption,omitempty"` -} - -// NodeReimageParameter ... -type NodeReimageParameter struct { - // NodeReimageOption - The default value is requeue. Possible values include: 'ComputeNodeReimageOptionRequeue', 'ComputeNodeReimageOptionTerminate', 'ComputeNodeReimageOptionTaskCompletion', 'ComputeNodeReimageOptionRetainedData' - NodeReimageOption ComputeNodeReimageOption `json:"nodeReimageOption,omitempty"` -} - -// NodeRemoveParameter ... -type NodeRemoveParameter struct { - NodeList *[]string `json:"nodeList,omitempty"` - // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData' - NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"` -} - -// NodeUpdateUserParameter ... -type NodeUpdateUserParameter struct { - // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is removed. - Password *string `json:"password,omitempty"` - // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If omitted, any existing SSH public key is removed. - SSHPublicKey *string `json:"sshPublicKey,omitempty"` -} - -// OSDisk ... -type OSDisk struct { - // ImageUris - All the VHDs must be identical and must reside in an Azure Storage account within the same subscription and same region as the Batch account. For best performance, it is recommended that each VHD resides in a separate Azure Storage account. Each VHD can serve upto 20 Windows compute nodes or 40 Linux compute nodes. You must supply enough VHD URIs to satisfy the 'targetDedicated' property of the pool. If you do not supply enough VHD URIs, the pool will partially allocate compute nodes, and a resize error will occur. - ImageUris *[]string `json:"imageUris,omitempty"` - // Caching - none - The caching mode for the disk is not enabled. readOnly - The caching mode for the disk is read only. readWrite - The caching mode for the disk is read and write. The default value for caching is none. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - Caching CachingType `json:"caching,omitempty"` -} - -// PoolAddParameter ... -type PoolAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two pool IDs within an account that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // TargetDedicated - This property must have the default value if enableAutoScale is true. It is required if enableAutoScale is false. - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // EnableAutoScale - If true, the autoScaleFormula property must be set. If false, the targetDedicated property must be set. The default value is false. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale compute nodes in an Azure Batch pool' (https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/). - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` - // StartTask - The task runs when the node is added to the pool or when the node is restarted. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - This property is currently not supported on pools created using the virtualMachineConfiguration (IaaS) property. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting). - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - UserAccounts *[]UserAccount `json:"userAccounts,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolEnableAutoScaleParameter ... -type PoolEnableAutoScaleParameter struct { - // AutoScaleFormula - The formula is checked for validity before it is applied to the pool. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` -} - -// PoolEvaluateAutoScaleParameter ... -type PoolEvaluateAutoScaleParameter struct { - // AutoScaleFormula - The formula is validated and its results calculated, but it is not applied to the pool. To apply the formula to the pool, 'Enable automatic scaling on a pool'. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` -} - -// PoolInformation ... -type PoolInformation struct { - // PoolID - You must ensure that the pool referenced by this property exists. If the pool does not exist at the time the Batch service tries to schedule a job, no tasks for the job will run until you create a pool with that id. Note that the Batch service will not reject the job request; it will simply not run tasks until the pool exists. You must specify either the pool ID or the auto pool specification, but not both. - PoolID *string `json:"poolId,omitempty"` - // AutoPoolSpecification - If auto pool creation fails, the Batch service moves the job to a completed state, and the pool creation error is set in the job's scheduling error property. The Batch service manages the lifetime (both creation and, unless keepAlive is specified, deletion) of the auto pool. Any user actions that affect the lifetime of the auto pool while the job is active will result in unexpected behavior. You must specify either the pool ID or the auto pool specification, but not both. - AutoPoolSpecification *AutoPoolSpecification `json:"autoPoolSpecification,omitempty"` -} - -// PoolListUsageMetricsResult ... -type PoolListUsageMetricsResult struct { - autorest.Response `json:"-"` - Value *[]PoolUsageMetrics `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// PoolListUsageMetricsResultIterator provides access to a complete listing of PoolUsageMetrics values. -type PoolListUsageMetricsResultIterator struct { - i int - page PoolListUsageMetricsResultPage -} - -// Next 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 *PoolListUsageMetricsResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PoolListUsageMetricsResultIterator) 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 PoolListUsageMetricsResultIterator) Response() PoolListUsageMetricsResult { - 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 PoolListUsageMetricsResultIterator) Value() PoolUsageMetrics { - if !iter.page.NotDone() { - return PoolUsageMetrics{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (plumr PoolListUsageMetricsResult) IsEmpty() bool { - return plumr.Value == nil || len(*plumr.Value) == 0 -} - -// poolListUsageMetricsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (plumr PoolListUsageMetricsResult) poolListUsageMetricsResultPreparer() (*http.Request, error) { - if plumr.OdataNextLink == nil || len(to.String(plumr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(plumr.OdataNextLink))) -} - -// PoolListUsageMetricsResultPage contains a page of PoolUsageMetrics values. -type PoolListUsageMetricsResultPage struct { - fn func(PoolListUsageMetricsResult) (PoolListUsageMetricsResult, error) - plumr PoolListUsageMetricsResult -} - -// 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. -func (page *PoolListUsageMetricsResultPage) Next() error { - next, err := page.fn(page.plumr) - if err != nil { - return err - } - page.plumr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PoolListUsageMetricsResultPage) NotDone() bool { - return !page.plumr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PoolListUsageMetricsResultPage) Response() PoolListUsageMetricsResult { - return page.plumr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PoolListUsageMetricsResultPage) Values() []PoolUsageMetrics { - if page.plumr.IsEmpty() { - return nil - } - return *page.plumr.Value -} - -// PoolPatchParameter ... -type PoolPatchParameter struct { - // StartTask - If omitted, any existing start task is left unchanged. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - If omitted, any existing certificate references are left unchanged. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. If this element is present, it replaces any existing application package references. If you specify an empty collection, then all application package references are removed from the pool. If omitted, any existing application package references are left unchanged. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - If this element is present, it replaces any existing metadata configured on the pool. If you specify an empty collection, any metadata is removed from the pool. If omitted, any existing metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolResizeParameter ... -type PoolResizeParameter struct { - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData' - NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"` -} - -// PoolSpecification ... -type PoolSpecification struct { - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - This property must be specified if the pool needs to be created with Azure PaaS VMs. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - This property must be specified if the pool needs to be created with Azure IaaS VMs. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting). - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - // TaskSchedulingPolicy - How tasks are distributed among compute nodes in the pool. - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // TargetDedicated - This property must not be specified if enableAutoScale is set to true. It is required if enableAutoScale is set to false. - TargetDedicated *int32 `json:"targetDedicated,omitempty"` - // EnableAutoScale - If false, the targetDedicated element is required. If true, the autoScaleFormula element is required. The pool automatically resizes according to the formula. The default value is false. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - This property is currently not supported on auto pools created with the virtualMachineConfiguration (IaaS) property. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - UserAccounts *[]UserAccount `json:"userAccounts,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolStatistics ... -type PoolStatistics struct { - autorest.Response `json:"-"` - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UsageStats *UsageStatistics `json:"usageStats,omitempty"` - ResourceStats *ResourceStatistics `json:"resourceStats,omitempty"` -} - -// PoolUpdatePropertiesParameter ... -type PoolUpdatePropertiesParameter struct { - // StartTask - If this element is present, it overwrites any existing start task. If omitted, any existing start task is removed from the pool. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - If you specify an empty collection, any existing certificate references are removed from the pool. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. The list replaces any existing application package references. If omitted, or if you specify an empty collection, any existing application packages references are removed from the pool. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - This list replaces any existing metadata configured on the pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the pool. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolUpgradeOSParameter ... -type PoolUpgradeOSParameter struct { - TargetOSVersion *string `json:"targetOSVersion,omitempty"` -} - -// PoolUsageMetrics ... -type PoolUsageMetrics struct { - PoolID *string `json:"poolId,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - EndTime *date.Time `json:"endTime,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - TotalCoreHours *float64 `json:"totalCoreHours,omitempty"` - DataIngressGiB *float64 `json:"dataIngressGiB,omitempty"` - DataEgressGiB *float64 `json:"dataEgressGiB,omitempty"` -} - -// ReadCloser ... -type ReadCloser struct { - autorest.Response `json:"-"` - Value *io.ReadCloser `json:"value,omitempty"` -} - -// RecentJob ... -type RecentJob struct { - ID *string `json:"id,omitempty"` - URL *string `json:"url,omitempty"` -} - -// ResizeError ... -type ResizeError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Values *[]NameValuePair `json:"values,omitempty"` -} - -// ResourceFile ... -type ResourceFile struct { - // BlobSource - This URL must be readable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, or set the ACL for the blob or its container to allow public access. - BlobSource *string `json:"blobSource,omitempty"` - FilePath *string `json:"filePath,omitempty"` - // FileMode - This property applies only to files being downloaded to Linux compute nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows node. If this property is not specified for a Linux node, then a default value of 0770 is applied to the file. - FileMode *string `json:"fileMode,omitempty"` -} - -// ResourceStatistics ... -type ResourceStatistics struct { - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - AvgCPUPercentage *float64 `json:"avgCPUPercentage,omitempty"` - AvgMemoryGiB *float64 `json:"avgMemoryGiB,omitempty"` - PeakMemoryGiB *float64 `json:"peakMemoryGiB,omitempty"` - AvgDiskGiB *float64 `json:"avgDiskGiB,omitempty"` - PeakDiskGiB *float64 `json:"peakDiskGiB,omitempty"` - DiskReadIOps *int64 `json:"diskReadIOps,omitempty"` - DiskWriteIOps *int64 `json:"diskWriteIOps,omitempty"` - DiskReadGiB *float64 `json:"diskReadGiB,omitempty"` - DiskWriteGiB *float64 `json:"diskWriteGiB,omitempty"` - NetworkReadGiB *float64 `json:"networkReadGiB,omitempty"` - NetworkWriteGiB *float64 `json:"networkWriteGiB,omitempty"` -} - -// Schedule ... -type Schedule struct { - // DoNotRunUntil - If you do not specify a doNotRunUntil time, the schedule becomes ready to create jobs immediately. - DoNotRunUntil *date.Time `json:"doNotRunUntil,omitempty"` - // DoNotRunAfter - If you do not specify a doNotRunAfter time, and you are creating a recurring job schedule, the job schedule will remain active until you explicitly terminate it. - DoNotRunAfter *date.Time `json:"doNotRunAfter,omitempty"` - // StartWindow - If a job is not created within the startWindow interval, then the 'opportunity' is lost; no job will be created until the next recurrence of the schedule. If the schedule is recurring, and the startWindow is longer than the recurrence interval, then this is equivalent to an infinite startWindow, because the job that is 'due' in one recurrenceInterval is not carried forward into the next recurrence interval. The default is infinite. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - StartWindow *string `json:"startWindow,omitempty"` - // RecurrenceInterval - Because a job schedule can have at most one active job under it at any given time, if it is time to create a new job under a job schedule, but the previous job is still running, the Batch service will not create the new job until the previous job finishes. If the previous job does not finish within the startWindow period of the new recurrenceInterval, then no new job will be scheduled for that interval. For recurring jobs, you should normally specify a jobManagerTask in the jobSpecification. If you do not use jobManagerTask, you will need an external process to monitor when jobs are created, add tasks to the jobs and terminate the jobs ready for the next recurrence. The default is that the schedule does not recur: one job is created, within the startWindow after the doNotRunUntil time, and the schedule is complete as soon as that job finishes. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - RecurrenceInterval *string `json:"recurrenceInterval,omitempty"` -} - -// StartTask ... -type StartTask struct { - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - // MaxTaskRetryCount - The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` - // WaitForSuccess - If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and scheduling error detail. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is false. - WaitForSuccess *bool `json:"waitForSuccess,omitempty"` -} - -// StartTaskInformation ... -type StartTaskInformation struct { - // State - running - The start task is currently running. completed - The start task has exited with exit code 0, or the start task has failed and the retry limit has reached, or the start task process did not run due to scheduling errors. Possible values include: 'StartTaskStateRunning', 'StartTaskStateCompleted' - State StartTaskState `json:"state,omitempty"` - // StartTime - This value is reset every time the task is restarted or retried (that is, this is the most recent time at which the start task started running). - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This is the end time of the most recent run of the start task, if that run has completed (even if that run failed and a retry is pending). This element is not present if the start task is currently running. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - This property is set only if the start task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the start task (due to timeout, or user termination via the API) you may see an operating system-defined exit code. - ExitCode *int32 `json:"exitCode,omitempty"` - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - // RetryCount - The task is retried if it exits with a nonzero exit code, up to the specified MaxTaskRetryCount. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` -} - -// SubtaskInformation ... -type SubtaskInformation struct { - ID *int32 `json:"id,omitempty"` - NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the subtask is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - This property is set only if the subtask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the subtask (due to timeout, or user termination via the API) you may see an operating system-defined exit code. - ExitCode *int32 `json:"exitCode,omitempty"` - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - // State - Possible values include: 'SubtaskStatePreparing', 'SubtaskStateRunning', 'SubtaskStateCompleted' - State SubtaskState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the subtask is in its initial running state. Possible values include: 'SubtaskStatePreparing', 'SubtaskStateRunning', 'SubtaskStateCompleted' - PreviousState SubtaskState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the subtask is in its initial running state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` -} - -// TaskAddCollectionParameter ... -type TaskAddCollectionParameter struct { - Value *[]TaskAddParameter `json:"value,omitempty"` -} - -// TaskAddCollectionResult ... -type TaskAddCollectionResult struct { - autorest.Response `json:"-"` - Value *[]TaskAddResult `json:"value,omitempty"` -} - -// TaskAddParameter ... -type TaskAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a job that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ExitConditions - How the Batch service should respond when the task completes. - ExitConditions *ExitConditions `json:"exitConditions,omitempty"` - // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"` - // Constraints - If you do not specify constraints, the maxTaskRetryCount is the maxTaskRetryCount specified for the job, and the maxWallClockTime and retentionTime are infinite. - Constraints *TaskConstraints `json:"constraints,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"` - // DependsOn - This task will not be scheduled until all tasks that it depends on have completed successfully. If any of those tasks fail and exhaust their retry counts, this task will never be scheduled. If the job does not have usesTaskDependencies set to true, and this element is present, the request fails with error code TaskDependenciesNotSpecifiedOnJob. - DependsOn *TaskDependencies `json:"dependsOn,omitempty"` - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job. - AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"` -} - -// TaskAddResult ... -type TaskAddResult struct { - // Status - Possible values include: 'TaskAddStatusSuccess', 'TaskAddStatusClientError', 'TaskAddStatusServerError', 'TaskAddStatusUnmapped' - Status TaskAddStatus `json:"status,omitempty"` - TaskID *string `json:"taskId,omitempty"` - ETag *string `json:"eTag,omitempty"` - LastModified *date.Time `json:"lastModified,omitempty"` - Location *string `json:"location,omitempty"` - Error *Error `json:"error,omitempty"` -} - -// TaskConstraints ... -type TaskConstraints struct { - // MaxWallClockTime - If this is not specified, there is no time limit on how long the task may run. - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged. - RetentionTime *string `json:"retentionTime,omitempty"` - // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` -} - -// TaskDependencies ... -type TaskDependencies struct { - TaskIds *[]string `json:"taskIds,omitempty"` - TaskIDRanges *[]TaskIDRange `json:"taskIdRanges,omitempty"` -} - -// TaskExecutionInformation ... -type TaskExecutionInformation struct { - // StartTime - 'Running' corresponds to the running state, so if the task specifies resource files or application packages, then the start time reflects the time at which the task started downloading or deploying these. If the task has been restarted or retried, this is the most recent time at which the task started running. This property is present only for tasks that are in the running or completed state. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - This property is set only if the task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the task (due to timeout, or user termination via the API) you may see an operating system-defined exit code. - ExitCode *int32 `json:"exitCode,omitempty"` - // SchedulingError - This property is set only if the task is in the completed state. - SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"` - // RetryCount - The task is retried if it exits with a nonzero exit code, up to the specified maxTaskRetryCount. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` - // RequeueCount - When the user removes nodes from a pool (by resizing/shrinking the pool) or when the job is being disabled, the user can specify that running tasks on the nodes be requeued for execution. This count tracks how many times the task has been requeued for these reasons. - RequeueCount *int32 `json:"requeueCount,omitempty"` - // LastRequeueTime - This property is set only if the requeueCount is nonzero. - LastRequeueTime *date.Time `json:"lastRequeueTime,omitempty"` -} - -// TaskIDRange the start and end of the range are inclusive. For example, if a range has start 9 and end 12, then -// it represents tasks '9', '10', '11' and '12'. -type TaskIDRange struct { - Start *int32 `json:"start,omitempty"` - End *int32 `json:"end,omitempty"` -} - -// TaskInformation ... -type TaskInformation struct { - TaskURL *string `json:"taskUrl,omitempty"` - JobID *string `json:"jobId,omitempty"` - TaskID *string `json:"taskId,omitempty"` - SubtaskID *int32 `json:"subtaskId,omitempty"` - // TaskState - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - TaskState TaskState `json:"taskState,omitempty"` - ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"` -} - -// TaskSchedulingError ... -type TaskSchedulingError struct { - // Category - Possible values include: 'SchedulingErrorCategoryUserError', 'SchedulingErrorCategoryServerError', 'SchedulingErrorCategoryUnmapped' - Category SchedulingErrorCategory `json:"category,omitempty"` - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Details *[]NameValuePair `json:"details,omitempty"` -} - -// TaskSchedulingPolicy ... -type TaskSchedulingPolicy struct { - // NodeFillType - Possible values include: 'ComputeNodeFillTypeSpread', 'ComputeNodeFillTypePack', 'ComputeNodeFillTypeUnmapped' - NodeFillType ComputeNodeFillType `json:"nodeFillType,omitempty"` -} - -// TaskStatistics ... -type TaskStatistics struct { - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UserCPUTime *string `json:"userCPUTime,omitempty"` - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If the task was retried, this includes the wall clock time of all the task retries. - WallClockTime *string `json:"wallClockTime,omitempty"` - ReadIOps *int64 `json:"readIOps,omitempty"` - WriteIOps *int64 `json:"writeIOps,omitempty"` - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - WaitTime *string `json:"waitTime,omitempty"` -} - -// TaskUpdateParameter ... -type TaskUpdateParameter struct { - // Constraints - If omitted, the task is given the default constraints. - Constraints *TaskConstraints `json:"constraints,omitempty"` -} - -// UsageStatistics ... -type UsageStatistics struct { - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - DedicatedCoreTime *string `json:"dedicatedCoreTime,omitempty"` -} - -// UserAccount ... -type UserAccount struct { - Name *string `json:"name,omitempty"` - Password *string `json:"password,omitempty"` - // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin' - ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"` - // SSHPrivateKey - The SSH private key establishes password-less SSH between nodes in a Linux pool when the pool's enableInterNodeCommunication property is true. This property will be ignored in a Windows pool. - SSHPrivateKey *string `json:"sshPrivateKey,omitempty"` -} - -// UserIdentity specify either the userName or autoUser property, but not both. -type UserIdentity struct { - // UserName - The userName and autoUser properties are mutually exclusive; you must specify one but not both. - UserName *string `json:"username,omitempty"` - // AutoUser - The userName and autoUser properties are mutually exclusive; you must specify one but not both. - AutoUser *AutoUserSpecification `json:"autoUser,omitempty"` -} - -// VirtualMachineConfiguration ... -type VirtualMachineConfiguration struct { - // ImageReference - This property and osDisk are mutually exclusive and one of the properties must be specified. - ImageReference *ImageReference `json:"imageReference,omitempty"` - // OsDisk - This property can be specified only if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. This property and imageReference are mutually exclusive and one of the properties must be specified. - OsDisk *OSDisk `json:"osDisk,omitempty"` - // NodeAgentSKUID - The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation. - NodeAgentSKUID *string `json:"nodeAgentSKUId,omitempty"` - // WindowsConfiguration - This property must not be specified if the imageReference or osDisk property specifies a Linux OS image. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` -} - -// WindowsConfiguration ... -type WindowsConfiguration struct { - // EnableAutomaticUpdates - If omitted, the default value is true. - EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` -} diff --git a/services/batch/2017-01-01.4.0/batch/pool.go b/services/batch/2017-01-01.4.0/batch/pool.go deleted file mode 100644 index a43ed39b7eee..000000000000 --- a/services/batch/2017-01-01.4.0/batch/pool.go +++ /dev/null @@ -1,1878 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// PoolClient is the a client for issuing REST requests to the Azure Batch service. -type PoolClient struct { - BaseClient -} - -// NewPoolClient creates an instance of the PoolClient client. -func NewPoolClient() PoolClient { - return NewPoolClientWithBaseURI(DefaultBaseURI) -} - -// NewPoolClientWithBaseURI creates an instance of the PoolClient client. -func NewPoolClientWithBaseURI(baseURI string) PoolClient { - return PoolClient{NewWithBaseURI(baseURI)} -} - -// Add when naming pools, avoid including sensitive information such as user names or secret project names. This -// information may appear in telemetry logs accessible to Microsoft Support engineers. -// -// pool is the pool to be added. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client PoolClient) Add(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: pool, - Constraints: []validation.Constraint{{Target: "pool.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, pool, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client PoolClient) AddPreparer(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/pools"), - autorest.WithJSON(pool), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 PoolClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete when you request that a pool be deleted, the following actions occur: the pool state is set to deleting; any -// ongoing resize operation on the pool are stopped; the Batch service starts resizing the pool to zero nodes; any -// tasks running on existing nodes are terminated and requeued (as if a resize pool operation had been requested with -// the default requeue option); finally, the pool is removed from the system. Because running tasks are requeued, the -// user can rerun these tasks by updating their job to target a different pool. The tasks can then run on the new pool. -// If you want to override the requeue behavior, then you should call resize pool explicitly to shrink the pool to zero -// size before deleting the pool. If you call an Update, Patch or Delete API on a pool in the deleting state, it will -// fail with HTTP status code 409 with error code PoolBeingDeleted. -// -// poolID is the ID of the pool to delete. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the -// resource known to the client. The operation will be performed only if the resource's current ETag on the service -// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of -// the resource known to the client. The operation will be performed only if the resource's current ETag on the -// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has not been modified since the specified time. -func (client PoolClient) Delete(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PoolClient) DeletePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 PoolClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) 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 -} - -// DisableAutoScale sends the disable auto scale request. -// -// poolID is the ID of the pool on which to disable automatic scaling. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client PoolClient) DisableAutoScale(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisableAutoScalePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.DisableAutoScaleSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure sending request") - return - } - - result, err = client.DisableAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure responding to request") - } - - return -} - -// DisableAutoScalePreparer prepares the DisableAutoScale request. -func (client PoolClient) DisableAutoScalePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/disableautoscale", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableAutoScaleSender sends the DisableAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) DisableAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableAutoScaleResponder handles the response to the DisableAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) DisableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EnableAutoScale you cannot enable automatic scaling on a pool if a resize operation is in progress on the pool. If -// automatic scaling of the pool is currently disabled, you must specify a valid autoscale formula as part of the -// request. If automatic scaling of the pool is already enabled, you may specify a new autoscale formula and/or a new -// evaluation interval. You cannot call this API for the same pool more than once every 30 seconds. -// -// poolID is the ID of the pool on which to enable automatic scaling. poolEnableAutoScaleParameter is the -// parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. ifMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service exactly matches the -// value specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to -// the client. The operation will be performed only if the resource's current ETag on the service does not match -// the value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the -// resource known to the client. The operation will be performed only if the resource on the service has been -// modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the -// resource known to the client. The operation will be performed only if the resource on the service has not been -// modified since the specified time. -func (client PoolClient) EnableAutoScale(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnableAutoScalePreparer(ctx, poolID, poolEnableAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.EnableAutoScaleSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure sending request") - return - } - - result, err = client.EnableAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure responding to request") - } - - return -} - -// EnableAutoScalePreparer prepares the EnableAutoScale request. -func (client PoolClient) EnableAutoScalePreparer(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/enableautoscale", pathParameters), - autorest.WithJSON(poolEnableAutoScaleParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableAutoScaleSender sends the EnableAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) EnableAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableAutoScaleResponder handles the response to the EnableAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) EnableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EvaluateAutoScale this API is primarily for validating an autoscale formula, as it simply returns the result without -// applying the formula to the pool. -// -// poolID is the ID of the pool on which to evaluate the automatic scaling formula. poolEvaluateAutoScaleParameter -// is the parameters for the request. timeout is the maximum time that the server can spend processing the request, -// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of -// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client PoolClient) EvaluateAutoScale(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AutoScaleRun, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolEvaluateAutoScaleParameter, - Constraints: []validation.Constraint{{Target: "poolEvaluateAutoScaleParameter.AutoScaleFormula", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "EvaluateAutoScale", err.Error()) - } - - req, err := client.EvaluateAutoScalePreparer(ctx, poolID, poolEvaluateAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.EvaluateAutoScaleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure sending request") - return - } - - result, err = client.EvaluateAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure responding to request") - } - - return -} - -// EvaluateAutoScalePreparer prepares the EvaluateAutoScale request. -func (client PoolClient) EvaluateAutoScalePreparer(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/evaluateautoscale", pathParameters), - autorest.WithJSON(poolEvaluateAutoScaleParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EvaluateAutoScaleSender sends the EvaluateAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) EvaluateAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EvaluateAutoScaleResponder handles the response to the EvaluateAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) EvaluateAutoScaleResponder(resp *http.Response) (result AutoScaleRun, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Exists gets basic properties of a pool. -// -// poolID is the ID of the pool to get. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the -// resource known to the client. The operation will be performed only if the resource's current ETag on the service -// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of -// the resource known to the client. The operation will be performed only if the resource's current ETag on the -// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has not been modified since the specified time. -func (client PoolClient) Exists(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ExistsPreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", nil, "Failure preparing request") - return - } - - resp, err := client.ExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure sending request") - return - } - - result, err = client.ExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure responding to request") - } - - return -} - -// ExistsPreparer prepares the Exists request. -func (client PoolClient) ExistsPreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExistsSender sends the Exists request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ExistsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExistsResponder handles the response to the Exists request. The method always -// closes the http.Response Body. -func (client PoolClient) ExistsResponder(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 information about the specified pool. -// -// poolID is the ID of the pool to get. selectParameter is an OData $select clause. expand is an OData $expand -// clause. timeout is the maximum time that the server can spend processing the request, in seconds. The default is -// 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration -// such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server -// should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client PoolClient) Get(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudPool, err error) { - req, err := client.GetPreparer(ctx, poolID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client PoolClient) GetPreparer(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 PoolClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) GetResponder(resp *http.Response) (result CloudPool, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAllLifetimeStatistics statistics are aggregated across all pools that have ever existed in the account, from -// account creation to the last update time of the statistics. -// -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client PoolClient) GetAllLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolStatistics, err error) { - req, err := client.GetAllLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", nil, "Failure preparing request") - return - } - - resp, err := client.GetAllLifetimeStatisticsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", resp, "Failure sending request") - return - } - - result, err = client.GetAllLifetimeStatisticsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", resp, "Failure responding to request") - } - - return -} - -// GetAllLifetimeStatisticsPreparer prepares the GetAllLifetimeStatistics request. -func (client PoolClient) GetAllLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/lifetimepoolstats"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAllLifetimeStatisticsSender sends the GetAllLifetimeStatistics request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) GetAllLifetimeStatisticsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetAllLifetimeStatisticsResponder handles the response to the GetAllLifetimeStatistics request. The method always -// closes the http.Response Body. -func (client PoolClient) GetAllLifetimeStatisticsResponder(resp *http.Response) (result PoolStatistics, 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. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand -// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 pools can be -// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. -func (client PoolClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure sending request") - return - } - - result.cplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client PoolClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/pools"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 PoolClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) ListResponder(resp *http.Response) (result CloudPoolListResult, 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 PoolClient) listNextResults(lastResults CloudPoolListResult) (result CloudPoolListResult, err error) { - req, err := lastResults.cloudPoolListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "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, "batch.PoolClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PoolClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListUsageMetrics if you do not specify a $filter clause including a poolId, the response includes all pools that -// existed in the account in the time range of the returned aggregation intervals. -// -// startTime is the earliest time from which to include metrics. This must be at least two and a half hours before -// the current time. If not specified this defaults to the start time of the last aggregation interval currently -// available. endTime is the latest time from which to include metrics. This must be at least two hours before the -// current time. If not specified this defaults to the end time of the last aggregation interval currently -// available. filter is an OData $filter clause. If this is not specified the response includes all pools that -// existed in the account in the time range of the returned aggregation intervals. maxResults is the maximum number -// of items to return in the response. A maximum of 1000 results will be returned. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client PoolClient) ListUsageMetrics(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListUsageMetricsResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "ListUsageMetrics", err.Error()) - } - - result.fn = client.listUsageMetricsNextResults - req, err := client.ListUsageMetricsPreparer(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListUsageMetricsSender(req) - if err != nil { - result.plumr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", resp, "Failure sending request") - return - } - - result.plumr, err = client.ListUsageMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", resp, "Failure responding to request") - } - - return -} - -// ListUsageMetricsPreparer prepares the ListUsageMetrics request. -func (client PoolClient) ListUsageMetricsPreparer(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if startTime != nil { - queryParameters["starttime"] = autorest.Encode("query", *startTime) - } - if endTime != nil { - queryParameters["endtime"] = autorest.Encode("query", *endTime) - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/poolusagemetrics"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListUsageMetricsSender sends the ListUsageMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ListUsageMetricsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListUsageMetricsResponder handles the response to the ListUsageMetrics request. The method always -// closes the http.Response Body. -func (client PoolClient) ListUsageMetricsResponder(resp *http.Response) (result PoolListUsageMetricsResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listUsageMetricsNextResults retrieves the next set of results, if any. -func (client PoolClient) listUsageMetricsNextResults(lastResults PoolListUsageMetricsResult) (result PoolListUsageMetricsResult, err error) { - req, err := lastResults.poolListUsageMetricsResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListUsageMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListUsageMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListUsageMetricsComplete enumerates all values, automatically crossing page boundaries as required. -func (client PoolClient) ListUsageMetricsComplete(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListUsageMetricsResultIterator, err error) { - result.page, err = client.ListUsageMetrics(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch this only replaces the pool properties specified in the request. For example, if the pool has a start task -// associated with it, and a request does not specify a start task element, then the pool keeps the existing start -// task. -// -// poolID is the ID of the pool to update. poolPatchParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client PoolClient) Patch(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, poolID, poolPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client PoolClient) PatchPreparer(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithJSON(poolPatchParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client PoolClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// RemoveNodes this operation can only run when the allocation state of the pool is steady. When this operation runs, -// the allocation state changes from steady to resizing. -// -// poolID is the ID of the pool from which you want to remove nodes. nodeRemoveParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client PoolClient) RemoveNodes(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: nodeRemoveParameter, - Constraints: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "RemoveNodes", err.Error()) - } - - req, err := client.RemoveNodesPreparer(ctx, poolID, nodeRemoveParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", nil, "Failure preparing request") - return - } - - resp, err := client.RemoveNodesSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure sending request") - return - } - - result, err = client.RemoveNodesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure responding to request") - } - - return -} - -// RemoveNodesPreparer prepares the RemoveNodes request. -func (client PoolClient) RemoveNodesPreparer(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/removenodes", pathParameters), - autorest.WithJSON(nodeRemoveParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RemoveNodesSender sends the RemoveNodes request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) RemoveNodesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// RemoveNodesResponder handles the response to the RemoveNodes request. The method always -// closes the http.Response Body. -func (client PoolClient) RemoveNodesResponder(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 -} - -// Resize you can only resize a pool when its allocation state is steady. If the pool is already resizing, the request -// fails with status code 409. When you resize a pool, the pool's allocation state changes from steady to resizing. You -// cannot resize pools which are configured for automatic scaling. If you try to do this, the Batch service returns an -// error 409. If you resize a pool downwards, the Batch service chooses which nodes to remove. To remove specific -// nodes, use the pool remove nodes API instead. -// -// poolID is the ID of the pool to resize. poolResizeParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client PoolClient) Resize(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolResizeParameter, - Constraints: []validation.Constraint{{Target: "poolResizeParameter.TargetDedicated", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "Resize", err.Error()) - } - - req, err := client.ResizePreparer(ctx, poolID, poolResizeParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", nil, "Failure preparing request") - return - } - - resp, err := client.ResizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure sending request") - return - } - - result, err = client.ResizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure responding to request") - } - - return -} - -// ResizePreparer prepares the Resize request. -func (client PoolClient) ResizePreparer(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/resize", pathParameters), - autorest.WithJSON(poolResizeParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResizeSender sends the Resize request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ResizeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ResizeResponder handles the response to the Resize request. The method always -// closes the http.Response Body. -func (client PoolClient) ResizeResponder(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 -} - -// StopResize this does not restore the pool to its previous state before the resize operation: it only stops any -// further changes being made, and the pool maintains its current state. A resize operation need not be an explicit -// resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. -// -// poolID is the ID of the pool whose resizing you want to stop. timeout is the maximum time that the server can -// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client PoolClient) StopResize(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.StopResizePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", nil, "Failure preparing request") - return - } - - resp, err := client.StopResizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure sending request") - return - } - - result, err = client.StopResizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure responding to request") - } - - return -} - -// StopResizePreparer prepares the StopResize request. -func (client PoolClient) StopResizePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/stopresize", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopResizeSender sends the StopResize request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) StopResizeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// StopResizeResponder handles the response to the StopResize request. The method always -// closes the http.Response Body. -func (client PoolClient) StopResizeResponder(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 -} - -// UpdateProperties this fully replaces all the updateable properties of the pool. For example, if the pool has a start -// task associated with it and if start task is not specified with this request, then the Batch service will remove the -// existing start task. -// -// poolID is the ID of the pool to update. poolUpdatePropertiesParameter is the parameters for the request. timeout -// is the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client PoolClient) UpdateProperties(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolUpdatePropertiesParameter, - Constraints: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "poolUpdatePropertiesParameter.CertificateReferences", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.ApplicationPackageReferences", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.Metadata", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "UpdateProperties", err.Error()) - } - - req, err := client.UpdatePropertiesPreparer(ctx, poolID, poolUpdatePropertiesParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", nil, "Failure preparing request") - return - } - - resp, err := client.UpdatePropertiesSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure sending request") - return - } - - result, err = client.UpdatePropertiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure responding to request") - } - - return -} - -// UpdatePropertiesPreparer prepares the UpdateProperties request. -func (client PoolClient) UpdatePropertiesPreparer(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/updateproperties", pathParameters), - autorest.WithJSON(poolUpdatePropertiesParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdatePropertiesSender sends the UpdateProperties request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) UpdatePropertiesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdatePropertiesResponder handles the response to the UpdateProperties request. The method always -// closes the http.Response Body. -func (client PoolClient) UpdatePropertiesResponder(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 -} - -// UpgradeOS during an upgrade, the Batch service upgrades each compute node in the pool. When a compute node is chosen -// for upgrade, any tasks running on that node are removed from the node and returned to the queue to be rerun later -// (or on a different compute node). The node will be unavailable until the upgrade is complete. This operation results -// in temporarily reduced pool capacity as nodes are taken out of service to be upgraded. Although the Batch service -// tries to avoid upgrading all compute nodes at the same time, it does not guarantee to do this (particularly on small -// pools); therefore, the pool may be temporarily unavailable to run tasks. When this operation runs, the pool state -// changes to upgrading. When all compute nodes have finished upgrading, the pool state returns to active. -// -// poolID is the ID of the pool to upgrade. poolUpgradeOSParameter is the parameters for the request. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client PoolClient) UpgradeOS(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolUpgradeOSParameter, - Constraints: []validation.Constraint{{Target: "poolUpgradeOSParameter.TargetOSVersion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "UpgradeOS", err.Error()) - } - - req, err := client.UpgradeOSPreparer(ctx, poolID, poolUpgradeOSParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", nil, "Failure preparing request") - return - } - - resp, err := client.UpgradeOSSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure sending request") - return - } - - result, err = client.UpgradeOSResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure responding to request") - } - - return -} - -// UpgradeOSPreparer prepares the UpgradeOS request. -func (client PoolClient) UpgradeOSPreparer(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/upgradeos", pathParameters), - autorest.WithJSON(poolUpgradeOSParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpgradeOSSender sends the UpgradeOS request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) UpgradeOSSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpgradeOSResponder handles the response to the UpgradeOS request. The method always -// closes the http.Response Body. -func (client PoolClient) UpgradeOSResponder(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/batch/2017-01-01.4.0/batch/task.go b/services/batch/2017-01-01.4.0/batch/task.go deleted file mode 100644 index 8d068742ac73..000000000000 --- a/services/batch/2017-01-01.4.0/batch/task.go +++ /dev/null @@ -1,1068 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// TaskClient is the a client for issuing REST requests to the Azure Batch service. -type TaskClient struct { - BaseClient -} - -// NewTaskClient creates an instance of the TaskClient client. -func NewTaskClient() TaskClient { - return NewTaskClientWithBaseURI(DefaultBaseURI) -} - -// NewTaskClientWithBaseURI creates an instance of the TaskClient client. -func NewTaskClientWithBaseURI(baseURI string) TaskClient { - return TaskClient{NewWithBaseURI(baseURI)} -} - -// Add sends the add request. -// -// jobID is the ID of the job to which the task is to be added. task is the task to be added. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client TaskClient) Add(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: task, - Constraints: []validation.Constraint{{Target: "task.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "task.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "task.AffinityInfo", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "task.AffinityInfo.AffinityID", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "task.MultiInstanceSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "task.MultiInstanceSettings.NumberOfInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, jobID, task, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client TaskClient) AddPreparer(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters), - autorest.WithJSON(task), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 TaskClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// AddCollection note that each task must have a unique ID. The Batch service may not return the results for each task -// in the same order the tasks were submitted in this request. If the server times out or the connection is closed -// during the request, the request may have been partially or fully processed, or not at all. In such cases, the user -// should re-issue the request. Note that it is up to the user to correctly handle failures when re-issuing a request. -// For example, you should use the same task ids during a retry so that if the prior operation succeeded, the retry -// will not create extra tasks unexpectedly. -// -// jobID is the ID of the job to which the task collection is to be added. taskCollection is the tasks to be added. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client TaskClient) AddCollection(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result TaskAddCollectionResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: taskCollection, - Constraints: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "AddCollection", err.Error()) - } - - req, err := client.AddCollectionPreparer(ctx, jobID, taskCollection, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", nil, "Failure preparing request") - return - } - - resp, err := client.AddCollectionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure sending request") - return - } - - result, err = client.AddCollectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure responding to request") - } - - return -} - -// AddCollectionPreparer prepares the AddCollection request. -func (client TaskClient) AddCollectionPreparer(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/addtaskcollection", pathParameters), - autorest.WithJSON(taskCollection), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddCollectionSender sends the AddCollection request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) AddCollectionSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddCollectionResponder handles the response to the AddCollection request. The method always -// closes the http.Response Body. -func (client TaskClient) AddCollectionResponder(resp *http.Response) (result TaskAddCollectionResult, 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 when a task is deleted, all of the files in its directory on the compute node where it ran are also deleted -// (regardless of the retention time). For multi-instance tasks, the delete task operation applies synchronously to the -// primary task; subtasks and their files are then deleted asynchronously in the background. -// -// jobID is the ID of the job from which to delete the task. taskID is the ID of the task to delete. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client TaskClient) Delete(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client TaskClient) DeletePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) 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 for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. -// Use the list subtasks API to retrieve information about subtasks. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task to get information about. -// selectParameter is an OData $select clause. expand is an OData $expand clause. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client TaskClient) Get(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudTask, err error) { - req, err := client.GetPreparer(ctx, jobID, taskID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client TaskClient) GetPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) GetResponder(resp *http.Response) (result CloudTask, 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 for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. -// Use the list subtasks API to retrieve information about subtasks. -// -// jobID is the ID of the job. filter is an OData $filter clause. selectParameter is an OData $select clause. -// expand is an OData $expand clause. maxResults is the maximum number of items to return in the response. A -// maximum of 1000 tasks can be returned. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client TaskClient) List(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ctlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure sending request") - return - } - - result.ctlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client TaskClient) ListPreparer(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 TaskClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) ListResponder(resp *http.Response) (result CloudTaskListResult, 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 TaskClient) listNextResults(lastResults CloudTaskListResult) (result CloudTaskListResult, err error) { - req, err := lastResults.cloudTaskListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.TaskClient", "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, "batch.TaskClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client TaskClient) ListComplete(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultIterator, err error) { - result.page, err = client.List(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListSubtasks if the task is not a multi-instance task then this returns an empty collection. -// -// jobID is the ID of the job. taskID is the ID of the task. selectParameter is an OData $select clause. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client TaskClient) ListSubtasks(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListSubtasksResult, err error) { - req, err := client.ListSubtasksPreparer(ctx, jobID, taskID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", nil, "Failure preparing request") - return - } - - resp, err := client.ListSubtasksSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure sending request") - return - } - - result, err = client.ListSubtasksResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure responding to request") - } - - return -} - -// ListSubtasksPreparer prepares the ListSubtasks request. -func (client TaskClient) ListSubtasksPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/subtasksinfo", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSubtasksSender sends the ListSubtasks request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) ListSubtasksSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListSubtasksResponder handles the response to the ListSubtasks request. The method always -// closes the http.Response Body. -func (client TaskClient) ListSubtasksResponder(resp *http.Response) (result CloudTaskListSubtasksResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Reactivate reactivation makes a task eligible to be retried again up to its maximum retry count. The task's state is -// changed to active. As the task is no longer in the completed state, any previous exit code or scheduling error is no -// longer available after reactivation. This will fail for tasks that are not completed or that previously completed -// successfully (with an exit code of 0). Additionally, this will fail if the job has completed (or is terminating or -// deleting). -// -// jobID is the ID of the job containing the task. taskID is the ID of the task to reactivate. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client TaskClient) Reactivate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ReactivatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", nil, "Failure preparing request") - return - } - - resp, err := client.ReactivateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure sending request") - return - } - - result, err = client.ReactivateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure responding to request") - } - - return -} - -// ReactivatePreparer prepares the Reactivate request. -func (client TaskClient) ReactivatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/reactivate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReactivateSender sends the Reactivate request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) ReactivateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ReactivateResponder handles the response to the Reactivate request. The method always -// closes the http.Response Body. -func (client TaskClient) ReactivateResponder(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 -} - -// Terminate when the task has been terminated, it moves to the completed state. For multi-instance tasks, the -// terminate task operation applies synchronously to the primary task; subtasks are then terminated asynchronously in -// the background. -// -// jobID is the ID of the job containing the task. taskID is the ID of the task to terminate. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client TaskClient) Terminate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client TaskClient) TerminatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client TaskClient) TerminateResponder(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 -} - -// Update updates the properties of the specified task. -// -// jobID is the ID of the job containing the task. taskID is the ID of the task to update. taskUpdateParameter is -// the parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. ifMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service exactly matches the -// value specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to -// the client. The operation will be performed only if the resource's current ETag on the service does not match -// the value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the -// resource known to the client. The operation will be performed only if the resource on the service has been -// modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the -// resource known to the client. The operation will be performed only if the resource on the service has not been -// modified since the specified time. -func (client TaskClient) Update(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.UpdatePreparer(ctx, jobID, taskID, taskUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client TaskClient) UpdatePreparer(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-01-01.4.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithJSON(taskUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) UpdateResponder(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/batch/2017-01-01.4.0/batch/version.go b/services/batch/2017-01-01.4.0/batch/version.go deleted file mode 100644 index e9ce3c3a44d0..000000000000 --- a/services/batch/2017-01-01.4.0/batch/version.go +++ /dev/null @@ -1,30 +0,0 @@ -package batch - -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.Number + " batch/2017-01-01.4.0" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/services/batch/2017-06-01.5.1/batch/account.go b/services/batch/2017-06-01.5.1/batch/account.go deleted file mode 100644 index 081728c758e3..000000000000 --- a/services/batch/2017-06-01.5.1/batch/account.go +++ /dev/null @@ -1,174 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// AccountClient is the a client for issuing REST requests to the Azure Batch service. -type AccountClient struct { - BaseClient -} - -// NewAccountClient creates an instance of the AccountClient client. -func NewAccountClient() AccountClient { - return NewAccountClientWithBaseURI(DefaultBaseURI) -} - -// NewAccountClientWithBaseURI creates an instance of the AccountClient client. -func NewAccountClientWithBaseURI(baseURI string) AccountClient { - return AccountClient{NewWithBaseURI(baseURI)} -} - -// ListNodeAgentSkus sends the list node agent skus request. -// -// filter is an OData $filter clause. maxResults is the maximum number of items to return in the response. A -// maximum of 1000 results will be returned. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client AccountClient) ListNodeAgentSkus(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.AccountClient", "ListNodeAgentSkus", err.Error()) - } - - result.fn = client.listNodeAgentSkusNextResults - req, err := client.ListNodeAgentSkusPreparer(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListNodeAgentSkusSender(req) - if err != nil { - result.alnasr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure sending request") - return - } - - result.alnasr, err = client.ListNodeAgentSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure responding to request") - } - - return -} - -// ListNodeAgentSkusPreparer prepares the ListNodeAgentSkus request. -func (client AccountClient) ListNodeAgentSkusPreparer(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/nodeagentskus"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListNodeAgentSkusSender sends the ListNodeAgentSkus request. The method will close the -// http.Response Body if it receives an error. -func (client AccountClient) ListNodeAgentSkusSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListNodeAgentSkusResponder handles the response to the ListNodeAgentSkus request. The method always -// closes the http.Response Body. -func (client AccountClient) ListNodeAgentSkusResponder(resp *http.Response) (result AccountListNodeAgentSkusResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNodeAgentSkusNextResults retrieves the next set of results, if any. -func (client AccountClient) listNodeAgentSkusNextResults(lastResults AccountListNodeAgentSkusResult) (result AccountListNodeAgentSkusResult, err error) { - req, err := lastResults.accountListNodeAgentSkusResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListNodeAgentSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListNodeAgentSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListNodeAgentSkusComplete enumerates all values, automatically crossing page boundaries as required. -func (client AccountClient) ListNodeAgentSkusComplete(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultIterator, err error) { - result.page, err = client.ListNodeAgentSkus(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2017-06-01.5.1/batch/application.go b/services/batch/2017-06-01.5.1/batch/application.go deleted file mode 100644 index 9b10977be59d..000000000000 --- a/services/batch/2017-06-01.5.1/batch/application.go +++ /dev/null @@ -1,264 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// ApplicationClient is the a client for issuing REST requests to the Azure Batch service. -type ApplicationClient struct { - BaseClient -} - -// NewApplicationClient creates an instance of the ApplicationClient client. -func NewApplicationClient() ApplicationClient { - return NewApplicationClientWithBaseURI(DefaultBaseURI) -} - -// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient client. -func NewApplicationClientWithBaseURI(baseURI string) ApplicationClient { - return ApplicationClient{NewWithBaseURI(baseURI)} -} - -// Get this operation returns only applications and versions that are available for use on compute nodes; that is, that -// can be used in an application package reference. For administrator information about applications and versions that -// are not yet available to compute nodes, use the Azure portal or the Azure Resource Manager API. -// -// applicationID is the ID of the application. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client ApplicationClient) Get(ctx context.Context, applicationID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationSummary, err error) { - req, err := client.GetPreparer(ctx, applicationID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationClient) GetPreparer(ctx context.Context, applicationID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationId": autorest.Encode("path", applicationID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/applications/{applicationId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ApplicationClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ApplicationClient) GetResponder(resp *http.Response) (result ApplicationSummary, 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 operation returns only applications and versions that are available for use on compute nodes; that is, -// that can be used in an application package reference. For administrator information about applications and versions -// that are not yet available to compute nodes, use the Azure portal or the Azure Resource Manager API. -// -// maxResults is the maximum number of items to return in the response. A maximum of 1000 applications can be -// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. -func (client ApplicationClient) List(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.ApplicationClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "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, "batch.ApplicationClient", "List", resp, "Failure sending request") - return - } - - result.alr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationClient) ListPreparer(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/applications"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ApplicationClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ApplicationClient) ListResponder(resp *http.Response) (result ApplicationListResult, 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 ApplicationClient) listNextResults(lastResults ApplicationListResult) (result ApplicationListResult, err error) { - req, err := lastResults.applicationListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.ApplicationClient", "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, "batch.ApplicationClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationClient) ListComplete(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultIterator, err error) { - result.page, err = client.List(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2017-06-01.5.1/batch/certificate.go b/services/batch/2017-06-01.5.1/batch/certificate.go deleted file mode 100644 index 8dc630d474a5..000000000000 --- a/services/batch/2017-06-01.5.1/batch/certificate.go +++ /dev/null @@ -1,555 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// CertificateClient is the a client for issuing REST requests to the Azure Batch service. -type CertificateClient struct { - BaseClient -} - -// NewCertificateClient creates an instance of the CertificateClient client. -func NewCertificateClient() CertificateClient { - return NewCertificateClientWithBaseURI(DefaultBaseURI) -} - -// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client. -func NewCertificateClientWithBaseURI(baseURI string) CertificateClient { - return CertificateClient{NewWithBaseURI(baseURI)} -} - -// Add sends the add request. -// -// certificate is the certificate to be added. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client CertificateClient) Add(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: certificate, - Constraints: []validation.Constraint{{Target: "certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "certificate.ThumbprintAlgorithm", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "certificate.Data", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.CertificateClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, certificate, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client CertificateClient) AddPreparer(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/certificates"), - autorest.WithJSON(certificate), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// CancelDeletion if you try to delete a certificate that is being used by a pool or compute node, the status of the -// certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this -// operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not -// need to run this operation after the deletion failed. You must make sure that the certificate is not being used by -// any resources, and then you can try again to delete the certificate. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate being deleted. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client CertificateClient) CancelDeletion(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.CancelDeletionPreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", nil, "Failure preparing request") - return - } - - resp, err := client.CancelDeletionSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure sending request") - return - } - - result, err = client.CancelDeletionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure responding to request") - } - - return -} - -// CancelDeletionPreparer prepares the CancelDeletion request. -func (client CertificateClient) CancelDeletionPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CancelDeletionSender sends the CancelDeletion request. The method will close the -// http.Response Body if it receives an error. -func (client CertificateClient) CancelDeletionSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CancelDeletionResponder handles the response to the CancelDeletion request. The method always -// closes the http.Response Body. -func (client CertificateClient) CancelDeletionResponder(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 -} - -// Delete you cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a -// certificate, you must therefore make sure that the certificate is not associated with any existing pools, the -// certificate is not installed on any compute nodes (even if you remove a certificate from a pool, it is not removed -// from existing compute nodes in that pool until they restart), and no running tasks depend on the certificate. If you -// try to delete a certificate that is in use, the deletion fails. The certificate status changes to deleteFailed. You -// can use Cancel Delete Certificate to set the status back to active if you decide that you want to continue using the -// certificate. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate to be deleted. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client CertificateClient) Delete(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CertificateClient) DeletePreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) 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 information about the specified certificate. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate to get. selectParameter is an OData $select clause. timeout is the maximum -// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is -// the caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client CertificateClient) Get(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result Certificate, err error) { - req, err := client.GetPreparer(ctx, thumbprintAlgorithm, thumbprint, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client CertificateClient) GetPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) GetResponder(resp *http.Response) (result Certificate, 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. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. maxResults is the maximum number -// of items to return in the response. A maximum of 1000 certificates can be returned. timeout is the maximum time -// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client CertificateClient) List(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.CertificateClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "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, "batch.CertificateClient", "List", resp, "Failure sending request") - return - } - - result.clr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client CertificateClient) ListPreparer(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/certificates"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) ListResponder(resp *http.Response) (result CertificateListResult, 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 CertificateClient) listNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) { - req, err := lastResults.certificateListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.CertificateClient", "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, "batch.CertificateClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CertificateClient) ListComplete(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2017-06-01.5.1/batch/client.go b/services/batch/2017-06-01.5.1/batch/client.go deleted file mode 100644 index 4cbdacf8cdcf..000000000000 --- a/services/batch/2017-06-01.5.1/batch/client.go +++ /dev/null @@ -1,49 +0,0 @@ -// Package batch implements the Azure ARM Batch service API version 2017-06-01.5.1. -// -// A client for issuing REST requests to the Azure Batch service. -package batch - -// 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 Batch - DefaultBaseURI = "https://batch.core.windows.net" -) - -// BaseClient is the base client for Batch. -type BaseClient struct { - autorest.Client - BaseURI string -} - -// New creates an instance of the BaseClient client. -func New() BaseClient { - return NewWithBaseURI(DefaultBaseURI) -} - -// NewWithBaseURI creates an instance of the BaseClient client. -func NewWithBaseURI(baseURI string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - } -} diff --git a/services/batch/2017-06-01.5.1/batch/computenode.go b/services/batch/2017-06-01.5.1/batch/computenode.go deleted file mode 100644 index 8ce773c2a9a4..000000000000 --- a/services/batch/2017-06-01.5.1/batch/computenode.go +++ /dev/null @@ -1,1122 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// ComputeNodeClient is the a client for issuing REST requests to the Azure Batch service. -type ComputeNodeClient struct { - BaseClient -} - -// NewComputeNodeClient creates an instance of the ComputeNodeClient client. -func NewComputeNodeClient() ComputeNodeClient { - return NewComputeNodeClientWithBaseURI(DefaultBaseURI) -} - -// NewComputeNodeClientWithBaseURI creates an instance of the ComputeNodeClient client. -func NewComputeNodeClientWithBaseURI(baseURI string) ComputeNodeClient { - return ComputeNodeClient{NewWithBaseURI(baseURI)} -} - -// AddUser you can add a user account to a node only when it is in the idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want -// to create a user account. userParameter is the user account to be created. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) AddUser(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: userParameter, - Constraints: []validation.Constraint{{Target: "userParameter.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.ComputeNodeClient", "AddUser", err.Error()) - } - - req, err := client.AddUserPreparer(ctx, poolID, nodeID, userParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", nil, "Failure preparing request") - return - } - - resp, err := client.AddUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure sending request") - return - } - - result, err = client.AddUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure responding to request") - } - - return -} - -// AddUserPreparer prepares the AddUser request. -func (client ComputeNodeClient) AddUserPreparer(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users", pathParameters), - autorest.WithJSON(userParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddUserSender sends the AddUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) AddUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddUserResponder handles the response to the AddUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) AddUserResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteUser you can delete a user account to a node only when it is in the idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want -// to delete a user account. userName is the name of the user account to delete. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) DeleteUser(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteUserPreparer(ctx, poolID, nodeID, userName, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure sending request") - return - } - - result, err = client.DeleteUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure responding to request") - } - - return -} - -// DeleteUserPreparer prepares the DeleteUser request. -func (client ComputeNodeClient) DeleteUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - "userName": autorest.Encode("path", userName), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteUserSender sends the DeleteUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) DeleteUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteUserResponder handles the response to the DeleteUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) DeleteUserResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// DisableScheduling you can disable task scheduling on a node only if its current scheduling state is enabled. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you -// want to disable task scheduling. nodeDisableSchedulingParameter is the parameters for the request. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) DisableScheduling(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisableSchedulingPreparer(ctx, poolID, nodeID, nodeDisableSchedulingParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSchedulingSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure sending request") - return - } - - result, err = client.DisableSchedulingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure responding to request") - } - - return -} - -// DisableSchedulingPreparer prepares the DisableScheduling request. -func (client ComputeNodeClient) DisableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/disablescheduling", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeDisableSchedulingParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeDisableSchedulingParameter)) - } - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableSchedulingSender sends the DisableScheduling request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) DisableSchedulingSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableSchedulingResponder handles the response to the DisableScheduling request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) DisableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EnableScheduling you can enable task scheduling on a node only if its current scheduling state is disabled -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you -// want to enable task scheduling. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client ComputeNodeClient) EnableScheduling(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnableSchedulingPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSchedulingSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure sending request") - return - } - - result, err = client.EnableSchedulingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure responding to request") - } - - return -} - -// EnableSchedulingPreparer prepares the EnableScheduling request. -func (client ComputeNodeClient) EnableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/enablescheduling", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableSchedulingSender sends the EnableScheduling request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) EnableSchedulingSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableSchedulingResponder handles the response to the EnableScheduling request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) EnableSchedulingResponder(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 sends the get request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want -// to get information about. selectParameter is an OData $select clause. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) Get(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNode, err error) { - req, err := client.GetPreparer(ctx, poolID, nodeID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ComputeNodeClient) GetPreparer(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ComputeNodeClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ComputeNodeClient) GetResponder(resp *http.Response) (result ComputeNode, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetRemoteDesktop before you can access a node by using the RDP file, you must create a user account on the node. -// This API can only be invoked on pools created with a cloud service configuration. For pools created with a virtual -// machine configuration, see the GetRemoteLoginSettings API. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which you -// want to get the Remote Desktop Protocol file. timeout is the maximum time that the server can spend processing -// the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in -// the form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) GetRemoteDesktop(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetRemoteDesktopPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", nil, "Failure preparing request") - return - } - - resp, err := client.GetRemoteDesktopSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure sending request") - return - } - - result, err = client.GetRemoteDesktopResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure responding to request") - } - - return -} - -// GetRemoteDesktopPreparer prepares the GetRemoteDesktop request. -func (client ComputeNodeClient) GetRemoteDesktopPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/rdp", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRemoteDesktopSender sends the GetRemoteDesktop request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) GetRemoteDesktopSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRemoteDesktopResponder handles the response to the GetRemoteDesktop request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) GetRemoteDesktopResponder(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 -} - -// GetRemoteLoginSettings before you can remotely login to a node using the remote login settings, you must create a -// user account on the node. This API can be invoked only on pools created with the virtual machine configuration -// property. For pools created with a cloud service configuration, see the GetRemoteDesktop API. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which to -// obtain the remote login settings. timeout is the maximum time that the server can spend processing the request, -// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of -// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client ComputeNodeClient) GetRemoteLoginSettings(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeGetRemoteLoginSettingsResult, err error) { - req, err := client.GetRemoteLoginSettingsPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", nil, "Failure preparing request") - return - } - - resp, err := client.GetRemoteLoginSettingsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure sending request") - return - } - - result, err = client.GetRemoteLoginSettingsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure responding to request") - } - - return -} - -// GetRemoteLoginSettingsPreparer prepares the GetRemoteLoginSettings request. -func (client ComputeNodeClient) GetRemoteLoginSettingsPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/remoteloginsettings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRemoteLoginSettingsSender sends the GetRemoteLoginSettings request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) GetRemoteLoginSettingsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRemoteLoginSettingsResponder handles the response to the GetRemoteLoginSettings request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) GetRemoteLoginSettingsResponder(resp *http.Response) (result ComputeNodeGetRemoteLoginSettingsResult, 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. -// -// poolID is the ID of the pool from which you want to list nodes. filter is an OData $filter clause.. -// selectParameter is an OData $select clause. maxResults is the maximum number of items to return in the response. -// A maximum of 1000 nodes can be returned. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) List(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.ComputeNodeClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cnlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure sending request") - return - } - - result.cnlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ComputeNodeClient) ListPreparer(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ComputeNodeClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ComputeNodeClient) ListResponder(resp *http.Response) (result ComputeNodeListResult, 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 ComputeNodeClient) listNextResults(lastResults ComputeNodeListResult) (result ComputeNodeListResult, err error) { - req, err := lastResults.computeNodeListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "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, "batch.ComputeNodeClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ComputeNodeClient) ListComplete(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultIterator, err error) { - result.page, err = client.List(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Reboot you can restart a node only if it is in an idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want -// to restart. nodeRebootParameter is the parameters for the request. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) Reboot(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.RebootPreparer(ctx, poolID, nodeID, nodeRebootParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", nil, "Failure preparing request") - return - } - - resp, err := client.RebootSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure sending request") - return - } - - result, err = client.RebootResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure responding to request") - } - - return -} - -// RebootPreparer prepares the Reboot request. -func (client ComputeNodeClient) RebootPreparer(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reboot", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeRebootParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeRebootParameter)) - } - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RebootSender sends the Reboot request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) RebootSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// RebootResponder handles the response to the Reboot request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) RebootResponder(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 -} - -// Reimage you can reinstall the operating system on a node only if it is in an idle or running state. This API can be -// invoked only on pools created with the cloud service configuration property. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want -// to restart. nodeReimageParameter is the parameters for the request. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) Reimage(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ReimagePreparer(ctx, poolID, nodeID, nodeReimageParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", nil, "Failure preparing request") - return - } - - resp, err := client.ReimageSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure sending request") - return - } - - result, err = client.ReimageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure responding to request") - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client ComputeNodeClient) ReimagePreparer(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeReimageParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeReimageParameter)) - } - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) ReimageSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) ReimageResponder(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 -} - -// UpdateUser this operation replaces of all the updateable properties of the account. For example, if the expiryTime -// element is not specified, the current value is replaced with the default value, not left unmodified. You can update -// a user account on a node only when it is in the idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want -// to update a user account. userName is the name of the user account to update. nodeUpdateUserParameter is the -// parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client ComputeNodeClient) UpdateUser(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.UpdateUserPreparer(ctx, poolID, nodeID, userName, nodeUpdateUserParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure sending request") - return - } - - result, err = client.UpdateUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure responding to request") - } - - return -} - -// UpdateUserPreparer prepares the UpdateUser request. -func (client ComputeNodeClient) UpdateUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - "userName": autorest.Encode("path", userName), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters), - autorest.WithJSON(nodeUpdateUserParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateUserSender sends the UpdateUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) UpdateUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateUserResponder handles the response to the UpdateUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) UpdateUserResponder(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/batch/2017-06-01.5.1/batch/file.go b/services/batch/2017-06-01.5.1/batch/file.go deleted file mode 100644 index 0049b60508f8..000000000000 --- a/services/batch/2017-06-01.5.1/batch/file.go +++ /dev/null @@ -1,942 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// FileClient is the a client for issuing REST requests to the Azure Batch service. -type FileClient struct { - BaseClient -} - -// NewFileClient creates an instance of the FileClient client. -func NewFileClient() FileClient { - return NewFileClientWithBaseURI(DefaultBaseURI) -} - -// NewFileClientWithBaseURI creates an instance of the FileClient client. -func NewFileClientWithBaseURI(baseURI string) FileClient { - return FileClient{NewWithBaseURI(baseURI)} -} - -// DeleteFromComputeNode sends the delete from compute node request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node from which you -// want to delete the file. filePath is the path to the file or directory that you want to delete. recursive is -// whether to delete children of a directory. If the filePath parameter represents a directory instead of a file, -// you can set recursive to true to delete the directory and all of the files and subdirectories in it. If -// recursive is false then the directory must be empty or deletion will fail. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client FileClient) DeleteFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteFromComputeNodePreparer(ctx, poolID, nodeID, filePath, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteFromComputeNodeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.DeleteFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// DeleteFromComputeNodePreparer prepares the DeleteFromComputeNode request. -func (client FileClient) DeleteFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteFromComputeNodeSender sends the DeleteFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) DeleteFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteFromComputeNodeResponder handles the response to the DeleteFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) DeleteFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteFromTask sends the delete from task request. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to delete. -// filePath is the path to the task file or directory that you want to delete. recursive is whether to delete -// children of a directory. If the filePath parameter represents a directory instead of a file, you can set -// recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false -// then the directory must be empty or deletion will fail. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client FileClient) DeleteFromTask(ctx context.Context, jobID string, taskID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteFromTaskPreparer(ctx, jobID, taskID, filePath, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteFromTaskSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure sending request") - return - } - - result, err = client.DeleteFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure responding to request") - } - - return -} - -// DeleteFromTaskPreparer prepares the DeleteFromTask request. -func (client FileClient) DeleteFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteFromTaskSender sends the DeleteFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) DeleteFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteFromTaskResponder handles the response to the DeleteFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) DeleteFromTaskResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetFromComputeNode returns the content of the specified compute node file. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains -// the file. filePath is the path to the compute node file that you want to get the content of. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ocpRange is -// the byte range to be retrieved. The default is to retrieve the entire file. The format is -// bytes=startRange-endRange. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client FileClient) GetFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetFromComputeNodePreparer(ctx, poolID, nodeID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.GetFromComputeNodeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.GetFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// GetFromComputeNodePreparer prepares the GetFromComputeNode request. -func (client FileClient) GetFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ocpRange) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-range", autorest.String(ocpRange))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetFromComputeNodeSender sends the GetFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetFromComputeNodeResponder handles the response to the GetFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) GetFromComputeNodeResponder(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 -} - -// GetFromTask returns the content of the specified task file. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to retrieve. -// filePath is the path to the task file that you want to get the content of. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ocpRange is -// the byte range to be retrieved. The default is to retrieve the entire file. The format is -// bytes=startRange-endRange. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client FileClient) GetFromTask(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetFromTaskPreparer(ctx, jobID, taskID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.GetFromTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure sending request") - return - } - - result, err = client.GetFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure responding to request") - } - - return -} - -// GetFromTaskPreparer prepares the GetFromTask request. -func (client FileClient) GetFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ocpRange) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-range", autorest.String(ocpRange))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetFromTaskSender sends the GetFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetFromTaskResponder handles the response to the GetFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) GetFromTaskResponder(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 -} - -// GetPropertiesFromComputeNode gets the properties of the specified compute node file. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains -// the file. filePath is the path to the compute node file that you want to get the properties of. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client FileClient) GetPropertiesFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.GetPropertiesFromComputeNodePreparer(ctx, poolID, nodeID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.GetPropertiesFromComputeNodeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.GetPropertiesFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// GetPropertiesFromComputeNodePreparer prepares the GetPropertiesFromComputeNode request. -func (client FileClient) GetPropertiesFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPropertiesFromComputeNodeSender sends the GetPropertiesFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetPropertiesFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPropertiesFromComputeNodeResponder handles the response to the GetPropertiesFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) GetPropertiesFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetPropertiesFromTask gets the properties of the specified task file. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to get the -// properties of. filePath is the path to the task file that you want to get the properties of. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client FileClient) GetPropertiesFromTask(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.GetPropertiesFromTaskPreparer(ctx, jobID, taskID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.GetPropertiesFromTaskSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", resp, "Failure sending request") - return - } - - result, err = client.GetPropertiesFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", resp, "Failure responding to request") - } - - return -} - -// GetPropertiesFromTaskPreparer prepares the GetPropertiesFromTask request. -func (client FileClient) GetPropertiesFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPropertiesFromTaskSender sends the GetPropertiesFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetPropertiesFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPropertiesFromTaskResponder handles the response to the GetPropertiesFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) GetPropertiesFromTaskResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// ListFromComputeNode sends the list from compute node request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node whose files -// you want to list. filter is an OData $filter clause. recursive is whether to list children of a directory. -// maxResults is the maximum number of items to return in the response. A maximum of 1000 files can be returned. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client FileClient) ListFromComputeNode(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.FileClient", "ListFromComputeNode", err.Error()) - } - - result.fn = client.listFromComputeNodeNextResults - req, err := client.ListFromComputeNodePreparer(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromComputeNodeSender(req) - if err != nil { - result.nflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure sending request") - return - } - - result.nflr, err = client.ListFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// ListFromComputeNodePreparer prepares the ListFromComputeNode request. -func (client FileClient) ListFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromComputeNodeSender sends the ListFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) ListFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromComputeNodeResponder handles the response to the ListFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) ListFromComputeNodeResponder(resp *http.Response) (result NodeFileListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromComputeNodeNextResults retrieves the next set of results, if any. -func (client FileClient) listFromComputeNodeNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) { - req, err := lastResults.nodeFileListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromComputeNodeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromComputeNodeComplete enumerates all values, automatically crossing page boundaries as required. -func (client FileClient) ListFromComputeNodeComplete(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) { - result.page, err = client.ListFromComputeNode(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListFromTask sends the list from task request. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose files you want to list. -// filter is an OData $filter clause. recursive is whether to list children of the task directory. This parameter -// can be used in combination with the filter parameter to list specific type of files. maxResults is the maximum -// number of items to return in the response. A maximum of 1000 files can be returned. timeout is the maximum time -// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client FileClient) ListFromTask(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.FileClient", "ListFromTask", err.Error()) - } - - result.fn = client.listFromTaskNextResults - req, err := client.ListFromTaskPreparer(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromTaskSender(req) - if err != nil { - result.nflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure sending request") - return - } - - result.nflr, err = client.ListFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure responding to request") - } - - return -} - -// ListFromTaskPreparer prepares the ListFromTask request. -func (client FileClient) ListFromTaskPreparer(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromTaskSender sends the ListFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) ListFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromTaskResponder handles the response to the ListFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) ListFromTaskResponder(resp *http.Response) (result NodeFileListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromTaskNextResults retrieves the next set of results, if any. -func (client FileClient) listFromTaskNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) { - req, err := lastResults.nodeFileListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromTaskComplete enumerates all values, automatically crossing page boundaries as required. -func (client FileClient) ListFromTaskComplete(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) { - result.page, err = client.ListFromTask(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2017-06-01.5.1/batch/job.go b/services/batch/2017-06-01.5.1/batch/job.go deleted file mode 100644 index 03e165045e9d..000000000000 --- a/services/batch/2017-06-01.5.1/batch/job.go +++ /dev/null @@ -1,1625 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// JobClient is the a client for issuing REST requests to the Azure Batch service. -type JobClient struct { - BaseClient -} - -// NewJobClient creates an instance of the JobClient client. -func NewJobClient() JobClient { - return NewJobClientWithBaseURI(DefaultBaseURI) -} - -// NewJobClientWithBaseURI creates an instance of the JobClient client. -func NewJobClientWithBaseURI(baseURI string) JobClient { - return JobClient{NewWithBaseURI(baseURI)} -} - -// Add the Batch service supports two ways to control the work done as part of a job. In the first approach, the user -// specifies a Job Manager task. The Batch service launches this task when it is ready to start the job. The Job -// Manager task controls all other tasks that run under this job, by using the Task APIs. In the second approach, the -// user directly controls the execution of tasks under an active job, by using the Task APIs. Also note: when naming -// jobs, avoid including sensitive information such as user names or secret project names. This information may appear -// in telemetry logs accessible to Microsoft Support engineers. -// -// job is the job to be added. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client JobClient) Add(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: job, - Constraints: []validation.Constraint{{Target: "job.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobManagerTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "job.JobPreparationTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "job.JobReleaseTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "job.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, job, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client JobClient) AddPreparer(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobs"), - autorest.WithJSON(job), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deleting a job also deletes all tasks that are part of that job, and all job statistics. This also overrides -// the retention period for task data; that is, if the job contains tasks which are still retained on compute nodes, -// the Batch services deletes those tasks' working directories and all their contents. When a Delete Job request is -// received, the Batch service sets the job to the deleting state. All update operations on a job that is in deleting -// state will fail with status code 409 (Conflict), with additional information indicating that the job is being -// deleted. -// -// jobID is the ID of the job to delete. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the -// resource known to the client. The operation will be performed only if the resource's current ETag on the service -// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of -// the resource known to the client. The operation will be performed only if the resource's current ETag on the -// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has not been modified since the specified time. -func (client JobClient) Delete(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobClient) DeletePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) 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 -} - -// Disable the Batch Service immediately moves the job to the disabling state. Batch then uses the disableTasks -// parameter to determine what to do with the currently running tasks of the job. The job remains in the disabling -// state until the disable operation is completed and all tasks have been dealt with according to the disableTasks -// option; the job then moves to the disabled state. No new tasks are started under the job until it moves back to -// active state. If you try to disable a job that is in any state other than active, disabling, or disabled, the -// request fails with status code 409. -// -// jobID is the ID of the job to disable. jobDisableParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobClient) Disable(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisablePreparer(ctx, jobID, jobDisableParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure sending request") - return - } - - result, err = client.DisableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure responding to request") - } - - return -} - -// DisablePreparer prepares the Disable request. -func (client JobClient) DisablePreparer(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/disable", pathParameters), - autorest.WithJSON(jobDisableParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) DisableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableResponder handles the response to the Disable request. The method always -// closes the http.Response Body. -func (client JobClient) DisableResponder(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 -} - -// Enable when you call this API, the Batch service sets a disabled job to the enabling state. After the this operation -// is completed, the job moves to the active state, and scheduling of new tasks under the job resumes. The Batch -// service does not allow a task to remain in the active state for more than 7 days. Therefore, if you enable a job -// containing active tasks which were added more than 7 days ago, those tasks will not run. -// -// jobID is the ID of the job to enable. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the -// resource known to the client. The operation will be performed only if the resource's current ETag on the service -// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of -// the resource known to the client. The operation will be performed only if the resource's current ETag on the -// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has not been modified since the specified time. -func (client JobClient) Enable(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnablePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure sending request") - return - } - - result, err = client.EnableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure responding to request") - } - - return -} - -// EnablePreparer prepares the Enable request. -func (client JobClient) EnablePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/enable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) EnableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableResponder handles the response to the Enable request. The method always -// closes the http.Response Body. -func (client JobClient) EnableResponder(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 sends the get request. -// -// jobID is the ID of the job. selectParameter is an OData $select clause. expand is an OData $expand clause. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -// ifMatch is an ETag value associated with the version of the resource known to the client. The operation will be -// performed only if the resource's current ETag on the service exactly matches the value specified by the client. -// ifNoneMatch is an ETag value associated with the version of the resource known to the client. The operation will -// be performed only if the resource's current ETag on the service does not match the value specified by the -// client. ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. -// The operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobClient) Get(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJob, err error) { - req, err := client.GetPreparer(ctx, jobID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobClient) GetPreparer(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) GetResponder(resp *http.Response) (result CloudJob, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAllLifetimeStatistics statistics are aggregated across all jobs that have ever existed in the account, from -// account creation to the last update time of the statistics. -// -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client JobClient) GetAllLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result JobStatistics, err error) { - req, err := client.GetAllLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", nil, "Failure preparing request") - return - } - - resp, err := client.GetAllLifetimeStatisticsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", resp, "Failure sending request") - return - } - - result, err = client.GetAllLifetimeStatisticsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", resp, "Failure responding to request") - } - - return -} - -// GetAllLifetimeStatisticsPreparer prepares the GetAllLifetimeStatistics request. -func (client JobClient) GetAllLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/lifetimejobstats"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAllLifetimeStatisticsSender sends the GetAllLifetimeStatistics request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) GetAllLifetimeStatisticsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetAllLifetimeStatisticsResponder handles the response to the GetAllLifetimeStatistics request. The method always -// closes the http.Response Body. -func (client JobClient) GetAllLifetimeStatisticsResponder(resp *http.Response) (result JobStatistics, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetTaskCounts task counts provide a count of the tasks by active, running or completed task state, and a count of -// tasks which succeeded or failed. Tasks in the preparing state are counted as running. If the validationStatus is -// unvalidated, then the Batch service has not been able to check state counts against the task states as reported in -// the List Tasks API. The validationStatus may be unvalidated if the job contains more than 200,000 tasks. -// -// jobID is the ID of the job. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client JobClient) GetTaskCounts(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result TaskCounts, err error) { - req, err := client.GetTaskCountsPreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetTaskCounts", nil, "Failure preparing request") - return - } - - resp, err := client.GetTaskCountsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetTaskCounts", resp, "Failure sending request") - return - } - - result, err = client.GetTaskCountsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetTaskCounts", resp, "Failure responding to request") - } - - return -} - -// GetTaskCountsPreparer prepares the GetTaskCounts request. -func (client JobClient) GetTaskCountsPreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/taskcounts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetTaskCountsSender sends the GetTaskCounts request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) GetTaskCountsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetTaskCountsResponder handles the response to the GetTaskCounts request. The method always -// closes the http.Response Body. -func (client JobClient) GetTaskCountsResponder(resp *http.Response) (result TaskCounts, 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. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand -// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 jobs can be -// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. -func (client JobClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cjlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure sending request") - return - } - - result.cjlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client JobClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobs"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) ListResponder(resp *http.Response) (result CloudJobListResult, 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 JobClient) listNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) { - req, err := lastResults.cloudJobListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "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, "batch.JobClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListFromJobSchedule sends the list from job schedule request. -// -// jobScheduleID is the ID of the job schedule from which you want to get a list of jobs. filter is an OData -// $filter clause. selectParameter is an OData $select clause. expand is an OData $expand clause. maxResults is the -// maximum number of items to return in the response. A maximum of 1000 jobs can be returned. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client JobClient) ListFromJobSchedule(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "ListFromJobSchedule", err.Error()) - } - - result.fn = client.listFromJobScheduleNextResults - req, err := client.ListFromJobSchedulePreparer(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromJobScheduleSender(req) - if err != nil { - result.cjlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure sending request") - return - } - - result.cjlr, err = client.ListFromJobScheduleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure responding to request") - } - - return -} - -// ListFromJobSchedulePreparer prepares the ListFromJobSchedule request. -func (client JobClient) ListFromJobSchedulePreparer(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/jobs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromJobScheduleSender sends the ListFromJobSchedule request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) ListFromJobScheduleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromJobScheduleResponder handles the response to the ListFromJobSchedule request. The method always -// closes the http.Response Body. -func (client JobClient) ListFromJobScheduleResponder(resp *http.Response) (result CloudJobListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromJobScheduleNextResults retrieves the next set of results, if any. -func (client JobClient) listFromJobScheduleNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) { - req, err := lastResults.cloudJobListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromJobScheduleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromJobScheduleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromJobScheduleComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListFromJobScheduleComplete(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) { - result.page, err = client.ListFromJobSchedule(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListPreparationAndReleaseTaskStatus this API returns the Job Preparation and Job Release task status on all compute -// nodes that have run the Job Preparation or Job Release task. This includes nodes which have since been removed from -// the pool. If this API is invoked on a job which has no Job Preparation or Job Release task, the Batch service -// returns HTTP status code 409 (Conflict) with an error code of JobPreparationTaskNotSpecified. -// -// jobID is the ID of the job. filter is an OData $filter clause. To get the status of the Job Preparation and Job -// Release tasks on a specific compute node, use "nodeId eq '{desired-node-id}'" selectParameter is an OData -// $select clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 tasks can -// be returned. timeout is the maximum time that the server can spend processing the request, in seconds. The -// default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. -func (client JobClient) ListPreparationAndReleaseTaskStatus(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "ListPreparationAndReleaseTaskStatus", err.Error()) - } - - result.fn = client.listPreparationAndReleaseTaskStatusNextResults - req, err := client.ListPreparationAndReleaseTaskStatusPreparer(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", nil, "Failure preparing request") - return - } - - resp, err := client.ListPreparationAndReleaseTaskStatusSender(req) - if err != nil { - result.cjlpartsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure sending request") - return - } - - result.cjlpartsr, err = client.ListPreparationAndReleaseTaskStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure responding to request") - } - - return -} - -// ListPreparationAndReleaseTaskStatusPreparer prepares the ListPreparationAndReleaseTaskStatus request. -func (client JobClient) ListPreparationAndReleaseTaskStatusPreparer(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/jobpreparationandreleasetaskstatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPreparationAndReleaseTaskStatusSender sends the ListPreparationAndReleaseTaskStatus request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) ListPreparationAndReleaseTaskStatusSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListPreparationAndReleaseTaskStatusResponder handles the response to the ListPreparationAndReleaseTaskStatus request. The method always -// closes the http.Response Body. -func (client JobClient) ListPreparationAndReleaseTaskStatusResponder(resp *http.Response) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listPreparationAndReleaseTaskStatusNextResults retrieves the next set of results, if any. -func (client JobClient) listPreparationAndReleaseTaskStatusNextResults(lastResults CloudJobListPreparationAndReleaseTaskStatusResult) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) { - req, err := lastResults.cloudJobListPreparationAndReleaseTaskStatusResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListPreparationAndReleaseTaskStatusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListPreparationAndReleaseTaskStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListPreparationAndReleaseTaskStatusComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListPreparationAndReleaseTaskStatusComplete(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultIterator, err error) { - result.page, err = client.ListPreparationAndReleaseTaskStatus(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch this replaces only the job properties specified in the request. For example, if the job has constraints, and a -// request does not specify the constraints element, then the job keeps the existing constraints. -// -// jobID is the ID of the job whose properties you want to update. jobPatchParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobClient) Patch(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, jobID, jobPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client JobClient) PatchPreparer(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithJSON(jobPatchParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client JobClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Terminate when a Terminate Job request is received, the Batch service sets the job to the terminating state. The -// Batch service then terminates any active or running tasks associated with the job, and runs any required Job Release -// tasks. The job then moves into the completed state. -// -// jobID is the ID of the job to terminate. jobTerminateParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobClient) Terminate(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobID, jobTerminateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client JobClient) TerminatePreparer(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if jobTerminateParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(jobTerminateParameter)) - } - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client JobClient) TerminateResponder(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 -} - -// Update this fully replaces all the updateable properties of the job. For example, if the job has constraints -// associated with it and if constraints is not specified with this request, then the Batch service will remove the -// existing constraints. -// -// jobID is the ID of the job whose properties you want to update. jobUpdateParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobClient) Update(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobUpdateParameter, - Constraints: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, jobID, jobUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client JobClient) UpdatePreparer(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithJSON(jobUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) UpdateResponder(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/batch/2017-06-01.5.1/batch/jobschedule.go b/services/batch/2017-06-01.5.1/batch/jobschedule.go deleted file mode 100644 index 7b93a9483216..000000000000 --- a/services/batch/2017-06-01.5.1/batch/jobschedule.go +++ /dev/null @@ -1,1269 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// JobScheduleClient is the a client for issuing REST requests to the Azure Batch service. -type JobScheduleClient struct { - BaseClient -} - -// NewJobScheduleClient creates an instance of the JobScheduleClient client. -func NewJobScheduleClient() JobScheduleClient { - return NewJobScheduleClientWithBaseURI(DefaultBaseURI) -} - -// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client. -func NewJobScheduleClientWithBaseURI(baseURI string) JobScheduleClient { - return JobScheduleClient{NewWithBaseURI(baseURI)} -} - -// Add sends the add request. -// -// cloudJobSchedule is the job schedule to be added. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client JobScheduleClient) Add(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: cloudJobSchedule, - Constraints: []validation.Constraint{{Target: "cloudJobSchedule.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.Schedule", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "cloudJobSchedule.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "cloudJobSchedule.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, cloudJobSchedule, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client JobScheduleClient) AddPreparer(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobschedules"), - autorest.WithJSON(cloudJobSchedule), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobScheduleClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete when you delete a job schedule, this also deletes all jobs and tasks under that schedule. When tasks are -// deleted, all the files in their working directories on the compute nodes are also deleted (the retention period is -// ignored). The job schedule statistics are no longer accessible once the job schedule is deleted, though they are -// still counted towards account lifetime statistics. -// -// jobScheduleID is the ID of the job schedule to delete. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Delete(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobScheduleClient) DeletePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) 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 -} - -// Disable no new jobs will be created until the job schedule is enabled again. -// -// jobScheduleID is the ID of the job schedule to disable. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Disable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure sending request") - return - } - - result, err = client.DisableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure responding to request") - } - - return -} - -// DisablePreparer prepares the Disable request. -func (client JobScheduleClient) DisablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/disable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) DisableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableResponder handles the response to the Disable request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) DisableResponder(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 -} - -// Enable sends the enable request. -// -// jobScheduleID is the ID of the job schedule to enable. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Enable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure sending request") - return - } - - result, err = client.EnableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure responding to request") - } - - return -} - -// EnablePreparer prepares the Enable request. -func (client JobScheduleClient) EnablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/enable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) EnableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableResponder handles the response to the Enable request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) EnableResponder(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 -} - -// Exists sends the exists request. -// -// jobScheduleID is the ID of the job schedule which you want to check. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Exists(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ExistsPreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", nil, "Failure preparing request") - return - } - - resp, err := client.ExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure sending request") - return - } - - result, err = client.ExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure responding to request") - } - - return -} - -// ExistsPreparer prepares the Exists request. -func (client JobScheduleClient) ExistsPreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExistsSender sends the Exists request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) ExistsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExistsResponder handles the response to the Exists request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) ExistsResponder(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 information about the specified job schedule. -// -// jobScheduleID is the ID of the job schedule to get. selectParameter is an OData $select clause. expand is an -// OData $expand clause. timeout is the maximum time that the server can spend processing the request, in seconds. -// The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with -// no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether -// the server should return the client-request-id in the response. ocpDate is the time the request was issued. -// Client libraries typically set this to the current system clock time; set it explicitly if you are calling the -// REST API directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobScheduleClient) Get(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJobSchedule, err error) { - req, err := client.GetPreparer(ctx, jobScheduleID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobScheduleClient) GetPreparer(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) GetResponder(resp *http.Response) (result CloudJobSchedule, 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. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand -// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 job schedules can -// be returned. timeout is the maximum time that the server can spend processing the request, in seconds. The -// default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. -func (client JobScheduleClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cjslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure sending request") - return - } - - result.cjslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client JobScheduleClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobschedules"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobScheduleClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) ListResponder(resp *http.Response) (result CloudJobScheduleListResult, 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 JobScheduleClient) listNextResults(lastResults CloudJobScheduleListResult) (result CloudJobScheduleListResult, err error) { - req, err := lastResults.cloudJobScheduleListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobScheduleClient", "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, "batch.JobScheduleClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobScheduleClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch this replaces only the job schedule properties specified in the request. For example, if the schedule property -// is not specified with this request, then the Batch service will keep the existing schedule. Changes to a job -// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are -// unaffected. -// -// jobScheduleID is the ID of the job schedule to update. jobSchedulePatchParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobScheduleClient) Patch(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, jobScheduleID, jobSchedulePatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client JobScheduleClient) PatchPreparer(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithJSON(jobSchedulePatchParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Terminate sends the terminate request. -// -// jobScheduleID is the ID of the job schedule to terminates. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Terminate(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client JobScheduleClient) TerminatePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) TerminateResponder(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 -} - -// Update this fully replaces all the updateable properties of the job schedule. For example, if the schedule property -// is not specified with this request, then the Batch service will remove the existing schedule. Changes to a job -// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are -// unaffected. -// -// jobScheduleID is the ID of the job schedule to update. jobScheduleUpdateParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobScheduleClient) Update(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobScheduleUpdateParameter, - Constraints: []validation.Constraint{{Target: "jobScheduleUpdateParameter.Schedule", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, jobScheduleID, jobScheduleUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client JobScheduleClient) UpdatePreparer(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithJSON(jobScheduleUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) UpdateResponder(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/batch/2017-06-01.5.1/batch/models.go b/services/batch/2017-06-01.5.1/batch/models.go deleted file mode 100644 index f40101979dfd..000000000000 --- a/services/batch/2017-06-01.5.1/batch/models.go +++ /dev/null @@ -1,3293 +0,0 @@ -package batch - -// 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" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "io" - "net/http" -) - -// AccessScope enumerates the values for access scope. -type AccessScope string - -const ( - // Job ... - Job AccessScope = "job" -) - -// PossibleAccessScopeValues returns an array of possible values for the AccessScope const type. -func PossibleAccessScopeValues() []AccessScope { - return []AccessScope{Job} -} - -// AllocationState enumerates the values for allocation state. -type AllocationState string - -const ( - // Resizing ... - Resizing AllocationState = "resizing" - // Steady ... - Steady AllocationState = "steady" - // Stopping ... - Stopping AllocationState = "stopping" -) - -// PossibleAllocationStateValues returns an array of possible values for the AllocationState const type. -func PossibleAllocationStateValues() []AllocationState { - return []AllocationState{Resizing, Steady, Stopping} -} - -// AutoUserScope enumerates the values for auto user scope. -type AutoUserScope string - -const ( - // Pool ... - Pool AutoUserScope = "pool" - // Task ... - Task AutoUserScope = "task" -) - -// PossibleAutoUserScopeValues returns an array of possible values for the AutoUserScope const type. -func PossibleAutoUserScopeValues() []AutoUserScope { - return []AutoUserScope{Pool, Task} -} - -// CachingType enumerates the values for caching type. -type CachingType string - -const ( - // None ... - None CachingType = "none" - // ReadOnly ... - ReadOnly CachingType = "readOnly" - // ReadWrite ... - ReadWrite CachingType = "readWrite" -) - -// PossibleCachingTypeValues returns an array of possible values for the CachingType const type. -func PossibleCachingTypeValues() []CachingType { - return []CachingType{None, ReadOnly, ReadWrite} -} - -// CertificateFormat enumerates the values for certificate format. -type CertificateFormat string - -const ( - // Cer ... - Cer CertificateFormat = "cer" - // Pfx ... - Pfx CertificateFormat = "pfx" -) - -// PossibleCertificateFormatValues returns an array of possible values for the CertificateFormat const type. -func PossibleCertificateFormatValues() []CertificateFormat { - return []CertificateFormat{Cer, Pfx} -} - -// CertificateState enumerates the values for certificate state. -type CertificateState string - -const ( - // Active ... - Active CertificateState = "active" - // DeleteFailed ... - DeleteFailed CertificateState = "deleteFailed" - // Deleting ... - Deleting CertificateState = "deleting" -) - -// PossibleCertificateStateValues returns an array of possible values for the CertificateState const type. -func PossibleCertificateStateValues() []CertificateState { - return []CertificateState{Active, DeleteFailed, Deleting} -} - -// CertificateStoreLocation enumerates the values for certificate store location. -type CertificateStoreLocation string - -const ( - // CurrentUser ... - CurrentUser CertificateStoreLocation = "currentUser" - // LocalMachine ... - LocalMachine CertificateStoreLocation = "localMachine" -) - -// PossibleCertificateStoreLocationValues returns an array of possible values for the CertificateStoreLocation const type. -func PossibleCertificateStoreLocationValues() []CertificateStoreLocation { - return []CertificateStoreLocation{CurrentUser, LocalMachine} -} - -// CertificateVisibility enumerates the values for certificate visibility. -type CertificateVisibility string - -const ( - // CertificateVisibilityRemoteUser ... - CertificateVisibilityRemoteUser CertificateVisibility = "remoteUser" - // CertificateVisibilityStartTask ... - CertificateVisibilityStartTask CertificateVisibility = "startTask" - // CertificateVisibilityTask ... - CertificateVisibilityTask CertificateVisibility = "task" -) - -// PossibleCertificateVisibilityValues returns an array of possible values for the CertificateVisibility const type. -func PossibleCertificateVisibilityValues() []CertificateVisibility { - return []CertificateVisibility{CertificateVisibilityRemoteUser, CertificateVisibilityStartTask, CertificateVisibilityTask} -} - -// ComputeNodeDeallocationOption enumerates the values for compute node deallocation option. -type ComputeNodeDeallocationOption string - -const ( - // Requeue ... - Requeue ComputeNodeDeallocationOption = "requeue" - // RetainedData ... - RetainedData ComputeNodeDeallocationOption = "retainedData" - // TaskCompletion ... - TaskCompletion ComputeNodeDeallocationOption = "taskCompletion" - // Terminate ... - Terminate ComputeNodeDeallocationOption = "terminate" -) - -// PossibleComputeNodeDeallocationOptionValues returns an array of possible values for the ComputeNodeDeallocationOption const type. -func PossibleComputeNodeDeallocationOptionValues() []ComputeNodeDeallocationOption { - return []ComputeNodeDeallocationOption{Requeue, RetainedData, TaskCompletion, Terminate} -} - -// ComputeNodeFillType enumerates the values for compute node fill type. -type ComputeNodeFillType string - -const ( - // Pack ... - Pack ComputeNodeFillType = "pack" - // Spread ... - Spread ComputeNodeFillType = "spread" -) - -// PossibleComputeNodeFillTypeValues returns an array of possible values for the ComputeNodeFillType const type. -func PossibleComputeNodeFillTypeValues() []ComputeNodeFillType { - return []ComputeNodeFillType{Pack, Spread} -} - -// ComputeNodeRebootOption enumerates the values for compute node reboot option. -type ComputeNodeRebootOption string - -const ( - // ComputeNodeRebootOptionRequeue ... - ComputeNodeRebootOptionRequeue ComputeNodeRebootOption = "requeue" - // ComputeNodeRebootOptionRetainedData ... - ComputeNodeRebootOptionRetainedData ComputeNodeRebootOption = "retainedData" - // ComputeNodeRebootOptionTaskCompletion ... - ComputeNodeRebootOptionTaskCompletion ComputeNodeRebootOption = "taskCompletion" - // ComputeNodeRebootOptionTerminate ... - ComputeNodeRebootOptionTerminate ComputeNodeRebootOption = "terminate" -) - -// PossibleComputeNodeRebootOptionValues returns an array of possible values for the ComputeNodeRebootOption const type. -func PossibleComputeNodeRebootOptionValues() []ComputeNodeRebootOption { - return []ComputeNodeRebootOption{ComputeNodeRebootOptionRequeue, ComputeNodeRebootOptionRetainedData, ComputeNodeRebootOptionTaskCompletion, ComputeNodeRebootOptionTerminate} -} - -// ComputeNodeReimageOption enumerates the values for compute node reimage option. -type ComputeNodeReimageOption string - -const ( - // ComputeNodeReimageOptionRequeue ... - ComputeNodeReimageOptionRequeue ComputeNodeReimageOption = "requeue" - // ComputeNodeReimageOptionRetainedData ... - ComputeNodeReimageOptionRetainedData ComputeNodeReimageOption = "retainedData" - // ComputeNodeReimageOptionTaskCompletion ... - ComputeNodeReimageOptionTaskCompletion ComputeNodeReimageOption = "taskCompletion" - // ComputeNodeReimageOptionTerminate ... - ComputeNodeReimageOptionTerminate ComputeNodeReimageOption = "terminate" -) - -// PossibleComputeNodeReimageOptionValues returns an array of possible values for the ComputeNodeReimageOption const type. -func PossibleComputeNodeReimageOptionValues() []ComputeNodeReimageOption { - return []ComputeNodeReimageOption{ComputeNodeReimageOptionRequeue, ComputeNodeReimageOptionRetainedData, ComputeNodeReimageOptionTaskCompletion, ComputeNodeReimageOptionTerminate} -} - -// ComputeNodeState enumerates the values for compute node state. -type ComputeNodeState string - -const ( - // Creating ... - Creating ComputeNodeState = "creating" - // Idle ... - Idle ComputeNodeState = "idle" - // LeavingPool ... - LeavingPool ComputeNodeState = "leavingPool" - // Offline ... - Offline ComputeNodeState = "offline" - // Preempted ... - Preempted ComputeNodeState = "preempted" - // Rebooting ... - Rebooting ComputeNodeState = "rebooting" - // Reimaging ... - Reimaging ComputeNodeState = "reimaging" - // Running ... - Running ComputeNodeState = "running" - // Starting ... - Starting ComputeNodeState = "starting" - // StartTaskFailed ... - StartTaskFailed ComputeNodeState = "startTaskFailed" - // Unknown ... - Unknown ComputeNodeState = "unknown" - // Unusable ... - Unusable ComputeNodeState = "unusable" - // WaitingForStartTask ... - WaitingForStartTask ComputeNodeState = "waitingForStartTask" -) - -// PossibleComputeNodeStateValues returns an array of possible values for the ComputeNodeState const type. -func PossibleComputeNodeStateValues() []ComputeNodeState { - return []ComputeNodeState{Creating, Idle, LeavingPool, Offline, Preempted, Rebooting, Reimaging, Running, Starting, StartTaskFailed, Unknown, Unusable, WaitingForStartTask} -} - -// DependencyAction enumerates the values for dependency action. -type DependencyAction string - -const ( - // Block ... - Block DependencyAction = "block" - // Satisfy ... - Satisfy DependencyAction = "satisfy" -) - -// PossibleDependencyActionValues returns an array of possible values for the DependencyAction const type. -func PossibleDependencyActionValues() []DependencyAction { - return []DependencyAction{Block, Satisfy} -} - -// DisableComputeNodeSchedulingOption enumerates the values for disable compute node scheduling option. -type DisableComputeNodeSchedulingOption string - -const ( - // DisableComputeNodeSchedulingOptionRequeue ... - DisableComputeNodeSchedulingOptionRequeue DisableComputeNodeSchedulingOption = "requeue" - // DisableComputeNodeSchedulingOptionTaskCompletion ... - DisableComputeNodeSchedulingOptionTaskCompletion DisableComputeNodeSchedulingOption = "taskCompletion" - // DisableComputeNodeSchedulingOptionTerminate ... - DisableComputeNodeSchedulingOptionTerminate DisableComputeNodeSchedulingOption = "terminate" -) - -// PossibleDisableComputeNodeSchedulingOptionValues returns an array of possible values for the DisableComputeNodeSchedulingOption const type. -func PossibleDisableComputeNodeSchedulingOptionValues() []DisableComputeNodeSchedulingOption { - return []DisableComputeNodeSchedulingOption{DisableComputeNodeSchedulingOptionRequeue, DisableComputeNodeSchedulingOptionTaskCompletion, DisableComputeNodeSchedulingOptionTerminate} -} - -// DisableJobOption enumerates the values for disable job option. -type DisableJobOption string - -const ( - // DisableJobOptionRequeue ... - DisableJobOptionRequeue DisableJobOption = "requeue" - // DisableJobOptionTerminate ... - DisableJobOptionTerminate DisableJobOption = "terminate" - // DisableJobOptionWait ... - DisableJobOptionWait DisableJobOption = "wait" -) - -// PossibleDisableJobOptionValues returns an array of possible values for the DisableJobOption const type. -func PossibleDisableJobOptionValues() []DisableJobOption { - return []DisableJobOption{DisableJobOptionRequeue, DisableJobOptionTerminate, DisableJobOptionWait} -} - -// ElevationLevel enumerates the values for elevation level. -type ElevationLevel string - -const ( - // Admin ... - Admin ElevationLevel = "admin" - // NonAdmin ... - NonAdmin ElevationLevel = "nonAdmin" -) - -// PossibleElevationLevelValues returns an array of possible values for the ElevationLevel const type. -func PossibleElevationLevelValues() []ElevationLevel { - return []ElevationLevel{Admin, NonAdmin} -} - -// ErrorCategory enumerates the values for error category. -type ErrorCategory string - -const ( - // ServerError ... - ServerError ErrorCategory = "serverError" - // UserError ... - UserError ErrorCategory = "userError" -) - -// PossibleErrorCategoryValues returns an array of possible values for the ErrorCategory const type. -func PossibleErrorCategoryValues() []ErrorCategory { - return []ErrorCategory{ServerError, UserError} -} - -// InboundEndpointProtocol enumerates the values for inbound endpoint protocol. -type InboundEndpointProtocol string - -const ( - // TCP ... - TCP InboundEndpointProtocol = "tcp" - // UDP ... - UDP InboundEndpointProtocol = "udp" -) - -// PossibleInboundEndpointProtocolValues returns an array of possible values for the InboundEndpointProtocol const type. -func PossibleInboundEndpointProtocolValues() []InboundEndpointProtocol { - return []InboundEndpointProtocol{TCP, UDP} -} - -// JobAction enumerates the values for job action. -type JobAction string - -const ( - // JobActionDisable ... - JobActionDisable JobAction = "disable" - // JobActionNone ... - JobActionNone JobAction = "none" - // JobActionTerminate ... - JobActionTerminate JobAction = "terminate" -) - -// PossibleJobActionValues returns an array of possible values for the JobAction const type. -func PossibleJobActionValues() []JobAction { - return []JobAction{JobActionDisable, JobActionNone, JobActionTerminate} -} - -// JobPreparationTaskState enumerates the values for job preparation task state. -type JobPreparationTaskState string - -const ( - // JobPreparationTaskStateCompleted ... - JobPreparationTaskStateCompleted JobPreparationTaskState = "completed" - // JobPreparationTaskStateRunning ... - JobPreparationTaskStateRunning JobPreparationTaskState = "running" -) - -// PossibleJobPreparationTaskStateValues returns an array of possible values for the JobPreparationTaskState const type. -func PossibleJobPreparationTaskStateValues() []JobPreparationTaskState { - return []JobPreparationTaskState{JobPreparationTaskStateCompleted, JobPreparationTaskStateRunning} -} - -// JobReleaseTaskState enumerates the values for job release task state. -type JobReleaseTaskState string - -const ( - // JobReleaseTaskStateCompleted ... - JobReleaseTaskStateCompleted JobReleaseTaskState = "completed" - // JobReleaseTaskStateRunning ... - JobReleaseTaskStateRunning JobReleaseTaskState = "running" -) - -// PossibleJobReleaseTaskStateValues returns an array of possible values for the JobReleaseTaskState const type. -func PossibleJobReleaseTaskStateValues() []JobReleaseTaskState { - return []JobReleaseTaskState{JobReleaseTaskStateCompleted, JobReleaseTaskStateRunning} -} - -// JobScheduleState enumerates the values for job schedule state. -type JobScheduleState string - -const ( - // JobScheduleStateActive ... - JobScheduleStateActive JobScheduleState = "active" - // JobScheduleStateCompleted ... - JobScheduleStateCompleted JobScheduleState = "completed" - // JobScheduleStateDeleting ... - JobScheduleStateDeleting JobScheduleState = "deleting" - // JobScheduleStateDisabled ... - JobScheduleStateDisabled JobScheduleState = "disabled" - // JobScheduleStateTerminating ... - JobScheduleStateTerminating JobScheduleState = "terminating" -) - -// PossibleJobScheduleStateValues returns an array of possible values for the JobScheduleState const type. -func PossibleJobScheduleStateValues() []JobScheduleState { - return []JobScheduleState{JobScheduleStateActive, JobScheduleStateCompleted, JobScheduleStateDeleting, JobScheduleStateDisabled, JobScheduleStateTerminating} -} - -// JobState enumerates the values for job state. -type JobState string - -const ( - // JobStateActive ... - JobStateActive JobState = "active" - // JobStateCompleted ... - JobStateCompleted JobState = "completed" - // JobStateDeleting ... - JobStateDeleting JobState = "deleting" - // JobStateDisabled ... - JobStateDisabled JobState = "disabled" - // JobStateDisabling ... - JobStateDisabling JobState = "disabling" - // JobStateEnabling ... - JobStateEnabling JobState = "enabling" - // JobStateTerminating ... - JobStateTerminating JobState = "terminating" -) - -// PossibleJobStateValues returns an array of possible values for the JobState const type. -func PossibleJobStateValues() []JobState { - return []JobState{JobStateActive, JobStateCompleted, JobStateDeleting, JobStateDisabled, JobStateDisabling, JobStateEnabling, JobStateTerminating} -} - -// NetworkSecurityGroupRuleAccess enumerates the values for network security group rule access. -type NetworkSecurityGroupRuleAccess string - -const ( - // Allow ... - Allow NetworkSecurityGroupRuleAccess = "allow" - // Deny ... - Deny NetworkSecurityGroupRuleAccess = "deny" -) - -// PossibleNetworkSecurityGroupRuleAccessValues returns an array of possible values for the NetworkSecurityGroupRuleAccess const type. -func PossibleNetworkSecurityGroupRuleAccessValues() []NetworkSecurityGroupRuleAccess { - return []NetworkSecurityGroupRuleAccess{Allow, Deny} -} - -// OnAllTasksComplete enumerates the values for on all tasks complete. -type OnAllTasksComplete string - -const ( - // NoAction ... - NoAction OnAllTasksComplete = "noAction" - // TerminateJob ... - TerminateJob OnAllTasksComplete = "terminateJob" -) - -// PossibleOnAllTasksCompleteValues returns an array of possible values for the OnAllTasksComplete const type. -func PossibleOnAllTasksCompleteValues() []OnAllTasksComplete { - return []OnAllTasksComplete{NoAction, TerminateJob} -} - -// OnTaskFailure enumerates the values for on task failure. -type OnTaskFailure string - -const ( - // OnTaskFailureNoAction ... - OnTaskFailureNoAction OnTaskFailure = "noAction" - // OnTaskFailurePerformExitOptionsJobAction ... - OnTaskFailurePerformExitOptionsJobAction OnTaskFailure = "performExitOptionsJobAction" -) - -// PossibleOnTaskFailureValues returns an array of possible values for the OnTaskFailure const type. -func PossibleOnTaskFailureValues() []OnTaskFailure { - return []OnTaskFailure{OnTaskFailureNoAction, OnTaskFailurePerformExitOptionsJobAction} -} - -// 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} -} - -// OutputFileUploadCondition enumerates the values for output file upload condition. -type OutputFileUploadCondition string - -const ( - // OutputFileUploadConditionTaskCompletion ... - OutputFileUploadConditionTaskCompletion OutputFileUploadCondition = "taskCompletion" - // OutputFileUploadConditionTaskFailure ... - OutputFileUploadConditionTaskFailure OutputFileUploadCondition = "taskFailure" - // OutputFileUploadConditionTaskSuccess ... - OutputFileUploadConditionTaskSuccess OutputFileUploadCondition = "taskSuccess" -) - -// PossibleOutputFileUploadConditionValues returns an array of possible values for the OutputFileUploadCondition const type. -func PossibleOutputFileUploadConditionValues() []OutputFileUploadCondition { - return []OutputFileUploadCondition{OutputFileUploadConditionTaskCompletion, OutputFileUploadConditionTaskFailure, OutputFileUploadConditionTaskSuccess} -} - -// PoolLifetimeOption enumerates the values for pool lifetime option. -type PoolLifetimeOption string - -const ( - // PoolLifetimeOptionJob ... - PoolLifetimeOptionJob PoolLifetimeOption = "job" - // PoolLifetimeOptionJobSchedule ... - PoolLifetimeOptionJobSchedule PoolLifetimeOption = "jobSchedule" -) - -// PossiblePoolLifetimeOptionValues returns an array of possible values for the PoolLifetimeOption const type. -func PossiblePoolLifetimeOptionValues() []PoolLifetimeOption { - return []PoolLifetimeOption{PoolLifetimeOptionJob, PoolLifetimeOptionJobSchedule} -} - -// PoolState enumerates the values for pool state. -type PoolState string - -const ( - // PoolStateActive ... - PoolStateActive PoolState = "active" - // PoolStateDeleting ... - PoolStateDeleting PoolState = "deleting" - // PoolStateUpgrading ... - PoolStateUpgrading PoolState = "upgrading" -) - -// PossiblePoolStateValues returns an array of possible values for the PoolState const type. -func PossiblePoolStateValues() []PoolState { - return []PoolState{PoolStateActive, PoolStateDeleting, PoolStateUpgrading} -} - -// SchedulingState enumerates the values for scheduling state. -type SchedulingState string - -const ( - // Disabled ... - Disabled SchedulingState = "disabled" - // Enabled ... - Enabled SchedulingState = "enabled" -) - -// PossibleSchedulingStateValues returns an array of possible values for the SchedulingState const type. -func PossibleSchedulingStateValues() []SchedulingState { - return []SchedulingState{Disabled, Enabled} -} - -// StartTaskState enumerates the values for start task state. -type StartTaskState string - -const ( - // StartTaskStateCompleted ... - StartTaskStateCompleted StartTaskState = "completed" - // StartTaskStateRunning ... - StartTaskStateRunning StartTaskState = "running" -) - -// PossibleStartTaskStateValues returns an array of possible values for the StartTaskState const type. -func PossibleStartTaskStateValues() []StartTaskState { - return []StartTaskState{StartTaskStateCompleted, StartTaskStateRunning} -} - -// SubtaskState enumerates the values for subtask state. -type SubtaskState string - -const ( - // SubtaskStateCompleted ... - SubtaskStateCompleted SubtaskState = "completed" - // SubtaskStatePreparing ... - SubtaskStatePreparing SubtaskState = "preparing" - // SubtaskStateRunning ... - SubtaskStateRunning SubtaskState = "running" -) - -// PossibleSubtaskStateValues returns an array of possible values for the SubtaskState const type. -func PossibleSubtaskStateValues() []SubtaskState { - return []SubtaskState{SubtaskStateCompleted, SubtaskStatePreparing, SubtaskStateRunning} -} - -// TaskAddStatus enumerates the values for task add status. -type TaskAddStatus string - -const ( - // TaskAddStatusClientError ... - TaskAddStatusClientError TaskAddStatus = "clientError" - // TaskAddStatusServerError ... - TaskAddStatusServerError TaskAddStatus = "serverError" - // TaskAddStatusSuccess ... - TaskAddStatusSuccess TaskAddStatus = "success" -) - -// PossibleTaskAddStatusValues returns an array of possible values for the TaskAddStatus const type. -func PossibleTaskAddStatusValues() []TaskAddStatus { - return []TaskAddStatus{TaskAddStatusClientError, TaskAddStatusServerError, TaskAddStatusSuccess} -} - -// TaskCountValidationStatus enumerates the values for task count validation status. -type TaskCountValidationStatus string - -const ( - // Unvalidated ... - Unvalidated TaskCountValidationStatus = "unvalidated" - // Validated ... - Validated TaskCountValidationStatus = "validated" -) - -// PossibleTaskCountValidationStatusValues returns an array of possible values for the TaskCountValidationStatus const type. -func PossibleTaskCountValidationStatusValues() []TaskCountValidationStatus { - return []TaskCountValidationStatus{Unvalidated, Validated} -} - -// TaskExecutionResult enumerates the values for task execution result. -type TaskExecutionResult string - -const ( - // Failure ... - Failure TaskExecutionResult = "failure" - // Success ... - Success TaskExecutionResult = "success" -) - -// PossibleTaskExecutionResultValues returns an array of possible values for the TaskExecutionResult const type. -func PossibleTaskExecutionResultValues() []TaskExecutionResult { - return []TaskExecutionResult{Failure, Success} -} - -// TaskState enumerates the values for task state. -type TaskState string - -const ( - // TaskStateActive ... - TaskStateActive TaskState = "active" - // TaskStateCompleted ... - TaskStateCompleted TaskState = "completed" - // TaskStatePreparing ... - TaskStatePreparing TaskState = "preparing" - // TaskStateRunning ... - TaskStateRunning TaskState = "running" -) - -// PossibleTaskStateValues returns an array of possible values for the TaskState const type. -func PossibleTaskStateValues() []TaskState { - return []TaskState{TaskStateActive, TaskStateCompleted, TaskStatePreparing, TaskStateRunning} -} - -// AccountListNodeAgentSkusResult ... -type AccountListNodeAgentSkusResult struct { - autorest.Response `json:"-"` - Value *[]NodeAgentSku `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// AccountListNodeAgentSkusResultIterator provides access to a complete listing of NodeAgentSku values. -type AccountListNodeAgentSkusResultIterator struct { - i int - page AccountListNodeAgentSkusResultPage -} - -// Next 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 *AccountListNodeAgentSkusResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AccountListNodeAgentSkusResultIterator) 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 AccountListNodeAgentSkusResultIterator) Response() AccountListNodeAgentSkusResult { - 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 AccountListNodeAgentSkusResultIterator) Value() NodeAgentSku { - if !iter.page.NotDone() { - return NodeAgentSku{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (alnasr AccountListNodeAgentSkusResult) IsEmpty() bool { - return alnasr.Value == nil || len(*alnasr.Value) == 0 -} - -// accountListNodeAgentSkusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alnasr AccountListNodeAgentSkusResult) accountListNodeAgentSkusResultPreparer() (*http.Request, error) { - if alnasr.OdataNextLink == nil || len(to.String(alnasr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alnasr.OdataNextLink))) -} - -// AccountListNodeAgentSkusResultPage contains a page of NodeAgentSku values. -type AccountListNodeAgentSkusResultPage struct { - fn func(AccountListNodeAgentSkusResult) (AccountListNodeAgentSkusResult, error) - alnasr AccountListNodeAgentSkusResult -} - -// 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. -func (page *AccountListNodeAgentSkusResultPage) Next() error { - next, err := page.fn(page.alnasr) - if err != nil { - return err - } - page.alnasr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AccountListNodeAgentSkusResultPage) NotDone() bool { - return !page.alnasr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AccountListNodeAgentSkusResultPage) Response() AccountListNodeAgentSkusResult { - return page.alnasr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AccountListNodeAgentSkusResultPage) Values() []NodeAgentSku { - if page.alnasr.IsEmpty() { - return nil - } - return *page.alnasr.Value -} - -// AffinityInformation ... -type AffinityInformation struct { - // AffinityID - You can pass the affinityId of a compute node to indicate that this task needs to run on that compute node. Note that this is just a soft affinity. If the target node is busy or unavailable at the time the task is scheduled, then the task will be scheduled elsewhere. - AffinityID *string `json:"affinityId,omitempty"` -} - -// ApplicationListResult ... -type ApplicationListResult struct { - autorest.Response `json:"-"` - Value *[]ApplicationSummary `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// ApplicationListResultIterator provides access to a complete listing of ApplicationSummary values. -type ApplicationListResultIterator struct { - i int - page ApplicationListResultPage -} - -// Next 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 *ApplicationListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationListResultIterator) 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 ApplicationListResultIterator) Response() ApplicationListResult { - 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 ApplicationListResultIterator) Value() ApplicationSummary { - if !iter.page.NotDone() { - return ApplicationSummary{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (alr ApplicationListResult) IsEmpty() bool { - return alr.Value == nil || len(*alr.Value) == 0 -} - -// applicationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alr ApplicationListResult) applicationListResultPreparer() (*http.Request, error) { - if alr.OdataNextLink == nil || len(to.String(alr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alr.OdataNextLink))) -} - -// ApplicationListResultPage contains a page of ApplicationSummary values. -type ApplicationListResultPage struct { - fn func(ApplicationListResult) (ApplicationListResult, error) - alr ApplicationListResult -} - -// 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. -func (page *ApplicationListResultPage) Next() error { - next, err := page.fn(page.alr) - if err != nil { - return err - } - page.alr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationListResultPage) NotDone() bool { - return !page.alr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationListResultPage) Response() ApplicationListResult { - return page.alr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationListResultPage) Values() []ApplicationSummary { - if page.alr.IsEmpty() { - return nil - } - return *page.alr.Value -} - -// ApplicationPackageReference ... -type ApplicationPackageReference struct { - ApplicationID *string `json:"applicationId,omitempty"` - // Version - If this is omitted on a pool, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences and HTTP status code 409. If this is omitted on a task, and no default version is specified for this application, the task fails with a pre-processing error. - Version *string `json:"version,omitempty"` -} - -// ApplicationSummary ... -type ApplicationSummary struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Versions *[]string `json:"versions,omitempty"` -} - -// AuthenticationTokenSettings ... -type AuthenticationTokenSettings struct { - // Access - The authentication token grants access to a limited set of Batch service operations. Currently the only supported value for the access property is 'job', which grants access to all operations related to the job which contains the task. - Access *[]AccessScope `json:"access,omitempty"` -} - -// AutoPoolSpecification ... -type AutoPoolSpecification struct { - // AutoPoolIDPrefix - The Batch service assigns each auto pool a unique identifier on creation. To distinguish between pools created for different purposes, you can specify this element to add a prefix to the ID that is assigned. The prefix can be up to 20 characters long. - AutoPoolIDPrefix *string `json:"autoPoolIdPrefix,omitempty"` - // PoolLifetimeOption - When the pool lifetime is jobSchedule the pool exists for the lifetime of the job schedule. The Batch Service creates the pool when it creates the first job on the schedule. You may apply this option only to job schedules, not to jobs. When the pool lifetime is job the pool exists for the lifetime of the job to which it is dedicated. The Batch service creates the pool when it creates the job. If the 'job' option is applied to a job schedule, the Batch service creates a new auto pool for every job created on the schedule. Possible values include: 'PoolLifetimeOptionJobSchedule', 'PoolLifetimeOptionJob' - PoolLifetimeOption PoolLifetimeOption `json:"poolLifetimeOption,omitempty"` - // KeepAlive - If false, the Batch service deletes the pool once its lifetime (as determined by the poolLifetimeOption setting) expires; that is, when the job or job schedule completes. If true, the Batch service does not delete the pool automatically. It is up to the user to delete auto pools created with this option. - KeepAlive *bool `json:"keepAlive,omitempty"` - Pool *PoolSpecification `json:"pool,omitempty"` -} - -// AutoScaleRun ... -type AutoScaleRun struct { - autorest.Response `json:"-"` - Timestamp *date.Time `json:"timestamp,omitempty"` - // Results - Each variable value is returned in the form $variable=value, and variables are separated by semicolons. - Results *string `json:"results,omitempty"` - Error *AutoScaleRunError `json:"error,omitempty"` -} - -// AutoScaleRunError ... -type AutoScaleRunError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Values *[]NameValuePair `json:"values,omitempty"` -} - -// AutoUserSpecification ... -type AutoUserSpecification struct { - // Scope - Values are: - // pool - specifies that the task runs as the common auto user account which is created on every node in a pool. - // task - specifies that the service should create a new user for the task. - // The default value is task. Possible values include: 'Task', 'Pool' - Scope AutoUserScope `json:"scope,omitempty"` - // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin' - ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"` -} - -// Certificate a certificate that can be installed on compute nodes and can be used to authenticate operations on -// the machine. -type Certificate struct { - autorest.Response `json:"-"` - Thumbprint *string `json:"thumbprint,omitempty"` - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - URL *string `json:"url,omitempty"` - // State - Possible values include: 'Active', 'Deleting', 'DeleteFailed' - State CertificateState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the certificate is in its initial active state. Possible values include: 'Active', 'Deleting', 'DeleteFailed' - PreviousState CertificateState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the certificate is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - PublicData *string `json:"publicData,omitempty"` - // DeleteCertificateError - This property is set only if the certificate is in the DeleteFailed state. - DeleteCertificateError *DeleteCertificateError `json:"deleteCertificateError,omitempty"` -} - -// CertificateAddParameter ... -type CertificateAddParameter struct { - Thumbprint *string `json:"thumbprint,omitempty"` - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - Data *string `json:"data,omitempty"` - // CertificateFormat - Possible values include: 'Pfx', 'Cer' - CertificateFormat CertificateFormat `json:"certificateFormat,omitempty"` - // Password - This is required if the certificate format is pfx. It should be omitted if the certificate format is cer. - Password *string `json:"password,omitempty"` -} - -// CertificateListResult ... -type CertificateListResult struct { - autorest.Response `json:"-"` - Value *[]Certificate `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CertificateListResultIterator provides access to a complete listing of Certificate values. -type CertificateListResultIterator struct { - i int - page CertificateListResultPage -} - -// Next 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 *CertificateListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CertificateListResultIterator) 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 CertificateListResultIterator) Response() CertificateListResult { - 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 CertificateListResultIterator) Value() Certificate { - if !iter.page.NotDone() { - return Certificate{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (clr CertificateListResult) IsEmpty() bool { - return clr.Value == nil || len(*clr.Value) == 0 -} - -// certificateListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) { - if clr.OdataNextLink == nil || len(to.String(clr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(clr.OdataNextLink))) -} - -// CertificateListResultPage contains a page of Certificate values. -type CertificateListResultPage struct { - fn func(CertificateListResult) (CertificateListResult, error) - clr CertificateListResult -} - -// 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. -func (page *CertificateListResultPage) Next() error { - next, err := page.fn(page.clr) - if err != nil { - return err - } - page.clr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CertificateListResultPage) NotDone() bool { - return !page.clr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CertificateListResultPage) Response() CertificateListResult { - return page.clr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CertificateListResultPage) Values() []Certificate { - if page.clr.IsEmpty() { - return nil - } - return *page.clr.Value -} - -// CertificateReference ... -type CertificateReference struct { - Thumbprint *string `json:"thumbprint,omitempty"` - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - // StoreLocation - The default value is currentUser. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. Possible values include: 'CurrentUser', 'LocalMachine' - StoreLocation CertificateStoreLocation `json:"storeLocation,omitempty"` - // StoreName - This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My. - StoreName *string `json:"storeName,omitempty"` - // Visibility - Values are: - // starttask - The user account under which the start task is run. - // task - The accounts under which job tasks are run. - // remoteuser - The accounts under which users remotely access the node. - // You can specify more than one visibility in this collection. The default is all accounts. - Visibility *[]CertificateVisibility `json:"visibility,omitempty"` -} - -// CloudJob ... -type CloudJob struct { - autorest.Response `json:"-"` - // ID - The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case). - ID *string `json:"id,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the job has changed between requests. In particular, you can be pass the ETag when updating a job to specify that your changes should take effect only if nobody else has modified the job in the meantime. - ETag *string `json:"eTag,omitempty"` - // LastModified - This is the last time at which the job level data, such as the job state or priority, changed. It does not factor in task-level changes such as adding new tasks or tasks changing state. - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting' - State JobState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the job is in its initial Active state. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting' - PreviousState JobState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the job is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. - Priority *int32 `json:"priority,omitempty"` - Constraints *JobConstraints `json:"constraints,omitempty"` - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - The Job Preparation task is a special task run on each node before any other task of the job. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - The Job Release task is a special task run at the end of the job on each node that has run any other task of the job. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value. - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // OnAllTasksComplete - noAction - do nothing. The job remains active unless terminated or disabled by some other means. terminateJob - terminate the job. The job's terminateReason is set to 'AllTasksComplete'. The default is noAction. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // OnTaskFailure - A task is considered to have failed if has a failureInfo. A failureInfo is set if the task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the task, for example due to a resource file download error. noAction - do nothing. performExitOptionsJobAction - take the action associated with the task exit condition in the task's exitConditions collection. (This may still result in no action being taken, if that is what the task specifies.) The default is noAction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction' - OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - ExecutionInfo *JobExecutionInformation `json:"executionInfo,omitempty"` - Stats *JobStatistics `json:"stats,omitempty"` -} - -// CloudJobListPreparationAndReleaseTaskStatusResult ... -type CloudJobListPreparationAndReleaseTaskStatusResult struct { - autorest.Response `json:"-"` - Value *[]JobPreparationAndReleaseTaskExecutionInformation `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobListPreparationAndReleaseTaskStatusResultIterator provides access to a complete listing of -// JobPreparationAndReleaseTaskExecutionInformation values. -type CloudJobListPreparationAndReleaseTaskStatusResultIterator struct { - i int - page CloudJobListPreparationAndReleaseTaskStatusResultPage -} - -// Next 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 *CloudJobListPreparationAndReleaseTaskStatusResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) 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 CloudJobListPreparationAndReleaseTaskStatusResultIterator) Response() CloudJobListPreparationAndReleaseTaskStatusResult { - 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 CloudJobListPreparationAndReleaseTaskStatusResultIterator) Value() JobPreparationAndReleaseTaskExecutionInformation { - if !iter.page.NotDone() { - return JobPreparationAndReleaseTaskExecutionInformation{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) IsEmpty() bool { - return cjlpartsr.Value == nil || len(*cjlpartsr.Value) == 0 -} - -// cloudJobListPreparationAndReleaseTaskStatusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) cloudJobListPreparationAndReleaseTaskStatusResultPreparer() (*http.Request, error) { - if cjlpartsr.OdataNextLink == nil || len(to.String(cjlpartsr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjlpartsr.OdataNextLink))) -} - -// CloudJobListPreparationAndReleaseTaskStatusResultPage contains a page of -// JobPreparationAndReleaseTaskExecutionInformation values. -type CloudJobListPreparationAndReleaseTaskStatusResultPage struct { - fn func(CloudJobListPreparationAndReleaseTaskStatusResult) (CloudJobListPreparationAndReleaseTaskStatusResult, error) - cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult -} - -// 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. -func (page *CloudJobListPreparationAndReleaseTaskStatusResultPage) Next() error { - next, err := page.fn(page.cjlpartsr) - if err != nil { - return err - } - page.cjlpartsr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) NotDone() bool { - return !page.cjlpartsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Response() CloudJobListPreparationAndReleaseTaskStatusResult { - return page.cjlpartsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Values() []JobPreparationAndReleaseTaskExecutionInformation { - if page.cjlpartsr.IsEmpty() { - return nil - } - return *page.cjlpartsr.Value -} - -// CloudJobListResult ... -type CloudJobListResult struct { - autorest.Response `json:"-"` - Value *[]CloudJob `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobListResultIterator provides access to a complete listing of CloudJob values. -type CloudJobListResultIterator struct { - i int - page CloudJobListResultPage -} - -// Next 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 *CloudJobListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobListResultIterator) 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 CloudJobListResultIterator) Response() CloudJobListResult { - 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 CloudJobListResultIterator) Value() CloudJob { - if !iter.page.NotDone() { - return CloudJob{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjlr CloudJobListResult) IsEmpty() bool { - return cjlr.Value == nil || len(*cjlr.Value) == 0 -} - -// cloudJobListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjlr CloudJobListResult) cloudJobListResultPreparer() (*http.Request, error) { - if cjlr.OdataNextLink == nil || len(to.String(cjlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjlr.OdataNextLink))) -} - -// CloudJobListResultPage contains a page of CloudJob values. -type CloudJobListResultPage struct { - fn func(CloudJobListResult) (CloudJobListResult, error) - cjlr CloudJobListResult -} - -// 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. -func (page *CloudJobListResultPage) Next() error { - next, err := page.fn(page.cjlr) - if err != nil { - return err - } - page.cjlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobListResultPage) NotDone() bool { - return !page.cjlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobListResultPage) Response() CloudJobListResult { - return page.cjlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobListResultPage) Values() []CloudJob { - if page.cjlr.IsEmpty() { - return nil - } - return *page.cjlr.Value -} - -// CloudJobSchedule ... -type CloudJobSchedule struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the job schedule has changed between requests. In particular, you can be pass the ETag with an Update Job Schedule request to specify that your changes should take effect only if nobody else has modified the schedule in the meantime. - ETag *string `json:"eTag,omitempty"` - // LastModified - This is the last time at which the schedule level data, such as the job specification or recurrence information, changed. It does not factor in job-level changes such as new jobs being created or jobs changing state. - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting' - State JobScheduleState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not present if the job schedule is in its initial active state. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting' - PreviousState JobScheduleState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not present if the job schedule is in its initial active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - Schedule *Schedule `json:"schedule,omitempty"` - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - ExecutionInfo *JobScheduleExecutionInformation `json:"executionInfo,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - Stats *JobScheduleStatistics `json:"stats,omitempty"` -} - -// CloudJobScheduleListResult ... -type CloudJobScheduleListResult struct { - autorest.Response `json:"-"` - Value *[]CloudJobSchedule `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobScheduleListResultIterator provides access to a complete listing of CloudJobSchedule values. -type CloudJobScheduleListResultIterator struct { - i int - page CloudJobScheduleListResultPage -} - -// Next 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 *CloudJobScheduleListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobScheduleListResultIterator) 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 CloudJobScheduleListResultIterator) Response() CloudJobScheduleListResult { - 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 CloudJobScheduleListResultIterator) Value() CloudJobSchedule { - if !iter.page.NotDone() { - return CloudJobSchedule{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjslr CloudJobScheduleListResult) IsEmpty() bool { - return cjslr.Value == nil || len(*cjslr.Value) == 0 -} - -// cloudJobScheduleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjslr CloudJobScheduleListResult) cloudJobScheduleListResultPreparer() (*http.Request, error) { - if cjslr.OdataNextLink == nil || len(to.String(cjslr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjslr.OdataNextLink))) -} - -// CloudJobScheduleListResultPage contains a page of CloudJobSchedule values. -type CloudJobScheduleListResultPage struct { - fn func(CloudJobScheduleListResult) (CloudJobScheduleListResult, error) - cjslr CloudJobScheduleListResult -} - -// 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. -func (page *CloudJobScheduleListResultPage) Next() error { - next, err := page.fn(page.cjslr) - if err != nil { - return err - } - page.cjslr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobScheduleListResultPage) NotDone() bool { - return !page.cjslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobScheduleListResultPage) Response() CloudJobScheduleListResult { - return page.cjslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobScheduleListResultPage) Values() []CloudJobSchedule { - if page.cjslr.IsEmpty() { - return nil - } - return *page.cjslr.Value -} - -// CloudPool ... -type CloudPool struct { - autorest.Response `json:"-"` - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the pool has changed between requests. In particular, you can be pass the ETag when updating a pool to specify that your changes should take effect only if nobody else has modified the pool in the meantime. - ETag *string `json:"eTag,omitempty"` - // LastModified - This is the last time at which the pool level data, such as the targetDedicatedNodes or enableAutoscale settings, changed. It does not factor in node-level changes such as a compute node changing state. - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Values are: - // active - The pool is available to run tasks subject to the availability of compute nodes. - // deleting - The user has requested that the pool be deleted, but the delete operation has not yet completed. - // upgrading - The user has requested that the operating system of the pool's nodes be upgraded, but the upgrade operation has not yet completed (that is, some nodes in the pool have not yet been upgraded). While upgrading, the pool may be able to run tasks (with reduced capacity) but this is not guaranteed. Possible values include: 'PoolStateActive', 'PoolStateDeleting', 'PoolStateUpgrading' - State PoolState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // AllocationState - Values are: - // steady - The pool is not resizing. There are no changes to the number of nodes in the pool in progress. A pool enters this state when it is created and when no operations are being performed on the pool to change the number of dedicated nodes. - // resizing - The pool is resizing; that is, compute nodes are being added to or removed from the pool. - // stopping - The pool was resizing, but the user has requested that the resize be stopped, but the stop request has not yet been completed. Possible values include: 'Steady', 'Resizing', 'Stopping' - AllocationState AllocationState `json:"allocationState,omitempty"` - AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // ResizeTimeout - This is the timeout for the most recent resize operation. (The initial sizing when the pool is created counts as a resize.) The default value is 15 minutes. - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // ResizeErrors - This property is set only if one or more errors occurred during the last pool resize, and only when the pool allocationState is Steady. - ResizeErrors *[]ResizeError `json:"resizeErrors,omitempty"` - CurrentDedicatedNodes *int32 `json:"currentDedicatedNodes,omitempty"` - // CurrentLowPriorityNodes - Low-priority compute nodes which have been preempted are included in this count. - CurrentLowPriorityNodes *int32 `json:"currentLowPriorityNodes,omitempty"` - TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"` - TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"` - // EnableAutoScale - If false, at least one of targetDedicateNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the pool automatically resizes according to the formula. The default value is false. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - This property is set only if the pool automatically scales, i.e. enableAutoScale is true. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - This property is set only if the pool automatically scales, i.e. enableAutoScale is true. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // AutoScaleRun - This property is set only if the pool automatically scales, i.e. enableAutoScale is true. - AutoScaleRun *AutoScaleRun `json:"autoScaleRun,omitempty"` - // EnableInterNodeCommunication - This imposes restrictions on which nodes can be assigned to the pool. Specifying this value can reduce the chance of the requested number of nodes to be allocated in the pool. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // ApplicationLicenses - The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail. - ApplicationLicenses *[]string `json:"applicationLicenses,omitempty"` - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - UserAccounts *[]UserAccount `json:"userAccounts,omitempty"` - Metadata *[]MetadataItem `json:"metadata,omitempty"` - Stats *PoolStatistics `json:"stats,omitempty"` -} - -// CloudPoolListResult ... -type CloudPoolListResult struct { - autorest.Response `json:"-"` - Value *[]CloudPool `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudPoolListResultIterator provides access to a complete listing of CloudPool values. -type CloudPoolListResultIterator struct { - i int - page CloudPoolListResultPage -} - -// Next 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 *CloudPoolListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudPoolListResultIterator) 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 CloudPoolListResultIterator) Response() CloudPoolListResult { - 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 CloudPoolListResultIterator) Value() CloudPool { - if !iter.page.NotDone() { - return CloudPool{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cplr CloudPoolListResult) IsEmpty() bool { - return cplr.Value == nil || len(*cplr.Value) == 0 -} - -// cloudPoolListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cplr CloudPoolListResult) cloudPoolListResultPreparer() (*http.Request, error) { - if cplr.OdataNextLink == nil || len(to.String(cplr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cplr.OdataNextLink))) -} - -// CloudPoolListResultPage contains a page of CloudPool values. -type CloudPoolListResultPage struct { - fn func(CloudPoolListResult) (CloudPoolListResult, error) - cplr CloudPoolListResult -} - -// 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. -func (page *CloudPoolListResultPage) Next() error { - next, err := page.fn(page.cplr) - if err != nil { - return err - } - page.cplr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudPoolListResultPage) NotDone() bool { - return !page.cplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudPoolListResultPage) Response() CloudPoolListResult { - return page.cplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudPoolListResultPage) Values() []CloudPool { - if page.cplr.IsEmpty() { - return nil - } - return *page.cplr.Value -} - -// CloudServiceConfiguration ... -type CloudServiceConfiguration struct { - // OsFamily - Possible values are: 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 - OS Family 3, equivalent to Windows Server 2012. 4 - OS Family 4, equivalent to Windows Server 2012 R2. 5 - OS Family 5, equivalent to Windows Server 2016. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). - OsFamily *string `json:"osFamily,omitempty"` - // TargetOSVersion - The default value is * which specifies the latest operating system version for the specified OS family. - TargetOSVersion *string `json:"targetOSVersion,omitempty"` - // CurrentOSVersion - This may differ from targetOSVersion if the pool state is Upgrading. In this case some virtual machines may be on the targetOSVersion and some may be on the currentOSVersion during the upgrade process. Once all virtual machines have upgraded, currentOSVersion is updated to be the same as targetOSVersion. - CurrentOSVersion *string `json:"currentOSVersion,omitempty"` -} - -// CloudTask ... -type CloudTask struct { - autorest.Response `json:"-"` - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the task has changed between requests. In particular, you can be pass the ETag when updating a task to specify that your changes should take effect only if nobody else has modified the task in the meantime. - ETag *string `json:"eTag,omitempty"` - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // ExitConditions - How the Batch service should respond when the task completes. - ExitConditions *ExitConditions `json:"exitConditions,omitempty"` - // State - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - State TaskState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the task is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - PreviousState TaskState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the task is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // OutputFiles - For multi-instance tasks, the files will only be uploaded from the compute node on which the primary task is executed. - OutputFiles *[]OutputFile `json:"outputFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"` - Constraints *TaskConstraints `json:"constraints,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"` - NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"` - MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"` - Stats *TaskStatistics `json:"stats,omitempty"` - // DependsOn - This task will not be scheduled until all tasks that it depends on have completed successfully. If any of those tasks fail and exhaust their retry counts, this task will never be scheduled. - DependsOn *TaskDependencies `json:"dependsOn,omitempty"` - // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task working directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job. - AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"` -} - -// CloudTaskListResult ... -type CloudTaskListResult struct { - autorest.Response `json:"-"` - Value *[]CloudTask `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudTaskListResultIterator provides access to a complete listing of CloudTask values. -type CloudTaskListResultIterator struct { - i int - page CloudTaskListResultPage -} - -// Next 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 *CloudTaskListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudTaskListResultIterator) 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 CloudTaskListResultIterator) Response() CloudTaskListResult { - 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 CloudTaskListResultIterator) Value() CloudTask { - if !iter.page.NotDone() { - return CloudTask{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (ctlr CloudTaskListResult) IsEmpty() bool { - return ctlr.Value == nil || len(*ctlr.Value) == 0 -} - -// cloudTaskListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ctlr CloudTaskListResult) cloudTaskListResultPreparer() (*http.Request, error) { - if ctlr.OdataNextLink == nil || len(to.String(ctlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ctlr.OdataNextLink))) -} - -// CloudTaskListResultPage contains a page of CloudTask values. -type CloudTaskListResultPage struct { - fn func(CloudTaskListResult) (CloudTaskListResult, error) - ctlr CloudTaskListResult -} - -// 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. -func (page *CloudTaskListResultPage) Next() error { - next, err := page.fn(page.ctlr) - if err != nil { - return err - } - page.ctlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudTaskListResultPage) NotDone() bool { - return !page.ctlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudTaskListResultPage) Response() CloudTaskListResult { - return page.ctlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudTaskListResultPage) Values() []CloudTask { - if page.ctlr.IsEmpty() { - return nil - } - return *page.ctlr.Value -} - -// CloudTaskListSubtasksResult ... -type CloudTaskListSubtasksResult struct { - autorest.Response `json:"-"` - Value *[]SubtaskInformation `json:"value,omitempty"` -} - -// ComputeNode ... -type ComputeNode struct { - autorest.Response `json:"-"` - // ID - Every node that is added to a pool is assigned a unique ID. Whenever a node is removed from a pool, all of its local files are deleted, and the ID is reclaimed and could be reused for new nodes. - ID *string `json:"id,omitempty"` - URL *string `json:"url,omitempty"` - // State - Values are: - // idle - The node is not currently running a task. - // rebooting - The node is rebooting. - // reimaging - The node is reimaging. - // running - The node is running one or more tasks (other than a start task). - // unusable - The node cannot be used for task execution due to errors. - // creating - The Batch service has obtained the underlying virtual machine from Azure Compute, but it has not yet started to join the pool. - // starting - the Batch service is starting on the underlying virtual machine. - // waitingforstarttask - The start task has started running on the compute node, but waitForSuccess is set and the start task has not yet completed. - // starttaskfailed - The start task has failed on the compute node (and exhausted all retries), and waitForSuccess is set. The node is not usable for running tasks. - // unknown - The Batch service has lost contact with the node, and does not know its true state. - // leavingpool - The node is leaving the pool, either because the user explicitly removed it or because the pool is resizing or autoscaling down. - // offline - The node is not currently running a task, and scheduling of new tasks to the node is disabled. - // preempted - The low-priority node has been preempted. Tasks which were running on the node when it was pre-empted will be rescheduled when another node becomes available. Possible values include: 'Idle', 'Rebooting', 'Reimaging', 'Running', 'Unusable', 'Creating', 'Starting', 'WaitingForStartTask', 'StartTaskFailed', 'Unknown', 'LeavingPool', 'Offline', 'Preempted' - State ComputeNodeState `json:"state,omitempty"` - // SchedulingState - Values are: - // enabled - Tasks can be scheduled on the node. - // disabled - No new tasks will be scheduled on the node. Tasks already running on the node may still run to completion. All nodes start with scheduling enabled. Possible values include: 'Enabled', 'Disabled' - SchedulingState SchedulingState `json:"schedulingState,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // LastBootTime - This property may not be present if the node state is unusable. - LastBootTime *date.Time `json:"lastBootTime,omitempty"` - AllocationTime *date.Time `json:"allocationTime,omitempty"` - // IPAddress - Every node that is added to a pool is assigned a unique IP address. Whenever a node is removed from a pool, all of its local files are deleted, and the IP address is reclaimed and could be reused for new nodes. - IPAddress *string `json:"ipAddress,omitempty"` - // AffinityID - Note that this is just a soft affinity. If the target node is busy or unavailable at the time the task is scheduled, then the task will be scheduled elsewhere. - AffinityID *string `json:"affinityId,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - TotalTasksRun *int32 `json:"totalTasksRun,omitempty"` - RunningTasksCount *int32 `json:"runningTasksCount,omitempty"` - TotalTasksSucceeded *int32 `json:"totalTasksSucceeded,omitempty"` - // RecentTasks - This property is present only if at least one task has run on this node since it was assigned to the pool. - RecentTasks *[]TaskInformation `json:"recentTasks,omitempty"` - StartTask *StartTask `json:"startTask,omitempty"` - StartTaskInfo *StartTaskInformation `json:"startTaskInfo,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - Errors *[]ComputeNodeError `json:"errors,omitempty"` - IsDedicated *bool `json:"isDedicated,omitempty"` - EndpointConfiguration *ComputeNodeEndpointConfiguration `json:"endpointConfiguration,omitempty"` -} - -// ComputeNodeEndpointConfiguration ... -type ComputeNodeEndpointConfiguration struct { - InboundEndpoints *[]InboundEndpoint `json:"inboundEndpoints,omitempty"` -} - -// ComputeNodeError ... -type ComputeNodeError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - ErrorDetails *[]NameValuePair `json:"errorDetails,omitempty"` -} - -// ComputeNodeGetRemoteLoginSettingsResult ... -type ComputeNodeGetRemoteLoginSettingsResult struct { - autorest.Response `json:"-"` - RemoteLoginIPAddress *string `json:"remoteLoginIPAddress,omitempty"` - RemoteLoginPort *int32 `json:"remoteLoginPort,omitempty"` -} - -// ComputeNodeInformation ... -type ComputeNodeInformation struct { - AffinityID *string `json:"affinityId,omitempty"` - NodeURL *string `json:"nodeUrl,omitempty"` - PoolID *string `json:"poolId,omitempty"` - NodeID *string `json:"nodeId,omitempty"` - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` -} - -// ComputeNodeListResult ... -type ComputeNodeListResult struct { - autorest.Response `json:"-"` - Value *[]ComputeNode `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// ComputeNodeListResultIterator provides access to a complete listing of ComputeNode values. -type ComputeNodeListResultIterator struct { - i int - page ComputeNodeListResultPage -} - -// Next 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 *ComputeNodeListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ComputeNodeListResultIterator) 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 ComputeNodeListResultIterator) Response() ComputeNodeListResult { - 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 ComputeNodeListResultIterator) Value() ComputeNode { - if !iter.page.NotDone() { - return ComputeNode{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cnlr ComputeNodeListResult) IsEmpty() bool { - return cnlr.Value == nil || len(*cnlr.Value) == 0 -} - -// computeNodeListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cnlr ComputeNodeListResult) computeNodeListResultPreparer() (*http.Request, error) { - if cnlr.OdataNextLink == nil || len(to.String(cnlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cnlr.OdataNextLink))) -} - -// ComputeNodeListResultPage contains a page of ComputeNode values. -type ComputeNodeListResultPage struct { - fn func(ComputeNodeListResult) (ComputeNodeListResult, error) - cnlr ComputeNodeListResult -} - -// 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. -func (page *ComputeNodeListResultPage) Next() error { - next, err := page.fn(page.cnlr) - if err != nil { - return err - } - page.cnlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ComputeNodeListResultPage) NotDone() bool { - return !page.cnlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ComputeNodeListResultPage) Response() ComputeNodeListResult { - return page.cnlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ComputeNodeListResultPage) Values() []ComputeNode { - if page.cnlr.IsEmpty() { - return nil - } - return *page.cnlr.Value -} - -// ComputeNodeUser ... -type ComputeNodeUser struct { - Name *string `json:"name,omitempty"` - // IsAdmin - The default value is false. - IsAdmin *bool `json:"isAdmin,omitempty"` - // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property. - Password *string `json:"password,omitempty"` - // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - SSHPublicKey *string `json:"sshPublicKey,omitempty"` -} - -// DeleteCertificateError ... -type DeleteCertificateError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - // Values - This list includes details such as the active pools and nodes referencing this certificate. However, if a large number of resources reference the certificate, the list contains only about the first hundred. - Values *[]NameValuePair `json:"values,omitempty"` -} - -// EnvironmentSetting ... -type EnvironmentSetting struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -// Error ... -type Error struct { - Code *string `json:"code,omitempty"` - Message *ErrorMessage `json:"message,omitempty"` - Values *[]ErrorDetail `json:"values,omitempty"` -} - -// ErrorDetail ... -type ErrorDetail struct { - Key *string `json:"key,omitempty"` - Value *string `json:"value,omitempty"` -} - -// ErrorMessage ... -type ErrorMessage struct { - Lang *string `json:"lang,omitempty"` - Value *string `json:"value,omitempty"` -} - -// ExitCodeMapping ... -type ExitCodeMapping struct { - Code *int32 `json:"code,omitempty"` - ExitOptions *ExitOptions `json:"exitOptions,omitempty"` -} - -// ExitCodeRangeMapping ... -type ExitCodeRangeMapping struct { - Start *int32 `json:"start,omitempty"` - End *int32 `json:"end,omitempty"` - ExitOptions *ExitOptions `json:"exitOptions,omitempty"` -} - -// ExitConditions ... -type ExitConditions struct { - ExitCodes *[]ExitCodeMapping `json:"exitCodes,omitempty"` - ExitCodeRanges *[]ExitCodeRangeMapping `json:"exitCodeRanges,omitempty"` - PreProcessingError *ExitOptions `json:"preProcessingError,omitempty"` - // FileUploadError - If the task exited with an exit code that was specified via exitCodes or exitCodeRanges, and then encountered a file upload error, then the action specified by the exit code takes precedence. - FileUploadError *ExitOptions `json:"fileUploadError,omitempty"` - // Default - This value is used if the task exits with any nonzero exit code not listed in the exitCodes or exitCodeRanges collection, with a pre-processing error if the preProcessingError property is not present, or with a file upload error if the fileUploadError property is not present. If you want non-default behaviour on exit code 0, you must list it explicitly using the exitCodes or exitCodeRanges collection. - Default *ExitOptions `json:"default,omitempty"` -} - -// ExitOptions ... -type ExitOptions struct { - // JobAction - Values are: - // none - Take no action. - // disable - Disable the job. This is equivalent to calling the disable job API, with a disableTasks value of requeue. - // terminate - Terminate the job. The terminateReason in the job's executionInfo is set to "TaskFailed". The default is none for exit code 0 and terminate for all other exit conditions. - // If the job's onTaskFailed property is noAction, then specifying this property returns an error and the add task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'JobActionNone', 'JobActionDisable', 'JobActionTerminate' - JobAction JobAction `json:"jobAction,omitempty"` - // DependencyAction - Values are: - // satisfy - Satisfy the task's dependencies. - // block - Block the task's dependencies. - // The default is 'satisfy' for exit code 0, and 'block' for all other exit conditions. If the job's usesTaskDependencies property is set to false, then specifying the dependencyAction property returns an erro and the add task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'Satisfy', 'Block' - DependencyAction DependencyAction `json:"dependencyAction,omitempty"` -} - -// FileProperties ... -type FileProperties struct { - // CreationTime - The creation time is not returned for files on Linux compute nodes. - CreationTime *date.Time `json:"creationTime,omitempty"` - LastModified *date.Time `json:"lastModified,omitempty"` - ContentLength *int64 `json:"contentLength,omitempty"` - ContentType *string `json:"contentType,omitempty"` - // FileMode - The file mode is returned only for files on Linux compute nodes. - FileMode *string `json:"fileMode,omitempty"` -} - -// ImageReference ... -type ImageReference struct { - // Publisher - For example, Canonical or MicrosoftWindowsServer. - Publisher *string `json:"publisher,omitempty"` - // Offer - For example, UbuntuServer or WindowsServer. - Offer *string `json:"offer,omitempty"` - // Sku - For example, 14.04.0-LTS or 2012-R2-Datacenter. - Sku *string `json:"sku,omitempty"` - // Version - A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. - Version *string `json:"version,omitempty"` -} - -// InboundEndpoint ... -type InboundEndpoint struct { - Name *string `json:"name,omitempty"` - // Protocol - Possible values include: 'TCP', 'UDP' - Protocol InboundEndpointProtocol `json:"protocol,omitempty"` - PublicIPAddress *string `json:"publicIPAddress,omitempty"` - PublicFQDN *string `json:"publicFQDN,omitempty"` - FrontendPort *int32 `json:"frontendPort,omitempty"` - BackendPort *int32 `json:"backendPort,omitempty"` -} - -// InboundNATPool ... -type InboundNATPool struct { - // Name - The name must be unique within a Batch pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. - Name *string `json:"name,omitempty"` - // Protocol - Possible values include: 'TCP', 'UDP' - Protocol InboundEndpointProtocol `json:"protocol,omitempty"` - // BackendPort - This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. - BackendPort *int32 `json:"backendPort,omitempty"` - // FrontendPortRangeStart - Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. - FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"` - // FrontendPortRangeEnd - Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. - FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"` - // NetworkSecurityGroupRules - The maximum number of rules that can be specified across all the endpoints on a Batch pool is 25. If no network security group rules are specified, a default rule will be created to allow inbound access to the specified backendPort. If the maximum number of network security group rules is exceeded the request fails with HTTP status code 400. - NetworkSecurityGroupRules *[]NetworkSecurityGroupRule `json:"networkSecurityGroupRules,omitempty"` -} - -// JobAddParameter ... -type JobAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. - Priority *int32 `json:"priority,omitempty"` - // Constraints - The execution constraints for the job. - Constraints *JobConstraints `json:"constraints,omitempty"` - // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job. The Job Manager task's typical purpose is to control and/or monitor job execution, for example by deciding what additional tasks to run, determining when the work is complete, etc. (However, a Job Manager task is not restricted to these activities - it is a fully-fledged task in the system and perform whatever actions are required for the job.) For example, a Job Manager task might download a file specified as a parameter, analyze the contents of that file and submit additional tasks based on those contents. - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task. The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value. - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic job termination without a Job Manager, you should initially set onAllTasksComplete to noAction and update the job properties to set onAllTasksComplete to terminateJob once you have finished adding tasks. Permitted values are: noAction - do nothing. The job remains active unless terminated or disabled by some other means. terminateJob - terminate the job. The job's terminateReason is set to 'AllTasksComplete'. The default is noAction. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // OnTaskFailure - A task is considered to have failed if has a failureInfo. A failureInfo is set if the task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the task, for example due to a resource file download error. noAction - do nothing. performExitOptionsJobAction - take the action associated with the task exit condition in the task's exitConditions collection. (This may still result in no action being taken, if that is what the task specifies.) The default is noAction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction' - OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` -} - -// JobConstraints ... -type JobConstraints struct { - // MaxWallClockTime - If the job does not complete within the time limit, the Batch service terminates it and any tasks that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry. If this property is not specified, there is no time limit on how long the job may run. - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try each task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry tasks. If the maximum retry count is -1, the Batch service retries tasks without limit. The default value is 0 (no retries). - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` -} - -// JobDisableParameter ... -type JobDisableParameter struct { - // DisableTasks - Values are: - // requeue - Terminate running tasks and requeue them. The tasks will run again when the job is enabled. - // terminate - Terminate running tasks. The tasks will not run again. - // wait - Allow currently running tasks to complete. Possible values include: 'DisableJobOptionRequeue', 'DisableJobOptionTerminate', 'DisableJobOptionWait' - DisableTasks DisableJobOption `json:"disableTasks,omitempty"` -} - -// JobExecutionInformation ... -type JobExecutionInformation struct { - // StartTime - This is the time at which the job was created. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the job is in the completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // PoolID - This element contains the actual pool where the job is assigned. When you get job details from the service, they also contain a poolInfo element, which contains the pool configuration data from when the job was added or updated. That poolInfo element may also contain a poolId element. If it does, the two IDs are the same. If it does not, it means the job ran on an auto pool, and this property contains the ID of that auto pool. - PoolID *string `json:"poolId,omitempty"` - // SchedulingError - This property is not set if there was no error starting the job. - SchedulingError *JobSchedulingError `json:"schedulingError,omitempty"` - // TerminateReason - This property is set only if the job is in the completed state. If the Batch service terminates the job, it sets the reason as follows: JMComplete - the Job Manager task completed, and killJobOnCompletion was set to true. MaxWallClockTimeExpiry - the job reached its maxWallClockTime constraint. TerminateJobSchedule - the job ran as part of a schedule, and the schedule terminated. AllTasksComplete - the job's onAllTasksComplete attribute is set to terminateJob, and all tasks in the job are complete. TaskFailed - the job's onTaskFailure attribute is set to performExitOptionsJobAction, and a task in the job failed with an exit condition that specified a jobAction of terminateJob. Any other string is a user-defined reason specified in a call to the 'Terminate a job' operation. - TerminateReason *string `json:"terminateReason,omitempty"` -} - -// JobManagerTask the Job Manager task is automatically started when the job is created. The Batch service tries to -// schedule the Job Manager task before any other tasks in the job. When shrinking a pool, the Batch service tries -// to preserve compute nodes where Job Manager tasks are running for as long as possible (that is, nodes running -// 'normal' tasks are removed before nodes running Job Manager tasks). When a Job Manager task fails and needs to -// be restarted, the system tries to schedule it at the highest priority. If there are no idle nodes available, the -// system may terminate one of the running tasks in the pool and return it to the queue in order to make room for -// the Job Manager task to restart. Note that a Job Manager task in one job does not have priority over tasks in -// other jobs. Across jobs, only job level priorities are observed. For example, if a Job Manager in a priority 0 -// job needs to be restarted, it will not displace tasks of a priority 1 job. -type JobManagerTask struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - It need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Files listed under this element are located in the task's working directory. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // OutputFiles - For multi-instance tasks, the files will only be uploaded from the compute node on which the primary task is executed. - OutputFiles *[]OutputFile `json:"outputFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - Constraints *TaskConstraints `json:"constraints,omitempty"` - // KillJobOnCompletion - If true, when the Job Manager task completes, the Batch service marks the job as complete. If any tasks are still running at this time (other than Job Release), those tasks are terminated. If false, the completion of the Job Manager task does not affect the job status. In this case, you should either use the onAllTasksComplete attribute to terminate the job, or have a client or user terminate the job explicitly. An example of this is if the Job Manager creates a set of tasks but then takes no further role in their execution. The default value is true. If you are using the onAllTasksComplete and onTaskFailure attributes to control job lifetime, and using the Job Manager task only to create the tasks for the job (not to monitor progress), then it is important to set killJobOnCompletion to false. - KillJobOnCompletion *bool `json:"killJobOnCompletion,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - // RunExclusive - If true, no other tasks will run on the same compute node for as long as the Job Manager is running. If false, other tasks can run simultaneously with the Job Manager on a compute node. The Job Manager task counts normally against the node's concurrent task limit, so this is only relevant if the node allows multiple concurrent tasks. The default value is true. - RunExclusive *bool `json:"runExclusive,omitempty"` - // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task working directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job. - AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"` - // AllowLowPriorityNode - The default value is false. - AllowLowPriorityNode *bool `json:"allowLowPriorityNode,omitempty"` -} - -// JobPatchParameter ... -type JobPatchParameter struct { - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged. - Priority *int32 `json:"priority,omitempty"` - // OnAllTasksComplete - If omitted, the completion behavior is left unchanged. You may not change the value from terminateJob to noAction - that is, once you have engaged automatic job termination, you cannot turn it off again. If you try to do this, the request fails with an 'invalid property value' error response; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // Constraints - If omitted, the existing execution constraints are left unchanged. - Constraints *JobConstraints `json:"constraints,omitempty"` - // PoolInfo - You may change the pool for a job only when the job is disabled. The Patch Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. If omitted, the job continues to run on its current pool. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - If omitted, the existing job metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobPreparationAndReleaseTaskExecutionInformation ... -type JobPreparationAndReleaseTaskExecutionInformation struct { - PoolID *string `json:"poolId,omitempty"` - NodeID *string `json:"nodeId,omitempty"` - NodeURL *string `json:"nodeUrl,omitempty"` - JobPreparationTaskExecutionInfo *JobPreparationTaskExecutionInformation `json:"jobPreparationTaskExecutionInfo,omitempty"` - // JobReleaseTaskExecutionInfo - This property is set only if the Job Release task has run on the node. - JobReleaseTaskExecutionInfo *JobReleaseTaskExecutionInformation `json:"jobReleaseTaskExecutionInfo,omitempty"` -} - -// JobPreparationTask you can use Job Preparation to prepare a compute node to run tasks for the job. Activities -// commonly performed in Job Preparation include: Downloading common resource files used by all the tasks in the -// job. The Job Preparation task can download these common resource files to the shared location on the compute -// node. (AZ_BATCH_NODE_ROOT_DIR\shared), or starting a local service on the compute node so that all tasks of that -// job can communicate with it. If the Job Preparation task fails (that is, exhausts its retry count before exiting -// with exit code 0), Batch will not run tasks of this job on the compute node. The node remains ineligible to run -// tasks of this job until it is reimaged. The node remains active and can be used for other jobs. The Job -// Preparation task can run multiple times on the same compute node. Therefore, you should write the Job -// Preparation task to handle re-execution. If the compute node is rebooted, the Job Preparation task is run again -// on the node before scheduling any other task of the job, if rerunOnNodeRebootAfterSuccess is true or if the Job -// Preparation task did not previously complete. If the compute node is reimaged, the Job Preparation task is run -// again before scheduling any task of the job. -type JobPreparationTask struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobpreparation'. No other task in the job can have the same ID as the Job Preparation task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobPreparationTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). - ID *string `json:"id,omitempty"` - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Files listed under this element are located in the task's working directory. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - Constraints *TaskConstraints `json:"constraints,omitempty"` - // WaitForSuccess - If true and the Job Preparation task fails on a compute node, the Batch service retries the Job Preparation task up to its maximum retry count (as specified in the constraints element). If the task has still not completed successfully after all retries, then the Batch service will not schedule tasks of the job to the compute node. The compute node remains active and eligible to run tasks of other jobs. If false, the Batch service will not wait for the Job Preparation task to complete. In this case, other tasks of the job can start executing on the compute node while the Job Preparation task is still running; and even if the Job Preparation task fails, new tasks will continue to be scheduled on the node. The default value is true. - WaitForSuccess *bool `json:"waitForSuccess,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task on Windows nodes, or a a non-administrative user unique to the pool on Linux nodes. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - // RerunOnNodeRebootAfterSuccess - The Job Preparation task is always rerun if a compute node is reimaged, or if the Job Preparation task did not complete (e.g. because the reboot occurred while the task was running). Therefore, you should always write a Job Preparation task to be idempotent and to behave correctly if run multiple times. The default value is true. - RerunOnNodeRebootAfterSuccess *bool `json:"rerunOnNodeRebootAfterSuccess,omitempty"` -} - -// JobPreparationTaskExecutionInformation ... -type JobPreparationTaskExecutionInformation struct { - // StartTime - If the task has been restarted or retried, this is the most recent time at which the task started running. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // State - Values are: - // running - the task is currently running (including retrying). - // completed - the task has exited with exit code 0, or the task has exhausted its retry limit, or the Batch service was unable to start the task due to task preparation errors (such as resource file download failures). Possible values include: 'JobPreparationTaskStateRunning', 'JobPreparationTaskStateCompleted' - State JobPreparationTaskState `json:"state,omitempty"` - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` - // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated. - ExitCode *int32 `json:"exitCode,omitempty"` - // FailureInfo - This property is set only if the task is in the completed state and encountered a failure. - FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"` - // RetryCount - Task application failures (non-zero exit code) are retried, pre-processing errors (the task could not be run) and file upload errors are not retried. The Batch service will retry the task up to the limit specified by the constraints. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - This property is set only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` - // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure' - Result TaskExecutionResult `json:"result,omitempty"` -} - -// JobReleaseTask the Job Release task runs when the job ends, because of one of the following: The user calls the -// Terminate Job API, or the Delete Job API while the job is still active, the job's maximum wall clock time -// constraint is reached, and the job is still active, or the job's Job Manager task completed, and the job is -// configured to terminate when the Job Manager completes. The Job Release task runs on each compute node where -// tasks of the job have run and the Job Preparation task ran and completed. If you reimage a compute node after it -// has run the Job Preparation task, and the job ends without any further tasks of the job running on that compute -// node (and hence the Job Preparation task does not re-run), then the Job Release task does not run on that node. -// If a compute node reboots while the Job Release task is still running, the Job Release task runs again when the -// compute node starts up. The job is not marked as complete until all Job Release tasks have completed. The Job -// Release task runs in the background. It does not occupy a scheduling slot; that is, it does not count towards -// the maxTasksPerNode limit specified on the pool. -type JobReleaseTask struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other task in the job can have the same ID as the Job Release task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). - ID *string `json:"id,omitempty"` - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Files listed under this element are located in the task's working directory. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged. - RetentionTime *string `json:"retentionTime,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` -} - -// JobReleaseTaskExecutionInformation ... -type JobReleaseTaskExecutionInformation struct { - // StartTime - If the task has been restarted or retried, this is the most recent time at which the task started running. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // State - Values are: - // running - the task is currently running (including retrying). - // completed - the task has exited, or the Batch service was unable to start the task due to task preparation errors (such as resource file download failures). Possible values include: 'JobReleaseTaskStateRunning', 'JobReleaseTaskStateCompleted' - State JobReleaseTaskState `json:"state,omitempty"` - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` - // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated. - ExitCode *int32 `json:"exitCode,omitempty"` - // FailureInfo - This property is set only if the task is in the completed state and encountered a failure. - FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"` - // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure' - Result TaskExecutionResult `json:"result,omitempty"` -} - -// JobScheduleAddParameter ... -type JobScheduleAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - Schedule *Schedule `json:"schedule,omitempty"` - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobScheduleExecutionInformation ... -type JobScheduleExecutionInformation struct { - // NextRunTime - This property is meaningful only if the schedule is in the active state when the time comes around. For example, if the schedule is disabled, no job will be created at nextRunTime unless the job is enabled before then. - NextRunTime *date.Time `json:"nextRunTime,omitempty"` - // RecentJob - This property is present only if the at least one job has run under the schedule. - RecentJob *RecentJob `json:"recentJob,omitempty"` - // EndTime - This property is set only if the job schedule is in the completed state. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// JobSchedulePatchParameter ... -type JobSchedulePatchParameter struct { - // Schedule - If you do not specify this element, the existing schedule is left unchanged. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - If you do not specify this element, existing metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobScheduleStatistics ... -type JobScheduleStatistics struct { - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UserCPUTime *string `json:"userCPUTime,omitempty"` - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If a task was retried, this includes the wall clock time of all the task retries. - WallClockTime *string `json:"wallClockTime,omitempty"` - ReadIOps *int64 `json:"readIOps,omitempty"` - WriteIOps *int64 `json:"writeIOps,omitempty"` - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"` - NumFailedTasks *int64 `json:"numFailedTasks,omitempty"` - NumTaskRetries *int64 `json:"numTaskRetries,omitempty"` - // WaitTime - This value is only reported in the account lifetime statistics; it is not included in the job statistics. - WaitTime *string `json:"waitTime,omitempty"` -} - -// JobScheduleUpdateParameter ... -type JobScheduleUpdateParameter struct { - // Schedule - If you do not specify this element, it is equivalent to passing the default schedule: that is, a single job scheduled to run immediately. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - If you do not specify this element, it takes the default value of an empty list; in effect, any existing metadata is deleted. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobSchedulingError ... -type JobSchedulingError struct { - // Category - Possible values include: 'UserError', 'ServerError' - Category ErrorCategory `json:"category,omitempty"` - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Details *[]NameValuePair `json:"details,omitempty"` -} - -// JobSpecification ... -type JobSpecification struct { - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. This priority is used as the default for all jobs under the job schedule. You can update a job's priority after it has been created using by using the update job API. - Priority *int32 `json:"priority,omitempty"` - // DisplayName - The name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` - // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic job termination without a Job Manager, you should initially set onAllTasksComplete to noAction and update the job properties to set onAllTasksComplete to terminateJob once you have finished adding tasks. The default is noAction. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // OnTaskFailure - The default is noAction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction' - OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"` - Constraints *JobConstraints `json:"constraints,omitempty"` - // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job using the Task API. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job. - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation. A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value. - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobStatistics ... -type JobStatistics struct { - autorest.Response `json:"-"` - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UserCPUTime *string `json:"userCPUTime,omitempty"` - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If a task was retried, this includes the wall clock time of all the task retries. - WallClockTime *string `json:"wallClockTime,omitempty"` - ReadIOps *int64 `json:"readIOps,omitempty"` - WriteIOps *int64 `json:"writeIOps,omitempty"` - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - // NumSucceededTasks - A task completes successfully if it returns exit code 0. - NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"` - // NumFailedTasks - A task fails if it exhausts its maximum retry count without returning exit code 0. - NumFailedTasks *int64 `json:"numFailedTasks,omitempty"` - NumTaskRetries *int64 `json:"numTaskRetries,omitempty"` - // WaitTime - The wait time for a task is defined as the elapsed time between the creation of the task and the start of task execution. (If the task is retried due to failures, the wait time is the time to the most recent task execution.) This value is only reported in the account lifetime statistics; it is not included in the job statistics. - WaitTime *string `json:"waitTime,omitempty"` -} - -// JobTerminateParameter ... -type JobTerminateParameter struct { - TerminateReason *string `json:"terminateReason,omitempty"` -} - -// JobUpdateParameter ... -type JobUpdateParameter struct { - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, it is set to the default value 0. - Priority *int32 `json:"priority,omitempty"` - // Constraints - If omitted, the constraints are cleared. - Constraints *JobConstraints `json:"constraints,omitempty"` - // PoolInfo - You may change the pool for a job only when the job is disabled. The Update Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - If omitted, it takes the default value of an empty list; in effect, any existing metadata is deleted. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - // OnAllTasksComplete - If omitted, the completion behavior is set to noAction. If the current value is terminateJob, this is an error because a job's completion behavior may not be changed from terminateJob to noAction. You may not change the value from terminatejob to noaction - that is, once you have engaged automatic job termination, you cannot turn it off again. If you try to do this, the request fails and Batch returns status code 400 (Bad Request) and an 'invalid property value' error response. If you do not specify this element in a PUT request, it is equivalent to passing noaction. This is an error if the current value is terminatejob. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` -} - -// LinuxUserConfiguration ... -type LinuxUserConfiguration struct { - // UID - The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the uid. - UID *int32 `json:"uid,omitempty"` - // Gid - The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the gid. - Gid *int32 `json:"gid,omitempty"` - // SSHPrivateKey - The private key must not be password protected. The private key is used to automatically configure asymmetric-key based authentication for SSH between nodes in a Linux pool when the pool's enableInterNodeCommunication property is true (it is ignored if enableInterNodeCommunication is false). It does this by placing the key pair into the user's .ssh directory. If not specified, password-less SSH is not configured between nodes (no modification of the user's .ssh directory is done). - SSHPrivateKey *string `json:"sshPrivateKey,omitempty"` -} - -// MetadataItem the Batch service does not assign any meaning to this metadata; it is solely for the use of user -// code. -type MetadataItem struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -// MultiInstanceSettings multi-instance tasks are commonly used to support MPI tasks. -type MultiInstanceSettings struct { - NumberOfInstances *int32 `json:"numberOfInstances,omitempty"` - // CoordinationCommandLine - A typical coordination command line launches a background service and verifies that the service is ready to process inter-node messages. - CoordinationCommandLine *string `json:"coordinationCommandLine,omitempty"` - // CommonResourceFiles - The difference between common resource files and task resource files is that common resource files are downloaded for all subtasks including the primary, whereas task resource files are downloaded only for the primary. Also note that these resource files are not downloaded to the task working directory, but instead are downloaded to the task root directory (one directory above the working directory). - CommonResourceFiles *[]ResourceFile `json:"commonResourceFiles,omitempty"` -} - -// NameValuePair ... -type NameValuePair struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -// NetworkConfiguration the network configuration for a pool. -type NetworkConfiguration struct { - // SubnetID - The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. For pools created via virtualMachineConfiguration the Batch account must have poolAllocationMode userSubscription in order to use a VNet. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For pools created with a virtual machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. For pools created with a cloud service configuration, enable ports 10100, 20100, and 30100. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration - SubnetID *string `json:"subnetId,omitempty"` - // EndpointConfiguration - Pool endpoint configuration is only supported on pools with the virtualMachineConfiguration property. - EndpointConfiguration *PoolEndpointConfiguration `json:"endpointConfiguration,omitempty"` -} - -// NetworkSecurityGroupRule ... -type NetworkSecurityGroupRule struct { - // Priority - Priorities within a pool must be unique and are evaluated in order of priority. The lower the number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed priorities are 150 to 3500. If any reserved or duplicate values are provided the request fails with HTTP status code 400. - Priority *int32 `json:"priority,omitempty"` - // Access - Possible values include: 'Allow', 'Deny' - Access NetworkSecurityGroupRuleAccess `json:"access,omitempty"` - // SourceAddressPrefix - Valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400. - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` -} - -// NodeAgentSku the Batch node agent is a program that runs on each node in the pool, and provides the -// command-and-control interface between the node and the Batch service. There are different implementations of the -// node agent, known as SKUs, for different operating systems. -type NodeAgentSku struct { - ID *string `json:"id,omitempty"` - // VerifiedImageReferences - This collection is not exhaustive (the node agent may be compatible with other images). - VerifiedImageReferences *[]ImageReference `json:"verifiedImageReferences,omitempty"` - // OsType - Possible values include: 'Linux', 'Windows' - OsType OSType `json:"osType,omitempty"` -} - -// NodeDisableSchedulingParameter ... -type NodeDisableSchedulingParameter struct { - // NodeDisableSchedulingOption - Values are: - // requeue - Terminate running task processes and requeue the tasks. The tasks may run again on other compute nodes, or when task scheduling is re-enabled on this node. Enter offline state as soon as tasks have been terminated. - // terminate - Terminate running tasks. The tasks will not run again. Enter offline state as soon as tasks have been terminated. - // taskcompletion - Allow currently running tasks to complete. Schedule no new tasks while waiting. Enter offline state when all tasks have completed. - // The default value is requeue. Possible values include: 'DisableComputeNodeSchedulingOptionRequeue', 'DisableComputeNodeSchedulingOptionTerminate', 'DisableComputeNodeSchedulingOptionTaskCompletion' - NodeDisableSchedulingOption DisableComputeNodeSchedulingOption `json:"nodeDisableSchedulingOption,omitempty"` -} - -// NodeFile ... -type NodeFile struct { - Name *string `json:"name,omitempty"` - URL *string `json:"url,omitempty"` - IsDirectory *bool `json:"isDirectory,omitempty"` - Properties *FileProperties `json:"properties,omitempty"` -} - -// NodeFileListResult ... -type NodeFileListResult struct { - autorest.Response `json:"-"` - Value *[]NodeFile `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// NodeFileListResultIterator provides access to a complete listing of NodeFile values. -type NodeFileListResultIterator struct { - i int - page NodeFileListResultPage -} - -// Next 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 *NodeFileListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter NodeFileListResultIterator) 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 NodeFileListResultIterator) Response() NodeFileListResult { - 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 NodeFileListResultIterator) Value() NodeFile { - if !iter.page.NotDone() { - return NodeFile{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (nflr NodeFileListResult) IsEmpty() bool { - return nflr.Value == nil || len(*nflr.Value) == 0 -} - -// nodeFileListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (nflr NodeFileListResult) nodeFileListResultPreparer() (*http.Request, error) { - if nflr.OdataNextLink == nil || len(to.String(nflr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(nflr.OdataNextLink))) -} - -// NodeFileListResultPage contains a page of NodeFile values. -type NodeFileListResultPage struct { - fn func(NodeFileListResult) (NodeFileListResult, error) - nflr NodeFileListResult -} - -// 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. -func (page *NodeFileListResultPage) Next() error { - next, err := page.fn(page.nflr) - if err != nil { - return err - } - page.nflr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page NodeFileListResultPage) NotDone() bool { - return !page.nflr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page NodeFileListResultPage) Response() NodeFileListResult { - return page.nflr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page NodeFileListResultPage) Values() []NodeFile { - if page.nflr.IsEmpty() { - return nil - } - return *page.nflr.Value -} - -// NodeRebootParameter ... -type NodeRebootParameter struct { - // NodeRebootOption - Values are: - // requeue - Terminate running task processes and requeue the tasks. The tasks will run again when a node is available. Restart the node as soon as tasks have been terminated. - // terminate - Terminate running tasks. The tasks will not run again. Restart the node as soon as tasks have been terminated. - // taskcompletion - Allow currently running tasks to complete. Schedule no new tasks while waiting. Restart the node when all tasks have completed. - // retaineddata - Allow currently running tasks to complete, then wait for all task data retention periods to expire. Schedule no new tasks while waiting. Restart the node when all task retention periods have expired. - // The default value is requeue. Possible values include: 'ComputeNodeRebootOptionRequeue', 'ComputeNodeRebootOptionTerminate', 'ComputeNodeRebootOptionTaskCompletion', 'ComputeNodeRebootOptionRetainedData' - NodeRebootOption ComputeNodeRebootOption `json:"nodeRebootOption,omitempty"` -} - -// NodeReimageParameter ... -type NodeReimageParameter struct { - // NodeReimageOption - Values are: - // requeue - Terminate running task processes and requeue the tasks. The tasks will run again when a node is available. Reimage the node as soon as tasks have been terminated. - // terminate - Terminate running tasks. The tasks will not run again. Reimage the node as soon as tasks have been terminated. - // taskcompletion - Allow currently running tasks to complete. Schedule no new tasks while waiting. Reimage the node when all tasks have completed. - // retaineddata - Allow currently running tasks to complete, then wait for all task data retention periods to expire. Schedule no new tasks while waiting. Reimage the node when all task retention periods have expired. - // The default value is requeue. Possible values include: 'ComputeNodeReimageOptionRequeue', 'ComputeNodeReimageOptionTerminate', 'ComputeNodeReimageOptionTaskCompletion', 'ComputeNodeReimageOptionRetainedData' - NodeReimageOption ComputeNodeReimageOption `json:"nodeReimageOption,omitempty"` -} - -// NodeRemoveParameter ... -type NodeRemoveParameter struct { - NodeList *[]string `json:"nodeList,omitempty"` - // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData' - NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"` -} - -// NodeUpdateUserParameter ... -type NodeUpdateUserParameter struct { - // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is removed. - Password *string `json:"password,omitempty"` - // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If omitted, any existing SSH public key is removed. - SSHPublicKey *string `json:"sshPublicKey,omitempty"` -} - -// OSDisk ... -type OSDisk struct { - // ImageUris - All the VHDs must be identical and must reside in an Azure Storage account within the same subscription and same region as the Batch account. For best performance, it is recommended that each VHD resides in a separate Azure Storage account. Each VHD can serve upto 20 Windows compute nodes or 40 Linux compute nodes. You must supply enough VHD URIs to satisfy the 'targetDedicated' property of the pool. If you do not supply enough VHD URIs, the pool will partially allocate compute nodes, and a resize error will occur. - ImageUris *[]string `json:"imageUris,omitempty"` - // Caching - Values are: - // none - The caching mode for the disk is not enabled. - // readOnly - The caching mode for the disk is read only. - // readWrite - The caching mode for the disk is read and write. - // The default value for caching is none. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - Caching CachingType `json:"caching,omitempty"` -} - -// OutputFile ... -type OutputFile struct { - // FilePattern - Both relative and absolute paths are supported. Relative paths are relative to the task working directory. The following wildcards are supported: * matches 0 or more characters (for example pattern abc* would match abc or abcdef), ** matches any directory, ? matches any single character, [abc] matches one character in the brackets, and [a-c] matches one character in the range. Brackets can include a negation to match any character not specified (for example [!abc] matches any character but a, b, or c). If a file name starts with "." it is ignored by default but may be matched by specifying it explicitly (for example *.gif will not match .a.gif, but .*.gif will). A simple example: **\*.txt matches any file that does not start in '.' and ends with .txt in the task working directory or any subdirectory. If the filename contains a wildcard character it can be escaped using brackets (for example abc[*] would match a file named abc*). Note that both \ and / are treated as directory separators on Windows, but only / is on Linux. Environment variables (%var% on Windows or $var on Linux) are expanded prior to the pattern being applied. - FilePattern *string `json:"filePattern,omitempty"` - Destination *OutputFileDestination `json:"destination,omitempty"` - UploadOptions *OutputFileUploadOptions `json:"uploadOptions,omitempty"` -} - -// OutputFileBlobContainerDestination ... -type OutputFileBlobContainerDestination struct { - // Path - If filePattern refers to a specific file (i.e. contains no wildcards), then path is the name of the blob to which to upload that file. If filePattern contains one or more wildcards (and therefore may match multiple files), then path is the name of the blob virtual directory (which is prepended to each blob name) to which to upload the file(s). If omitted, file(s) are uploaded to the root of the container with a blob name matching their file name. - Path *string `json:"path,omitempty"` - // ContainerURL - The URL must include a Shared Access Signature (SAS) granting write permissions to the container. - ContainerURL *string `json:"containerUrl,omitempty"` -} - -// OutputFileDestination ... -type OutputFileDestination struct { - Container *OutputFileBlobContainerDestination `json:"container,omitempty"` -} - -// OutputFileUploadOptions ... -type OutputFileUploadOptions struct { - // UploadCondition - The default is taskCompletion. Possible values include: 'OutputFileUploadConditionTaskSuccess', 'OutputFileUploadConditionTaskFailure', 'OutputFileUploadConditionTaskCompletion' - UploadCondition OutputFileUploadCondition `json:"uploadCondition,omitempty"` -} - -// PoolAddParameter ... -type PoolAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two pool IDs within an account that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // TargetDedicatedNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. - TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"` - // TargetLowPriorityNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. - TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"` - // EnableAutoScale - If false, at least one of targetDedicateNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the pool automatically resizes according to the formula. The default value is false. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale compute nodes in an Azure Batch pool' (https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/). - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` - // StartTask - The task runs when the node is added to the pool or when the node is restarted. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // ApplicationLicenses - The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail. - ApplicationLicenses *[]string `json:"applicationLicenses,omitempty"` - // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting). - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - UserAccounts *[]UserAccount `json:"userAccounts,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolEnableAutoScaleParameter ... -type PoolEnableAutoScaleParameter struct { - // AutoScaleFormula - The formula is checked for validity before it is applied to the pool. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` -} - -// PoolEndpointConfiguration ... -type PoolEndpointConfiguration struct { - // InboundNATPools - The maximum number of inbound NAT pools per Batch pool is 5. If the maximum number of inbound NAT pools is exceeded the request fails with HTTP status code 400. - InboundNATPools *[]InboundNATPool `json:"inboundNATPools,omitempty"` -} - -// PoolEvaluateAutoScaleParameter ... -type PoolEvaluateAutoScaleParameter struct { - // AutoScaleFormula - The formula is validated and its results calculated, but it is not applied to the pool. To apply the formula to the pool, 'Enable automatic scaling on a pool'. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` -} - -// PoolInformation ... -type PoolInformation struct { - // PoolID - You must ensure that the pool referenced by this property exists. If the pool does not exist at the time the Batch service tries to schedule a job, no tasks for the job will run until you create a pool with that id. Note that the Batch service will not reject the job request; it will simply not run tasks until the pool exists. You must specify either the pool ID or the auto pool specification, but not both. - PoolID *string `json:"poolId,omitempty"` - // AutoPoolSpecification - If auto pool creation fails, the Batch service moves the job to a completed state, and the pool creation error is set in the job's scheduling error property. The Batch service manages the lifetime (both creation and, unless keepAlive is specified, deletion) of the auto pool. Any user actions that affect the lifetime of the auto pool while the job is active will result in unexpected behavior. You must specify either the pool ID or the auto pool specification, but not both. - AutoPoolSpecification *AutoPoolSpecification `json:"autoPoolSpecification,omitempty"` -} - -// PoolListUsageMetricsResult ... -type PoolListUsageMetricsResult struct { - autorest.Response `json:"-"` - Value *[]PoolUsageMetrics `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// PoolListUsageMetricsResultIterator provides access to a complete listing of PoolUsageMetrics values. -type PoolListUsageMetricsResultIterator struct { - i int - page PoolListUsageMetricsResultPage -} - -// Next 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 *PoolListUsageMetricsResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PoolListUsageMetricsResultIterator) 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 PoolListUsageMetricsResultIterator) Response() PoolListUsageMetricsResult { - 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 PoolListUsageMetricsResultIterator) Value() PoolUsageMetrics { - if !iter.page.NotDone() { - return PoolUsageMetrics{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (plumr PoolListUsageMetricsResult) IsEmpty() bool { - return plumr.Value == nil || len(*plumr.Value) == 0 -} - -// poolListUsageMetricsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (plumr PoolListUsageMetricsResult) poolListUsageMetricsResultPreparer() (*http.Request, error) { - if plumr.OdataNextLink == nil || len(to.String(plumr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(plumr.OdataNextLink))) -} - -// PoolListUsageMetricsResultPage contains a page of PoolUsageMetrics values. -type PoolListUsageMetricsResultPage struct { - fn func(PoolListUsageMetricsResult) (PoolListUsageMetricsResult, error) - plumr PoolListUsageMetricsResult -} - -// 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. -func (page *PoolListUsageMetricsResultPage) Next() error { - next, err := page.fn(page.plumr) - if err != nil { - return err - } - page.plumr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PoolListUsageMetricsResultPage) NotDone() bool { - return !page.plumr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PoolListUsageMetricsResultPage) Response() PoolListUsageMetricsResult { - return page.plumr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PoolListUsageMetricsResultPage) Values() []PoolUsageMetrics { - if page.plumr.IsEmpty() { - return nil - } - return *page.plumr.Value -} - -// PoolPatchParameter ... -type PoolPatchParameter struct { - // StartTask - If this element is present, it overwrites any existing start task. If omitted, any existing start task is left unchanged. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - If this element is present, it replaces any existing certificate references configured on the pool. If omitted, any existing certificate references are left unchanged. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. If this element is present, it replaces any existing application package references. If you specify an empty collection, then all application package references are removed from the pool. If omitted, any existing application package references are left unchanged. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - If this element is present, it replaces any existing metadata configured on the pool. If you specify an empty collection, any metadata is removed from the pool. If omitted, any existing metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolResizeParameter ... -type PoolResizeParameter struct { - TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"` - TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"` - // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData' - NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"` -} - -// PoolSpecification ... -type PoolSpecification struct { - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - This property must be specified if the pool needs to be created with Azure PaaS VMs. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - This property must be specified if the pool needs to be created with Azure IaaS VMs. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting). - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // TargetDedicatedNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. - TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"` - // TargetLowPriorityNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. - TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"` - // EnableAutoScale - If false, at least one of targetDedicateNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula element is required. The pool automatically resizes according to the formula. The default value is false. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // ApplicationLicenses - The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail. - ApplicationLicenses *[]string `json:"applicationLicenses,omitempty"` - UserAccounts *[]UserAccount `json:"userAccounts,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolStatistics ... -type PoolStatistics struct { - autorest.Response `json:"-"` - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UsageStats *UsageStatistics `json:"usageStats,omitempty"` - ResourceStats *ResourceStatistics `json:"resourceStats,omitempty"` -} - -// PoolUpdatePropertiesParameter ... -type PoolUpdatePropertiesParameter struct { - // StartTask - If this element is present, it overwrites any existing start task. If omitted, any existing start task is removed from the pool. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - This list replaces any existing certificate references configured on the pool. If you specify an empty collection, any existing certificate references are removed from the pool. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - The list replaces any existing application package references on the pool. Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. If omitted, or if you specify an empty collection, any existing application packages references are removed from the pool. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - This list replaces any existing metadata configured on the pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the pool. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolUpgradeOSParameter ... -type PoolUpgradeOSParameter struct { - TargetOSVersion *string `json:"targetOSVersion,omitempty"` -} - -// PoolUsageMetrics ... -type PoolUsageMetrics struct { - PoolID *string `json:"poolId,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - EndTime *date.Time `json:"endTime,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, STANDARD_A1_V2 and STANDARD_A2_V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - TotalCoreHours *float64 `json:"totalCoreHours,omitempty"` - DataIngressGiB *float64 `json:"dataIngressGiB,omitempty"` - DataEgressGiB *float64 `json:"dataEgressGiB,omitempty"` -} - -// ReadCloser ... -type ReadCloser struct { - autorest.Response `json:"-"` - Value *io.ReadCloser `json:"value,omitempty"` -} - -// RecentJob ... -type RecentJob struct { - ID *string `json:"id,omitempty"` - URL *string `json:"url,omitempty"` -} - -// ResizeError ... -type ResizeError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Values *[]NameValuePair `json:"values,omitempty"` -} - -// ResourceFile ... -type ResourceFile struct { - // BlobSource - This URL must be readable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, or set the ACL for the blob or its container to allow public access. - BlobSource *string `json:"blobSource,omitempty"` - FilePath *string `json:"filePath,omitempty"` - // FileMode - This property applies only to files being downloaded to Linux compute nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows node. If this property is not specified for a Linux node, then a default value of 0770 is applied to the file. - FileMode *string `json:"fileMode,omitempty"` -} - -// ResourceStatistics ... -type ResourceStatistics struct { - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - AvgCPUPercentage *float64 `json:"avgCPUPercentage,omitempty"` - AvgMemoryGiB *float64 `json:"avgMemoryGiB,omitempty"` - PeakMemoryGiB *float64 `json:"peakMemoryGiB,omitempty"` - AvgDiskGiB *float64 `json:"avgDiskGiB,omitempty"` - PeakDiskGiB *float64 `json:"peakDiskGiB,omitempty"` - DiskReadIOps *int64 `json:"diskReadIOps,omitempty"` - DiskWriteIOps *int64 `json:"diskWriteIOps,omitempty"` - DiskReadGiB *float64 `json:"diskReadGiB,omitempty"` - DiskWriteGiB *float64 `json:"diskWriteGiB,omitempty"` - NetworkReadGiB *float64 `json:"networkReadGiB,omitempty"` - NetworkWriteGiB *float64 `json:"networkWriteGiB,omitempty"` -} - -// Schedule ... -type Schedule struct { - // DoNotRunUntil - If you do not specify a doNotRunUntil time, the schedule becomes ready to create jobs immediately. - DoNotRunUntil *date.Time `json:"doNotRunUntil,omitempty"` - // DoNotRunAfter - If you do not specify a doNotRunAfter time, and you are creating a recurring job schedule, the job schedule will remain active until you explicitly terminate it. - DoNotRunAfter *date.Time `json:"doNotRunAfter,omitempty"` - // StartWindow - If a job is not created within the startWindow interval, then the 'opportunity' is lost; no job will be created until the next recurrence of the schedule. If the schedule is recurring, and the startWindow is longer than the recurrence interval, then this is equivalent to an infinite startWindow, because the job that is 'due' in one recurrenceInterval is not carried forward into the next recurrence interval. The default is infinite. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - StartWindow *string `json:"startWindow,omitempty"` - // RecurrenceInterval - Because a job schedule can have at most one active job under it at any given time, if it is time to create a new job under a job schedule, but the previous job is still running, the Batch service will not create the new job until the previous job finishes. If the previous job does not finish within the startWindow period of the new recurrenceInterval, then no new job will be scheduled for that interval. For recurring jobs, you should normally specify a jobManagerTask in the jobSpecification. If you do not use jobManagerTask, you will need an external process to monitor when jobs are created, add tasks to the jobs and terminate the jobs ready for the next recurrence. The default is that the schedule does not recur: one job is created, within the startWindow after the doNotRunUntil time, and the schedule is complete as soon as that job finishes. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - RecurrenceInterval *string `json:"recurrenceInterval,omitempty"` -} - -// StartTask ... -type StartTask struct { - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ResourceFiles - Files listed under this element are located in the task's working directory. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - // MaxTaskRetryCount - The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` - // WaitForSuccess - If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and failure info details. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is false. - WaitForSuccess *bool `json:"waitForSuccess,omitempty"` -} - -// StartTaskInformation ... -type StartTaskInformation struct { - // State - Values are: - // running - The start task is currently running. - // completed - The start task has exited with exit code 0, or the start task has failed and the retry limit has reached, or the start task process did not run due to task preparation errors (such as resource file download failures). Possible values include: 'StartTaskStateRunning', 'StartTaskStateCompleted' - State StartTaskState `json:"state,omitempty"` - // StartTime - This value is reset every time the task is restarted or retried (that is, this is the most recent time at which the start task started running). - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This is the end time of the most recent run of the start task, if that run has completed (even if that run failed and a retry is pending). This element is not present if the start task is currently running. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - This property is set only if the start task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the start task (due to timeout, or user termination via the API) you may see an operating system-defined exit code. - ExitCode *int32 `json:"exitCode,omitempty"` - // FailureInfo - This property is set only if the task is in the completed state and encountered a failure. - FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"` - // RetryCount - Task application failures (non-zero exit code) are retried, pre-processing errors (the task could not be run) and file upload errors are not retried. The Batch service will retry the task up to the limit specified by the constraints. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` - // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure' - Result TaskExecutionResult `json:"result,omitempty"` -} - -// SubtaskInformation ... -type SubtaskInformation struct { - ID *int32 `json:"id,omitempty"` - NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the subtask is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - This property is set only if the subtask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the subtask (due to timeout, or user termination via the API) you may see an operating system-defined exit code. - ExitCode *int32 `json:"exitCode,omitempty"` - // FailureInfo - This property is set only if the task is in the completed state and encountered a failure. - FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"` - // State - Possible values include: 'SubtaskStatePreparing', 'SubtaskStateRunning', 'SubtaskStateCompleted' - State SubtaskState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the subtask is in its initial running state. Possible values include: 'SubtaskStatePreparing', 'SubtaskStateRunning', 'SubtaskStateCompleted' - PreviousState SubtaskState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the subtask is in its initial running state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure' - Result TaskExecutionResult `json:"result,omitempty"` -} - -// TaskAddCollectionParameter ... -type TaskAddCollectionParameter struct { - // Value - The total serialized size of this collection must be less than 4MB. If it is greater than 4MB (for example if each task has 100's of resource files or environment variables), the request will fail with code 'RequestBodyTooLarge' and should be retried again with fewer tasks. - Value *[]TaskAddParameter `json:"value,omitempty"` -} - -// TaskAddCollectionResult ... -type TaskAddCollectionResult struct { - autorest.Response `json:"-"` - Value *[]TaskAddResult `json:"value,omitempty"` -} - -// TaskAddParameter ... -type TaskAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a job that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ExitConditions - How the Batch service should respond when the task completes. - ExitConditions *ExitConditions `json:"exitConditions,omitempty"` - // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // OutputFiles - For multi-instance tasks, the files will only be uploaded from the compute node on which the primary task is executed. - OutputFiles *[]OutputFile `json:"outputFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"` - // Constraints - If you do not specify constraints, the maxTaskRetryCount is the maxTaskRetryCount specified for the job, and the maxWallClockTime and retentionTime are infinite. - Constraints *TaskConstraints `json:"constraints,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"` - // DependsOn - This task will not be scheduled until all tasks that it depends on have completed successfully. If any of those tasks fail and exhaust their retry counts, this task will never be scheduled. If the job does not have usesTaskDependencies set to true, and this element is present, the request fails with error code TaskDependenciesNotSpecifiedOnJob. - DependsOn *TaskDependencies `json:"dependsOn,omitempty"` - // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task working directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job. - AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"` -} - -// TaskAddResult ... -type TaskAddResult struct { - // Status - Values are: - // success - Task was added successfully. - // clienterror - Task failed to add due to a client error and should not be retried without modifying the request as appropriate. - // servererror - Task failed to add due to a server error and can be retried without modification. Possible values include: 'TaskAddStatusSuccess', 'TaskAddStatusClientError', 'TaskAddStatusServerError' - Status TaskAddStatus `json:"status,omitempty"` - TaskID *string `json:"taskId,omitempty"` - // ETag - You can use this to detect whether the task has changed between requests. In particular, you can be pass the ETag with an Update Task request to specify that your changes should take effect only if nobody else has modified the job in the meantime. - ETag *string `json:"eTag,omitempty"` - LastModified *date.Time `json:"lastModified,omitempty"` - Location *string `json:"location,omitempty"` - Error *Error `json:"error,omitempty"` -} - -// TaskConstraints ... -type TaskConstraints struct { - // MaxWallClockTime - If this is not specified, there is no time limit on how long the task may run. - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged. - RetentionTime *string `json:"retentionTime,omitempty"` - // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` -} - -// TaskCounts ... -type TaskCounts struct { - autorest.Response `json:"-"` - Active *int32 `json:"active,omitempty"` - Running *int32 `json:"running,omitempty"` - Completed *int32 `json:"completed,omitempty"` - Succeeded *int32 `json:"succeeded,omitempty"` - Failed *int32 `json:"failed,omitempty"` - // ValidationStatus - If the validationStatus is unvalidated, then the Batch service has not been able to check state counts against the task states as reported in the List Tasks API. The validationStatus may be unvalidated if the job contains more than 200,000 tasks. Possible values include: 'Validated', 'Unvalidated' - ValidationStatus TaskCountValidationStatus `json:"validationStatus,omitempty"` -} - -// TaskDependencies ... -type TaskDependencies struct { - // TaskIds - The taskIds collection is limited to 64000 characters total (i.e. the combined length of all task IDs). If the taskIds collection exceeds the maximum length, the Add Task request fails with error code TaskDependencyListTooLong. In this case consider using task ID ranges instead. - TaskIds *[]string `json:"taskIds,omitempty"` - TaskIDRanges *[]TaskIDRange `json:"taskIdRanges,omitempty"` -} - -// TaskExecutionInformation ... -type TaskExecutionInformation struct { - // StartTime - 'Running' corresponds to the running state, so if the task specifies resource files or application packages, then the start time reflects the time at which the task started downloading or deploying these. If the task has been restarted or retried, this is the most recent time at which the task started running. This property is present only for tasks that are in the running or completed state. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - This property is set only if the task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the task (due to timeout, or user termination via the API) you may see an operating system-defined exit code. - ExitCode *int32 `json:"exitCode,omitempty"` - // FailureInfo - This property is set only if the task is in the completed state and encountered a failure. - FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"` - // RetryCount - Task application failures (non-zero exit code) are retried, pre-processing errors (the task could not be run) and file upload errors are not retried. The Batch service will retry the task up to the limit specified by the constraints. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` - // RequeueCount - When the user removes nodes from a pool (by resizing/shrinking the pool) or when the job is being disabled, the user can specify that running tasks on the nodes be requeued for execution. This count tracks how many times the task has been requeued for these reasons. - RequeueCount *int32 `json:"requeueCount,omitempty"` - // LastRequeueTime - This property is set only if the requeueCount is nonzero. - LastRequeueTime *date.Time `json:"lastRequeueTime,omitempty"` - // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure' - Result TaskExecutionResult `json:"result,omitempty"` -} - -// TaskFailureInformation ... -type TaskFailureInformation struct { - // Category - Possible values include: 'UserError', 'ServerError' - Category ErrorCategory `json:"category,omitempty"` - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Details *[]NameValuePair `json:"details,omitempty"` -} - -// TaskIDRange the start and end of the range are inclusive. For example, if a range has start 9 and end 12, then -// it represents tasks '9', '10', '11' and '12'. -type TaskIDRange struct { - Start *int32 `json:"start,omitempty"` - End *int32 `json:"end,omitempty"` -} - -// TaskInformation ... -type TaskInformation struct { - TaskURL *string `json:"taskUrl,omitempty"` - JobID *string `json:"jobId,omitempty"` - TaskID *string `json:"taskId,omitempty"` - SubtaskID *int32 `json:"subtaskId,omitempty"` - // TaskState - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - TaskState TaskState `json:"taskState,omitempty"` - ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"` -} - -// TaskSchedulingPolicy ... -type TaskSchedulingPolicy struct { - // NodeFillType - Possible values include: 'Spread', 'Pack' - NodeFillType ComputeNodeFillType `json:"nodeFillType,omitempty"` -} - -// TaskStatistics ... -type TaskStatistics struct { - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UserCPUTime *string `json:"userCPUTime,omitempty"` - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If the task was retried, this includes the wall clock time of all the task retries. - WallClockTime *string `json:"wallClockTime,omitempty"` - ReadIOps *int64 `json:"readIOps,omitempty"` - WriteIOps *int64 `json:"writeIOps,omitempty"` - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - WaitTime *string `json:"waitTime,omitempty"` -} - -// TaskUpdateParameter ... -type TaskUpdateParameter struct { - // Constraints - If omitted, the task is given the default constraints. For multi-instance tasks, updating the retention time applies only to the primary task and not subtasks. - Constraints *TaskConstraints `json:"constraints,omitempty"` -} - -// UsageStatistics ... -type UsageStatistics struct { - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - DedicatedCoreTime *string `json:"dedicatedCoreTime,omitempty"` -} - -// UserAccount ... -type UserAccount struct { - Name *string `json:"name,omitempty"` - Password *string `json:"password,omitempty"` - // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin' - ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"` - // LinuxUserConfiguration - This property is ignored if specified on a Windows pool. If not specified, the user is created with the default options. - LinuxUserConfiguration *LinuxUserConfiguration `json:"linuxUserConfiguration,omitempty"` -} - -// UserIdentity specify either the userName or autoUser property, but not both. -type UserIdentity struct { - // UserName - The userName and autoUser properties are mutually exclusive; you must specify one but not both. - UserName *string `json:"username,omitempty"` - // AutoUser - The userName and autoUser properties are mutually exclusive; you must specify one but not both. - AutoUser *AutoUserSpecification `json:"autoUser,omitempty"` -} - -// VirtualMachineConfiguration ... -type VirtualMachineConfiguration struct { - // ImageReference - This property and osDisk are mutually exclusive and one of the properties must be specified. - ImageReference *ImageReference `json:"imageReference,omitempty"` - // OsDisk - This property can be specified only if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. This property and imageReference are mutually exclusive and one of the properties must be specified. - OsDisk *OSDisk `json:"osDisk,omitempty"` - // NodeAgentSKUID - The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation. - NodeAgentSKUID *string `json:"nodeAgentSKUId,omitempty"` - // WindowsConfiguration - This property must not be specified if the imageReference or osDisk property specifies a Linux OS image. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` -} - -// WindowsConfiguration ... -type WindowsConfiguration struct { - // EnableAutomaticUpdates - If omitted, the default value is true. - EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` -} diff --git a/services/batch/2017-06-01.5.1/batch/pool.go b/services/batch/2017-06-01.5.1/batch/pool.go deleted file mode 100644 index e24802b02cab..000000000000 --- a/services/batch/2017-06-01.5.1/batch/pool.go +++ /dev/null @@ -1,1884 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// PoolClient is the a client for issuing REST requests to the Azure Batch service. -type PoolClient struct { - BaseClient -} - -// NewPoolClient creates an instance of the PoolClient client. -func NewPoolClient() PoolClient { - return NewPoolClientWithBaseURI(DefaultBaseURI) -} - -// NewPoolClientWithBaseURI creates an instance of the PoolClient client. -func NewPoolClientWithBaseURI(baseURI string) PoolClient { - return PoolClient{NewWithBaseURI(baseURI)} -} - -// Add when naming pools, avoid including sensitive information such as user names or secret project names. This -// information may appear in telemetry logs accessible to Microsoft Support engineers. -// -// pool is the pool to be added. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client PoolClient) Add(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: pool, - Constraints: []validation.Constraint{{Target: "pool.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "pool.NetworkConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, pool, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client PoolClient) AddPreparer(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/pools"), - autorest.WithJSON(pool), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 PoolClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete when you request that a pool be deleted, the following actions occur: the pool state is set to deleting; any -// ongoing resize operation on the pool are stopped; the Batch service starts resizing the pool to zero nodes; any -// tasks running on existing nodes are terminated and requeued (as if a resize pool operation had been requested with -// the default requeue option); finally, the pool is removed from the system. Because running tasks are requeued, the -// user can rerun these tasks by updating their job to target a different pool. The tasks can then run on the new pool. -// If you want to override the requeue behavior, then you should call resize pool explicitly to shrink the pool to zero -// size before deleting the pool. If you call an Update, Patch or Delete API on a pool in the deleting state, it will -// fail with HTTP status code 409 with error code PoolBeingDeleted. -// -// poolID is the ID of the pool to delete. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the -// resource known to the client. The operation will be performed only if the resource's current ETag on the service -// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of -// the resource known to the client. The operation will be performed only if the resource's current ETag on the -// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has not been modified since the specified time. -func (client PoolClient) Delete(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PoolClient) DeletePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 PoolClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) 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 -} - -// DisableAutoScale sends the disable auto scale request. -// -// poolID is the ID of the pool on which to disable automatic scaling. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client PoolClient) DisableAutoScale(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisableAutoScalePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.DisableAutoScaleSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure sending request") - return - } - - result, err = client.DisableAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure responding to request") - } - - return -} - -// DisableAutoScalePreparer prepares the DisableAutoScale request. -func (client PoolClient) DisableAutoScalePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/disableautoscale", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableAutoScaleSender sends the DisableAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) DisableAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableAutoScaleResponder handles the response to the DisableAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) DisableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EnableAutoScale you cannot enable automatic scaling on a pool if a resize operation is in progress on the pool. If -// automatic scaling of the pool is currently disabled, you must specify a valid autoscale formula as part of the -// request. If automatic scaling of the pool is already enabled, you may specify a new autoscale formula and/or a new -// evaluation interval. You cannot call this API for the same pool more than once every 30 seconds. -// -// poolID is the ID of the pool on which to enable automatic scaling. poolEnableAutoScaleParameter is the -// parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. ifMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service exactly matches the -// value specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to -// the client. The operation will be performed only if the resource's current ETag on the service does not match -// the value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the -// resource known to the client. The operation will be performed only if the resource on the service has been -// modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the -// resource known to the client. The operation will be performed only if the resource on the service has not been -// modified since the specified time. -func (client PoolClient) EnableAutoScale(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnableAutoScalePreparer(ctx, poolID, poolEnableAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.EnableAutoScaleSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure sending request") - return - } - - result, err = client.EnableAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure responding to request") - } - - return -} - -// EnableAutoScalePreparer prepares the EnableAutoScale request. -func (client PoolClient) EnableAutoScalePreparer(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/enableautoscale", pathParameters), - autorest.WithJSON(poolEnableAutoScaleParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableAutoScaleSender sends the EnableAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) EnableAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableAutoScaleResponder handles the response to the EnableAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) EnableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EvaluateAutoScale this API is primarily for validating an autoscale formula, as it simply returns the result without -// applying the formula to the pool. The pool must have auto scaling enabled in order to evaluate a formula. -// -// poolID is the ID of the pool on which to evaluate the automatic scaling formula. poolEvaluateAutoScaleParameter -// is the parameters for the request. timeout is the maximum time that the server can spend processing the request, -// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of -// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client PoolClient) EvaluateAutoScale(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AutoScaleRun, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolEvaluateAutoScaleParameter, - Constraints: []validation.Constraint{{Target: "poolEvaluateAutoScaleParameter.AutoScaleFormula", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "EvaluateAutoScale", err.Error()) - } - - req, err := client.EvaluateAutoScalePreparer(ctx, poolID, poolEvaluateAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.EvaluateAutoScaleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure sending request") - return - } - - result, err = client.EvaluateAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure responding to request") - } - - return -} - -// EvaluateAutoScalePreparer prepares the EvaluateAutoScale request. -func (client PoolClient) EvaluateAutoScalePreparer(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/evaluateautoscale", pathParameters), - autorest.WithJSON(poolEvaluateAutoScaleParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EvaluateAutoScaleSender sends the EvaluateAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) EvaluateAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EvaluateAutoScaleResponder handles the response to the EvaluateAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) EvaluateAutoScaleResponder(resp *http.Response) (result AutoScaleRun, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Exists gets basic properties of a pool. -// -// poolID is the ID of the pool to get. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the -// resource known to the client. The operation will be performed only if the resource's current ETag on the service -// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of -// the resource known to the client. The operation will be performed only if the resource's current ETag on the -// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has not been modified since the specified time. -func (client PoolClient) Exists(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ExistsPreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", nil, "Failure preparing request") - return - } - - resp, err := client.ExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure sending request") - return - } - - result, err = client.ExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure responding to request") - } - - return -} - -// ExistsPreparer prepares the Exists request. -func (client PoolClient) ExistsPreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExistsSender sends the Exists request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ExistsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExistsResponder handles the response to the Exists request. The method always -// closes the http.Response Body. -func (client PoolClient) ExistsResponder(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 information about the specified pool. -// -// poolID is the ID of the pool to get. selectParameter is an OData $select clause. expand is an OData $expand -// clause. timeout is the maximum time that the server can spend processing the request, in seconds. The default is -// 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration -// such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server -// should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client PoolClient) Get(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudPool, err error) { - req, err := client.GetPreparer(ctx, poolID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client PoolClient) GetPreparer(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 PoolClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) GetResponder(resp *http.Response) (result CloudPool, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAllLifetimeStatistics statistics are aggregated across all pools that have ever existed in the account, from -// account creation to the last update time of the statistics. -// -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client PoolClient) GetAllLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolStatistics, err error) { - req, err := client.GetAllLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", nil, "Failure preparing request") - return - } - - resp, err := client.GetAllLifetimeStatisticsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", resp, "Failure sending request") - return - } - - result, err = client.GetAllLifetimeStatisticsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", resp, "Failure responding to request") - } - - return -} - -// GetAllLifetimeStatisticsPreparer prepares the GetAllLifetimeStatistics request. -func (client PoolClient) GetAllLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/lifetimepoolstats"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAllLifetimeStatisticsSender sends the GetAllLifetimeStatistics request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) GetAllLifetimeStatisticsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetAllLifetimeStatisticsResponder handles the response to the GetAllLifetimeStatistics request. The method always -// closes the http.Response Body. -func (client PoolClient) GetAllLifetimeStatisticsResponder(resp *http.Response) (result PoolStatistics, 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. -// -// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand -// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 pools can be -// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. -func (client PoolClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure sending request") - return - } - - result.cplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client PoolClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/pools"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 PoolClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) ListResponder(resp *http.Response) (result CloudPoolListResult, 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 PoolClient) listNextResults(lastResults CloudPoolListResult) (result CloudPoolListResult, err error) { - req, err := lastResults.cloudPoolListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "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, "batch.PoolClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PoolClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListUsageMetrics if you do not specify a $filter clause including a poolId, the response includes all pools that -// existed in the account in the time range of the returned aggregation intervals. If you do not specify a $filter -// clause including a startTime or endTime these filters default to the start and end times of the last aggregation -// interval currently available; that is, only the last aggregation interval is returned. -// -// startTime is the earliest time from which to include metrics. This must be at least two and a half hours before -// the current time. If not specified this defaults to the start time of the last aggregation interval currently -// available. endTime is the latest time from which to include metrics. This must be at least two hours before the -// current time. If not specified this defaults to the end time of the last aggregation interval currently -// available. filter is an OData $filter clause. If this is not specified the response includes all pools that -// existed in the account in the time range of the returned aggregation intervals. maxResults is the maximum number -// of items to return in the response. A maximum of 1000 results will be returned. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client PoolClient) ListUsageMetrics(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListUsageMetricsResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "ListUsageMetrics", err.Error()) - } - - result.fn = client.listUsageMetricsNextResults - req, err := client.ListUsageMetricsPreparer(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListUsageMetricsSender(req) - if err != nil { - result.plumr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", resp, "Failure sending request") - return - } - - result.plumr, err = client.ListUsageMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", resp, "Failure responding to request") - } - - return -} - -// ListUsageMetricsPreparer prepares the ListUsageMetrics request. -func (client PoolClient) ListUsageMetricsPreparer(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if startTime != nil { - queryParameters["starttime"] = autorest.Encode("query", *startTime) - } - if endTime != nil { - queryParameters["endtime"] = autorest.Encode("query", *endTime) - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/poolusagemetrics"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListUsageMetricsSender sends the ListUsageMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ListUsageMetricsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListUsageMetricsResponder handles the response to the ListUsageMetrics request. The method always -// closes the http.Response Body. -func (client PoolClient) ListUsageMetricsResponder(resp *http.Response) (result PoolListUsageMetricsResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listUsageMetricsNextResults retrieves the next set of results, if any. -func (client PoolClient) listUsageMetricsNextResults(lastResults PoolListUsageMetricsResult) (result PoolListUsageMetricsResult, err error) { - req, err := lastResults.poolListUsageMetricsResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListUsageMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListUsageMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListUsageMetricsComplete enumerates all values, automatically crossing page boundaries as required. -func (client PoolClient) ListUsageMetricsComplete(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListUsageMetricsResultIterator, err error) { - result.page, err = client.ListUsageMetrics(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch this only replaces the pool properties specified in the request. For example, if the pool has a start task -// associated with it, and a request does not specify a start task element, then the pool keeps the existing start -// task. -// -// poolID is the ID of the pool to update. poolPatchParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client PoolClient) Patch(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, poolID, poolPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client PoolClient) PatchPreparer(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithJSON(poolPatchParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client PoolClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// RemoveNodes this operation can only run when the allocation state of the pool is steady. When this operation runs, -// the allocation state changes from steady to resizing. -// -// poolID is the ID of the pool from which you want to remove nodes. nodeRemoveParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client PoolClient) RemoveNodes(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: nodeRemoveParameter, - Constraints: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "RemoveNodes", err.Error()) - } - - req, err := client.RemoveNodesPreparer(ctx, poolID, nodeRemoveParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", nil, "Failure preparing request") - return - } - - resp, err := client.RemoveNodesSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure sending request") - return - } - - result, err = client.RemoveNodesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure responding to request") - } - - return -} - -// RemoveNodesPreparer prepares the RemoveNodes request. -func (client PoolClient) RemoveNodesPreparer(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/removenodes", pathParameters), - autorest.WithJSON(nodeRemoveParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RemoveNodesSender sends the RemoveNodes request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) RemoveNodesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// RemoveNodesResponder handles the response to the RemoveNodes request. The method always -// closes the http.Response Body. -func (client PoolClient) RemoveNodesResponder(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 -} - -// Resize you can only resize a pool when its allocation state is steady. If the pool is already resizing, the request -// fails with status code 409. When you resize a pool, the pool's allocation state changes from steady to resizing. You -// cannot resize pools which are configured for automatic scaling. If you try to do this, the Batch service returns an -// error 409. If you resize a pool downwards, the Batch service chooses which nodes to remove. To remove specific -// nodes, use the pool remove nodes API instead. -// -// poolID is the ID of the pool to resize. poolResizeParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client PoolClient) Resize(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ResizePreparer(ctx, poolID, poolResizeParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", nil, "Failure preparing request") - return - } - - resp, err := client.ResizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure sending request") - return - } - - result, err = client.ResizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure responding to request") - } - - return -} - -// ResizePreparer prepares the Resize request. -func (client PoolClient) ResizePreparer(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/resize", pathParameters), - autorest.WithJSON(poolResizeParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResizeSender sends the Resize request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ResizeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ResizeResponder handles the response to the Resize request. The method always -// closes the http.Response Body. -func (client PoolClient) ResizeResponder(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 -} - -// StopResize this does not restore the pool to its previous state before the resize operation: it only stops any -// further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the -// number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state -// changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this -// API can also be used to halt the initial sizing of the pool when it is created. -// -// poolID is the ID of the pool whose resizing you want to stop. timeout is the maximum time that the server can -// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client PoolClient) StopResize(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.StopResizePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", nil, "Failure preparing request") - return - } - - resp, err := client.StopResizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure sending request") - return - } - - result, err = client.StopResizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure responding to request") - } - - return -} - -// StopResizePreparer prepares the StopResize request. -func (client PoolClient) StopResizePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/stopresize", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopResizeSender sends the StopResize request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) StopResizeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// StopResizeResponder handles the response to the StopResize request. The method always -// closes the http.Response Body. -func (client PoolClient) StopResizeResponder(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 -} - -// UpdateProperties this fully replaces all the updateable properties of the pool. For example, if the pool has a start -// task associated with it and if start task is not specified with this request, then the Batch service will remove the -// existing start task. -// -// poolID is the ID of the pool to update. poolUpdatePropertiesParameter is the parameters for the request. timeout -// is the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client PoolClient) UpdateProperties(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolUpdatePropertiesParameter, - Constraints: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "poolUpdatePropertiesParameter.CertificateReferences", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.ApplicationPackageReferences", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.Metadata", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "UpdateProperties", err.Error()) - } - - req, err := client.UpdatePropertiesPreparer(ctx, poolID, poolUpdatePropertiesParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", nil, "Failure preparing request") - return - } - - resp, err := client.UpdatePropertiesSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure sending request") - return - } - - result, err = client.UpdatePropertiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure responding to request") - } - - return -} - -// UpdatePropertiesPreparer prepares the UpdateProperties request. -func (client PoolClient) UpdatePropertiesPreparer(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/updateproperties", pathParameters), - autorest.WithJSON(poolUpdatePropertiesParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdatePropertiesSender sends the UpdateProperties request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) UpdatePropertiesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdatePropertiesResponder handles the response to the UpdateProperties request. The method always -// closes the http.Response Body. -func (client PoolClient) UpdatePropertiesResponder(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 -} - -// UpgradeOS during an upgrade, the Batch service upgrades each compute node in the pool. When a compute node is chosen -// for upgrade, any tasks running on that node are removed from the node and returned to the queue to be rerun later -// (or on a different compute node). The node will be unavailable until the upgrade is complete. This operation results -// in temporarily reduced pool capacity as nodes are taken out of service to be upgraded. Although the Batch service -// tries to avoid upgrading all compute nodes at the same time, it does not guarantee to do this (particularly on small -// pools); therefore, the pool may be temporarily unavailable to run tasks. When this operation runs, the pool state -// changes to upgrading. When all compute nodes have finished upgrading, the pool state returns to active. While the -// upgrade is in progress, the pool's currentOSVersion reflects the OS version that nodes are upgrading from, and -// targetOSVersion reflects the OS version that nodes are upgrading to. Once the upgrade is complete, currentOSVersion -// is updated to reflect the OS version now running on all nodes. This operation can only be invoked on pools created -// with the cloudServiceConfiguration property. -// -// poolID is the ID of the pool to upgrade. poolUpgradeOSParameter is the parameters for the request. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client PoolClient) UpgradeOS(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolUpgradeOSParameter, - Constraints: []validation.Constraint{{Target: "poolUpgradeOSParameter.TargetOSVersion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "UpgradeOS", err.Error()) - } - - req, err := client.UpgradeOSPreparer(ctx, poolID, poolUpgradeOSParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", nil, "Failure preparing request") - return - } - - resp, err := client.UpgradeOSSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure sending request") - return - } - - result, err = client.UpgradeOSResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure responding to request") - } - - return -} - -// UpgradeOSPreparer prepares the UpgradeOS request. -func (client PoolClient) UpgradeOSPreparer(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/upgradeos", pathParameters), - autorest.WithJSON(poolUpgradeOSParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpgradeOSSender sends the UpgradeOS request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) UpgradeOSSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpgradeOSResponder handles the response to the UpgradeOS request. The method always -// closes the http.Response Body. -func (client PoolClient) UpgradeOSResponder(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/batch/2017-06-01.5.1/batch/task.go b/services/batch/2017-06-01.5.1/batch/task.go deleted file mode 100644 index dd8c9edb081e..000000000000 --- a/services/batch/2017-06-01.5.1/batch/task.go +++ /dev/null @@ -1,1070 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// TaskClient is the a client for issuing REST requests to the Azure Batch service. -type TaskClient struct { - BaseClient -} - -// NewTaskClient creates an instance of the TaskClient client. -func NewTaskClient() TaskClient { - return NewTaskClientWithBaseURI(DefaultBaseURI) -} - -// NewTaskClientWithBaseURI creates an instance of the TaskClient client. -func NewTaskClientWithBaseURI(baseURI string) TaskClient { - return TaskClient{NewWithBaseURI(baseURI)} -} - -// Add sends the add request. -// -// jobID is the ID of the job to which the task is to be added. task is the task to be added. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client TaskClient) Add(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: task, - Constraints: []validation.Constraint{{Target: "task.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "task.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "task.AffinityInfo", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "task.AffinityInfo.AffinityID", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "task.MultiInstanceSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "task.MultiInstanceSettings.NumberOfInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, jobID, task, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client TaskClient) AddPreparer(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters), - autorest.WithJSON(task), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 TaskClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// AddCollection note that each task must have a unique ID. The Batch service may not return the results for each task -// in the same order the tasks were submitted in this request. If the server times out or the connection is closed -// during the request, the request may have been partially or fully processed, or not at all. In such cases, the user -// should re-issue the request. Note that it is up to the user to correctly handle failures when re-issuing a request. -// For example, you should use the same task IDs during a retry so that if the prior operation succeeded, the retry -// will not create extra tasks unexpectedly. If the response contains any tasks which failed to add, a client can retry -// the request. In a retry, it is most efficient to resubmit only tasks that failed to add, and to omit tasks that were -// successfully added on the first attempt. -// -// jobID is the ID of the job to which the task collection is to be added. taskCollection is the tasks to be added. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client TaskClient) AddCollection(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result TaskAddCollectionResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: taskCollection, - Constraints: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "AddCollection", err.Error()) - } - - req, err := client.AddCollectionPreparer(ctx, jobID, taskCollection, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", nil, "Failure preparing request") - return - } - - resp, err := client.AddCollectionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure sending request") - return - } - - result, err = client.AddCollectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure responding to request") - } - - return -} - -// AddCollectionPreparer prepares the AddCollection request. -func (client TaskClient) AddCollectionPreparer(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/addtaskcollection", pathParameters), - autorest.WithJSON(taskCollection), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddCollectionSender sends the AddCollection request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) AddCollectionSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddCollectionResponder handles the response to the AddCollection request. The method always -// closes the http.Response Body. -func (client TaskClient) AddCollectionResponder(resp *http.Response) (result TaskAddCollectionResult, 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 when a task is deleted, all of the files in its directory on the compute node where it ran are also deleted -// (regardless of the retention time). For multi-instance tasks, the delete task operation applies synchronously to the -// primary task; subtasks and their files are then deleted asynchronously in the background. -// -// jobID is the ID of the job from which to delete the task. taskID is the ID of the task to delete. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client TaskClient) Delete(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client TaskClient) DeletePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) 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 for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. -// Use the list subtasks API to retrieve information about subtasks. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task to get information about. -// selectParameter is an OData $select clause. expand is an OData $expand clause. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client TaskClient) Get(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudTask, err error) { - req, err := client.GetPreparer(ctx, jobID, taskID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client TaskClient) GetPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) GetResponder(resp *http.Response) (result CloudTask, 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 for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. -// Use the list subtasks API to retrieve information about subtasks. -// -// jobID is the ID of the job. filter is an OData $filter clause. selectParameter is an OData $select clause. -// expand is an OData $expand clause. maxResults is the maximum number of items to return in the response. A -// maximum of 1000 tasks can be returned. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client TaskClient) List(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ctlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure sending request") - return - } - - result.ctlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client TaskClient) ListPreparer(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 TaskClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) ListResponder(resp *http.Response) (result CloudTaskListResult, 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 TaskClient) listNextResults(lastResults CloudTaskListResult) (result CloudTaskListResult, err error) { - req, err := lastResults.cloudTaskListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.TaskClient", "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, "batch.TaskClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client TaskClient) ListComplete(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultIterator, err error) { - result.page, err = client.List(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListSubtasks if the task is not a multi-instance task then this returns an empty collection. -// -// jobID is the ID of the job. taskID is the ID of the task. selectParameter is an OData $select clause. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client TaskClient) ListSubtasks(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListSubtasksResult, err error) { - req, err := client.ListSubtasksPreparer(ctx, jobID, taskID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", nil, "Failure preparing request") - return - } - - resp, err := client.ListSubtasksSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure sending request") - return - } - - result, err = client.ListSubtasksResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure responding to request") - } - - return -} - -// ListSubtasksPreparer prepares the ListSubtasks request. -func (client TaskClient) ListSubtasksPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/subtasksinfo", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSubtasksSender sends the ListSubtasks request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) ListSubtasksSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListSubtasksResponder handles the response to the ListSubtasks request. The method always -// closes the http.Response Body. -func (client TaskClient) ListSubtasksResponder(resp *http.Response) (result CloudTaskListSubtasksResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Reactivate reactivation makes a task eligible to be retried again up to its maximum retry count. The task's state is -// changed to active. As the task is no longer in the completed state, any previous exit code or failure information is -// no longer available after reactivation. Each time a task is reactivated, its retry count is reset to 0. Reactivation -// will fail for tasks that are not completed or that previously completed successfully (with an exit code of 0). -// Additionally, it will fail if the job has completed (or is terminating or deleting). -// -// jobID is the ID of the job containing the task. taskID is the ID of the task to reactivate. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client TaskClient) Reactivate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ReactivatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", nil, "Failure preparing request") - return - } - - resp, err := client.ReactivateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure sending request") - return - } - - result, err = client.ReactivateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure responding to request") - } - - return -} - -// ReactivatePreparer prepares the Reactivate request. -func (client TaskClient) ReactivatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/reactivate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReactivateSender sends the Reactivate request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) ReactivateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ReactivateResponder handles the response to the Reactivate request. The method always -// closes the http.Response Body. -func (client TaskClient) ReactivateResponder(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 -} - -// Terminate when the task has been terminated, it moves to the completed state. For multi-instance tasks, the -// terminate task operation applies synchronously to the primary task; subtasks are then terminated asynchronously in -// the background. -// -// jobID is the ID of the job containing the task. taskID is the ID of the task to terminate. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client TaskClient) Terminate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client TaskClient) TerminatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client TaskClient) TerminateResponder(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 -} - -// Update updates the properties of the specified task. -// -// jobID is the ID of the job containing the task. taskID is the ID of the task to update. taskUpdateParameter is -// the parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. ifMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service exactly matches the -// value specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to -// the client. The operation will be performed only if the resource's current ETag on the service does not match -// the value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the -// resource known to the client. The operation will be performed only if the resource on the service has been -// modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the -// resource known to the client. The operation will be performed only if the resource on the service has not been -// modified since the specified time. -func (client TaskClient) Update(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.UpdatePreparer(ctx, jobID, taskID, taskUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client TaskClient) UpdatePreparer(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-06-01.5.1" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithJSON(taskUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) UpdateResponder(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/batch/2017-06-01.5.1/batch/version.go b/services/batch/2017-06-01.5.1/batch/version.go deleted file mode 100644 index fb1f35fb5b21..000000000000 --- a/services/batch/2017-06-01.5.1/batch/version.go +++ /dev/null @@ -1,30 +0,0 @@ -package batch - -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.Number + " batch/2017-06-01.5.1" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/services/batch/2017-09-01.6.0/batch/account.go b/services/batch/2017-09-01.6.0/batch/account.go deleted file mode 100644 index 1e4fba835806..000000000000 --- a/services/batch/2017-09-01.6.0/batch/account.go +++ /dev/null @@ -1,175 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// AccountClient is the a client for issuing REST requests to the Azure Batch service. -type AccountClient struct { - BaseClient -} - -// NewAccountClient creates an instance of the AccountClient client. -func NewAccountClient() AccountClient { - return NewAccountClientWithBaseURI(DefaultBaseURI) -} - -// NewAccountClientWithBaseURI creates an instance of the AccountClient client. -func NewAccountClientWithBaseURI(baseURI string) AccountClient { - return AccountClient{NewWithBaseURI(baseURI)} -} - -// ListNodeAgentSkus sends the list node agent skus request. -// -// filter is an OData $filter clause. For more information on constructing this filter, see -// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-node-agent-skus. maxResults -// is the maximum number of items to return in the response. A maximum of 1000 results will be returned. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client AccountClient) ListNodeAgentSkus(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.AccountClient", "ListNodeAgentSkus", err.Error()) - } - - result.fn = client.listNodeAgentSkusNextResults - req, err := client.ListNodeAgentSkusPreparer(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListNodeAgentSkusSender(req) - if err != nil { - result.alnasr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure sending request") - return - } - - result.alnasr, err = client.ListNodeAgentSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure responding to request") - } - - return -} - -// ListNodeAgentSkusPreparer prepares the ListNodeAgentSkus request. -func (client AccountClient) ListNodeAgentSkusPreparer(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/nodeagentskus"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListNodeAgentSkusSender sends the ListNodeAgentSkus request. The method will close the -// http.Response Body if it receives an error. -func (client AccountClient) ListNodeAgentSkusSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListNodeAgentSkusResponder handles the response to the ListNodeAgentSkus request. The method always -// closes the http.Response Body. -func (client AccountClient) ListNodeAgentSkusResponder(resp *http.Response) (result AccountListNodeAgentSkusResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNodeAgentSkusNextResults retrieves the next set of results, if any. -func (client AccountClient) listNodeAgentSkusNextResults(lastResults AccountListNodeAgentSkusResult) (result AccountListNodeAgentSkusResult, err error) { - req, err := lastResults.accountListNodeAgentSkusResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListNodeAgentSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListNodeAgentSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListNodeAgentSkusComplete enumerates all values, automatically crossing page boundaries as required. -func (client AccountClient) ListNodeAgentSkusComplete(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultIterator, err error) { - result.page, err = client.ListNodeAgentSkus(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2017-09-01.6.0/batch/application.go b/services/batch/2017-09-01.6.0/batch/application.go deleted file mode 100644 index de66c6d66086..000000000000 --- a/services/batch/2017-09-01.6.0/batch/application.go +++ /dev/null @@ -1,264 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// ApplicationClient is the a client for issuing REST requests to the Azure Batch service. -type ApplicationClient struct { - BaseClient -} - -// NewApplicationClient creates an instance of the ApplicationClient client. -func NewApplicationClient() ApplicationClient { - return NewApplicationClientWithBaseURI(DefaultBaseURI) -} - -// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient client. -func NewApplicationClientWithBaseURI(baseURI string) ApplicationClient { - return ApplicationClient{NewWithBaseURI(baseURI)} -} - -// Get this operation returns only applications and versions that are available for use on compute nodes; that is, that -// can be used in an application package reference. For administrator information about applications and versions that -// are not yet available to compute nodes, use the Azure portal or the Azure Resource Manager API. -// -// applicationID is the ID of the application. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client ApplicationClient) Get(ctx context.Context, applicationID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationSummary, err error) { - req, err := client.GetPreparer(ctx, applicationID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationClient) GetPreparer(ctx context.Context, applicationID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationId": autorest.Encode("path", applicationID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/applications/{applicationId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ApplicationClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ApplicationClient) GetResponder(resp *http.Response) (result ApplicationSummary, 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 operation returns only applications and versions that are available for use on compute nodes; that is, -// that can be used in an application package reference. For administrator information about applications and versions -// that are not yet available to compute nodes, use the Azure portal or the Azure Resource Manager API. -// -// maxResults is the maximum number of items to return in the response. A maximum of 1000 applications can be -// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. -func (client ApplicationClient) List(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.ApplicationClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "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, "batch.ApplicationClient", "List", resp, "Failure sending request") - return - } - - result.alr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationClient) ListPreparer(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/applications"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ApplicationClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ApplicationClient) ListResponder(resp *http.Response) (result ApplicationListResult, 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 ApplicationClient) listNextResults(lastResults ApplicationListResult) (result ApplicationListResult, err error) { - req, err := lastResults.applicationListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.ApplicationClient", "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, "batch.ApplicationClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationClient) ListComplete(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultIterator, err error) { - result.page, err = client.List(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2017-09-01.6.0/batch/certificate.go b/services/batch/2017-09-01.6.0/batch/certificate.go deleted file mode 100644 index 28e2724ee7e6..000000000000 --- a/services/batch/2017-09-01.6.0/batch/certificate.go +++ /dev/null @@ -1,557 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// CertificateClient is the a client for issuing REST requests to the Azure Batch service. -type CertificateClient struct { - BaseClient -} - -// NewCertificateClient creates an instance of the CertificateClient client. -func NewCertificateClient() CertificateClient { - return NewCertificateClientWithBaseURI(DefaultBaseURI) -} - -// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client. -func NewCertificateClientWithBaseURI(baseURI string) CertificateClient { - return CertificateClient{NewWithBaseURI(baseURI)} -} - -// Add sends the add request. -// -// certificate is the certificate to be added. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client CertificateClient) Add(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: certificate, - Constraints: []validation.Constraint{{Target: "certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "certificate.ThumbprintAlgorithm", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "certificate.Data", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.CertificateClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, certificate, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client CertificateClient) AddPreparer(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/certificates"), - autorest.WithJSON(certificate), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// CancelDeletion if you try to delete a certificate that is being used by a pool or compute node, the status of the -// certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this -// operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not -// need to run this operation after the deletion failed. You must make sure that the certificate is not being used by -// any resources, and then you can try again to delete the certificate. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate being deleted. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client CertificateClient) CancelDeletion(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.CancelDeletionPreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", nil, "Failure preparing request") - return - } - - resp, err := client.CancelDeletionSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure sending request") - return - } - - result, err = client.CancelDeletionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure responding to request") - } - - return -} - -// CancelDeletionPreparer prepares the CancelDeletion request. -func (client CertificateClient) CancelDeletionPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CancelDeletionSender sends the CancelDeletion request. The method will close the -// http.Response Body if it receives an error. -func (client CertificateClient) CancelDeletionSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CancelDeletionResponder handles the response to the CancelDeletion request. The method always -// closes the http.Response Body. -func (client CertificateClient) CancelDeletionResponder(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 -} - -// Delete you cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a -// certificate, you must therefore make sure that the certificate is not associated with any existing pools, the -// certificate is not installed on any compute nodes (even if you remove a certificate from a pool, it is not removed -// from existing compute nodes in that pool until they restart), and no running tasks depend on the certificate. If you -// try to delete a certificate that is in use, the deletion fails. The certificate status changes to deleteFailed. You -// can use Cancel Delete Certificate to set the status back to active if you decide that you want to continue using the -// certificate. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate to be deleted. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client CertificateClient) Delete(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CertificateClient) DeletePreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) 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 information about the specified certificate. -// -// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is -// the thumbprint of the certificate to get. selectParameter is an OData $select clause. timeout is the maximum -// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is -// the caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client CertificateClient) Get(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result Certificate, err error) { - req, err := client.GetPreparer(ctx, thumbprintAlgorithm, thumbprint, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client CertificateClient) GetPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "thumbprint": autorest.Encode("path", thumbprint), - "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) GetResponder(resp *http.Response) (result Certificate, 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. -// -// filter is an OData $filter clause. For more information on constructing this filter, see -// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-certificates. selectParameter -// is an OData $select clause. maxResults is the maximum number of items to return in the response. A maximum of -// 1000 certificates can be returned. timeout is the maximum time that the server can spend processing the request, -// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of -// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client CertificateClient) List(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.CertificateClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "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, "batch.CertificateClient", "List", resp, "Failure sending request") - return - } - - result.clr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client CertificateClient) ListPreparer(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/certificates"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 CertificateClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 CertificateClient) ListResponder(resp *http.Response) (result CertificateListResult, 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 CertificateClient) listNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) { - req, err := lastResults.certificateListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.CertificateClient", "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, "batch.CertificateClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CertificateClient) ListComplete(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2017-09-01.6.0/batch/client.go b/services/batch/2017-09-01.6.0/batch/client.go deleted file mode 100644 index 87ffc1ecd65a..000000000000 --- a/services/batch/2017-09-01.6.0/batch/client.go +++ /dev/null @@ -1,49 +0,0 @@ -// Package batch implements the Azure ARM Batch service API version 2017-09-01.6.0. -// -// A client for issuing REST requests to the Azure Batch service. -package batch - -// 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 Batch - DefaultBaseURI = "https://batch.core.windows.net" -) - -// BaseClient is the base client for Batch. -type BaseClient struct { - autorest.Client - BaseURI string -} - -// New creates an instance of the BaseClient client. -func New() BaseClient { - return NewWithBaseURI(DefaultBaseURI) -} - -// NewWithBaseURI creates an instance of the BaseClient client. -func NewWithBaseURI(baseURI string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - } -} diff --git a/services/batch/2017-09-01.6.0/batch/computenode.go b/services/batch/2017-09-01.6.0/batch/computenode.go deleted file mode 100644 index f28823c047f1..000000000000 --- a/services/batch/2017-09-01.6.0/batch/computenode.go +++ /dev/null @@ -1,1124 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// ComputeNodeClient is the a client for issuing REST requests to the Azure Batch service. -type ComputeNodeClient struct { - BaseClient -} - -// NewComputeNodeClient creates an instance of the ComputeNodeClient client. -func NewComputeNodeClient() ComputeNodeClient { - return NewComputeNodeClientWithBaseURI(DefaultBaseURI) -} - -// NewComputeNodeClientWithBaseURI creates an instance of the ComputeNodeClient client. -func NewComputeNodeClientWithBaseURI(baseURI string) ComputeNodeClient { - return ComputeNodeClient{NewWithBaseURI(baseURI)} -} - -// AddUser you can add a user account to a node only when it is in the idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want -// to create a user account. userParameter is the user account to be created. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) AddUser(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: userParameter, - Constraints: []validation.Constraint{{Target: "userParameter.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.ComputeNodeClient", "AddUser", err.Error()) - } - - req, err := client.AddUserPreparer(ctx, poolID, nodeID, userParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", nil, "Failure preparing request") - return - } - - resp, err := client.AddUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure sending request") - return - } - - result, err = client.AddUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure responding to request") - } - - return -} - -// AddUserPreparer prepares the AddUser request. -func (client ComputeNodeClient) AddUserPreparer(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users", pathParameters), - autorest.WithJSON(userParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddUserSender sends the AddUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) AddUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddUserResponder handles the response to the AddUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) AddUserResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteUser you can delete a user account to a node only when it is in the idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want -// to delete a user account. userName is the name of the user account to delete. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) DeleteUser(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteUserPreparer(ctx, poolID, nodeID, userName, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure sending request") - return - } - - result, err = client.DeleteUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure responding to request") - } - - return -} - -// DeleteUserPreparer prepares the DeleteUser request. -func (client ComputeNodeClient) DeleteUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - "userName": autorest.Encode("path", userName), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteUserSender sends the DeleteUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) DeleteUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteUserResponder handles the response to the DeleteUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) DeleteUserResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// DisableScheduling you can disable task scheduling on a node only if its current scheduling state is enabled. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you -// want to disable task scheduling. nodeDisableSchedulingParameter is the parameters for the request. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) DisableScheduling(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisableSchedulingPreparer(ctx, poolID, nodeID, nodeDisableSchedulingParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSchedulingSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure sending request") - return - } - - result, err = client.DisableSchedulingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure responding to request") - } - - return -} - -// DisableSchedulingPreparer prepares the DisableScheduling request. -func (client ComputeNodeClient) DisableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/disablescheduling", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeDisableSchedulingParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeDisableSchedulingParameter)) - } - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableSchedulingSender sends the DisableScheduling request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) DisableSchedulingSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableSchedulingResponder handles the response to the DisableScheduling request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) DisableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EnableScheduling you can enable task scheduling on a node only if its current scheduling state is disabled -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you -// want to enable task scheduling. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client ComputeNodeClient) EnableScheduling(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnableSchedulingPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSchedulingSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure sending request") - return - } - - result, err = client.EnableSchedulingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure responding to request") - } - - return -} - -// EnableSchedulingPreparer prepares the EnableScheduling request. -func (client ComputeNodeClient) EnableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/enablescheduling", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableSchedulingSender sends the EnableScheduling request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) EnableSchedulingSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableSchedulingResponder handles the response to the EnableScheduling request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) EnableSchedulingResponder(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 sends the get request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want -// to get information about. selectParameter is an OData $select clause. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) Get(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNode, err error) { - req, err := client.GetPreparer(ctx, poolID, nodeID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ComputeNodeClient) GetPreparer(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ComputeNodeClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ComputeNodeClient) GetResponder(resp *http.Response) (result ComputeNode, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetRemoteDesktop before you can access a node by using the RDP file, you must create a user account on the node. -// This API can only be invoked on pools created with a cloud service configuration. For pools created with a virtual -// machine configuration, see the GetRemoteLoginSettings API. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which you -// want to get the Remote Desktop Protocol file. timeout is the maximum time that the server can spend processing -// the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in -// the form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) GetRemoteDesktop(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetRemoteDesktopPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", nil, "Failure preparing request") - return - } - - resp, err := client.GetRemoteDesktopSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure sending request") - return - } - - result, err = client.GetRemoteDesktopResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure responding to request") - } - - return -} - -// GetRemoteDesktopPreparer prepares the GetRemoteDesktop request. -func (client ComputeNodeClient) GetRemoteDesktopPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/rdp", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRemoteDesktopSender sends the GetRemoteDesktop request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) GetRemoteDesktopSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRemoteDesktopResponder handles the response to the GetRemoteDesktop request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) GetRemoteDesktopResponder(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 -} - -// GetRemoteLoginSettings before you can remotely login to a node using the remote login settings, you must create a -// user account on the node. This API can be invoked only on pools created with the virtual machine configuration -// property. For pools created with a cloud service configuration, see the GetRemoteDesktop API. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which to -// obtain the remote login settings. timeout is the maximum time that the server can spend processing the request, -// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of -// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client ComputeNodeClient) GetRemoteLoginSettings(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeGetRemoteLoginSettingsResult, err error) { - req, err := client.GetRemoteLoginSettingsPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", nil, "Failure preparing request") - return - } - - resp, err := client.GetRemoteLoginSettingsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure sending request") - return - } - - result, err = client.GetRemoteLoginSettingsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure responding to request") - } - - return -} - -// GetRemoteLoginSettingsPreparer prepares the GetRemoteLoginSettings request. -func (client ComputeNodeClient) GetRemoteLoginSettingsPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/remoteloginsettings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRemoteLoginSettingsSender sends the GetRemoteLoginSettings request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) GetRemoteLoginSettingsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRemoteLoginSettingsResponder handles the response to the GetRemoteLoginSettings request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) GetRemoteLoginSettingsResponder(resp *http.Response) (result ComputeNodeGetRemoteLoginSettingsResult, 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. -// -// poolID is the ID of the pool from which you want to list nodes. filter is an OData $filter clause. For more -// information on constructing this filter, see -// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. -// selectParameter is an OData $select clause. maxResults is the maximum number of items to return in the response. -// A maximum of 1000 nodes can be returned. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) List(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.ComputeNodeClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cnlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure sending request") - return - } - - result.cnlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ComputeNodeClient) ListPreparer(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 ComputeNodeClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ComputeNodeClient) ListResponder(resp *http.Response) (result ComputeNodeListResult, 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 ComputeNodeClient) listNextResults(lastResults ComputeNodeListResult) (result ComputeNodeListResult, err error) { - req, err := lastResults.computeNodeListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "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, "batch.ComputeNodeClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ComputeNodeClient) ListComplete(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultIterator, err error) { - result.page, err = client.List(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Reboot you can restart a node only if it is in an idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want -// to restart. nodeRebootParameter is the parameters for the request. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) Reboot(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.RebootPreparer(ctx, poolID, nodeID, nodeRebootParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", nil, "Failure preparing request") - return - } - - resp, err := client.RebootSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure sending request") - return - } - - result, err = client.RebootResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure responding to request") - } - - return -} - -// RebootPreparer prepares the Reboot request. -func (client ComputeNodeClient) RebootPreparer(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reboot", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeRebootParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeRebootParameter)) - } - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RebootSender sends the Reboot request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) RebootSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// RebootResponder handles the response to the Reboot request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) RebootResponder(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 -} - -// Reimage you can reinstall the operating system on a node only if it is in an idle or running state. This API can be -// invoked only on pools created with the cloud service configuration property. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want -// to restart. nodeReimageParameter is the parameters for the request. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client ComputeNodeClient) Reimage(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ReimagePreparer(ctx, poolID, nodeID, nodeReimageParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", nil, "Failure preparing request") - return - } - - resp, err := client.ReimageSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure sending request") - return - } - - result, err = client.ReimageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure responding to request") - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client ComputeNodeClient) ReimagePreparer(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if nodeReimageParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(nodeReimageParameter)) - } - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) ReimageSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) ReimageResponder(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 -} - -// UpdateUser this operation replaces of all the updateable properties of the account. For example, if the expiryTime -// element is not specified, the current value is replaced with the default value, not left unmodified. You can update -// a user account on a node only when it is in the idle or running state. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want -// to update a user account. userName is the name of the user account to update. nodeUpdateUserParameter is the -// parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client ComputeNodeClient) UpdateUser(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.UpdateUserPreparer(ctx, poolID, nodeID, userName, nodeUpdateUserParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateUserSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure sending request") - return - } - - result, err = client.UpdateUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure responding to request") - } - - return -} - -// UpdateUserPreparer prepares the UpdateUser request. -func (client ComputeNodeClient) UpdateUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - "userName": autorest.Encode("path", userName), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters), - autorest.WithJSON(nodeUpdateUserParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateUserSender sends the UpdateUser request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeNodeClient) UpdateUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateUserResponder handles the response to the UpdateUser request. The method always -// closes the http.Response Body. -func (client ComputeNodeClient) UpdateUserResponder(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/batch/2017-09-01.6.0/batch/file.go b/services/batch/2017-09-01.6.0/batch/file.go deleted file mode 100644 index d05993078297..000000000000 --- a/services/batch/2017-09-01.6.0/batch/file.go +++ /dev/null @@ -1,946 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// FileClient is the a client for issuing REST requests to the Azure Batch service. -type FileClient struct { - BaseClient -} - -// NewFileClient creates an instance of the FileClient client. -func NewFileClient() FileClient { - return NewFileClientWithBaseURI(DefaultBaseURI) -} - -// NewFileClientWithBaseURI creates an instance of the FileClient client. -func NewFileClientWithBaseURI(baseURI string) FileClient { - return FileClient{NewWithBaseURI(baseURI)} -} - -// DeleteFromComputeNode sends the delete from compute node request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node from which you -// want to delete the file. filePath is the path to the file or directory that you want to delete. recursive is -// whether to delete children of a directory. If the filePath parameter represents a directory instead of a file, -// you can set recursive to true to delete the directory and all of the files and subdirectories in it. If -// recursive is false then the directory must be empty or deletion will fail. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client FileClient) DeleteFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteFromComputeNodePreparer(ctx, poolID, nodeID, filePath, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteFromComputeNodeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.DeleteFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// DeleteFromComputeNodePreparer prepares the DeleteFromComputeNode request. -func (client FileClient) DeleteFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteFromComputeNodeSender sends the DeleteFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) DeleteFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteFromComputeNodeResponder handles the response to the DeleteFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) DeleteFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteFromTask sends the delete from task request. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to delete. -// filePath is the path to the task file or directory that you want to delete. recursive is whether to delete -// children of a directory. If the filePath parameter represents a directory instead of a file, you can set -// recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false -// then the directory must be empty or deletion will fail. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client FileClient) DeleteFromTask(ctx context.Context, jobID string, taskID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeleteFromTaskPreparer(ctx, jobID, taskID, filePath, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteFromTaskSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure sending request") - return - } - - result, err = client.DeleteFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure responding to request") - } - - return -} - -// DeleteFromTaskPreparer prepares the DeleteFromTask request. -func (client FileClient) DeleteFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteFromTaskSender sends the DeleteFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) DeleteFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteFromTaskResponder handles the response to the DeleteFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) DeleteFromTaskResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetFromComputeNode returns the content of the specified compute node file. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains -// the file. filePath is the path to the compute node file that you want to get the content of. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ocpRange is -// the byte range to be retrieved. The default is to retrieve the entire file. The format is -// bytes=startRange-endRange. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client FileClient) GetFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetFromComputeNodePreparer(ctx, poolID, nodeID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.GetFromComputeNodeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.GetFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// GetFromComputeNodePreparer prepares the GetFromComputeNode request. -func (client FileClient) GetFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ocpRange) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-range", autorest.String(ocpRange))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetFromComputeNodeSender sends the GetFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetFromComputeNodeResponder handles the response to the GetFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) GetFromComputeNodeResponder(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 -} - -// GetFromTask returns the content of the specified task file. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to retrieve. -// filePath is the path to the task file that you want to get the content of. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ocpRange is -// the byte range to be retrieved. The default is to retrieve the entire file. The format is -// bytes=startRange-endRange. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client FileClient) GetFromTask(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) { - req, err := client.GetFromTaskPreparer(ctx, jobID, taskID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.GetFromTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure sending request") - return - } - - result, err = client.GetFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure responding to request") - } - - return -} - -// GetFromTaskPreparer prepares the GetFromTask request. -func (client FileClient) GetFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ocpRange) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-range", autorest.String(ocpRange))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetFromTaskSender sends the GetFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetFromTaskResponder handles the response to the GetFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) GetFromTaskResponder(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 -} - -// GetPropertiesFromComputeNode gets the properties of the specified compute node file. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains -// the file. filePath is the path to the compute node file that you want to get the properties of. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client FileClient) GetPropertiesFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.GetPropertiesFromComputeNodePreparer(ctx, poolID, nodeID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.GetPropertiesFromComputeNodeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", resp, "Failure sending request") - return - } - - result, err = client.GetPropertiesFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// GetPropertiesFromComputeNodePreparer prepares the GetPropertiesFromComputeNode request. -func (client FileClient) GetPropertiesFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPropertiesFromComputeNodeSender sends the GetPropertiesFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetPropertiesFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPropertiesFromComputeNodeResponder handles the response to the GetPropertiesFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) GetPropertiesFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetPropertiesFromTask gets the properties of the specified task file. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to get the -// properties of. filePath is the path to the task file that you want to get the properties of. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client FileClient) GetPropertiesFromTask(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.GetPropertiesFromTaskPreparer(ctx, jobID, taskID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.GetPropertiesFromTaskSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", resp, "Failure sending request") - return - } - - result, err = client.GetPropertiesFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", resp, "Failure responding to request") - } - - return -} - -// GetPropertiesFromTaskPreparer prepares the GetPropertiesFromTask request. -func (client FileClient) GetPropertiesFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "filePath": autorest.Encode("path", filePath), - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPropertiesFromTaskSender sends the GetPropertiesFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) GetPropertiesFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPropertiesFromTaskResponder handles the response to the GetPropertiesFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) GetPropertiesFromTaskResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// ListFromComputeNode sends the list from compute node request. -// -// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node whose files -// you want to list. filter is an OData $filter clause. For more information on constructing this filter, see -// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. recursive -// is whether to list children of a directory. maxResults is the maximum number of items to return in the response. -// A maximum of 1000 files can be returned. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client FileClient) ListFromComputeNode(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.FileClient", "ListFromComputeNode", err.Error()) - } - - result.fn = client.listFromComputeNodeNextResults - req, err := client.ListFromComputeNodePreparer(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromComputeNodeSender(req) - if err != nil { - result.nflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure sending request") - return - } - - result.nflr, err = client.ListFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure responding to request") - } - - return -} - -// ListFromComputeNodePreparer prepares the ListFromComputeNode request. -func (client FileClient) ListFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "nodeId": autorest.Encode("path", nodeID), - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromComputeNodeSender sends the ListFromComputeNode request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) ListFromComputeNodeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromComputeNodeResponder handles the response to the ListFromComputeNode request. The method always -// closes the http.Response Body. -func (client FileClient) ListFromComputeNodeResponder(resp *http.Response) (result NodeFileListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromComputeNodeNextResults retrieves the next set of results, if any. -func (client FileClient) listFromComputeNodeNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) { - req, err := lastResults.nodeFileListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromComputeNodeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromComputeNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromComputeNodeComplete enumerates all values, automatically crossing page boundaries as required. -func (client FileClient) ListFromComputeNodeComplete(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) { - result.page, err = client.ListFromComputeNode(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListFromTask sends the list from task request. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task whose files you want to list. -// filter is an OData $filter clause. For more information on constructing this filter, see -// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-task-files. recursive is -// whether to list children of the task directory. This parameter can be used in combination with the filter -// parameter to list specific type of files. maxResults is the maximum number of items to return in the response. A -// maximum of 1000 files can be returned. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client FileClient) ListFromTask(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.FileClient", "ListFromTask", err.Error()) - } - - result.fn = client.listFromTaskNextResults - req, err := client.ListFromTaskPreparer(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromTaskSender(req) - if err != nil { - result.nflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure sending request") - return - } - - result.nflr, err = client.ListFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure responding to request") - } - - return -} - -// ListFromTaskPreparer prepares the ListFromTask request. -func (client FileClient) ListFromTaskPreparer(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if recursive != nil { - queryParameters["recursive"] = autorest.Encode("query", *recursive) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromTaskSender sends the ListFromTask request. The method will close the -// http.Response Body if it receives an error. -func (client FileClient) ListFromTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromTaskResponder handles the response to the ListFromTask request. The method always -// closes the http.Response Body. -func (client FileClient) ListFromTaskResponder(resp *http.Response) (result NodeFileListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromTaskNextResults retrieves the next set of results, if any. -func (client FileClient) listFromTaskNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) { - req, err := lastResults.nodeFileListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromTaskComplete enumerates all values, automatically crossing page boundaries as required. -func (client FileClient) ListFromTaskComplete(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) { - result.page, err = client.ListFromTask(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} diff --git a/services/batch/2017-09-01.6.0/batch/job.go b/services/batch/2017-09-01.6.0/batch/job.go deleted file mode 100644 index a1ce513e8337..000000000000 --- a/services/batch/2017-09-01.6.0/batch/job.go +++ /dev/null @@ -1,1660 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// JobClient is the a client for issuing REST requests to the Azure Batch service. -type JobClient struct { - BaseClient -} - -// NewJobClient creates an instance of the JobClient client. -func NewJobClient() JobClient { - return NewJobClientWithBaseURI(DefaultBaseURI) -} - -// NewJobClientWithBaseURI creates an instance of the JobClient client. -func NewJobClientWithBaseURI(baseURI string) JobClient { - return JobClient{NewWithBaseURI(baseURI)} -} - -// Add the Batch service supports two ways to control the work done as part of a job. In the first approach, the user -// specifies a Job Manager task. The Batch service launches this task when it is ready to start the job. The Job -// Manager task controls all other tasks that run under this job, by using the Task APIs. In the second approach, the -// user directly controls the execution of tasks under an active job, by using the Task APIs. Also note: when naming -// jobs, avoid including sensitive information such as user names or secret project names. This information may appear -// in telemetry logs accessible to Microsoft Support engineers. -// -// job is the job to be added. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client JobClient) Add(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: job, - Constraints: []validation.Constraint{{Target: "job.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobManagerTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobManagerTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobManagerTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobManagerTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobManagerTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobManagerTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - {Target: "job.JobPreparationTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobPreparationTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobPreparationTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobPreparationTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobPreparationTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobPreparationTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - {Target: "job.JobReleaseTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobReleaseTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobReleaseTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobReleaseTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.JobReleaseTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.JobReleaseTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - {Target: "job.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration.Type", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, job, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client JobClient) AddPreparer(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobs"), - autorest.WithJSON(job), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deleting a job also deletes all tasks that are part of that job, and all job statistics. This also overrides -// the retention period for task data; that is, if the job contains tasks which are still retained on compute nodes, -// the Batch services deletes those tasks' working directories and all their contents. When a Delete Job request is -// received, the Batch service sets the job to the deleting state. All update operations on a job that is in deleting -// state will fail with status code 409 (Conflict), with additional information indicating that the job is being -// deleted. -// -// jobID is the ID of the job to delete. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the -// resource known to the client. The operation will be performed only if the resource's current ETag on the service -// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of -// the resource known to the client. The operation will be performed only if the resource's current ETag on the -// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has not been modified since the specified time. -func (client JobClient) Delete(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobClient) DeletePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) 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 -} - -// Disable the Batch Service immediately moves the job to the disabling state. Batch then uses the disableTasks -// parameter to determine what to do with the currently running tasks of the job. The job remains in the disabling -// state until the disable operation is completed and all tasks have been dealt with according to the disableTasks -// option; the job then moves to the disabled state. No new tasks are started under the job until it moves back to -// active state. If you try to disable a job that is in any state other than active, disabling, or disabled, the -// request fails with status code 409. -// -// jobID is the ID of the job to disable. jobDisableParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobClient) Disable(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisablePreparer(ctx, jobID, jobDisableParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure sending request") - return - } - - result, err = client.DisableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure responding to request") - } - - return -} - -// DisablePreparer prepares the Disable request. -func (client JobClient) DisablePreparer(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/disable", pathParameters), - autorest.WithJSON(jobDisableParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) DisableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableResponder handles the response to the Disable request. The method always -// closes the http.Response Body. -func (client JobClient) DisableResponder(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 -} - -// Enable when you call this API, the Batch service sets a disabled job to the enabling state. After the this operation -// is completed, the job moves to the active state, and scheduling of new tasks under the job resumes. The Batch -// service does not allow a task to remain in the active state for more than 7 days. Therefore, if you enable a job -// containing active tasks which were added more than 7 days ago, those tasks will not run. -// -// jobID is the ID of the job to enable. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the -// resource known to the client. The operation will be performed only if the resource's current ETag on the service -// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of -// the resource known to the client. The operation will be performed only if the resource's current ETag on the -// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has not been modified since the specified time. -func (client JobClient) Enable(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnablePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure sending request") - return - } - - result, err = client.EnableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure responding to request") - } - - return -} - -// EnablePreparer prepares the Enable request. -func (client JobClient) EnablePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/enable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) EnableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableResponder handles the response to the Enable request. The method always -// closes the http.Response Body. -func (client JobClient) EnableResponder(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 sends the get request. -// -// jobID is the ID of the job. selectParameter is an OData $select clause. expand is an OData $expand clause. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -// ifMatch is an ETag value associated with the version of the resource known to the client. The operation will be -// performed only if the resource's current ETag on the service exactly matches the value specified by the client. -// ifNoneMatch is an ETag value associated with the version of the resource known to the client. The operation will -// be performed only if the resource's current ETag on the service does not match the value specified by the -// client. ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. -// The operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobClient) Get(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJob, err error) { - req, err := client.GetPreparer(ctx, jobID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobClient) GetPreparer(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) GetResponder(resp *http.Response) (result CloudJob, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAllLifetimeStatistics statistics are aggregated across all jobs that have ever existed in the account, from -// account creation to the last update time of the statistics. -// -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client JobClient) GetAllLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result JobStatistics, err error) { - req, err := client.GetAllLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", nil, "Failure preparing request") - return - } - - resp, err := client.GetAllLifetimeStatisticsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", resp, "Failure sending request") - return - } - - result, err = client.GetAllLifetimeStatisticsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", resp, "Failure responding to request") - } - - return -} - -// GetAllLifetimeStatisticsPreparer prepares the GetAllLifetimeStatistics request. -func (client JobClient) GetAllLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/lifetimejobstats"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAllLifetimeStatisticsSender sends the GetAllLifetimeStatistics request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) GetAllLifetimeStatisticsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetAllLifetimeStatisticsResponder handles the response to the GetAllLifetimeStatistics request. The method always -// closes the http.Response Body. -func (client JobClient) GetAllLifetimeStatisticsResponder(resp *http.Response) (result JobStatistics, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetTaskCounts task counts provide a count of the tasks by active, running or completed task state, and a count of -// tasks which succeeded or failed. Tasks in the preparing state are counted as running. If the validationStatus is -// unvalidated, then the Batch service has not been able to check state counts against the task states as reported in -// the List Tasks API. The validationStatus may be unvalidated if the job contains more than 200,000 tasks. -// -// jobID is the ID of the job. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client JobClient) GetTaskCounts(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result TaskCounts, err error) { - req, err := client.GetTaskCountsPreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetTaskCounts", nil, "Failure preparing request") - return - } - - resp, err := client.GetTaskCountsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetTaskCounts", resp, "Failure sending request") - return - } - - result, err = client.GetTaskCountsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "GetTaskCounts", resp, "Failure responding to request") - } - - return -} - -// GetTaskCountsPreparer prepares the GetTaskCounts request. -func (client JobClient) GetTaskCountsPreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/taskcounts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetTaskCountsSender sends the GetTaskCounts request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) GetTaskCountsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetTaskCountsResponder handles the response to the GetTaskCounts request. The method always -// closes the http.Response Body. -func (client JobClient) GetTaskCountsResponder(resp *http.Response) (result TaskCounts, 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. -// -// filter is an OData $filter clause. For more information on constructing this filter, see -// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs. selectParameter is an -// OData $select clause. expand is an OData $expand clause. maxResults is the maximum number of items to return in -// the response. A maximum of 1000 jobs can be returned. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client JobClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cjlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure sending request") - return - } - - result.cjlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client JobClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobs"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) ListResponder(resp *http.Response) (result CloudJobListResult, 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 JobClient) listNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) { - req, err := lastResults.cloudJobListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "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, "batch.JobClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListFromJobSchedule sends the list from job schedule request. -// -// jobScheduleID is the ID of the job schedule from which you want to get a list of jobs. filter is an OData -// $filter clause. For more information on constructing this filter, see -// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. -// selectParameter is an OData $select clause. expand is an OData $expand clause. maxResults is the maximum number -// of items to return in the response. A maximum of 1000 jobs can be returned. timeout is the maximum time that the -// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client JobClient) ListFromJobSchedule(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "ListFromJobSchedule", err.Error()) - } - - result.fn = client.listFromJobScheduleNextResults - req, err := client.ListFromJobSchedulePreparer(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", nil, "Failure preparing request") - return - } - - resp, err := client.ListFromJobScheduleSender(req) - if err != nil { - result.cjlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure sending request") - return - } - - result.cjlr, err = client.ListFromJobScheduleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure responding to request") - } - - return -} - -// ListFromJobSchedulePreparer prepares the ListFromJobSchedule request. -func (client JobClient) ListFromJobSchedulePreparer(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/jobs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFromJobScheduleSender sends the ListFromJobSchedule request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) ListFromJobScheduleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListFromJobScheduleResponder handles the response to the ListFromJobSchedule request. The method always -// closes the http.Response Body. -func (client JobClient) ListFromJobScheduleResponder(resp *http.Response) (result CloudJobListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFromJobScheduleNextResults retrieves the next set of results, if any. -func (client JobClient) listFromJobScheduleNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) { - req, err := lastResults.cloudJobListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFromJobScheduleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFromJobScheduleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFromJobScheduleComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListFromJobScheduleComplete(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) { - result.page, err = client.ListFromJobSchedule(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListPreparationAndReleaseTaskStatus this API returns the Job Preparation and Job Release task status on all compute -// nodes that have run the Job Preparation or Job Release task. This includes nodes which have since been removed from -// the pool. If this API is invoked on a job which has no Job Preparation or Job Release task, the Batch service -// returns HTTP status code 409 (Conflict) with an error code of JobPreparationTaskNotSpecified. -// -// jobID is the ID of the job. filter is an OData $filter clause. For more information on constructing this filter, -// see -// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. -// selectParameter is an OData $select clause. maxResults is the maximum number of items to return in the response. -// A maximum of 1000 tasks can be returned. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. -func (client JobClient) ListPreparationAndReleaseTaskStatus(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "ListPreparationAndReleaseTaskStatus", err.Error()) - } - - result.fn = client.listPreparationAndReleaseTaskStatusNextResults - req, err := client.ListPreparationAndReleaseTaskStatusPreparer(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", nil, "Failure preparing request") - return - } - - resp, err := client.ListPreparationAndReleaseTaskStatusSender(req) - if err != nil { - result.cjlpartsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure sending request") - return - } - - result.cjlpartsr, err = client.ListPreparationAndReleaseTaskStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure responding to request") - } - - return -} - -// ListPreparationAndReleaseTaskStatusPreparer prepares the ListPreparationAndReleaseTaskStatus request. -func (client JobClient) ListPreparationAndReleaseTaskStatusPreparer(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/jobpreparationandreleasetaskstatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPreparationAndReleaseTaskStatusSender sends the ListPreparationAndReleaseTaskStatus request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) ListPreparationAndReleaseTaskStatusSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListPreparationAndReleaseTaskStatusResponder handles the response to the ListPreparationAndReleaseTaskStatus request. The method always -// closes the http.Response Body. -func (client JobClient) ListPreparationAndReleaseTaskStatusResponder(resp *http.Response) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listPreparationAndReleaseTaskStatusNextResults retrieves the next set of results, if any. -func (client JobClient) listPreparationAndReleaseTaskStatusNextResults(lastResults CloudJobListPreparationAndReleaseTaskStatusResult) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) { - req, err := lastResults.cloudJobListPreparationAndReleaseTaskStatusResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListPreparationAndReleaseTaskStatusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListPreparationAndReleaseTaskStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListPreparationAndReleaseTaskStatusComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListPreparationAndReleaseTaskStatusComplete(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultIterator, err error) { - result.page, err = client.ListPreparationAndReleaseTaskStatus(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch this replaces only the job properties specified in the request. For example, if the job has constraints, and a -// request does not specify the constraints element, then the job keeps the existing constraints. -// -// jobID is the ID of the job whose properties you want to update. jobPatchParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobClient) Patch(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, jobID, jobPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client JobClient) PatchPreparer(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithJSON(jobPatchParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client JobClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Terminate when a Terminate Job request is received, the Batch service sets the job to the terminating state. The -// Batch service then terminates any active or running tasks associated with the job, and runs any required Job Release -// tasks. The job then moves into the completed state. -// -// jobID is the ID of the job to terminate. jobTerminateParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobClient) Terminate(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobID, jobTerminateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client JobClient) TerminatePreparer(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if jobTerminateParameter != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(jobTerminateParameter)) - } - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client JobClient) TerminateResponder(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 -} - -// Update this fully replaces all the updateable properties of the job. For example, if the job has constraints -// associated with it and if constraints is not specified with this request, then the Batch service will remove the -// existing constraints. -// -// jobID is the ID of the job whose properties you want to update. jobUpdateParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobClient) Update(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobUpdateParameter, - Constraints: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration.Type", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, jobID, jobUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client JobClient) UpdatePreparer(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}", pathParameters), - autorest.WithJSON(jobUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobClient) UpdateResponder(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/batch/2017-09-01.6.0/batch/jobschedule.go b/services/batch/2017-09-01.6.0/batch/jobschedule.go deleted file mode 100644 index f6e83fb3368f..000000000000 --- a/services/batch/2017-09-01.6.0/batch/jobschedule.go +++ /dev/null @@ -1,1324 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// JobScheduleClient is the a client for issuing REST requests to the Azure Batch service. -type JobScheduleClient struct { - BaseClient -} - -// NewJobScheduleClient creates an instance of the JobScheduleClient client. -func NewJobScheduleClient() JobScheduleClient { - return NewJobScheduleClientWithBaseURI(DefaultBaseURI) -} - -// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client. -func NewJobScheduleClientWithBaseURI(baseURI string) JobScheduleClient { - return JobScheduleClient{NewWithBaseURI(baseURI)} -} - -// Add sends the add request. -// -// cloudJobSchedule is the job schedule to be added. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client JobScheduleClient) Add(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: cloudJobSchedule, - Constraints: []validation.Constraint{{Target: "cloudJobSchedule.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.Schedule", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - {Target: "cloudJobSchedule.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - {Target: "cloudJobSchedule.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration.Type", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, cloudJobSchedule, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client JobScheduleClient) AddPreparer(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobschedules"), - autorest.WithJSON(cloudJobSchedule), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobScheduleClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete when you delete a job schedule, this also deletes all jobs and tasks under that schedule. When tasks are -// deleted, all the files in their working directories on the compute nodes are also deleted (the retention period is -// ignored). The job schedule statistics are no longer accessible once the job schedule is deleted, though they are -// still counted towards account lifetime statistics. -// -// jobScheduleID is the ID of the job schedule to delete. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Delete(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobScheduleClient) DeletePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) 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 -} - -// Disable no new jobs will be created until the job schedule is enabled again. -// -// jobScheduleID is the ID of the job schedule to disable. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Disable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", nil, "Failure preparing request") - return - } - - resp, err := client.DisableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure sending request") - return - } - - result, err = client.DisableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure responding to request") - } - - return -} - -// DisablePreparer prepares the Disable request. -func (client JobScheduleClient) DisablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/disable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) DisableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableResponder handles the response to the Disable request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) DisableResponder(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 -} - -// Enable sends the enable request. -// -// jobScheduleID is the ID of the job schedule to enable. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Enable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", nil, "Failure preparing request") - return - } - - resp, err := client.EnableSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure sending request") - return - } - - result, err = client.EnableResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure responding to request") - } - - return -} - -// EnablePreparer prepares the Enable request. -func (client JobScheduleClient) EnablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/enable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) EnableSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableResponder handles the response to the Enable request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) EnableResponder(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 -} - -// Exists sends the exists request. -// -// jobScheduleID is the ID of the job schedule which you want to check. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Exists(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ExistsPreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", nil, "Failure preparing request") - return - } - - resp, err := client.ExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure sending request") - return - } - - result, err = client.ExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure responding to request") - } - - return -} - -// ExistsPreparer prepares the Exists request. -func (client JobScheduleClient) ExistsPreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExistsSender sends the Exists request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) ExistsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExistsResponder handles the response to the Exists request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) ExistsResponder(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 information about the specified job schedule. -// -// jobScheduleID is the ID of the job schedule to get. selectParameter is an OData $select clause. expand is an -// OData $expand clause. timeout is the maximum time that the server can spend processing the request, in seconds. -// The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with -// no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether -// the server should return the client-request-id in the response. ocpDate is the time the request was issued. -// Client libraries typically set this to the current system clock time; set it explicitly if you are calling the -// REST API directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobScheduleClient) Get(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJobSchedule, err error) { - req, err := client.GetPreparer(ctx, jobScheduleID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobScheduleClient) GetPreparer(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) GetResponder(resp *http.Response) (result CloudJobSchedule, 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. -// -// filter is an OData $filter clause. For more information on constructing this filter, see -// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. -// selectParameter is an OData $select clause. expand is an OData $expand clause. maxResults is the maximum number -// of items to return in the response. A maximum of 1000 job schedules can be returned. timeout is the maximum time -// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client JobScheduleClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cjslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure sending request") - return - } - - result.cjslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client JobScheduleClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/jobschedules"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 JobScheduleClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) ListResponder(resp *http.Response) (result CloudJobScheduleListResult, 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 JobScheduleClient) listNextResults(lastResults CloudJobScheduleListResult) (result CloudJobScheduleListResult, err error) { - req, err := lastResults.cloudJobScheduleListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.JobScheduleClient", "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, "batch.JobScheduleClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobScheduleClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch this replaces only the job schedule properties specified in the request. For example, if the schedule property -// is not specified with this request, then the Batch service will keep the existing schedule. Changes to a job -// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are -// unaffected. -// -// jobScheduleID is the ID of the job schedule to update. jobSchedulePatchParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobScheduleClient) Patch(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, jobScheduleID, jobSchedulePatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client JobScheduleClient) PatchPreparer(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithJSON(jobSchedulePatchParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Terminate sends the terminate request. -// -// jobScheduleID is the ID of the job schedule to terminates. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client JobScheduleClient) Terminate(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client JobScheduleClient) TerminatePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) TerminateResponder(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 -} - -// Update this fully replaces all the updateable properties of the job schedule. For example, if the schedule property -// is not specified with this request, then the Batch service will remove the existing schedule. Changes to a job -// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are -// unaffected. -// -// jobScheduleID is the ID of the job schedule to update. jobScheduleUpdateParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client JobScheduleClient) Update(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobScheduleUpdateParameter, - Constraints: []validation.Constraint{{Target: "jobScheduleUpdateParameter.Schedule", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration.Type", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.JobScheduleClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, jobScheduleID, jobScheduleUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client JobScheduleClient) UpdatePreparer(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobScheduleId": autorest.Encode("path", jobScheduleID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters), - autorest.WithJSON(jobScheduleUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 JobScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 JobScheduleClient) UpdateResponder(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/batch/2017-09-01.6.0/batch/models.go b/services/batch/2017-09-01.6.0/batch/models.go deleted file mode 100644 index d75557cf0e08..000000000000 --- a/services/batch/2017-09-01.6.0/batch/models.go +++ /dev/null @@ -1,3418 +0,0 @@ -package batch - -// 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" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "io" - "net/http" -) - -// AccessScope enumerates the values for access scope. -type AccessScope string - -const ( - // Job Grants access to perform all operations on the job containing the task. - Job AccessScope = "job" -) - -// PossibleAccessScopeValues returns an array of possible values for the AccessScope const type. -func PossibleAccessScopeValues() []AccessScope { - return []AccessScope{Job} -} - -// AllocationState enumerates the values for allocation state. -type AllocationState string - -const ( - // Resizing The pool is resizing; that is, compute nodes are being added to or removed from the pool. - Resizing AllocationState = "resizing" - // Steady The pool is not resizing. There are no changes to the number of nodes in the pool in progress. A - // pool enters this state when it is created and when no operations are being performed on the pool to - // change the number of nodes. - Steady AllocationState = "steady" - // Stopping The pool was resizing, but the user has requested that the resize be stopped, but the stop - // request has not yet been completed. - Stopping AllocationState = "stopping" -) - -// PossibleAllocationStateValues returns an array of possible values for the AllocationState const type. -func PossibleAllocationStateValues() []AllocationState { - return []AllocationState{Resizing, Steady, Stopping} -} - -// AutoUserScope enumerates the values for auto user scope. -type AutoUserScope string - -const ( - // Pool Specifies that the task runs as the common auto user account which is created on every node in a - // pool. - Pool AutoUserScope = "pool" - // Task Specifies that the service should create a new user for the task. - Task AutoUserScope = "task" -) - -// PossibleAutoUserScopeValues returns an array of possible values for the AutoUserScope const type. -func PossibleAutoUserScopeValues() []AutoUserScope { - return []AutoUserScope{Pool, Task} -} - -// CachingType enumerates the values for caching type. -type CachingType string - -const ( - // None The caching mode for the disk is not enabled. - None CachingType = "none" - // ReadOnly The caching mode for the disk is read only. - ReadOnly CachingType = "readonly" - // ReadWrite The caching mode for the disk is read and write. - ReadWrite CachingType = "readwrite" -) - -// PossibleCachingTypeValues returns an array of possible values for the CachingType const type. -func PossibleCachingTypeValues() []CachingType { - return []CachingType{None, ReadOnly, ReadWrite} -} - -// CertificateFormat enumerates the values for certificate format. -type CertificateFormat string - -const ( - // Cer The certificate is a base64-encoded X.509 certificate. - Cer CertificateFormat = "cer" - // Pfx The certificate is a PFX (PKCS#12) formatted certificate or certificate chain. - Pfx CertificateFormat = "pfx" -) - -// PossibleCertificateFormatValues returns an array of possible values for the CertificateFormat const type. -func PossibleCertificateFormatValues() []CertificateFormat { - return []CertificateFormat{Cer, Pfx} -} - -// CertificateState enumerates the values for certificate state. -type CertificateState string - -const ( - // Active The certificate is available for use in pools. - Active CertificateState = "active" - // DeleteFailed The user requested that the certificate be deleted, but there are pools that still have - // references to the certificate, or it is still installed on one or more compute nodes. (The latter can - // occur if the certificate has been removed from the pool, but the node has not yet restarted. Nodes - // refresh their certificates only when they restart.) You may use the cancel certificate delete operation - // to cancel the delete, or the delete certificate operation to retry the delete. - DeleteFailed CertificateState = "deletefailed" - // Deleting The user has requested that the certificate be deleted, but the delete operation has not yet - // completed. You may not reference the certificate when creating or updating pools. - Deleting CertificateState = "deleting" -) - -// PossibleCertificateStateValues returns an array of possible values for the CertificateState const type. -func PossibleCertificateStateValues() []CertificateState { - return []CertificateState{Active, DeleteFailed, Deleting} -} - -// CertificateStoreLocation enumerates the values for certificate store location. -type CertificateStoreLocation string - -const ( - // CurrentUser Certificates should be installed to the CurrentUser certificate store. - CurrentUser CertificateStoreLocation = "currentuser" - // LocalMachine Certificates should be installed to the LocalMachine certificate store. - LocalMachine CertificateStoreLocation = "localmachine" -) - -// PossibleCertificateStoreLocationValues returns an array of possible values for the CertificateStoreLocation const type. -func PossibleCertificateStoreLocationValues() []CertificateStoreLocation { - return []CertificateStoreLocation{CurrentUser, LocalMachine} -} - -// CertificateVisibility enumerates the values for certificate visibility. -type CertificateVisibility string - -const ( - // CertificateVisibilityRemoteUser The certificate should be visibile to the user accounts under which - // users remotely access the node. - CertificateVisibilityRemoteUser CertificateVisibility = "remoteuser" - // CertificateVisibilityStartTask The certificate should be visible to the user account under which the - // start task is run. - CertificateVisibilityStartTask CertificateVisibility = "starttask" - // CertificateVisibilityTask The certificate should be visibile to the user accounts under which job tasks - // are run. - CertificateVisibilityTask CertificateVisibility = "task" -) - -// PossibleCertificateVisibilityValues returns an array of possible values for the CertificateVisibility const type. -func PossibleCertificateVisibilityValues() []CertificateVisibility { - return []CertificateVisibility{CertificateVisibilityRemoteUser, CertificateVisibilityStartTask, CertificateVisibilityTask} -} - -// ComputeNodeDeallocationOption enumerates the values for compute node deallocation option. -type ComputeNodeDeallocationOption string - -const ( - // Requeue Terminate running task processes and requeue the tasks. The tasks will run again when a node is - // available. Remove nodes as soon as tasks have been terminated. - Requeue ComputeNodeDeallocationOption = "requeue" - // RetainedData Allow currently running tasks to complete, then wait for all task data retention periods to - // expire. Schedule no new tasks while waiting. Remove nodes when all task retention periods have expired. - RetainedData ComputeNodeDeallocationOption = "retaineddata" - // TaskCompletion Allow currently running tasks to complete. Schedule no new tasks while waiting. Remove - // nodes when all tasks have completed. - TaskCompletion ComputeNodeDeallocationOption = "taskcompletion" - // Terminate Terminate running tasks. The tasks will be completed with failureInfo indicating that they - // were terminated, and will not run again. Remove nodes as soon as tasks have been terminated. - Terminate ComputeNodeDeallocationOption = "terminate" -) - -// PossibleComputeNodeDeallocationOptionValues returns an array of possible values for the ComputeNodeDeallocationOption const type. -func PossibleComputeNodeDeallocationOptionValues() []ComputeNodeDeallocationOption { - return []ComputeNodeDeallocationOption{Requeue, RetainedData, TaskCompletion, Terminate} -} - -// ComputeNodeFillType enumerates the values for compute node fill type. -type ComputeNodeFillType string - -const ( - // Pack As many tasks as possible (maxTasksPerNode) should be assigned to each node in the pool before any - // tasks are assigned to the next node in the pool. - Pack ComputeNodeFillType = "pack" - // Spread Tasks should be assigned evenly across all nodes in the pool. - Spread ComputeNodeFillType = "spread" -) - -// PossibleComputeNodeFillTypeValues returns an array of possible values for the ComputeNodeFillType const type. -func PossibleComputeNodeFillTypeValues() []ComputeNodeFillType { - return []ComputeNodeFillType{Pack, Spread} -} - -// ComputeNodeRebootOption enumerates the values for compute node reboot option. -type ComputeNodeRebootOption string - -const ( - // ComputeNodeRebootOptionRequeue Terminate running task processes and requeue the tasks. The tasks will - // run again when a node is available. Restart the node as soon as tasks have been terminated. - ComputeNodeRebootOptionRequeue ComputeNodeRebootOption = "requeue" - // ComputeNodeRebootOptionRetainedData Allow currently running tasks to complete, then wait for all task - // data retention periods to expire. Schedule no new tasks while waiting. Restart the node when all task - // retention periods have expired. - ComputeNodeRebootOptionRetainedData ComputeNodeRebootOption = "retaineddata" - // ComputeNodeRebootOptionTaskCompletion Allow currently running tasks to complete. Schedule no new tasks - // while waiting. Restart the node when all tasks have completed. - ComputeNodeRebootOptionTaskCompletion ComputeNodeRebootOption = "taskcompletion" - // ComputeNodeRebootOptionTerminate Terminate running tasks. The tasks will be completed with failureInfo - // indicating that they were terminated, and will not run again. Restart the node as soon as tasks have - // been terminated. - ComputeNodeRebootOptionTerminate ComputeNodeRebootOption = "terminate" -) - -// PossibleComputeNodeRebootOptionValues returns an array of possible values for the ComputeNodeRebootOption const type. -func PossibleComputeNodeRebootOptionValues() []ComputeNodeRebootOption { - return []ComputeNodeRebootOption{ComputeNodeRebootOptionRequeue, ComputeNodeRebootOptionRetainedData, ComputeNodeRebootOptionTaskCompletion, ComputeNodeRebootOptionTerminate} -} - -// ComputeNodeReimageOption enumerates the values for compute node reimage option. -type ComputeNodeReimageOption string - -const ( - // ComputeNodeReimageOptionRequeue Terminate running task processes and requeue the tasks. The tasks will - // run again when a node is available. Reimage the node as soon as tasks have been terminated. - ComputeNodeReimageOptionRequeue ComputeNodeReimageOption = "requeue" - // ComputeNodeReimageOptionRetainedData Allow currently running tasks to complete, then wait for all task - // data retention periods to expire. Schedule no new tasks while waiting. Reimage the node when all task - // retention periods have expired. - ComputeNodeReimageOptionRetainedData ComputeNodeReimageOption = "retaineddata" - // ComputeNodeReimageOptionTaskCompletion Allow currently running tasks to complete. Schedule no new tasks - // while waiting. Reimage the node when all tasks have completed. - ComputeNodeReimageOptionTaskCompletion ComputeNodeReimageOption = "taskcompletion" - // ComputeNodeReimageOptionTerminate Terminate running tasks. The tasks will be completed with failureInfo - // indicating that they were terminated, and will not run again. Reimage the node as soon as tasks have - // been terminated. - ComputeNodeReimageOptionTerminate ComputeNodeReimageOption = "terminate" -) - -// PossibleComputeNodeReimageOptionValues returns an array of possible values for the ComputeNodeReimageOption const type. -func PossibleComputeNodeReimageOptionValues() []ComputeNodeReimageOption { - return []ComputeNodeReimageOption{ComputeNodeReimageOptionRequeue, ComputeNodeReimageOptionRetainedData, ComputeNodeReimageOptionTaskCompletion, ComputeNodeReimageOptionTerminate} -} - -// ComputeNodeState enumerates the values for compute node state. -type ComputeNodeState string - -const ( - // Creating The Batch service has obtained the underlying virtual machine from Azure Compute, but it has - // not yet started to join the pool. - Creating ComputeNodeState = "creating" - // Idle The node is not currently running a task. - Idle ComputeNodeState = "idle" - // LeavingPool The node is leaving the pool, either because the user explicitly removed it or because the - // pool is resizing or autoscaling down. - LeavingPool ComputeNodeState = "leavingpool" - // Offline The node is not currently running a task, and scheduling of new tasks to the node is disabled. - Offline ComputeNodeState = "offline" - // Preempted The low-priority node has been preempted. Tasks which were running on the node when it was - // pre-empted will be rescheduled when another node becomes available. - Preempted ComputeNodeState = "preempted" - // Rebooting The node is rebooting. - Rebooting ComputeNodeState = "rebooting" - // Reimaging The node is reimaging. - Reimaging ComputeNodeState = "reimaging" - // Running The node is running one or more tasks (other than a start task). - Running ComputeNodeState = "running" - // Starting The Batch service is starting on the underlying virtual machine. - Starting ComputeNodeState = "starting" - // StartTaskFailed The start task has failed on the compute node (and exhausted all retries), and - // waitForSuccess is set. The node is not usable for running tasks. - StartTaskFailed ComputeNodeState = "starttaskfailed" - // Unknown The Batch service has lost contact with the node, and does not know its true state. - Unknown ComputeNodeState = "unknown" - // Unusable The node cannot be used for task execution due to errors. - Unusable ComputeNodeState = "unusable" - // WaitingForStartTask The start task has started running on the compute node, but waitForSuccess is set - // and the start task has not yet completed. - WaitingForStartTask ComputeNodeState = "waitingforstarttask" -) - -// PossibleComputeNodeStateValues returns an array of possible values for the ComputeNodeState const type. -func PossibleComputeNodeStateValues() []ComputeNodeState { - return []ComputeNodeState{Creating, Idle, LeavingPool, Offline, Preempted, Rebooting, Reimaging, Running, Starting, StartTaskFailed, Unknown, Unusable, WaitingForStartTask} -} - -// DependencyAction enumerates the values for dependency action. -type DependencyAction string - -const ( - // Block Block the task's dependencies. - Block DependencyAction = "block" - // Satisfy Satisfy the task's dependencies. - Satisfy DependencyAction = "satisfy" -) - -// PossibleDependencyActionValues returns an array of possible values for the DependencyAction const type. -func PossibleDependencyActionValues() []DependencyAction { - return []DependencyAction{Block, Satisfy} -} - -// DisableComputeNodeSchedulingOption enumerates the values for disable compute node scheduling option. -type DisableComputeNodeSchedulingOption string - -const ( - // DisableComputeNodeSchedulingOptionRequeue Terminate running task processes and requeue the tasks. The - // tasks may run again on other compute nodes, or when task scheduling is re-enabled on this node. Enter - // offline state as soon as tasks have been terminated. - DisableComputeNodeSchedulingOptionRequeue DisableComputeNodeSchedulingOption = "requeue" - // DisableComputeNodeSchedulingOptionTaskCompletion Allow currently running tasks to complete. Schedule no - // new tasks while waiting. Enter offline state when all tasks have completed. - DisableComputeNodeSchedulingOptionTaskCompletion DisableComputeNodeSchedulingOption = "taskcompletion" - // DisableComputeNodeSchedulingOptionTerminate Terminate running tasks. The tasks will be completed with - // failureInfo indicating that they were terminated, and will not run again. Enter offline state as soon as - // tasks have been terminated. - DisableComputeNodeSchedulingOptionTerminate DisableComputeNodeSchedulingOption = "terminate" -) - -// PossibleDisableComputeNodeSchedulingOptionValues returns an array of possible values for the DisableComputeNodeSchedulingOption const type. -func PossibleDisableComputeNodeSchedulingOptionValues() []DisableComputeNodeSchedulingOption { - return []DisableComputeNodeSchedulingOption{DisableComputeNodeSchedulingOptionRequeue, DisableComputeNodeSchedulingOptionTaskCompletion, DisableComputeNodeSchedulingOptionTerminate} -} - -// DisableJobOption enumerates the values for disable job option. -type DisableJobOption string - -const ( - // DisableJobOptionRequeue Terminate running tasks and requeue them. The tasks will run again when the job - // is enabled. - DisableJobOptionRequeue DisableJobOption = "requeue" - // DisableJobOptionTerminate Terminate running tasks. The tasks will be completed with failureInfo - // indicating that they were terminated, and will not run again. - DisableJobOptionTerminate DisableJobOption = "terminate" - // DisableJobOptionWait Allow currently running tasks to complete. - DisableJobOptionWait DisableJobOption = "wait" -) - -// PossibleDisableJobOptionValues returns an array of possible values for the DisableJobOption const type. -func PossibleDisableJobOptionValues() []DisableJobOption { - return []DisableJobOption{DisableJobOptionRequeue, DisableJobOptionTerminate, DisableJobOptionWait} -} - -// ElevationLevel enumerates the values for elevation level. -type ElevationLevel string - -const ( - // Admin The user is a user with elevated access and operates with full Administrator permissions. - Admin ElevationLevel = "admin" - // NonAdmin The user is a standard user without elevated access. - NonAdmin ElevationLevel = "nonadmin" -) - -// PossibleElevationLevelValues returns an array of possible values for the ElevationLevel const type. -func PossibleElevationLevelValues() []ElevationLevel { - return []ElevationLevel{Admin, NonAdmin} -} - -// ErrorCategory enumerates the values for error category. -type ErrorCategory string - -const ( - // ServerError The error is due to an internal server issue. - ServerError ErrorCategory = "servererror" - // UserError The error is due to a user issue, such as misconfiguration. - UserError ErrorCategory = "usererror" -) - -// PossibleErrorCategoryValues returns an array of possible values for the ErrorCategory const type. -func PossibleErrorCategoryValues() []ErrorCategory { - return []ErrorCategory{ServerError, UserError} -} - -// InboundEndpointProtocol enumerates the values for inbound endpoint protocol. -type InboundEndpointProtocol string - -const ( - // TCP Use TCP for the endpoint. - TCP InboundEndpointProtocol = "tcp" - // UDP Use UDP for the endpoint. - UDP InboundEndpointProtocol = "udp" -) - -// PossibleInboundEndpointProtocolValues returns an array of possible values for the InboundEndpointProtocol const type. -func PossibleInboundEndpointProtocolValues() []InboundEndpointProtocol { - return []InboundEndpointProtocol{TCP, UDP} -} - -// JobAction enumerates the values for job action. -type JobAction string - -const ( - // JobActionDisable Disable the job. This is equivalent to calling the disable job API, with a disableTasks - // value of requeue. - JobActionDisable JobAction = "disable" - // JobActionNone Take no action. - JobActionNone JobAction = "none" - // JobActionTerminate Terminate the job. The terminateReason in the job's executionInfo is set to - // "TaskFailed". - JobActionTerminate JobAction = "terminate" -) - -// PossibleJobActionValues returns an array of possible values for the JobAction const type. -func PossibleJobActionValues() []JobAction { - return []JobAction{JobActionDisable, JobActionNone, JobActionTerminate} -} - -// JobPreparationTaskState enumerates the values for job preparation task state. -type JobPreparationTaskState string - -const ( - // JobPreparationTaskStateCompleted The task has exited with exit code 0, or the task has exhausted its - // retry limit, or the Batch service was unable to start the task due to task preparation errors (such as - // resource file download failures). - JobPreparationTaskStateCompleted JobPreparationTaskState = "completed" - // JobPreparationTaskStateRunning The task is currently running (including retrying). - JobPreparationTaskStateRunning JobPreparationTaskState = "running" -) - -// PossibleJobPreparationTaskStateValues returns an array of possible values for the JobPreparationTaskState const type. -func PossibleJobPreparationTaskStateValues() []JobPreparationTaskState { - return []JobPreparationTaskState{JobPreparationTaskStateCompleted, JobPreparationTaskStateRunning} -} - -// JobReleaseTaskState enumerates the values for job release task state. -type JobReleaseTaskState string - -const ( - // JobReleaseTaskStateCompleted The task has exited with exit code 0, or the task has exhausted its retry - // limit, or the Batch service was unable to start the task due to task preparation errors (such as - // resource file download failures). - JobReleaseTaskStateCompleted JobReleaseTaskState = "completed" - // JobReleaseTaskStateRunning The task is currently running (including retrying). - JobReleaseTaskStateRunning JobReleaseTaskState = "running" -) - -// PossibleJobReleaseTaskStateValues returns an array of possible values for the JobReleaseTaskState const type. -func PossibleJobReleaseTaskStateValues() []JobReleaseTaskState { - return []JobReleaseTaskState{JobReleaseTaskStateCompleted, JobReleaseTaskStateRunning} -} - -// JobScheduleState enumerates the values for job schedule state. -type JobScheduleState string - -const ( - // JobScheduleStateActive The job schedule is active and will create jobs as per its schedule. - JobScheduleStateActive JobScheduleState = "active" - // JobScheduleStateCompleted The schedule has terminated, either by reaching its end time or by the user - // terminating it explicitly. - JobScheduleStateCompleted JobScheduleState = "completed" - // JobScheduleStateDeleting The user has requested that the schedule be deleted, but the delete operation - // is still in progress. The scheduler will not initiate any new jobs for this schedule, and will delete - // any existing jobs and tasks under the schedule, including any active job. The schedule will be deleted - // when all jobs and tasks under the schedule have been deleted. - JobScheduleStateDeleting JobScheduleState = "deleting" - // JobScheduleStateDisabled The user has disabled the schedule. The scheduler will not initiate any new - // jobs will on this schedule, but any existing active job will continue to run. - JobScheduleStateDisabled JobScheduleState = "disabled" - // JobScheduleStateTerminating The schedule has no more work to do, or has been explicitly terminated by - // the user, but the termination operation is still in progress. The scheduler will not initiate any new - // jobs for this schedule, nor is any existing job active. - JobScheduleStateTerminating JobScheduleState = "terminating" -) - -// PossibleJobScheduleStateValues returns an array of possible values for the JobScheduleState const type. -func PossibleJobScheduleStateValues() []JobScheduleState { - return []JobScheduleState{JobScheduleStateActive, JobScheduleStateCompleted, JobScheduleStateDeleting, JobScheduleStateDisabled, JobScheduleStateTerminating} -} - -// JobState enumerates the values for job state. -type JobState string - -const ( - // JobStateActive The job is available to have tasks scheduled. - JobStateActive JobState = "active" - // JobStateCompleted All tasks have terminated, and the system will not accept any more tasks or any - // further changes to the job. - JobStateCompleted JobState = "completed" - // JobStateDeleting A user has requested that the job be deleted, but the delete operation is still in - // progress (for example, because the system is still terminating running tasks). - JobStateDeleting JobState = "deleting" - // JobStateDisabled A user has disabled the job. No tasks are running, and no new tasks will be scheduled. - JobStateDisabled JobState = "disabled" - // JobStateDisabling A user has requested that the job be disabled, but the disable operation is still in - // progress (for example, waiting for tasks to terminate). - JobStateDisabling JobState = "disabling" - // JobStateEnabling A user has requested that the job be enabled, but the enable operation is still in - // progress. - JobStateEnabling JobState = "enabling" - // JobStateTerminating The job is about to complete, either because a Job Manager task has completed or - // because the user has terminated the job, but the terminate operation is still in progress (for example, - // because Job Release tasks are running). - JobStateTerminating JobState = "terminating" -) - -// PossibleJobStateValues returns an array of possible values for the JobState const type. -func PossibleJobStateValues() []JobState { - return []JobState{JobStateActive, JobStateCompleted, JobStateDeleting, JobStateDisabled, JobStateDisabling, JobStateEnabling, JobStateTerminating} -} - -// NetworkSecurityGroupRuleAccess enumerates the values for network security group rule access. -type NetworkSecurityGroupRuleAccess string - -const ( - // Allow Allow access. - Allow NetworkSecurityGroupRuleAccess = "allow" - // Deny Deny access. - Deny NetworkSecurityGroupRuleAccess = "deny" -) - -// PossibleNetworkSecurityGroupRuleAccessValues returns an array of possible values for the NetworkSecurityGroupRuleAccess const type. -func PossibleNetworkSecurityGroupRuleAccessValues() []NetworkSecurityGroupRuleAccess { - return []NetworkSecurityGroupRuleAccess{Allow, Deny} -} - -// OnAllTasksComplete enumerates the values for on all tasks complete. -type OnAllTasksComplete string - -const ( - // NoAction Do nothing. The job remains active unless terminated or disabled by some other means. - NoAction OnAllTasksComplete = "noaction" - // TerminateJob Terminate the job. The job's terminateReason is set to 'AllTasksComplete'. - TerminateJob OnAllTasksComplete = "terminatejob" -) - -// PossibleOnAllTasksCompleteValues returns an array of possible values for the OnAllTasksComplete const type. -func PossibleOnAllTasksCompleteValues() []OnAllTasksComplete { - return []OnAllTasksComplete{NoAction, TerminateJob} -} - -// OnTaskFailure enumerates the values for on task failure. -type OnTaskFailure string - -const ( - // OnTaskFailureNoAction Do nothing. The job remains active unless terminated or disabled by some other - // means. - OnTaskFailureNoAction OnTaskFailure = "noaction" - // OnTaskFailurePerformExitOptionsJobAction Take the action associated with the task exit condition in the - // task's exitConditions collection. (This may still result in no action being taken, if that is what the - // task specifies.) - OnTaskFailurePerformExitOptionsJobAction OnTaskFailure = "performexitoptionsjobaction" -) - -// PossibleOnTaskFailureValues returns an array of possible values for the OnTaskFailure const type. -func PossibleOnTaskFailureValues() []OnTaskFailure { - return []OnTaskFailure{OnTaskFailureNoAction, OnTaskFailurePerformExitOptionsJobAction} -} - -// OSType enumerates the values for os type. -type OSType string - -const ( - // Linux The Linux operating system. - Linux OSType = "linux" - // Windows The Windows operating system. - Windows OSType = "windows" -) - -// PossibleOSTypeValues returns an array of possible values for the OSType const type. -func PossibleOSTypeValues() []OSType { - return []OSType{Linux, Windows} -} - -// OutputFileUploadCondition enumerates the values for output file upload condition. -type OutputFileUploadCondition string - -const ( - // OutputFileUploadConditionTaskCompletion Upload the file(s) after the task process exits, no matter what - // the exit code was. - OutputFileUploadConditionTaskCompletion OutputFileUploadCondition = "taskcompletion" - // OutputFileUploadConditionTaskFailure Upload the file(s) only after the task process exits with a nonzero - // exit code. - OutputFileUploadConditionTaskFailure OutputFileUploadCondition = "taskfailure" - // OutputFileUploadConditionTaskSuccess Upload the file(s) only after the task process exits with an exit - // code of 0. - OutputFileUploadConditionTaskSuccess OutputFileUploadCondition = "tasksuccess" -) - -// PossibleOutputFileUploadConditionValues returns an array of possible values for the OutputFileUploadCondition const type. -func PossibleOutputFileUploadConditionValues() []OutputFileUploadCondition { - return []OutputFileUploadCondition{OutputFileUploadConditionTaskCompletion, OutputFileUploadConditionTaskFailure, OutputFileUploadConditionTaskSuccess} -} - -// PoolLifetimeOption enumerates the values for pool lifetime option. -type PoolLifetimeOption string - -const ( - // PoolLifetimeOptionJob The pool exists for the lifetime of the job to which it is dedicated. The Batch - // service creates the pool when it creates the job. If the 'job' option is applied to a job schedule, the - // Batch service creates a new auto pool for every job created on the schedule. - PoolLifetimeOptionJob PoolLifetimeOption = "job" - // PoolLifetimeOptionJobSchedule The pool exists for the lifetime of the job schedule. The Batch Service - // creates the pool when it creates the first job on the schedule. You may apply this option only to job - // schedules, not to jobs. - PoolLifetimeOptionJobSchedule PoolLifetimeOption = "jobschedule" -) - -// PossiblePoolLifetimeOptionValues returns an array of possible values for the PoolLifetimeOption const type. -func PossiblePoolLifetimeOptionValues() []PoolLifetimeOption { - return []PoolLifetimeOption{PoolLifetimeOptionJob, PoolLifetimeOptionJobSchedule} -} - -// PoolState enumerates the values for pool state. -type PoolState string - -const ( - // PoolStateActive The pool is available to run tasks subject to the availability of compute nodes. - PoolStateActive PoolState = "active" - // PoolStateDeleting The user has requested that the pool be deleted, but the delete operation has not yet - // completed. - PoolStateDeleting PoolState = "deleting" - // PoolStateUpgrading The user has requested that the operating system of the pool's nodes be upgraded, but - // the upgrade operation has not yet completed (that is, some nodes in the pool have not yet been - // upgraded). While upgrading, the pool may be able to run tasks (with reduced capacity) but this is not - // guaranteed. - PoolStateUpgrading PoolState = "upgrading" -) - -// PossiblePoolStateValues returns an array of possible values for the PoolState const type. -func PossiblePoolStateValues() []PoolState { - return []PoolState{PoolStateActive, PoolStateDeleting, PoolStateUpgrading} -} - -// SchedulingState enumerates the values for scheduling state. -type SchedulingState string - -const ( - // Disabled No new tasks will be scheduled on the node. Tasks already running on the node may still run to - // completion. All nodes start with scheduling enabled. - Disabled SchedulingState = "disabled" - // Enabled Tasks can be scheduled on the node. - Enabled SchedulingState = "enabled" -) - -// PossibleSchedulingStateValues returns an array of possible values for the SchedulingState const type. -func PossibleSchedulingStateValues() []SchedulingState { - return []SchedulingState{Disabled, Enabled} -} - -// StartTaskState enumerates the values for start task state. -type StartTaskState string - -const ( - // StartTaskStateCompleted The start task has exited with exit code 0, or the start task has failed and the - // retry limit has reached, or the start task process did not run due to task preparation errors (such as - // resource file download failures). - StartTaskStateCompleted StartTaskState = "completed" - // StartTaskStateRunning The start task is currently running. - StartTaskStateRunning StartTaskState = "running" -) - -// PossibleStartTaskStateValues returns an array of possible values for the StartTaskState const type. -func PossibleStartTaskStateValues() []StartTaskState { - return []StartTaskState{StartTaskStateCompleted, StartTaskStateRunning} -} - -// StorageAccountType enumerates the values for storage account type. -type StorageAccountType string - -const ( - // PremiumLRS The data disk should use premium locally redundant storage. - PremiumLRS StorageAccountType = "premium_lrs" - // StandardLRS The data disk should use standard locally redundant storage. - StandardLRS StorageAccountType = "standard_lrs" -) - -// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. -func PossibleStorageAccountTypeValues() []StorageAccountType { - return []StorageAccountType{PremiumLRS, StandardLRS} -} - -// SubtaskState enumerates the values for subtask state. -type SubtaskState string - -const ( - // SubtaskStateCompleted The task is no longer eligible to run, usually because the task has finished - // successfully, or the task has finished unsuccessfully and has exhausted its retry limit. A task is also - // marked as completed if an error occurred launching the task, or when the task has been terminated. - SubtaskStateCompleted SubtaskState = "completed" - // SubtaskStatePreparing The task has been assigned to a compute node, but is waiting for a required Job - // Preparation task to complete on the node. If the Job Preparation task succeeds, the task will move to - // running. If the Job Preparation task fails, the task will return to active and will be eligible to be - // assigned to a different node. - SubtaskStatePreparing SubtaskState = "preparing" - // SubtaskStateRunning The task is running on a compute node. This includes task-level preparation such as - // downloading resource files or deploying application packages specified on the task - it does not - // necessarily mean that the task command line has started executing. - SubtaskStateRunning SubtaskState = "running" -) - -// PossibleSubtaskStateValues returns an array of possible values for the SubtaskState const type. -func PossibleSubtaskStateValues() []SubtaskState { - return []SubtaskState{SubtaskStateCompleted, SubtaskStatePreparing, SubtaskStateRunning} -} - -// TaskAddStatus enumerates the values for task add status. -type TaskAddStatus string - -const ( - // TaskAddStatusClientError The task failed to add due to a client error and should not be retried without - // modifying the request as appropriate. - TaskAddStatusClientError TaskAddStatus = "clienterror" - // TaskAddStatusServerError Task failed to add due to a server error and can be retried without - // modification. - TaskAddStatusServerError TaskAddStatus = "servererror" - // TaskAddStatusSuccess The task was added successfully. - TaskAddStatusSuccess TaskAddStatus = "success" -) - -// PossibleTaskAddStatusValues returns an array of possible values for the TaskAddStatus const type. -func PossibleTaskAddStatusValues() []TaskAddStatus { - return []TaskAddStatus{TaskAddStatusClientError, TaskAddStatusServerError, TaskAddStatusSuccess} -} - -// TaskCountValidationStatus enumerates the values for task count validation status. -type TaskCountValidationStatus string - -const ( - // Unvalidated The Batch service has not been able to check state counts against the task states as - // reported in the List Tasks API. The validationStatus may be unvalidated if the job contains more than - // 200,000 tasks. - Unvalidated TaskCountValidationStatus = "unvalidated" - // Validated The Batch service has validated the state counts against the task states as reported in the - // List Tasks API. - Validated TaskCountValidationStatus = "validated" -) - -// PossibleTaskCountValidationStatusValues returns an array of possible values for the TaskCountValidationStatus const type. -func PossibleTaskCountValidationStatusValues() []TaskCountValidationStatus { - return []TaskCountValidationStatus{Unvalidated, Validated} -} - -// TaskExecutionResult enumerates the values for task execution result. -type TaskExecutionResult string - -const ( - // Failure There was an error during processing of the task. The failure may have occurred before the task - // process was launched, while the task process was executing, or after the task process exited. - Failure TaskExecutionResult = "failure" - // Success The task ran successfully. - Success TaskExecutionResult = "success" -) - -// PossibleTaskExecutionResultValues returns an array of possible values for the TaskExecutionResult const type. -func PossibleTaskExecutionResultValues() []TaskExecutionResult { - return []TaskExecutionResult{Failure, Success} -} - -// TaskState enumerates the values for task state. -type TaskState string - -const ( - // TaskStateActive The task is queued and able to run, but is not currently assigned to a compute node. A - // task enters this state when it is created, when it is enabled after being disabled, or when it is - // awaiting a retry after a failed run. - TaskStateActive TaskState = "active" - // TaskStateCompleted The task is no longer eligible to run, usually because the task has finished - // successfully, or the task has finished unsuccessfully and has exhausted its retry limit. A task is also - // marked as completed if an error occurred launching the task, or when the task has been terminated. - TaskStateCompleted TaskState = "completed" - // TaskStatePreparing The task has been assigned to a compute node, but is waiting for a required Job - // Preparation task to complete on the node. If the Job Preparation task succeeds, the task will move to - // running. If the Job Preparation task fails, the task will return to active and will be eligible to be - // assigned to a different node. - TaskStatePreparing TaskState = "preparing" - // TaskStateRunning The task is running on a compute node. This includes task-level preparation such as - // downloading resource files or deploying application packages specified on the task - it does not - // necessarily mean that the task command line has started executing. - TaskStateRunning TaskState = "running" -) - -// PossibleTaskStateValues returns an array of possible values for the TaskState const type. -func PossibleTaskStateValues() []TaskState { - return []TaskState{TaskStateActive, TaskStateCompleted, TaskStatePreparing, TaskStateRunning} -} - -// AccountListNodeAgentSkusResult ... -type AccountListNodeAgentSkusResult struct { - autorest.Response `json:"-"` - Value *[]NodeAgentSku `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// AccountListNodeAgentSkusResultIterator provides access to a complete listing of NodeAgentSku values. -type AccountListNodeAgentSkusResultIterator struct { - i int - page AccountListNodeAgentSkusResultPage -} - -// Next 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 *AccountListNodeAgentSkusResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AccountListNodeAgentSkusResultIterator) 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 AccountListNodeAgentSkusResultIterator) Response() AccountListNodeAgentSkusResult { - 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 AccountListNodeAgentSkusResultIterator) Value() NodeAgentSku { - if !iter.page.NotDone() { - return NodeAgentSku{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (alnasr AccountListNodeAgentSkusResult) IsEmpty() bool { - return alnasr.Value == nil || len(*alnasr.Value) == 0 -} - -// accountListNodeAgentSkusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alnasr AccountListNodeAgentSkusResult) accountListNodeAgentSkusResultPreparer() (*http.Request, error) { - if alnasr.OdataNextLink == nil || len(to.String(alnasr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alnasr.OdataNextLink))) -} - -// AccountListNodeAgentSkusResultPage contains a page of NodeAgentSku values. -type AccountListNodeAgentSkusResultPage struct { - fn func(AccountListNodeAgentSkusResult) (AccountListNodeAgentSkusResult, error) - alnasr AccountListNodeAgentSkusResult -} - -// 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. -func (page *AccountListNodeAgentSkusResultPage) Next() error { - next, err := page.fn(page.alnasr) - if err != nil { - return err - } - page.alnasr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AccountListNodeAgentSkusResultPage) NotDone() bool { - return !page.alnasr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AccountListNodeAgentSkusResultPage) Response() AccountListNodeAgentSkusResult { - return page.alnasr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AccountListNodeAgentSkusResultPage) Values() []NodeAgentSku { - if page.alnasr.IsEmpty() { - return nil - } - return *page.alnasr.Value -} - -// AffinityInformation ... -type AffinityInformation struct { - // AffinityID - You can pass the affinityId of a compute node to indicate that this task needs to run on that compute node. Note that this is just a soft affinity. If the target node is busy or unavailable at the time the task is scheduled, then the task will be scheduled elsewhere. - AffinityID *string `json:"affinityId,omitempty"` -} - -// ApplicationListResult ... -type ApplicationListResult struct { - autorest.Response `json:"-"` - Value *[]ApplicationSummary `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// ApplicationListResultIterator provides access to a complete listing of ApplicationSummary values. -type ApplicationListResultIterator struct { - i int - page ApplicationListResultPage -} - -// Next 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 *ApplicationListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationListResultIterator) 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 ApplicationListResultIterator) Response() ApplicationListResult { - 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 ApplicationListResultIterator) Value() ApplicationSummary { - if !iter.page.NotDone() { - return ApplicationSummary{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (alr ApplicationListResult) IsEmpty() bool { - return alr.Value == nil || len(*alr.Value) == 0 -} - -// applicationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alr ApplicationListResult) applicationListResultPreparer() (*http.Request, error) { - if alr.OdataNextLink == nil || len(to.String(alr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alr.OdataNextLink))) -} - -// ApplicationListResultPage contains a page of ApplicationSummary values. -type ApplicationListResultPage struct { - fn func(ApplicationListResult) (ApplicationListResult, error) - alr ApplicationListResult -} - -// 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. -func (page *ApplicationListResultPage) Next() error { - next, err := page.fn(page.alr) - if err != nil { - return err - } - page.alr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationListResultPage) NotDone() bool { - return !page.alr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationListResultPage) Response() ApplicationListResult { - return page.alr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationListResultPage) Values() []ApplicationSummary { - if page.alr.IsEmpty() { - return nil - } - return *page.alr.Value -} - -// ApplicationPackageReference ... -type ApplicationPackageReference struct { - ApplicationID *string `json:"applicationId,omitempty"` - // Version - If this is omitted on a pool, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences and HTTP status code 409. If this is omitted on a task, and no default version is specified for this application, the task fails with a pre-processing error. - Version *string `json:"version,omitempty"` -} - -// ApplicationSummary ... -type ApplicationSummary struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Versions *[]string `json:"versions,omitempty"` -} - -// AuthenticationTokenSettings ... -type AuthenticationTokenSettings struct { - // Access - The authentication token grants access to a limited set of Batch service operations. Currently the only supported value for the access property is 'job', which grants access to all operations related to the job which contains the task. - Access *[]AccessScope `json:"access,omitempty"` -} - -// AutoPoolSpecification ... -type AutoPoolSpecification struct { - // AutoPoolIDPrefix - The Batch service assigns each auto pool a unique identifier on creation. To distinguish between pools created for different purposes, you can specify this element to add a prefix to the ID that is assigned. The prefix can be up to 20 characters long. - AutoPoolIDPrefix *string `json:"autoPoolIdPrefix,omitempty"` - // PoolLifetimeOption - Possible values include: 'PoolLifetimeOptionJobSchedule', 'PoolLifetimeOptionJob' - PoolLifetimeOption PoolLifetimeOption `json:"poolLifetimeOption,omitempty"` - // KeepAlive - If false, the Batch service deletes the pool once its lifetime (as determined by the poolLifetimeOption setting) expires; that is, when the job or job schedule completes. If true, the Batch service does not delete the pool automatically. It is up to the user to delete auto pools created with this option. - KeepAlive *bool `json:"keepAlive,omitempty"` - Pool *PoolSpecification `json:"pool,omitempty"` -} - -// AutoScaleRun ... -type AutoScaleRun struct { - autorest.Response `json:"-"` - Timestamp *date.Time `json:"timestamp,omitempty"` - // Results - Each variable value is returned in the form $variable=value, and variables are separated by semicolons. - Results *string `json:"results,omitempty"` - Error *AutoScaleRunError `json:"error,omitempty"` -} - -// AutoScaleRunError ... -type AutoScaleRunError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Values *[]NameValuePair `json:"values,omitempty"` -} - -// AutoUserSpecification ... -type AutoUserSpecification struct { - // Scope - The default value is task. Possible values include: 'Task', 'Pool' - Scope AutoUserScope `json:"scope,omitempty"` - // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin' - ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"` -} - -// Certificate a certificate that can be installed on compute nodes and can be used to authenticate operations on -// the machine. -type Certificate struct { - autorest.Response `json:"-"` - Thumbprint *string `json:"thumbprint,omitempty"` - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - URL *string `json:"url,omitempty"` - // State - Possible values include: 'Active', 'Deleting', 'DeleteFailed' - State CertificateState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the certificate is in its initial active state. Possible values include: 'Active', 'Deleting', 'DeleteFailed' - PreviousState CertificateState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the certificate is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - PublicData *string `json:"publicData,omitempty"` - // DeleteCertificateError - This property is set only if the certificate is in the DeleteFailed state. - DeleteCertificateError *DeleteCertificateError `json:"deleteCertificateError,omitempty"` -} - -// CertificateAddParameter ... -type CertificateAddParameter struct { - Thumbprint *string `json:"thumbprint,omitempty"` - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - Data *string `json:"data,omitempty"` - // CertificateFormat - Possible values include: 'Pfx', 'Cer' - CertificateFormat CertificateFormat `json:"certificateFormat,omitempty"` - // Password - This is required if the certificate format is pfx. It should be omitted if the certificate format is cer. - Password *string `json:"password,omitempty"` -} - -// CertificateListResult ... -type CertificateListResult struct { - autorest.Response `json:"-"` - Value *[]Certificate `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CertificateListResultIterator provides access to a complete listing of Certificate values. -type CertificateListResultIterator struct { - i int - page CertificateListResultPage -} - -// Next 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 *CertificateListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CertificateListResultIterator) 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 CertificateListResultIterator) Response() CertificateListResult { - 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 CertificateListResultIterator) Value() Certificate { - if !iter.page.NotDone() { - return Certificate{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (clr CertificateListResult) IsEmpty() bool { - return clr.Value == nil || len(*clr.Value) == 0 -} - -// certificateListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) { - if clr.OdataNextLink == nil || len(to.String(clr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(clr.OdataNextLink))) -} - -// CertificateListResultPage contains a page of Certificate values. -type CertificateListResultPage struct { - fn func(CertificateListResult) (CertificateListResult, error) - clr CertificateListResult -} - -// 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. -func (page *CertificateListResultPage) Next() error { - next, err := page.fn(page.clr) - if err != nil { - return err - } - page.clr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CertificateListResultPage) NotDone() bool { - return !page.clr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CertificateListResultPage) Response() CertificateListResult { - return page.clr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CertificateListResultPage) Values() []Certificate { - if page.clr.IsEmpty() { - return nil - } - return *page.clr.Value -} - -// CertificateReference ... -type CertificateReference struct { - Thumbprint *string `json:"thumbprint,omitempty"` - ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` - // StoreLocation - The default value is currentuser. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. Possible values include: 'CurrentUser', 'LocalMachine' - StoreLocation CertificateStoreLocation `json:"storeLocation,omitempty"` - // StoreName - This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My. - StoreName *string `json:"storeName,omitempty"` - // Visibility - You can specify more than one visibility in this collection. The default is all accounts. - Visibility *[]CertificateVisibility `json:"visibility,omitempty"` -} - -// CloudJob ... -type CloudJob struct { - autorest.Response `json:"-"` - // ID - The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case). - ID *string `json:"id,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the job has changed between requests. In particular, you can be pass the ETag when updating a job to specify that your changes should take effect only if nobody else has modified the job in the meantime. - ETag *string `json:"eTag,omitempty"` - // LastModified - This is the last time at which the job level data, such as the job state or priority, changed. It does not factor in task-level changes such as adding new tasks or tasks changing state. - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting' - State JobState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the job is in its initial Active state. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting' - PreviousState JobState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the job is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. - Priority *int32 `json:"priority,omitempty"` - Constraints *JobConstraints `json:"constraints,omitempty"` - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - The Job Preparation task is a special task run on each node before any other task of the job. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - The Job Release task is a special task run at the end of the job on each node that has run any other task of the job. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value. - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // OnAllTasksComplete - The default is noaction. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // OnTaskFailure - A task is considered to have failed if has a failureInfo. A failureInfo is set if the task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the task, for example due to a resource file download error. The default is noaction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction' - OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - ExecutionInfo *JobExecutionInformation `json:"executionInfo,omitempty"` - Stats *JobStatistics `json:"stats,omitempty"` -} - -// CloudJobListPreparationAndReleaseTaskStatusResult ... -type CloudJobListPreparationAndReleaseTaskStatusResult struct { - autorest.Response `json:"-"` - Value *[]JobPreparationAndReleaseTaskExecutionInformation `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobListPreparationAndReleaseTaskStatusResultIterator provides access to a complete listing of -// JobPreparationAndReleaseTaskExecutionInformation values. -type CloudJobListPreparationAndReleaseTaskStatusResultIterator struct { - i int - page CloudJobListPreparationAndReleaseTaskStatusResultPage -} - -// Next 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 *CloudJobListPreparationAndReleaseTaskStatusResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) 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 CloudJobListPreparationAndReleaseTaskStatusResultIterator) Response() CloudJobListPreparationAndReleaseTaskStatusResult { - 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 CloudJobListPreparationAndReleaseTaskStatusResultIterator) Value() JobPreparationAndReleaseTaskExecutionInformation { - if !iter.page.NotDone() { - return JobPreparationAndReleaseTaskExecutionInformation{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) IsEmpty() bool { - return cjlpartsr.Value == nil || len(*cjlpartsr.Value) == 0 -} - -// cloudJobListPreparationAndReleaseTaskStatusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) cloudJobListPreparationAndReleaseTaskStatusResultPreparer() (*http.Request, error) { - if cjlpartsr.OdataNextLink == nil || len(to.String(cjlpartsr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjlpartsr.OdataNextLink))) -} - -// CloudJobListPreparationAndReleaseTaskStatusResultPage contains a page of -// JobPreparationAndReleaseTaskExecutionInformation values. -type CloudJobListPreparationAndReleaseTaskStatusResultPage struct { - fn func(CloudJobListPreparationAndReleaseTaskStatusResult) (CloudJobListPreparationAndReleaseTaskStatusResult, error) - cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult -} - -// 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. -func (page *CloudJobListPreparationAndReleaseTaskStatusResultPage) Next() error { - next, err := page.fn(page.cjlpartsr) - if err != nil { - return err - } - page.cjlpartsr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) NotDone() bool { - return !page.cjlpartsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Response() CloudJobListPreparationAndReleaseTaskStatusResult { - return page.cjlpartsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Values() []JobPreparationAndReleaseTaskExecutionInformation { - if page.cjlpartsr.IsEmpty() { - return nil - } - return *page.cjlpartsr.Value -} - -// CloudJobListResult ... -type CloudJobListResult struct { - autorest.Response `json:"-"` - Value *[]CloudJob `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobListResultIterator provides access to a complete listing of CloudJob values. -type CloudJobListResultIterator struct { - i int - page CloudJobListResultPage -} - -// Next 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 *CloudJobListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobListResultIterator) 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 CloudJobListResultIterator) Response() CloudJobListResult { - 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 CloudJobListResultIterator) Value() CloudJob { - if !iter.page.NotDone() { - return CloudJob{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjlr CloudJobListResult) IsEmpty() bool { - return cjlr.Value == nil || len(*cjlr.Value) == 0 -} - -// cloudJobListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjlr CloudJobListResult) cloudJobListResultPreparer() (*http.Request, error) { - if cjlr.OdataNextLink == nil || len(to.String(cjlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjlr.OdataNextLink))) -} - -// CloudJobListResultPage contains a page of CloudJob values. -type CloudJobListResultPage struct { - fn func(CloudJobListResult) (CloudJobListResult, error) - cjlr CloudJobListResult -} - -// 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. -func (page *CloudJobListResultPage) Next() error { - next, err := page.fn(page.cjlr) - if err != nil { - return err - } - page.cjlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobListResultPage) NotDone() bool { - return !page.cjlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobListResultPage) Response() CloudJobListResult { - return page.cjlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobListResultPage) Values() []CloudJob { - if page.cjlr.IsEmpty() { - return nil - } - return *page.cjlr.Value -} - -// CloudJobSchedule ... -type CloudJobSchedule struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the job schedule has changed between requests. In particular, you can be pass the ETag with an Update Job Schedule request to specify that your changes should take effect only if nobody else has modified the schedule in the meantime. - ETag *string `json:"eTag,omitempty"` - // LastModified - This is the last time at which the schedule level data, such as the job specification or recurrence information, changed. It does not factor in job-level changes such as new jobs being created or jobs changing state. - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting' - State JobScheduleState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not present if the job schedule is in its initial active state. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting' - PreviousState JobScheduleState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not present if the job schedule is in its initial active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - Schedule *Schedule `json:"schedule,omitempty"` - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - ExecutionInfo *JobScheduleExecutionInformation `json:"executionInfo,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - Stats *JobScheduleStatistics `json:"stats,omitempty"` -} - -// CloudJobScheduleListResult ... -type CloudJobScheduleListResult struct { - autorest.Response `json:"-"` - Value *[]CloudJobSchedule `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudJobScheduleListResultIterator provides access to a complete listing of CloudJobSchedule values. -type CloudJobScheduleListResultIterator struct { - i int - page CloudJobScheduleListResultPage -} - -// Next 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 *CloudJobScheduleListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudJobScheduleListResultIterator) 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 CloudJobScheduleListResultIterator) Response() CloudJobScheduleListResult { - 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 CloudJobScheduleListResultIterator) Value() CloudJobSchedule { - if !iter.page.NotDone() { - return CloudJobSchedule{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cjslr CloudJobScheduleListResult) IsEmpty() bool { - return cjslr.Value == nil || len(*cjslr.Value) == 0 -} - -// cloudJobScheduleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cjslr CloudJobScheduleListResult) cloudJobScheduleListResultPreparer() (*http.Request, error) { - if cjslr.OdataNextLink == nil || len(to.String(cjslr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cjslr.OdataNextLink))) -} - -// CloudJobScheduleListResultPage contains a page of CloudJobSchedule values. -type CloudJobScheduleListResultPage struct { - fn func(CloudJobScheduleListResult) (CloudJobScheduleListResult, error) - cjslr CloudJobScheduleListResult -} - -// 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. -func (page *CloudJobScheduleListResultPage) Next() error { - next, err := page.fn(page.cjslr) - if err != nil { - return err - } - page.cjslr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudJobScheduleListResultPage) NotDone() bool { - return !page.cjslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudJobScheduleListResultPage) Response() CloudJobScheduleListResult { - return page.cjslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudJobScheduleListResultPage) Values() []CloudJobSchedule { - if page.cjslr.IsEmpty() { - return nil - } - return *page.cjslr.Value -} - -// CloudPool ... -type CloudPool struct { - autorest.Response `json:"-"` - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the pool has changed between requests. In particular, you can be pass the ETag when updating a pool to specify that your changes should take effect only if nobody else has modified the pool in the meantime. - ETag *string `json:"eTag,omitempty"` - // LastModified - This is the last time at which the pool level data, such as the targetDedicatedNodes or enableAutoscale settings, changed. It does not factor in node-level changes such as a compute node changing state. - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // State - Possible values include: 'PoolStateActive', 'PoolStateDeleting', 'PoolStateUpgrading' - State PoolState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // AllocationState - Possible values include: 'Steady', 'Resizing', 'Stopping' - AllocationState AllocationState `json:"allocationState,omitempty"` - AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // ResizeTimeout - This is the timeout for the most recent resize operation. (The initial sizing when the pool is created counts as a resize.) The default value is 15 minutes. - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // ResizeErrors - This property is set only if one or more errors occurred during the last pool resize, and only when the pool allocationState is Steady. - ResizeErrors *[]ResizeError `json:"resizeErrors,omitempty"` - CurrentDedicatedNodes *int32 `json:"currentDedicatedNodes,omitempty"` - // CurrentLowPriorityNodes - Low-priority compute nodes which have been preempted are included in this count. - CurrentLowPriorityNodes *int32 `json:"currentLowPriorityNodes,omitempty"` - TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"` - TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"` - // EnableAutoScale - If false, at least one of targetDedicateNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the pool automatically resizes according to the formula. The default value is false. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - This property is set only if the pool automatically scales, i.e. enableAutoScale is true. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - This property is set only if the pool automatically scales, i.e. enableAutoScale is true. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // AutoScaleRun - This property is set only if the pool automatically scales, i.e. enableAutoScale is true. - AutoScaleRun *AutoScaleRun `json:"autoScaleRun,omitempty"` - // EnableInterNodeCommunication - This imposes restrictions on which nodes can be assigned to the pool. Specifying this value can reduce the chance of the requested number of nodes to be allocated in the pool. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // ApplicationLicenses - The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail. - ApplicationLicenses *[]string `json:"applicationLicenses,omitempty"` - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - UserAccounts *[]UserAccount `json:"userAccounts,omitempty"` - Metadata *[]MetadataItem `json:"metadata,omitempty"` - Stats *PoolStatistics `json:"stats,omitempty"` -} - -// CloudPoolListResult ... -type CloudPoolListResult struct { - autorest.Response `json:"-"` - Value *[]CloudPool `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudPoolListResultIterator provides access to a complete listing of CloudPool values. -type CloudPoolListResultIterator struct { - i int - page CloudPoolListResultPage -} - -// Next 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 *CloudPoolListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudPoolListResultIterator) 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 CloudPoolListResultIterator) Response() CloudPoolListResult { - 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 CloudPoolListResultIterator) Value() CloudPool { - if !iter.page.NotDone() { - return CloudPool{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cplr CloudPoolListResult) IsEmpty() bool { - return cplr.Value == nil || len(*cplr.Value) == 0 -} - -// cloudPoolListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cplr CloudPoolListResult) cloudPoolListResultPreparer() (*http.Request, error) { - if cplr.OdataNextLink == nil || len(to.String(cplr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cplr.OdataNextLink))) -} - -// CloudPoolListResultPage contains a page of CloudPool values. -type CloudPoolListResultPage struct { - fn func(CloudPoolListResult) (CloudPoolListResult, error) - cplr CloudPoolListResult -} - -// 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. -func (page *CloudPoolListResultPage) Next() error { - next, err := page.fn(page.cplr) - if err != nil { - return err - } - page.cplr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudPoolListResultPage) NotDone() bool { - return !page.cplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudPoolListResultPage) Response() CloudPoolListResult { - return page.cplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudPoolListResultPage) Values() []CloudPool { - if page.cplr.IsEmpty() { - return nil - } - return *page.cplr.Value -} - -// CloudServiceConfiguration ... -type CloudServiceConfiguration struct { - // OsFamily - Possible values are: 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 - OS Family 3, equivalent to Windows Server 2012. 4 - OS Family 4, equivalent to Windows Server 2012 R2. 5 - OS Family 5, equivalent to Windows Server 2016. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). - OsFamily *string `json:"osFamily,omitempty"` - // TargetOSVersion - The default value is * which specifies the latest operating system version for the specified OS family. - TargetOSVersion *string `json:"targetOSVersion,omitempty"` - // CurrentOSVersion - This may differ from targetOSVersion if the pool state is Upgrading. In this case some virtual machines may be on the targetOSVersion and some may be on the currentOSVersion during the upgrade process. Once all virtual machines have upgraded, currentOSVersion is updated to be the same as targetOSVersion. - CurrentOSVersion *string `json:"currentOSVersion,omitempty"` -} - -// CloudTask ... -type CloudTask struct { - autorest.Response `json:"-"` - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - URL *string `json:"url,omitempty"` - // ETag - This is an opaque string. You can use it to detect whether the task has changed between requests. In particular, you can be pass the ETag when updating a task to specify that your changes should take effect only if nobody else has modified the task in the meantime. - ETag *string `json:"eTag,omitempty"` - LastModified *date.Time `json:"lastModified,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // ExitConditions - How the Batch service should respond when the task completes. - ExitConditions *ExitConditions `json:"exitConditions,omitempty"` - // State - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - State TaskState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the task is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - PreviousState TaskState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the task is in its initial Active state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ContainerSettings - If the pool that will run this task has containerConfiguration set, this must be set as well. If the pool that will run this task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container. - ContainerSettings *TaskContainerSettings `json:"containerSettings,omitempty"` - // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // OutputFiles - For multi-instance tasks, the files will only be uploaded from the compute node on which the primary task is executed. - OutputFiles *[]OutputFile `json:"outputFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"` - Constraints *TaskConstraints `json:"constraints,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"` - NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"` - MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"` - Stats *TaskStatistics `json:"stats,omitempty"` - // DependsOn - This task will not be scheduled until all tasks that it depends on have completed successfully. If any of those tasks fail and exhaust their retry counts, this task will never be scheduled. - DependsOn *TaskDependencies `json:"dependsOn,omitempty"` - // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task working directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job. - AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"` -} - -// CloudTaskListResult ... -type CloudTaskListResult struct { - autorest.Response `json:"-"` - Value *[]CloudTask `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// CloudTaskListResultIterator provides access to a complete listing of CloudTask values. -type CloudTaskListResultIterator struct { - i int - page CloudTaskListResultPage -} - -// Next 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 *CloudTaskListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudTaskListResultIterator) 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 CloudTaskListResultIterator) Response() CloudTaskListResult { - 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 CloudTaskListResultIterator) Value() CloudTask { - if !iter.page.NotDone() { - return CloudTask{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (ctlr CloudTaskListResult) IsEmpty() bool { - return ctlr.Value == nil || len(*ctlr.Value) == 0 -} - -// cloudTaskListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ctlr CloudTaskListResult) cloudTaskListResultPreparer() (*http.Request, error) { - if ctlr.OdataNextLink == nil || len(to.String(ctlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ctlr.OdataNextLink))) -} - -// CloudTaskListResultPage contains a page of CloudTask values. -type CloudTaskListResultPage struct { - fn func(CloudTaskListResult) (CloudTaskListResult, error) - ctlr CloudTaskListResult -} - -// 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. -func (page *CloudTaskListResultPage) Next() error { - next, err := page.fn(page.ctlr) - if err != nil { - return err - } - page.ctlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudTaskListResultPage) NotDone() bool { - return !page.ctlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudTaskListResultPage) Response() CloudTaskListResult { - return page.ctlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudTaskListResultPage) Values() []CloudTask { - if page.ctlr.IsEmpty() { - return nil - } - return *page.ctlr.Value -} - -// CloudTaskListSubtasksResult ... -type CloudTaskListSubtasksResult struct { - autorest.Response `json:"-"` - Value *[]SubtaskInformation `json:"value,omitempty"` -} - -// ComputeNode ... -type ComputeNode struct { - autorest.Response `json:"-"` - // ID - Every node that is added to a pool is assigned a unique ID. Whenever a node is removed from a pool, all of its local files are deleted, and the ID is reclaimed and could be reused for new nodes. - ID *string `json:"id,omitempty"` - URL *string `json:"url,omitempty"` - // State - The low-priority node has been preempted. Tasks which were running on the node when it was pre-empted will be rescheduled when another node becomes available. Possible values include: 'Idle', 'Rebooting', 'Reimaging', 'Running', 'Unusable', 'Creating', 'Starting', 'WaitingForStartTask', 'StartTaskFailed', 'Unknown', 'LeavingPool', 'Offline', 'Preempted' - State ComputeNodeState `json:"state,omitempty"` - // SchedulingState - Possible values include: 'Enabled', 'Disabled' - SchedulingState SchedulingState `json:"schedulingState,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // LastBootTime - This property may not be present if the node state is unusable. - LastBootTime *date.Time `json:"lastBootTime,omitempty"` - AllocationTime *date.Time `json:"allocationTime,omitempty"` - // IPAddress - Every node that is added to a pool is assigned a unique IP address. Whenever a node is removed from a pool, all of its local files are deleted, and the IP address is reclaimed and could be reused for new nodes. - IPAddress *string `json:"ipAddress,omitempty"` - // AffinityID - Note that this is just a soft affinity. If the target node is busy or unavailable at the time the task is scheduled, then the task will be scheduled elsewhere. - AffinityID *string `json:"affinityId,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - TotalTasksRun *int32 `json:"totalTasksRun,omitempty"` - RunningTasksCount *int32 `json:"runningTasksCount,omitempty"` - TotalTasksSucceeded *int32 `json:"totalTasksSucceeded,omitempty"` - // RecentTasks - This property is present only if at least one task has run on this node since it was assigned to the pool. - RecentTasks *[]TaskInformation `json:"recentTasks,omitempty"` - StartTask *StartTask `json:"startTask,omitempty"` - StartTaskInfo *StartTaskInformation `json:"startTaskInfo,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - Errors *[]ComputeNodeError `json:"errors,omitempty"` - IsDedicated *bool `json:"isDedicated,omitempty"` - EndpointConfiguration *ComputeNodeEndpointConfiguration `json:"endpointConfiguration,omitempty"` -} - -// ComputeNodeEndpointConfiguration ... -type ComputeNodeEndpointConfiguration struct { - InboundEndpoints *[]InboundEndpoint `json:"inboundEndpoints,omitempty"` -} - -// ComputeNodeError ... -type ComputeNodeError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - ErrorDetails *[]NameValuePair `json:"errorDetails,omitempty"` -} - -// ComputeNodeGetRemoteLoginSettingsResult ... -type ComputeNodeGetRemoteLoginSettingsResult struct { - autorest.Response `json:"-"` - RemoteLoginIPAddress *string `json:"remoteLoginIPAddress,omitempty"` - RemoteLoginPort *int32 `json:"remoteLoginPort,omitempty"` -} - -// ComputeNodeInformation ... -type ComputeNodeInformation struct { - AffinityID *string `json:"affinityId,omitempty"` - NodeURL *string `json:"nodeUrl,omitempty"` - PoolID *string `json:"poolId,omitempty"` - NodeID *string `json:"nodeId,omitempty"` - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` -} - -// ComputeNodeListResult ... -type ComputeNodeListResult struct { - autorest.Response `json:"-"` - Value *[]ComputeNode `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// ComputeNodeListResultIterator provides access to a complete listing of ComputeNode values. -type ComputeNodeListResultIterator struct { - i int - page ComputeNodeListResultPage -} - -// Next 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 *ComputeNodeListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ComputeNodeListResultIterator) 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 ComputeNodeListResultIterator) Response() ComputeNodeListResult { - 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 ComputeNodeListResultIterator) Value() ComputeNode { - if !iter.page.NotDone() { - return ComputeNode{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (cnlr ComputeNodeListResult) IsEmpty() bool { - return cnlr.Value == nil || len(*cnlr.Value) == 0 -} - -// computeNodeListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cnlr ComputeNodeListResult) computeNodeListResultPreparer() (*http.Request, error) { - if cnlr.OdataNextLink == nil || len(to.String(cnlr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cnlr.OdataNextLink))) -} - -// ComputeNodeListResultPage contains a page of ComputeNode values. -type ComputeNodeListResultPage struct { - fn func(ComputeNodeListResult) (ComputeNodeListResult, error) - cnlr ComputeNodeListResult -} - -// 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. -func (page *ComputeNodeListResultPage) Next() error { - next, err := page.fn(page.cnlr) - if err != nil { - return err - } - page.cnlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ComputeNodeListResultPage) NotDone() bool { - return !page.cnlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ComputeNodeListResultPage) Response() ComputeNodeListResult { - return page.cnlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ComputeNodeListResultPage) Values() []ComputeNode { - if page.cnlr.IsEmpty() { - return nil - } - return *page.cnlr.Value -} - -// ComputeNodeUser ... -type ComputeNodeUser struct { - Name *string `json:"name,omitempty"` - // IsAdmin - The default value is false. - IsAdmin *bool `json:"isAdmin,omitempty"` - // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property. - Password *string `json:"password,omitempty"` - // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - SSHPublicKey *string `json:"sshPublicKey,omitempty"` -} - -// ContainerConfiguration ... -type ContainerConfiguration struct { - Type *string `json:"type,omitempty"` - // ContainerImageNames - This is the full image reference, as would be specified to "docker pull". An image will be sourced from the default Docker registry unless the image is fully qualified with an alternative registry. - ContainerImageNames *[]string `json:"containerImageNames,omitempty"` - // ContainerRegistries - If any images must be downloaded from a private registry which requires credentials, then those credentials must be provided here. - ContainerRegistries *[]ContainerRegistry `json:"containerRegistries,omitempty"` -} - -// ContainerRegistry ... -type ContainerRegistry struct { - // RegistryServer - If omitted, the default is "docker.io". - RegistryServer *string `json:"registryServer,omitempty"` - UserName *string `json:"username,omitempty"` - Password *string `json:"password,omitempty"` -} - -// DataDisk ... -type DataDisk struct { - // Lun - The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. - Lun *int32 `json:"lun,omitempty"` - // Caching - The default value for caching is none. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - Caching CachingType `json:"caching,omitempty"` - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // StorageAccountType - If omitted, the default is "standard_lrs". Possible values include: 'StandardLRS', 'PremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` -} - -// DeleteCertificateError ... -type DeleteCertificateError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - // Values - This list includes details such as the active pools and nodes referencing this certificate. However, if a large number of resources reference the certificate, the list contains only about the first hundred. - Values *[]NameValuePair `json:"values,omitempty"` -} - -// EnvironmentSetting ... -type EnvironmentSetting struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -// Error ... -type Error struct { - Code *string `json:"code,omitempty"` - Message *ErrorMessage `json:"message,omitempty"` - Values *[]ErrorDetail `json:"values,omitempty"` -} - -// ErrorDetail ... -type ErrorDetail struct { - Key *string `json:"key,omitempty"` - Value *string `json:"value,omitempty"` -} - -// ErrorMessage ... -type ErrorMessage struct { - Lang *string `json:"lang,omitempty"` - Value *string `json:"value,omitempty"` -} - -// ExitCodeMapping ... -type ExitCodeMapping struct { - Code *int32 `json:"code,omitempty"` - ExitOptions *ExitOptions `json:"exitOptions,omitempty"` -} - -// ExitCodeRangeMapping ... -type ExitCodeRangeMapping struct { - Start *int32 `json:"start,omitempty"` - End *int32 `json:"end,omitempty"` - ExitOptions *ExitOptions `json:"exitOptions,omitempty"` -} - -// ExitConditions ... -type ExitConditions struct { - ExitCodes *[]ExitCodeMapping `json:"exitCodes,omitempty"` - ExitCodeRanges *[]ExitCodeRangeMapping `json:"exitCodeRanges,omitempty"` - PreProcessingError *ExitOptions `json:"preProcessingError,omitempty"` - // FileUploadError - If the task exited with an exit code that was specified via exitCodes or exitCodeRanges, and then encountered a file upload error, then the action specified by the exit code takes precedence. - FileUploadError *ExitOptions `json:"fileUploadError,omitempty"` - // Default - This value is used if the task exits with any nonzero exit code not listed in the exitCodes or exitCodeRanges collection, with a pre-processing error if the preProcessingError property is not present, or with a file upload error if the fileUploadError property is not present. If you want non-default behaviour on exit code 0, you must list it explicitly using the exitCodes or exitCodeRanges collection. - Default *ExitOptions `json:"default,omitempty"` -} - -// ExitOptions ... -type ExitOptions struct { - // JobAction - The default is none for exit code 0 and terminate for all other exit conditions. If the job's onTaskFailed property is noaction, then specifying this property returns an error and the add task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'JobActionNone', 'JobActionDisable', 'JobActionTerminate' - JobAction JobAction `json:"jobAction,omitempty"` - // DependencyAction - The default is 'satisfy' for exit code 0, and 'block' for all other exit conditions. If the job's usesTaskDependencies property is set to false, then specifying the dependencyAction property returns an error and the add task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'Satisfy', 'Block' - DependencyAction DependencyAction `json:"dependencyAction,omitempty"` -} - -// FileProperties ... -type FileProperties struct { - // CreationTime - The creation time is not returned for files on Linux compute nodes. - CreationTime *date.Time `json:"creationTime,omitempty"` - LastModified *date.Time `json:"lastModified,omitempty"` - ContentLength *int64 `json:"contentLength,omitempty"` - ContentType *string `json:"contentType,omitempty"` - // FileMode - The file mode is returned only for files on Linux compute nodes. - FileMode *string `json:"fileMode,omitempty"` -} - -// ImageReference ... -type ImageReference struct { - // Publisher - For example, Canonical or MicrosoftWindowsServer. - Publisher *string `json:"publisher,omitempty"` - // Offer - For example, UbuntuServer or WindowsServer. - Offer *string `json:"offer,omitempty"` - // Sku - For example, 14.04.0-LTS or 2012-R2-Datacenter. - Sku *string `json:"sku,omitempty"` - // Version - A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. - Version *string `json:"version,omitempty"` - // VirtualMachineImageID - This property is mutually exclusive with other ImageReference properties. The virtual machine image must be in the same region and subscription as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. - VirtualMachineImageID *string `json:"virtualMachineImageId,omitempty"` -} - -// InboundEndpoint ... -type InboundEndpoint struct { - Name *string `json:"name,omitempty"` - // Protocol - Possible values include: 'TCP', 'UDP' - Protocol InboundEndpointProtocol `json:"protocol,omitempty"` - PublicIPAddress *string `json:"publicIPAddress,omitempty"` - PublicFQDN *string `json:"publicFQDN,omitempty"` - FrontendPort *int32 `json:"frontendPort,omitempty"` - BackendPort *int32 `json:"backendPort,omitempty"` -} - -// InboundNATPool ... -type InboundNATPool struct { - // Name - The name must be unique within a Batch pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. - Name *string `json:"name,omitempty"` - // Protocol - Possible values include: 'TCP', 'UDP' - Protocol InboundEndpointProtocol `json:"protocol,omitempty"` - // BackendPort - This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. - BackendPort *int32 `json:"backendPort,omitempty"` - // FrontendPortRangeStart - Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. - FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"` - // FrontendPortRangeEnd - Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. - FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"` - // NetworkSecurityGroupRules - The maximum number of rules that can be specified across all the endpoints on a Batch pool is 25. If no network security group rules are specified, a default rule will be created to allow inbound access to the specified backendPort. If the maximum number of network security group rules is exceeded the request fails with HTTP status code 400. - NetworkSecurityGroupRules *[]NetworkSecurityGroupRule `json:"networkSecurityGroupRules,omitempty"` -} - -// JobAddParameter ... -type JobAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. - Priority *int32 `json:"priority,omitempty"` - // Constraints - The execution constraints for the job. - Constraints *JobConstraints `json:"constraints,omitempty"` - // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job. The Job Manager task's typical purpose is to control and/or monitor job execution, for example by deciding what additional tasks to run, determining when the work is complete, etc. (However, a Job Manager task is not restricted to these activities - it is a fully-fledged task in the system and perform whatever actions are required for the job.) For example, a Job Manager task might download a file specified as a parameter, analyze the contents of that file and submit additional tasks based on those contents. - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task. The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value. - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the job properties to set onAllTasksComplete to terminatejob once you have finished adding tasks. The default is noaction. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // OnTaskFailure - A task is considered to have failed if has a failureInfo. A failureInfo is set if the task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the task, for example due to a resource file download error. The default is noaction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction' - OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` -} - -// JobConstraints ... -type JobConstraints struct { - // MaxWallClockTime - If the job does not complete within the time limit, the Batch service terminates it and any tasks that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry. If this property is not specified, there is no time limit on how long the job may run. - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try each task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry tasks. If the maximum retry count is -1, the Batch service retries tasks without limit. The default value is 0 (no retries). - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` -} - -// JobDisableParameter ... -type JobDisableParameter struct { - // DisableTasks - Possible values include: 'DisableJobOptionRequeue', 'DisableJobOptionTerminate', 'DisableJobOptionWait' - DisableTasks DisableJobOption `json:"disableTasks,omitempty"` -} - -// JobExecutionInformation ... -type JobExecutionInformation struct { - // StartTime - This is the time at which the job was created. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the job is in the completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // PoolID - This element contains the actual pool where the job is assigned. When you get job details from the service, they also contain a poolInfo element, which contains the pool configuration data from when the job was added or updated. That poolInfo element may also contain a poolId element. If it does, the two IDs are the same. If it does not, it means the job ran on an auto pool, and this property contains the ID of that auto pool. - PoolID *string `json:"poolId,omitempty"` - // SchedulingError - This property is not set if there was no error starting the job. - SchedulingError *JobSchedulingError `json:"schedulingError,omitempty"` - // TerminateReason - This property is set only if the job is in the completed state. If the Batch service terminates the job, it sets the reason as follows: JMComplete - the Job Manager task completed, and killJobOnCompletion was set to true. MaxWallClockTimeExpiry - the job reached its maxWallClockTime constraint. TerminateJobSchedule - the job ran as part of a schedule, and the schedule terminated. AllTasksComplete - the job's onAllTasksComplete attribute is set to terminatejob, and all tasks in the job are complete. TaskFailed - the job's onTaskFailure attribute is set to performExitOptionsJobAction, and a task in the job failed with an exit condition that specified a jobAction of terminatejob. Any other string is a user-defined reason specified in a call to the 'Terminate a job' operation. - TerminateReason *string `json:"terminateReason,omitempty"` -} - -// JobManagerTask the Job Manager task is automatically started when the job is created. The Batch service tries to -// schedule the Job Manager task before any other tasks in the job. When shrinking a pool, the Batch service tries -// to preserve compute nodes where Job Manager tasks are running for as long as possible (that is, nodes running -// 'normal' tasks are removed before nodes running Job Manager tasks). When a Job Manager task fails and needs to -// be restarted, the system tries to schedule it at the highest priority. If there are no idle nodes available, the -// system may terminate one of the running tasks in the pool and return it to the queue in order to make room for -// the Job Manager task to restart. Note that a Job Manager task in one job does not have priority over tasks in -// other jobs. Across jobs, only job level priorities are observed. For example, if a Job Manager in a priority 0 -// job needs to be restarted, it will not displace tasks of a priority 1 job. -type JobManagerTask struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. - ID *string `json:"id,omitempty"` - // DisplayName - It need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ContainerSettings - If the pool that will run this task has containerConfiguration set, this must be set as well. If the pool that will run this task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container. - ContainerSettings *TaskContainerSettings `json:"containerSettings,omitempty"` - // ResourceFiles - Files listed under this element are located in the task's working directory. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // OutputFiles - For multi-instance tasks, the files will only be uploaded from the compute node on which the primary task is executed. - OutputFiles *[]OutputFile `json:"outputFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - Constraints *TaskConstraints `json:"constraints,omitempty"` - // KillJobOnCompletion - If true, when the Job Manager task completes, the Batch service marks the job as complete. If any tasks are still running at this time (other than Job Release), those tasks are terminated. If false, the completion of the Job Manager task does not affect the job status. In this case, you should either use the onAllTasksComplete attribute to terminate the job, or have a client or user terminate the job explicitly. An example of this is if the Job Manager creates a set of tasks but then takes no further role in their execution. The default value is true. If you are using the onAllTasksComplete and onTaskFailure attributes to control job lifetime, and using the Job Manager task only to create the tasks for the job (not to monitor progress), then it is important to set killJobOnCompletion to false. - KillJobOnCompletion *bool `json:"killJobOnCompletion,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - // RunExclusive - If true, no other tasks will run on the same compute node for as long as the Job Manager is running. If false, other tasks can run simultaneously with the Job Manager on a compute node. The Job Manager task counts normally against the node's concurrent task limit, so this is only relevant if the node allows multiple concurrent tasks. The default value is true. - RunExclusive *bool `json:"runExclusive,omitempty"` - // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task working directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job. - AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"` - // AllowLowPriorityNode - The default value is false. - AllowLowPriorityNode *bool `json:"allowLowPriorityNode,omitempty"` -} - -// JobPatchParameter ... -type JobPatchParameter struct { - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged. - Priority *int32 `json:"priority,omitempty"` - // OnAllTasksComplete - If omitted, the completion behavior is left unchanged. You may not change the value from terminatejob to noaction - that is, once you have engaged automatic job termination, you cannot turn it off again. If you try to do this, the request fails with an 'invalid property value' error response; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // Constraints - If omitted, the existing execution constraints are left unchanged. - Constraints *JobConstraints `json:"constraints,omitempty"` - // PoolInfo - You may change the pool for a job only when the job is disabled. The Patch Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. If omitted, the job continues to run on its current pool. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - If omitted, the existing job metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobPreparationAndReleaseTaskExecutionInformation ... -type JobPreparationAndReleaseTaskExecutionInformation struct { - PoolID *string `json:"poolId,omitempty"` - NodeID *string `json:"nodeId,omitempty"` - NodeURL *string `json:"nodeUrl,omitempty"` - JobPreparationTaskExecutionInfo *JobPreparationTaskExecutionInformation `json:"jobPreparationTaskExecutionInfo,omitempty"` - // JobReleaseTaskExecutionInfo - This property is set only if the Job Release task has run on the node. - JobReleaseTaskExecutionInfo *JobReleaseTaskExecutionInformation `json:"jobReleaseTaskExecutionInfo,omitempty"` -} - -// JobPreparationTask you can use Job Preparation to prepare a compute node to run tasks for the job. Activities -// commonly performed in Job Preparation include: Downloading common resource files used by all the tasks in the -// job. The Job Preparation task can download these common resource files to the shared location on the compute -// node. (AZ_BATCH_NODE_ROOT_DIR\shared), or starting a local service on the compute node so that all tasks of that -// job can communicate with it. If the Job Preparation task fails (that is, exhausts its retry count before exiting -// with exit code 0), Batch will not run tasks of this job on the compute node. The node remains ineligible to run -// tasks of this job until it is reimaged. The node remains active and can be used for other jobs. The Job -// Preparation task can run multiple times on the same compute node. Therefore, you should write the Job -// Preparation task to handle re-execution. If the compute node is rebooted, the Job Preparation task is run again -// on the node before scheduling any other task of the job, if rerunOnNodeRebootAfterSuccess is true or if the Job -// Preparation task did not previously complete. If the compute node is reimaged, the Job Preparation task is run -// again before scheduling any task of the job. -type JobPreparationTask struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobpreparation'. No other task in the job can have the same ID as the Job Preparation task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobPreparationTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). - ID *string `json:"id,omitempty"` - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ContainerSettings - When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container. - ContainerSettings *TaskContainerSettings `json:"containerSettings,omitempty"` - // ResourceFiles - Files listed under this element are located in the task's working directory. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - Constraints *TaskConstraints `json:"constraints,omitempty"` - // WaitForSuccess - If true and the Job Preparation task fails on a compute node, the Batch service retries the Job Preparation task up to its maximum retry count (as specified in the constraints element). If the task has still not completed successfully after all retries, then the Batch service will not schedule tasks of the job to the compute node. The compute node remains active and eligible to run tasks of other jobs. If false, the Batch service will not wait for the Job Preparation task to complete. In this case, other tasks of the job can start executing on the compute node while the Job Preparation task is still running; and even if the Job Preparation task fails, new tasks will continue to be scheduled on the node. The default value is true. - WaitForSuccess *bool `json:"waitForSuccess,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task on Windows nodes, or a a non-administrative user unique to the pool on Linux nodes. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - // RerunOnNodeRebootAfterSuccess - The Job Preparation task is always rerun if a compute node is reimaged, or if the Job Preparation task did not complete (e.g. because the reboot occurred while the task was running). Therefore, you should always write a Job Preparation task to be idempotent and to behave correctly if run multiple times. The default value is true. - RerunOnNodeRebootAfterSuccess *bool `json:"rerunOnNodeRebootAfterSuccess,omitempty"` -} - -// JobPreparationTaskExecutionInformation ... -type JobPreparationTaskExecutionInformation struct { - // StartTime - If the task has been restarted or retried, this is the most recent time at which the task started running. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // State - Possible values include: 'JobPreparationTaskStateRunning', 'JobPreparationTaskStateCompleted' - State JobPreparationTaskState `json:"state,omitempty"` - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` - // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated. - ExitCode *int32 `json:"exitCode,omitempty"` - // ContainerInfo - This property is set only if the task runs in a container context. - ContainerInfo *TaskContainerExecutionInformation `json:"containerInfo,omitempty"` - // FailureInfo - This property is set only if the task is in the completed state and encountered a failure. - FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"` - // RetryCount - Task application failures (non-zero exit code) are retried, pre-processing errors (the task could not be run) and file upload errors are not retried. The Batch service will retry the task up to the limit specified by the constraints. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - This property is set only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` - // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure' - Result TaskExecutionResult `json:"result,omitempty"` -} - -// JobReleaseTask the Job Release task runs when the job ends, because of one of the following: The user calls the -// Terminate Job API, or the Delete Job API while the job is still active, the job's maximum wall clock time -// constraint is reached, and the job is still active, or the job's Job Manager task completed, and the job is -// configured to terminate when the Job Manager completes. The Job Release task runs on each compute node where -// tasks of the job have run and the Job Preparation task ran and completed. If you reimage a compute node after it -// has run the Job Preparation task, and the job ends without any further tasks of the job running on that compute -// node (and hence the Job Preparation task does not re-run), then the Job Release task does not run on that node. -// If a compute node reboots while the Job Release task is still running, the Job Release task runs again when the -// compute node starts up. The job is not marked as complete until all Job Release tasks have completed. The Job -// Release task runs in the background. It does not occupy a scheduling slot; that is, it does not count towards -// the maxTasksPerNode limit specified on the pool. -type JobReleaseTask struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other task in the job can have the same ID as the Job Release task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). - ID *string `json:"id,omitempty"` - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ContainerSettings - When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container. - ContainerSettings *TaskContainerSettings `json:"containerSettings,omitempty"` - // ResourceFiles - Files listed under this element are located in the task's working directory. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged. - RetentionTime *string `json:"retentionTime,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` -} - -// JobReleaseTaskExecutionInformation ... -type JobReleaseTaskExecutionInformation struct { - // StartTime - If the task has been restarted or retried, this is the most recent time at which the task started running. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // State - Possible values include: 'JobReleaseTaskStateRunning', 'JobReleaseTaskStateCompleted' - State JobReleaseTaskState `json:"state,omitempty"` - TaskRootDirectory *string `json:"taskRootDirectory,omitempty"` - TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"` - // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated. - ExitCode *int32 `json:"exitCode,omitempty"` - // ContainerInfo - This property is set only if the task runs in a container context. - ContainerInfo *TaskContainerExecutionInformation `json:"containerInfo,omitempty"` - // FailureInfo - This property is set only if the task is in the completed state and encountered a failure. - FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"` - // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure' - Result TaskExecutionResult `json:"result,omitempty"` -} - -// JobScheduleAddParameter ... -type JobScheduleAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - Schedule *Schedule `json:"schedule,omitempty"` - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobScheduleExecutionInformation ... -type JobScheduleExecutionInformation struct { - // NextRunTime - This property is meaningful only if the schedule is in the active state when the time comes around. For example, if the schedule is disabled, no job will be created at nextRunTime unless the job is enabled before then. - NextRunTime *date.Time `json:"nextRunTime,omitempty"` - // RecentJob - This property is present only if the at least one job has run under the schedule. - RecentJob *RecentJob `json:"recentJob,omitempty"` - // EndTime - This property is set only if the job schedule is in the completed state. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// JobSchedulePatchParameter ... -type JobSchedulePatchParameter struct { - // Schedule - If you do not specify this element, the existing schedule is left unchanged. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - If you do not specify this element, existing metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobScheduleStatistics ... -type JobScheduleStatistics struct { - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UserCPUTime *string `json:"userCPUTime,omitempty"` - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If a task was retried, this includes the wall clock time of all the task retries. - WallClockTime *string `json:"wallClockTime,omitempty"` - ReadIOps *int64 `json:"readIOps,omitempty"` - WriteIOps *int64 `json:"writeIOps,omitempty"` - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"` - NumFailedTasks *int64 `json:"numFailedTasks,omitempty"` - NumTaskRetries *int64 `json:"numTaskRetries,omitempty"` - // WaitTime - This value is only reported in the account lifetime statistics; it is not included in the job statistics. - WaitTime *string `json:"waitTime,omitempty"` -} - -// JobScheduleUpdateParameter ... -type JobScheduleUpdateParameter struct { - // Schedule - If you do not specify this element, it is equivalent to passing the default schedule: that is, a single job scheduled to run immediately. - Schedule *Schedule `json:"schedule,omitempty"` - // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification. - JobSpecification *JobSpecification `json:"jobSpecification,omitempty"` - // Metadata - If you do not specify this element, it takes the default value of an empty list; in effect, any existing metadata is deleted. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobSchedulingError ... -type JobSchedulingError struct { - // Category - Possible values include: 'UserError', 'ServerError' - Category ErrorCategory `json:"category,omitempty"` - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Details *[]NameValuePair `json:"details,omitempty"` -} - -// JobSpecification ... -type JobSpecification struct { - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. This priority is used as the default for all jobs under the job schedule. You can update a job's priority after it has been created using by using the update job API. - Priority *int32 `json:"priority,omitempty"` - // DisplayName - The name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"` - // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the job properties to set onAllTasksComplete to terminatejob once you have finished adding tasks. The default is noaction. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` - // OnTaskFailure - The default is noaction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction' - OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"` - Constraints *JobConstraints `json:"constraints,omitempty"` - // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job using the Task API. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job. - JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"` - // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node. - JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"` - // JobReleaseTask - The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation. A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task. - JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"` - // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value. - CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"` - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// JobStatistics ... -type JobStatistics struct { - autorest.Response `json:"-"` - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UserCPUTime *string `json:"userCPUTime,omitempty"` - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If a task was retried, this includes the wall clock time of all the task retries. - WallClockTime *string `json:"wallClockTime,omitempty"` - ReadIOps *int64 `json:"readIOps,omitempty"` - WriteIOps *int64 `json:"writeIOps,omitempty"` - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - // NumSucceededTasks - A task completes successfully if it returns exit code 0. - NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"` - // NumFailedTasks - A task fails if it exhausts its maximum retry count without returning exit code 0. - NumFailedTasks *int64 `json:"numFailedTasks,omitempty"` - NumTaskRetries *int64 `json:"numTaskRetries,omitempty"` - // WaitTime - The wait time for a task is defined as the elapsed time between the creation of the task and the start of task execution. (If the task is retried due to failures, the wait time is the time to the most recent task execution.) This value is only reported in the account lifetime statistics; it is not included in the job statistics. - WaitTime *string `json:"waitTime,omitempty"` -} - -// JobTerminateParameter ... -type JobTerminateParameter struct { - TerminateReason *string `json:"terminateReason,omitempty"` -} - -// JobUpdateParameter ... -type JobUpdateParameter struct { - // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, it is set to the default value 0. - Priority *int32 `json:"priority,omitempty"` - // Constraints - If omitted, the constraints are cleared. - Constraints *JobConstraints `json:"constraints,omitempty"` - // PoolInfo - You may change the pool for a job only when the job is disabled. The Update Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. - PoolInfo *PoolInformation `json:"poolInfo,omitempty"` - // Metadata - If omitted, it takes the default value of an empty list; in effect, any existing metadata is deleted. - Metadata *[]MetadataItem `json:"metadata,omitempty"` - // OnAllTasksComplete - If omitted, the completion behavior is set to noaction. If the current value is terminatejob, this is an error because a job's completion behavior may not be changed from terminatejob to noaction. You may not change the value from terminatejob to noaction - that is, once you have engaged automatic job termination, you cannot turn it off again. If you try to do this, the request fails and Batch returns status code 400 (Bad Request) and an 'invalid property value' error response. If you do not specify this element in a PUT request, it is equivalent to passing noaction. This is an error if the current value is terminatejob. Possible values include: 'NoAction', 'TerminateJob' - OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"` -} - -// LinuxUserConfiguration ... -type LinuxUserConfiguration struct { - // UID - The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the uid. - UID *int32 `json:"uid,omitempty"` - // Gid - The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the gid. - Gid *int32 `json:"gid,omitempty"` - // SSHPrivateKey - The private key must not be password protected. The private key is used to automatically configure asymmetric-key based authentication for SSH between nodes in a Linux pool when the pool's enableInterNodeCommunication property is true (it is ignored if enableInterNodeCommunication is false). It does this by placing the key pair into the user's .ssh directory. If not specified, password-less SSH is not configured between nodes (no modification of the user's .ssh directory is done). - SSHPrivateKey *string `json:"sshPrivateKey,omitempty"` -} - -// MetadataItem the Batch service does not assign any meaning to this metadata; it is solely for the use of user -// code. -type MetadataItem struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -// MultiInstanceSettings multi-instance tasks are commonly used to support MPI tasks. -type MultiInstanceSettings struct { - // NumberOfInstances - If omitted, the default is 1. - NumberOfInstances *int32 `json:"numberOfInstances,omitempty"` - // CoordinationCommandLine - A typical coordination command line launches a background service and verifies that the service is ready to process inter-node messages. - CoordinationCommandLine *string `json:"coordinationCommandLine,omitempty"` - // CommonResourceFiles - The difference between common resource files and task resource files is that common resource files are downloaded for all subtasks including the primary, whereas task resource files are downloaded only for the primary. Also note that these resource files are not downloaded to the task working directory, but instead are downloaded to the task root directory (one directory above the working directory). - CommonResourceFiles *[]ResourceFile `json:"commonResourceFiles,omitempty"` -} - -// NameValuePair ... -type NameValuePair struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -// NetworkConfiguration the network configuration for a pool. -type NetworkConfiguration struct { - // SubnetID - The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. For pools created with virtualMachineConfiguration only ARM virtual networks ('Microsoft.Network/virtualNetworks') are supported, but for pools created with cloudServiceConfiguration both ARM and classic virtual networks are supported. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For pools created with a virtual machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. For pools created with a cloud service configuration, enable ports 10100, 20100, and 30100. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration - SubnetID *string `json:"subnetId,omitempty"` - // EndpointConfiguration - Pool endpoint configuration is only supported on pools with the virtualMachineConfiguration property. - EndpointConfiguration *PoolEndpointConfiguration `json:"endpointConfiguration,omitempty"` -} - -// NetworkSecurityGroupRule ... -type NetworkSecurityGroupRule struct { - // Priority - Priorities within a pool must be unique and are evaluated in order of priority. The lower the number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed priorities are 150 to 3500. If any reserved or duplicate values are provided the request fails with HTTP status code 400. - Priority *int32 `json:"priority,omitempty"` - // Access - Possible values include: 'Allow', 'Deny' - Access NetworkSecurityGroupRuleAccess `json:"access,omitempty"` - // SourceAddressPrefix - Valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400. - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` -} - -// NodeAgentSku the Batch node agent is a program that runs on each node in the pool, and provides the -// command-and-control interface between the node and the Batch service. There are different implementations of the -// node agent, known as SKUs, for different operating systems. -type NodeAgentSku struct { - ID *string `json:"id,omitempty"` - // VerifiedImageReferences - This collection is not exhaustive (the node agent may be compatible with other images). - VerifiedImageReferences *[]ImageReference `json:"verifiedImageReferences,omitempty"` - // OsType - Possible values include: 'Linux', 'Windows' - OsType OSType `json:"osType,omitempty"` -} - -// NodeDisableSchedulingParameter ... -type NodeDisableSchedulingParameter struct { - // NodeDisableSchedulingOption - The default value is requeue. Possible values include: 'DisableComputeNodeSchedulingOptionRequeue', 'DisableComputeNodeSchedulingOptionTerminate', 'DisableComputeNodeSchedulingOptionTaskCompletion' - NodeDisableSchedulingOption DisableComputeNodeSchedulingOption `json:"nodeDisableSchedulingOption,omitempty"` -} - -// NodeFile ... -type NodeFile struct { - Name *string `json:"name,omitempty"` - URL *string `json:"url,omitempty"` - IsDirectory *bool `json:"isDirectory,omitempty"` - Properties *FileProperties `json:"properties,omitempty"` -} - -// NodeFileListResult ... -type NodeFileListResult struct { - autorest.Response `json:"-"` - Value *[]NodeFile `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// NodeFileListResultIterator provides access to a complete listing of NodeFile values. -type NodeFileListResultIterator struct { - i int - page NodeFileListResultPage -} - -// Next 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 *NodeFileListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter NodeFileListResultIterator) 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 NodeFileListResultIterator) Response() NodeFileListResult { - 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 NodeFileListResultIterator) Value() NodeFile { - if !iter.page.NotDone() { - return NodeFile{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (nflr NodeFileListResult) IsEmpty() bool { - return nflr.Value == nil || len(*nflr.Value) == 0 -} - -// nodeFileListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (nflr NodeFileListResult) nodeFileListResultPreparer() (*http.Request, error) { - if nflr.OdataNextLink == nil || len(to.String(nflr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(nflr.OdataNextLink))) -} - -// NodeFileListResultPage contains a page of NodeFile values. -type NodeFileListResultPage struct { - fn func(NodeFileListResult) (NodeFileListResult, error) - nflr NodeFileListResult -} - -// 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. -func (page *NodeFileListResultPage) Next() error { - next, err := page.fn(page.nflr) - if err != nil { - return err - } - page.nflr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page NodeFileListResultPage) NotDone() bool { - return !page.nflr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page NodeFileListResultPage) Response() NodeFileListResult { - return page.nflr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page NodeFileListResultPage) Values() []NodeFile { - if page.nflr.IsEmpty() { - return nil - } - return *page.nflr.Value -} - -// NodeRebootParameter ... -type NodeRebootParameter struct { - // NodeRebootOption - The default value is requeue. Possible values include: 'ComputeNodeRebootOptionRequeue', 'ComputeNodeRebootOptionTerminate', 'ComputeNodeRebootOptionTaskCompletion', 'ComputeNodeRebootOptionRetainedData' - NodeRebootOption ComputeNodeRebootOption `json:"nodeRebootOption,omitempty"` -} - -// NodeReimageParameter ... -type NodeReimageParameter struct { - // NodeReimageOption - The default value is requeue. Possible values include: 'ComputeNodeReimageOptionRequeue', 'ComputeNodeReimageOptionTerminate', 'ComputeNodeReimageOptionTaskCompletion', 'ComputeNodeReimageOptionRetainedData' - NodeReimageOption ComputeNodeReimageOption `json:"nodeReimageOption,omitempty"` -} - -// NodeRemoveParameter ... -type NodeRemoveParameter struct { - NodeList *[]string `json:"nodeList,omitempty"` - // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData' - NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"` -} - -// NodeUpdateUserParameter ... -type NodeUpdateUserParameter struct { - // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is removed. - Password *string `json:"password,omitempty"` - // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If omitted, any existing SSH public key is removed. - SSHPublicKey *string `json:"sshPublicKey,omitempty"` -} - -// OSDisk ... -type OSDisk struct { - // Caching - The default value for caching is none. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - Caching CachingType `json:"caching,omitempty"` -} - -// OutputFile ... -type OutputFile struct { - // FilePattern - Both relative and absolute paths are supported. Relative paths are relative to the task working directory. The following wildcards are supported: * matches 0 or more characters (for example pattern abc* would match abc or abcdef), ** matches any directory, ? matches any single character, [abc] matches one character in the brackets, and [a-c] matches one character in the range. Brackets can include a negation to match any character not specified (for example [!abc] matches any character but a, b, or c). If a file name starts with "." it is ignored by default but may be matched by specifying it explicitly (for example *.gif will not match .a.gif, but .*.gif will). A simple example: **\*.txt matches any file that does not start in '.' and ends with .txt in the task working directory or any subdirectory. If the filename contains a wildcard character it can be escaped using brackets (for example abc[*] would match a file named abc*). Note that both \ and / are treated as directory separators on Windows, but only / is on Linux. Environment variables (%var% on Windows or $var on Linux) are expanded prior to the pattern being applied. - FilePattern *string `json:"filePattern,omitempty"` - Destination *OutputFileDestination `json:"destination,omitempty"` - UploadOptions *OutputFileUploadOptions `json:"uploadOptions,omitempty"` -} - -// OutputFileBlobContainerDestination ... -type OutputFileBlobContainerDestination struct { - // Path - If filePattern refers to a specific file (i.e. contains no wildcards), then path is the name of the blob to which to upload that file. If filePattern contains one or more wildcards (and therefore may match multiple files), then path is the name of the blob virtual directory (which is prepended to each blob name) to which to upload the file(s). If omitted, file(s) are uploaded to the root of the container with a blob name matching their file name. - Path *string `json:"path,omitempty"` - // ContainerURL - The URL must include a Shared Access Signature (SAS) granting write permissions to the container. - ContainerURL *string `json:"containerUrl,omitempty"` -} - -// OutputFileDestination ... -type OutputFileDestination struct { - Container *OutputFileBlobContainerDestination `json:"container,omitempty"` -} - -// OutputFileUploadOptions ... -type OutputFileUploadOptions struct { - // UploadCondition - The default is taskcompletion. Possible values include: 'OutputFileUploadConditionTaskSuccess', 'OutputFileUploadConditionTaskFailure', 'OutputFileUploadConditionTaskCompletion' - UploadCondition OutputFileUploadCondition `json:"uploadCondition,omitempty"` -} - -// PoolAddParameter ... -type PoolAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two pool IDs within an account that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // TargetDedicatedNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. - TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"` - // TargetLowPriorityNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. - TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"` - // EnableAutoScale - If false, at least one of targetDedicateNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the pool automatically resizes according to the formula. The default value is false. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale compute nodes in an Azure Batch pool' (https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/). - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` - // StartTask - The task runs when the node is added to the pool or when the node is restarted. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // ApplicationLicenses - The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail. - ApplicationLicenses *[]string `json:"applicationLicenses,omitempty"` - // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting). - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - UserAccounts *[]UserAccount `json:"userAccounts,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolEnableAutoScaleParameter ... -type PoolEnableAutoScaleParameter struct { - // AutoScaleFormula - The formula is checked for validity before it is applied to the pool. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued. - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` -} - -// PoolEndpointConfiguration ... -type PoolEndpointConfiguration struct { - // InboundNATPools - The maximum number of inbound NAT pools per Batch pool is 5. If the maximum number of inbound NAT pools is exceeded the request fails with HTTP status code 400. - InboundNATPools *[]InboundNATPool `json:"inboundNATPools,omitempty"` -} - -// PoolEvaluateAutoScaleParameter ... -type PoolEvaluateAutoScaleParameter struct { - // AutoScaleFormula - The formula is validated and its results calculated, but it is not applied to the pool. To apply the formula to the pool, 'Enable automatic scaling on a pool'. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` -} - -// PoolInformation ... -type PoolInformation struct { - // PoolID - You must ensure that the pool referenced by this property exists. If the pool does not exist at the time the Batch service tries to schedule a job, no tasks for the job will run until you create a pool with that id. Note that the Batch service will not reject the job request; it will simply not run tasks until the pool exists. You must specify either the pool ID or the auto pool specification, but not both. - PoolID *string `json:"poolId,omitempty"` - // AutoPoolSpecification - If auto pool creation fails, the Batch service moves the job to a completed state, and the pool creation error is set in the job's scheduling error property. The Batch service manages the lifetime (both creation and, unless keepAlive is specified, deletion) of the auto pool. Any user actions that affect the lifetime of the auto pool while the job is active will result in unexpected behavior. You must specify either the pool ID or the auto pool specification, but not both. - AutoPoolSpecification *AutoPoolSpecification `json:"autoPoolSpecification,omitempty"` -} - -// PoolListUsageMetricsResult ... -type PoolListUsageMetricsResult struct { - autorest.Response `json:"-"` - Value *[]PoolUsageMetrics `json:"value,omitempty"` - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// PoolListUsageMetricsResultIterator provides access to a complete listing of PoolUsageMetrics values. -type PoolListUsageMetricsResultIterator struct { - i int - page PoolListUsageMetricsResultPage -} - -// Next 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 *PoolListUsageMetricsResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PoolListUsageMetricsResultIterator) 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 PoolListUsageMetricsResultIterator) Response() PoolListUsageMetricsResult { - 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 PoolListUsageMetricsResultIterator) Value() PoolUsageMetrics { - if !iter.page.NotDone() { - return PoolUsageMetrics{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (plumr PoolListUsageMetricsResult) IsEmpty() bool { - return plumr.Value == nil || len(*plumr.Value) == 0 -} - -// poolListUsageMetricsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (plumr PoolListUsageMetricsResult) poolListUsageMetricsResultPreparer() (*http.Request, error) { - if plumr.OdataNextLink == nil || len(to.String(plumr.OdataNextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(plumr.OdataNextLink))) -} - -// PoolListUsageMetricsResultPage contains a page of PoolUsageMetrics values. -type PoolListUsageMetricsResultPage struct { - fn func(PoolListUsageMetricsResult) (PoolListUsageMetricsResult, error) - plumr PoolListUsageMetricsResult -} - -// 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. -func (page *PoolListUsageMetricsResultPage) Next() error { - next, err := page.fn(page.plumr) - if err != nil { - return err - } - page.plumr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PoolListUsageMetricsResultPage) NotDone() bool { - return !page.plumr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PoolListUsageMetricsResultPage) Response() PoolListUsageMetricsResult { - return page.plumr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PoolListUsageMetricsResultPage) Values() []PoolUsageMetrics { - if page.plumr.IsEmpty() { - return nil - } - return *page.plumr.Value -} - -// PoolPatchParameter ... -type PoolPatchParameter struct { - // StartTask - If this element is present, it overwrites any existing start task. If omitted, any existing start task is left unchanged. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - If this element is present, it replaces any existing certificate references configured on the pool. If omitted, any existing certificate references are left unchanged. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. If this element is present, it replaces any existing application package references. If you specify an empty collection, then all application package references are removed from the pool. If omitted, any existing application package references are left unchanged. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - If this element is present, it replaces any existing metadata configured on the pool. If you specify an empty collection, any metadata is removed from the pool. If omitted, any existing metadata is left unchanged. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolResizeParameter ... -type PoolResizeParameter struct { - TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"` - TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"` - // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData' - NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"` -} - -// PoolSpecification ... -type PoolSpecification struct { - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - // CloudServiceConfiguration - This property must be specified if the pool needs to be created with Azure PaaS VMs. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. - CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` - // VirtualMachineConfiguration - This property must be specified if the pool needs to be created with Azure IaaS VMs. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting). - MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` - TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` - // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - ResizeTimeout *string `json:"resizeTimeout,omitempty"` - // TargetDedicatedNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. - TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"` - // TargetLowPriorityNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. - TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"` - // EnableAutoScale - If false, at least one of targetDedicateNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula element is required. The pool automatically resizes according to the formula. The default value is false. - EnableAutoScale *bool `json:"enableAutoScale,omitempty"` - // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. - AutoScaleFormula *string `json:"autoScaleFormula,omitempty"` - // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"` - // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false. - EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"` - NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // ApplicationLicenses - The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail. - ApplicationLicenses *[]string `json:"applicationLicenses,omitempty"` - UserAccounts *[]UserAccount `json:"userAccounts,omitempty"` - // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolStatistics ... -type PoolStatistics struct { - autorest.Response `json:"-"` - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UsageStats *UsageStatistics `json:"usageStats,omitempty"` - ResourceStats *ResourceStatistics `json:"resourceStats,omitempty"` -} - -// PoolUpdatePropertiesParameter ... -type PoolUpdatePropertiesParameter struct { - // StartTask - If this element is present, it overwrites any existing start task. If omitted, any existing start task is removed from the pool. - StartTask *StartTask `json:"startTask,omitempty"` - // CertificateReferences - This list replaces any existing certificate references configured on the pool. If you specify an empty collection, any existing certificate references are removed from the pool. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"` - // ApplicationPackageReferences - The list replaces any existing application package references on the pool. Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. If omitted, or if you specify an empty collection, any existing application packages references are removed from the pool. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // Metadata - This list replaces any existing metadata configured on the pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the pool. - Metadata *[]MetadataItem `json:"metadata,omitempty"` -} - -// PoolUpgradeOSParameter ... -type PoolUpgradeOSParameter struct { - TargetOSVersion *string `json:"targetOSVersion,omitempty"` -} - -// PoolUsageMetrics ... -type PoolUsageMetrics struct { - PoolID *string `json:"poolId,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - EndTime *date.Time `json:"endTime,omitempty"` - // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, STANDARD_A1_V2 and STANDARD_A2_V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). - VMSize *string `json:"vmSize,omitempty"` - TotalCoreHours *float64 `json:"totalCoreHours,omitempty"` - DataIngressGiB *float64 `json:"dataIngressGiB,omitempty"` - DataEgressGiB *float64 `json:"dataEgressGiB,omitempty"` -} - -// ReadCloser ... -type ReadCloser struct { - autorest.Response `json:"-"` - Value *io.ReadCloser `json:"value,omitempty"` -} - -// RecentJob ... -type RecentJob struct { - ID *string `json:"id,omitempty"` - URL *string `json:"url,omitempty"` -} - -// ResizeError ... -type ResizeError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Values *[]NameValuePair `json:"values,omitempty"` -} - -// ResourceFile ... -type ResourceFile struct { - // BlobSource - This URL must be readable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, or set the ACL for the blob or its container to allow public access. - BlobSource *string `json:"blobSource,omitempty"` - FilePath *string `json:"filePath,omitempty"` - // FileMode - This property applies only to files being downloaded to Linux compute nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows node. If this property is not specified for a Linux node, then a default value of 0770 is applied to the file. - FileMode *string `json:"fileMode,omitempty"` -} - -// ResourceStatistics ... -type ResourceStatistics struct { - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - AvgCPUPercentage *float64 `json:"avgCPUPercentage,omitempty"` - AvgMemoryGiB *float64 `json:"avgMemoryGiB,omitempty"` - PeakMemoryGiB *float64 `json:"peakMemoryGiB,omitempty"` - AvgDiskGiB *float64 `json:"avgDiskGiB,omitempty"` - PeakDiskGiB *float64 `json:"peakDiskGiB,omitempty"` - DiskReadIOps *int64 `json:"diskReadIOps,omitempty"` - DiskWriteIOps *int64 `json:"diskWriteIOps,omitempty"` - DiskReadGiB *float64 `json:"diskReadGiB,omitempty"` - DiskWriteGiB *float64 `json:"diskWriteGiB,omitempty"` - NetworkReadGiB *float64 `json:"networkReadGiB,omitempty"` - NetworkWriteGiB *float64 `json:"networkWriteGiB,omitempty"` -} - -// Schedule ... -type Schedule struct { - // DoNotRunUntil - If you do not specify a doNotRunUntil time, the schedule becomes ready to create jobs immediately. - DoNotRunUntil *date.Time `json:"doNotRunUntil,omitempty"` - // DoNotRunAfter - If you do not specify a doNotRunAfter time, and you are creating a recurring job schedule, the job schedule will remain active until you explicitly terminate it. - DoNotRunAfter *date.Time `json:"doNotRunAfter,omitempty"` - // StartWindow - If a job is not created within the startWindow interval, then the 'opportunity' is lost; no job will be created until the next recurrence of the schedule. If the schedule is recurring, and the startWindow is longer than the recurrence interval, then this is equivalent to an infinite startWindow, because the job that is 'due' in one recurrenceInterval is not carried forward into the next recurrence interval. The default is infinite. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - StartWindow *string `json:"startWindow,omitempty"` - // RecurrenceInterval - Because a job schedule can have at most one active job under it at any given time, if it is time to create a new job under a job schedule, but the previous job is still running, the Batch service will not create the new job until the previous job finishes. If the previous job does not finish within the startWindow period of the new recurrenceInterval, then no new job will be scheduled for that interval. For recurring jobs, you should normally specify a jobManagerTask in the jobSpecification. If you do not use jobManagerTask, you will need an external process to monitor when jobs are created, add tasks to the jobs and terminate the jobs ready for the next recurrence. The default is that the schedule does not recur: one job is created, within the startWindow after the doNotRunUntil time, and the schedule is complete as soon as that job finishes. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - RecurrenceInterval *string `json:"recurrenceInterval,omitempty"` -} - -// StartTask ... -type StartTask struct { - // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ContainerSettings - When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container. - ContainerSettings *TaskContainerSettings `json:"containerSettings,omitempty"` - // ResourceFiles - Files listed under this element are located in the task's working directory. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - // MaxTaskRetryCount - The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` - // WaitForSuccess - If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and failure info details. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is false. - WaitForSuccess *bool `json:"waitForSuccess,omitempty"` -} - -// StartTaskInformation ... -type StartTaskInformation struct { - // State - Possible values include: 'StartTaskStateRunning', 'StartTaskStateCompleted' - State StartTaskState `json:"state,omitempty"` - // StartTime - This value is reset every time the task is restarted or retried (that is, this is the most recent time at which the start task started running). - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This is the end time of the most recent run of the start task, if that run has completed (even if that run failed and a retry is pending). This element is not present if the start task is currently running. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - This property is set only if the start task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the start task (due to timeout, or user termination via the API) you may see an operating system-defined exit code. - ExitCode *int32 `json:"exitCode,omitempty"` - // ContainerInfo - This property is set only if the task runs in a container context. - ContainerInfo *TaskContainerExecutionInformation `json:"containerInfo,omitempty"` - // FailureInfo - This property is set only if the task is in the completed state and encountered a failure. - FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"` - // RetryCount - Task application failures (non-zero exit code) are retried, pre-processing errors (the task could not be run) and file upload errors are not retried. The Batch service will retry the task up to the limit specified by the constraints. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` - // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure' - Result TaskExecutionResult `json:"result,omitempty"` -} - -// SubtaskInformation ... -type SubtaskInformation struct { - ID *int32 `json:"id,omitempty"` - NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the subtask is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - This property is set only if the subtask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the subtask (due to timeout, or user termination via the API) you may see an operating system-defined exit code. - ExitCode *int32 `json:"exitCode,omitempty"` - // ContainerInfo - This property is set only if the task runs in a container context. - ContainerInfo *TaskContainerExecutionInformation `json:"containerInfo,omitempty"` - // FailureInfo - This property is set only if the task is in the completed state and encountered a failure. - FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"` - // State - Possible values include: 'SubtaskStatePreparing', 'SubtaskStateRunning', 'SubtaskStateCompleted' - State SubtaskState `json:"state,omitempty"` - StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"` - // PreviousState - This property is not set if the subtask is in its initial running state. Possible values include: 'SubtaskStatePreparing', 'SubtaskStateRunning', 'SubtaskStateCompleted' - PreviousState SubtaskState `json:"previousState,omitempty"` - // PreviousStateTransitionTime - This property is not set if the subtask is in its initial running state. - PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"` - // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure' - Result TaskExecutionResult `json:"result,omitempty"` -} - -// TaskAddCollectionParameter ... -type TaskAddCollectionParameter struct { - // Value - The total serialized size of this collection must be less than 4MB. If it is greater than 4MB (for example if each task has 100's of resource files or environment variables), the request will fail with code 'RequestBodyTooLarge' and should be retried again with fewer tasks. - Value *[]TaskAddParameter `json:"value,omitempty"` -} - -// TaskAddCollectionResult ... -type TaskAddCollectionResult struct { - autorest.Response `json:"-"` - Value *[]TaskAddResult `json:"value,omitempty"` -} - -// TaskAddParameter ... -type TaskAddParameter struct { - // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a job that differ only by case). - ID *string `json:"id,omitempty"` - // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - DisplayName *string `json:"displayName,omitempty"` - // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. - CommandLine *string `json:"commandLine,omitempty"` - // ContainerSettings - If the pool that will run this task has containerConfiguration set, this must be set as well. If the pool that will run this task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container. - ContainerSettings *TaskContainerSettings `json:"containerSettings,omitempty"` - // ExitConditions - How the Batch service should respond when the task completes. - ExitConditions *ExitConditions `json:"exitConditions,omitempty"` - // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed. - ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` - // OutputFiles - For multi-instance tasks, the files will only be uploaded from the compute node on which the primary task is executed. - OutputFiles *[]OutputFile `json:"outputFiles,omitempty"` - EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` - AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"` - // Constraints - If you do not specify constraints, the maxTaskRetryCount is the maxTaskRetryCount specified for the job, and the maxWallClockTime and retentionTime are infinite. - Constraints *TaskConstraints `json:"constraints,omitempty"` - // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. - UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"` - // DependsOn - This task will not be scheduled until all tasks that it depends on have completed successfully. If any of those tasks fail and exhaust their retry counts, this task will never be scheduled. If the job does not have usesTaskDependencies set to true, and this element is present, the request fails with error code TaskDependenciesNotSpecifiedOnJob. - DependsOn *TaskDependencies `json:"dependsOn,omitempty"` - // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task working directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails. - ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"` - // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job. - AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"` -} - -// TaskAddResult ... -type TaskAddResult struct { - // Status - Possible values include: 'TaskAddStatusSuccess', 'TaskAddStatusClientError', 'TaskAddStatusServerError' - Status TaskAddStatus `json:"status,omitempty"` - TaskID *string `json:"taskId,omitempty"` - // ETag - You can use this to detect whether the task has changed between requests. In particular, you can be pass the ETag with an Update Task request to specify that your changes should take effect only if nobody else has modified the job in the meantime. - ETag *string `json:"eTag,omitempty"` - LastModified *date.Time `json:"lastModified,omitempty"` - Location *string `json:"location,omitempty"` - Error *Error `json:"error,omitempty"` -} - -// TaskConstraints ... -type TaskConstraints struct { - // MaxWallClockTime - If this is not specified, there is no time limit on how long the task may run. - MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` - // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged. - RetentionTime *string `json:"retentionTime,omitempty"` - // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. - MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` -} - -// TaskContainerExecutionInformation ... -type TaskContainerExecutionInformation struct { - ContainerID *string `json:"containerId,omitempty"` - // State - This is the state of the container according to the Docker service. It is equivalent to the status field returned by "docker inspect". - State *string `json:"state,omitempty"` - // Error - This is the detailed error string from the Docker service, if available. It is equivalent to the error field returned by "docker inspect". - Error *string `json:"error,omitempty"` -} - -// TaskContainerSettings ... -type TaskContainerSettings struct { - // ContainerRunOptions - These additional options are supplied as arguments to the "docker create" command, in addition to those controlled by the Batch Service. - ContainerRunOptions *string `json:"containerRunOptions,omitempty"` - // ImageName - This is the full image reference, as would be specified to "docker pull". If no tag is provided as part of the image name, the tag ":latest" is used as a default. - ImageName *string `json:"imageName,omitempty"` - // Registry - This setting can be omitted if was already provided at pool creation. - Registry *ContainerRegistry `json:"registry,omitempty"` -} - -// TaskCounts ... -type TaskCounts struct { - autorest.Response `json:"-"` - Active *int32 `json:"active,omitempty"` - Running *int32 `json:"running,omitempty"` - Completed *int32 `json:"completed,omitempty"` - Succeeded *int32 `json:"succeeded,omitempty"` - Failed *int32 `json:"failed,omitempty"` - // ValidationStatus - Possible values include: 'Validated', 'Unvalidated' - ValidationStatus TaskCountValidationStatus `json:"validationStatus,omitempty"` -} - -// TaskDependencies ... -type TaskDependencies struct { - // TaskIds - The taskIds collection is limited to 64000 characters total (i.e. the combined length of all task IDs). If the taskIds collection exceeds the maximum length, the Add Task request fails with error code TaskDependencyListTooLong. In this case consider using task ID ranges instead. - TaskIds *[]string `json:"taskIds,omitempty"` - TaskIDRanges *[]TaskIDRange `json:"taskIdRanges,omitempty"` -} - -// TaskExecutionInformation ... -type TaskExecutionInformation struct { - // StartTime - 'Running' corresponds to the running state, so if the task specifies resource files or application packages, then the start time reflects the time at which the task started downloading or deploying these. If the task has been restarted or retried, this is the most recent time at which the task started running. This property is present only for tasks that are in the running or completed state. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is set only if the task is in the Completed state. - EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - This property is set only if the task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the task (due to timeout, or user termination via the API) you may see an operating system-defined exit code. - ExitCode *int32 `json:"exitCode,omitempty"` - // ContainerInfo - This property is set only if the task runs in a container context. - ContainerInfo *TaskContainerExecutionInformation `json:"containerInfo,omitempty"` - // FailureInfo - This property is set only if the task is in the completed state and encountered a failure. - FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"` - // RetryCount - Task application failures (non-zero exit code) are retried, pre-processing errors (the task could not be run) and file upload errors are not retried. The Batch service will retry the task up to the limit specified by the constraints. - RetryCount *int32 `json:"retryCount,omitempty"` - // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. - LastRetryTime *date.Time `json:"lastRetryTime,omitempty"` - // RequeueCount - When the user removes nodes from a pool (by resizing/shrinking the pool) or when the job is being disabled, the user can specify that running tasks on the nodes be requeued for execution. This count tracks how many times the task has been requeued for these reasons. - RequeueCount *int32 `json:"requeueCount,omitempty"` - // LastRequeueTime - This property is set only if the requeueCount is nonzero. - LastRequeueTime *date.Time `json:"lastRequeueTime,omitempty"` - // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure' - Result TaskExecutionResult `json:"result,omitempty"` -} - -// TaskFailureInformation ... -type TaskFailureInformation struct { - // Category - Possible values include: 'UserError', 'ServerError' - Category ErrorCategory `json:"category,omitempty"` - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Details *[]NameValuePair `json:"details,omitempty"` -} - -// TaskIDRange the start and end of the range are inclusive. For example, if a range has start 9 and end 12, then -// it represents tasks '9', '10', '11' and '12'. -type TaskIDRange struct { - Start *int32 `json:"start,omitempty"` - End *int32 `json:"end,omitempty"` -} - -// TaskInformation ... -type TaskInformation struct { - TaskURL *string `json:"taskUrl,omitempty"` - JobID *string `json:"jobId,omitempty"` - TaskID *string `json:"taskId,omitempty"` - SubtaskID *int32 `json:"subtaskId,omitempty"` - // TaskState - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted' - TaskState TaskState `json:"taskState,omitempty"` - ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"` -} - -// TaskSchedulingPolicy ... -type TaskSchedulingPolicy struct { - // NodeFillType - Possible values include: 'Spread', 'Pack' - NodeFillType ComputeNodeFillType `json:"nodeFillType,omitempty"` -} - -// TaskStatistics ... -type TaskStatistics struct { - URL *string `json:"url,omitempty"` - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - UserCPUTime *string `json:"userCPUTime,omitempty"` - KernelCPUTime *string `json:"kernelCPUTime,omitempty"` - // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If the task was retried, this includes the wall clock time of all the task retries. - WallClockTime *string `json:"wallClockTime,omitempty"` - ReadIOps *int64 `json:"readIOps,omitempty"` - WriteIOps *int64 `json:"writeIOps,omitempty"` - ReadIOGiB *float64 `json:"readIOGiB,omitempty"` - WriteIOGiB *float64 `json:"writeIOGiB,omitempty"` - WaitTime *string `json:"waitTime,omitempty"` -} - -// TaskUpdateParameter ... -type TaskUpdateParameter struct { - // Constraints - If omitted, the task is given the default constraints. For multi-instance tasks, updating the retention time applies only to the primary task and not subtasks. - Constraints *TaskConstraints `json:"constraints,omitempty"` -} - -// UsageStatistics ... -type UsageStatistics struct { - StartTime *date.Time `json:"startTime,omitempty"` - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - DedicatedCoreTime *string `json:"dedicatedCoreTime,omitempty"` -} - -// UserAccount ... -type UserAccount struct { - Name *string `json:"name,omitempty"` - Password *string `json:"password,omitempty"` - // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin' - ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"` - // LinuxUserConfiguration - This property is ignored if specified on a Windows pool. If not specified, the user is created with the default options. - LinuxUserConfiguration *LinuxUserConfiguration `json:"linuxUserConfiguration,omitempty"` -} - -// UserIdentity specify either the userName or autoUser property, but not both. -type UserIdentity struct { - // UserName - The userName and autoUser properties are mutually exclusive; you must specify one but not both. - UserName *string `json:"username,omitempty"` - // AutoUser - The userName and autoUser properties are mutually exclusive; you must specify one but not both. - AutoUser *AutoUserSpecification `json:"autoUser,omitempty"` -} - -// VirtualMachineConfiguration ... -type VirtualMachineConfiguration struct { - ImageReference *ImageReference `json:"imageReference,omitempty"` - OsDisk *OSDisk `json:"osDisk,omitempty"` - // NodeAgentSKUID - The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation. - NodeAgentSKUID *string `json:"nodeAgentSKUId,omitempty"` - // WindowsConfiguration - This property must not be specified if the imageReference or osDisk property specifies a Linux OS image. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` - // DataDisks - This property must be specified if the compute nodes in the pool need to have empty data disks attached to them. This cannot be updated. Each node gets its own disk (the disk is not a file share). Existing disks cannot be attached, each attached disk is empty. When the node is removed from the pool, the disk and all data associated with it is also deleted. The disk is not formatted after being attached, it must be formatted before use - for more information see https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/attach-disk#initialize-a-new-data-disk-in-linux and https://docs.microsoft.com/en-us/azure/virtual-machines/windows/attach-disk-ps#add-an-empty-data-disk-to-a-virtual-machine. - DataDisks *[]DataDisk `json:"dataDisks,omitempty"` - // LicenseType - This only applies to images that contain the Windows operating system, and should only be used when you hold valid on-premises licenses for the nodes which will be deployed. If omitted, no on-premises licensing discount is applied. Values are: - // Windows_Server - The on-premises license is for Windows Server. - // Windows_Client - The on-premises license is for Windows Client. - LicenseType *string `json:"licenseType,omitempty"` - // ContainerConfiguration - If specified, setup is performed on each node in the pool to allow tasks to run in containers. All regular tasks and job manager tasks run on this pool must specify the containerSettings property, and all other tasks may specify it. - ContainerConfiguration *ContainerConfiguration `json:"containerConfiguration,omitempty"` -} - -// WindowsConfiguration ... -type WindowsConfiguration struct { - // EnableAutomaticUpdates - If omitted, the default value is true. - EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` -} diff --git a/services/batch/2017-09-01.6.0/batch/pool.go b/services/batch/2017-09-01.6.0/batch/pool.go deleted file mode 100644 index b9846a345fb4..000000000000 --- a/services/batch/2017-09-01.6.0/batch/pool.go +++ /dev/null @@ -1,1897 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// PoolClient is the a client for issuing REST requests to the Azure Batch service. -type PoolClient struct { - BaseClient -} - -// NewPoolClient creates an instance of the PoolClient client. -func NewPoolClient() PoolClient { - return NewPoolClientWithBaseURI(DefaultBaseURI) -} - -// NewPoolClientWithBaseURI creates an instance of the PoolClient client. -func NewPoolClientWithBaseURI(baseURI string) PoolClient { - return PoolClient{NewWithBaseURI(baseURI)} -} - -// Add when naming pools, avoid including sensitive information such as user names or secret project names. This -// information may appear in telemetry logs accessible to Microsoft Support engineers. -// -// pool is the pool to be added. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client PoolClient) Add(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: pool, - Constraints: []validation.Constraint{{Target: "pool.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.CloudServiceConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.VirtualMachineConfiguration.ContainerConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ContainerConfiguration.Type", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "pool.NetworkConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "pool.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.StartTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.StartTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.StartTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "pool.StartTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "pool.StartTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, pool, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client PoolClient) AddPreparer(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/pools"), - autorest.WithJSON(pool), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 PoolClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete when you request that a pool be deleted, the following actions occur: the pool state is set to deleting; any -// ongoing resize operation on the pool are stopped; the Batch service starts resizing the pool to zero nodes; any -// tasks running on existing nodes are terminated and requeued (as if a resize pool operation had been requested with -// the default requeue option); finally, the pool is removed from the system. Because running tasks are requeued, the -// user can rerun these tasks by updating their job to target a different pool. The tasks can then run on the new pool. -// If you want to override the requeue behavior, then you should call resize pool explicitly to shrink the pool to zero -// size before deleting the pool. If you call an Update, Patch or Delete API on a pool in the deleting state, it will -// fail with HTTP status code 409 with error code PoolBeingDeleted. -// -// poolID is the ID of the pool to delete. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the -// resource known to the client. The operation will be performed only if the resource's current ETag on the service -// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of -// the resource known to the client. The operation will be performed only if the resource's current ETag on the -// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has not been modified since the specified time. -func (client PoolClient) Delete(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PoolClient) DeletePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 PoolClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) 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 -} - -// DisableAutoScale sends the disable auto scale request. -// -// poolID is the ID of the pool on which to disable automatic scaling. timeout is the maximum time that the server -// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client PoolClient) DisableAutoScale(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DisableAutoScalePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.DisableAutoScaleSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure sending request") - return - } - - result, err = client.DisableAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure responding to request") - } - - return -} - -// DisableAutoScalePreparer prepares the DisableAutoScale request. -func (client PoolClient) DisableAutoScalePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/disableautoscale", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableAutoScaleSender sends the DisableAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) DisableAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DisableAutoScaleResponder handles the response to the DisableAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) DisableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EnableAutoScale you cannot enable automatic scaling on a pool if a resize operation is in progress on the pool. If -// automatic scaling of the pool is currently disabled, you must specify a valid autoscale formula as part of the -// request. If automatic scaling of the pool is already enabled, you may specify a new autoscale formula and/or a new -// evaluation interval. You cannot call this API for the same pool more than once every 30 seconds. -// -// poolID is the ID of the pool on which to enable automatic scaling. poolEnableAutoScaleParameter is the -// parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. ifMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service exactly matches the -// value specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to -// the client. The operation will be performed only if the resource's current ETag on the service does not match -// the value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the -// resource known to the client. The operation will be performed only if the resource on the service has been -// modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the -// resource known to the client. The operation will be performed only if the resource on the service has not been -// modified since the specified time. -func (client PoolClient) EnableAutoScale(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.EnableAutoScalePreparer(ctx, poolID, poolEnableAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.EnableAutoScaleSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure sending request") - return - } - - result, err = client.EnableAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure responding to request") - } - - return -} - -// EnableAutoScalePreparer prepares the EnableAutoScale request. -func (client PoolClient) EnableAutoScalePreparer(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/enableautoscale", pathParameters), - autorest.WithJSON(poolEnableAutoScaleParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableAutoScaleSender sends the EnableAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) EnableAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EnableAutoScaleResponder handles the response to the EnableAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) EnableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EvaluateAutoScale this API is primarily for validating an autoscale formula, as it simply returns the result without -// applying the formula to the pool. The pool must have auto scaling enabled in order to evaluate a formula. -// -// poolID is the ID of the pool on which to evaluate the automatic scaling formula. poolEvaluateAutoScaleParameter -// is the parameters for the request. timeout is the maximum time that the server can spend processing the request, -// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of -// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. -func (client PoolClient) EvaluateAutoScale(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AutoScaleRun, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolEvaluateAutoScaleParameter, - Constraints: []validation.Constraint{{Target: "poolEvaluateAutoScaleParameter.AutoScaleFormula", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "EvaluateAutoScale", err.Error()) - } - - req, err := client.EvaluateAutoScalePreparer(ctx, poolID, poolEvaluateAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", nil, "Failure preparing request") - return - } - - resp, err := client.EvaluateAutoScaleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure sending request") - return - } - - result, err = client.EvaluateAutoScaleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure responding to request") - } - - return -} - -// EvaluateAutoScalePreparer prepares the EvaluateAutoScale request. -func (client PoolClient) EvaluateAutoScalePreparer(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/evaluateautoscale", pathParameters), - autorest.WithJSON(poolEvaluateAutoScaleParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EvaluateAutoScaleSender sends the EvaluateAutoScale request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) EvaluateAutoScaleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EvaluateAutoScaleResponder handles the response to the EvaluateAutoScale request. The method always -// closes the http.Response Body. -func (client PoolClient) EvaluateAutoScaleResponder(resp *http.Response) (result AutoScaleRun, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Exists gets basic properties of a pool. -// -// poolID is the ID of the pool to get. timeout is the maximum time that the server can spend processing the -// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the -// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the -// time the request was issued. Client libraries typically set this to the current system clock time; set it -// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the -// resource known to the client. The operation will be performed only if the resource's current ETag on the service -// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of -// the resource known to the client. The operation will be performed only if the resource's current ETag on the -// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last -// modified time of the resource known to the client. The operation will be performed only if the resource on the -// service has not been modified since the specified time. -func (client PoolClient) Exists(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ExistsPreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", nil, "Failure preparing request") - return - } - - resp, err := client.ExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure sending request") - return - } - - result, err = client.ExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure responding to request") - } - - return -} - -// ExistsPreparer prepares the Exists request. -func (client PoolClient) ExistsPreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExistsSender sends the Exists request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ExistsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExistsResponder handles the response to the Exists request. The method always -// closes the http.Response Body. -func (client PoolClient) ExistsResponder(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 information about the specified pool. -// -// poolID is the ID of the pool to get. selectParameter is an OData $select clause. expand is an OData $expand -// clause. timeout is the maximum time that the server can spend processing the request, in seconds. The default is -// 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration -// such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server -// should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client PoolClient) Get(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudPool, err error) { - req, err := client.GetPreparer(ctx, poolID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client PoolClient) GetPreparer(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 PoolClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) GetResponder(resp *http.Response) (result CloudPool, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAllLifetimeStatistics statistics are aggregated across all pools that have ever existed in the account, from -// account creation to the last update time of the statistics. -// -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client PoolClient) GetAllLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolStatistics, err error) { - req, err := client.GetAllLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", nil, "Failure preparing request") - return - } - - resp, err := client.GetAllLifetimeStatisticsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", resp, "Failure sending request") - return - } - - result, err = client.GetAllLifetimeStatisticsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", resp, "Failure responding to request") - } - - return -} - -// GetAllLifetimeStatisticsPreparer prepares the GetAllLifetimeStatistics request. -func (client PoolClient) GetAllLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/lifetimepoolstats"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAllLifetimeStatisticsSender sends the GetAllLifetimeStatistics request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) GetAllLifetimeStatisticsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetAllLifetimeStatisticsResponder handles the response to the GetAllLifetimeStatistics request. The method always -// closes the http.Response Body. -func (client PoolClient) GetAllLifetimeStatisticsResponder(resp *http.Response) (result PoolStatistics, 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. -// -// filter is an OData $filter clause. For more information on constructing this filter, see -// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-pools. selectParameter is an -// OData $select clause. expand is an OData $expand clause. maxResults is the maximum number of items to return in -// the response. A maximum of 1000 pools can be returned. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client PoolClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure sending request") - return - } - - result.cplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client PoolClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/pools"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 PoolClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 PoolClient) ListResponder(resp *http.Response) (result CloudPoolListResult, 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 PoolClient) listNextResults(lastResults CloudPoolListResult) (result CloudPoolListResult, err error) { - req, err := lastResults.cloudPoolListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "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, "batch.PoolClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PoolClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultIterator, err error) { - result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListUsageMetrics if you do not specify a $filter clause including a poolId, the response includes all pools that -// existed in the account in the time range of the returned aggregation intervals. If you do not specify a $filter -// clause including a startTime or endTime these filters default to the start and end times of the last aggregation -// interval currently available; that is, only the last aggregation interval is returned. -// -// startTime is the earliest time from which to include metrics. This must be at least two and a half hours before -// the current time. If not specified this defaults to the start time of the last aggregation interval currently -// available. endTime is the latest time from which to include metrics. This must be at least two hours before the -// current time. If not specified this defaults to the end time of the last aggregation interval currently -// available. filter is an OData $filter clause. For more information on constructing this filter, see -// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. -// maxResults is the maximum number of items to return in the response. A maximum of 1000 results will be returned. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client PoolClient) ListUsageMetrics(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListUsageMetricsResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "ListUsageMetrics", err.Error()) - } - - result.fn = client.listUsageMetricsNextResults - req, err := client.ListUsageMetricsPreparer(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListUsageMetricsSender(req) - if err != nil { - result.plumr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", resp, "Failure sending request") - return - } - - result.plumr, err = client.ListUsageMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", resp, "Failure responding to request") - } - - return -} - -// ListUsageMetricsPreparer prepares the ListUsageMetrics request. -func (client PoolClient) ListUsageMetricsPreparer(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if startTime != nil { - queryParameters["starttime"] = autorest.Encode("query", *startTime) - } - if endTime != nil { - queryParameters["endtime"] = autorest.Encode("query", *endTime) - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/poolusagemetrics"), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListUsageMetricsSender sends the ListUsageMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ListUsageMetricsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListUsageMetricsResponder handles the response to the ListUsageMetrics request. The method always -// closes the http.Response Body. -func (client PoolClient) ListUsageMetricsResponder(resp *http.Response) (result PoolListUsageMetricsResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listUsageMetricsNextResults retrieves the next set of results, if any. -func (client PoolClient) listUsageMetricsNextResults(lastResults PoolListUsageMetricsResult) (result PoolListUsageMetricsResult, err error) { - req, err := lastResults.poolListUsageMetricsResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListUsageMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListUsageMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListUsageMetricsComplete enumerates all values, automatically crossing page boundaries as required. -func (client PoolClient) ListUsageMetricsComplete(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListUsageMetricsResultIterator, err error) { - result.page, err = client.ListUsageMetrics(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// Patch this only replaces the pool properties specified in the request. For example, if the pool has a start task -// associated with it, and a request does not specify a start task element, then the pool keeps the existing start -// task. -// -// poolID is the ID of the pool to update. poolPatchParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client PoolClient) Patch(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.PatchPreparer(ctx, poolID, poolPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure responding to request") - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client PoolClient) PatchPreparer(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}", pathParameters), - autorest.WithJSON(poolPatchParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) PatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client PoolClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// RemoveNodes this operation can only run when the allocation state of the pool is steady. When this operation runs, -// the allocation state changes from steady to resizing. -// -// poolID is the ID of the pool from which you want to remove nodes. nodeRemoveParameter is the parameters for the -// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default -// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no -// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the -// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client -// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API -// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The -// operation will be performed only if the resource's current ETag on the service exactly matches the value -// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service does not match the -// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource -// known to the client. The operation will be performed only if the resource on the service has been modified since -// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to -// the client. The operation will be performed only if the resource on the service has not been modified since the -// specified time. -func (client PoolClient) RemoveNodes(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: nodeRemoveParameter, - Constraints: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "RemoveNodes", err.Error()) - } - - req, err := client.RemoveNodesPreparer(ctx, poolID, nodeRemoveParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", nil, "Failure preparing request") - return - } - - resp, err := client.RemoveNodesSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure sending request") - return - } - - result, err = client.RemoveNodesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure responding to request") - } - - return -} - -// RemoveNodesPreparer prepares the RemoveNodes request. -func (client PoolClient) RemoveNodesPreparer(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/removenodes", pathParameters), - autorest.WithJSON(nodeRemoveParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RemoveNodesSender sends the RemoveNodes request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) RemoveNodesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// RemoveNodesResponder handles the response to the RemoveNodes request. The method always -// closes the http.Response Body. -func (client PoolClient) RemoveNodesResponder(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 -} - -// Resize you can only resize a pool when its allocation state is steady. If the pool is already resizing, the request -// fails with status code 409. When you resize a pool, the pool's allocation state changes from steady to resizing. You -// cannot resize pools which are configured for automatic scaling. If you try to do this, the Batch service returns an -// error 409. If you resize a pool downwards, the Batch service chooses which nodes to remove. To remove specific -// nodes, use the pool remove nodes API instead. -// -// poolID is the ID of the pool to resize. poolResizeParameter is the parameters for the request. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client PoolClient) Resize(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ResizePreparer(ctx, poolID, poolResizeParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", nil, "Failure preparing request") - return - } - - resp, err := client.ResizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure sending request") - return - } - - result, err = client.ResizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure responding to request") - } - - return -} - -// ResizePreparer prepares the Resize request. -func (client PoolClient) ResizePreparer(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/resize", pathParameters), - autorest.WithJSON(poolResizeParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResizeSender sends the Resize request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) ResizeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ResizeResponder handles the response to the Resize request. The method always -// closes the http.Response Body. -func (client PoolClient) ResizeResponder(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 -} - -// StopResize this does not restore the pool to its previous state before the resize operation: it only stops any -// further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the -// number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state -// changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this -// API can also be used to halt the initial sizing of the pool when it is created. -// -// poolID is the ID of the pool whose resizing you want to stop. timeout is the maximum time that the server can -// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated -// request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client PoolClient) StopResize(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.StopResizePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", nil, "Failure preparing request") - return - } - - resp, err := client.StopResizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure sending request") - return - } - - result, err = client.StopResizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure responding to request") - } - - return -} - -// StopResizePreparer prepares the StopResize request. -func (client PoolClient) StopResizePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/stopresize", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopResizeSender sends the StopResize request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) StopResizeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// StopResizeResponder handles the response to the StopResize request. The method always -// closes the http.Response Body. -func (client PoolClient) StopResizeResponder(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 -} - -// UpdateProperties this fully replaces all the updateable properties of the pool. For example, if the pool has a start -// task associated with it and if start task is not specified with this request, then the Batch service will remove the -// existing start task. -// -// poolID is the ID of the pool to update. poolUpdatePropertiesParameter is the parameters for the request. timeout -// is the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client PoolClient) UpdateProperties(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolUpdatePropertiesParameter, - Constraints: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.StartTask.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.StartTask.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.StartTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - {Target: "poolUpdatePropertiesParameter.CertificateReferences", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.ApplicationPackageReferences", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "poolUpdatePropertiesParameter.Metadata", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "UpdateProperties", err.Error()) - } - - req, err := client.UpdatePropertiesPreparer(ctx, poolID, poolUpdatePropertiesParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", nil, "Failure preparing request") - return - } - - resp, err := client.UpdatePropertiesSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure sending request") - return - } - - result, err = client.UpdatePropertiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure responding to request") - } - - return -} - -// UpdatePropertiesPreparer prepares the UpdateProperties request. -func (client PoolClient) UpdatePropertiesPreparer(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/updateproperties", pathParameters), - autorest.WithJSON(poolUpdatePropertiesParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdatePropertiesSender sends the UpdateProperties request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) UpdatePropertiesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdatePropertiesResponder handles the response to the UpdateProperties request. The method always -// closes the http.Response Body. -func (client PoolClient) UpdatePropertiesResponder(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 -} - -// UpgradeOS during an upgrade, the Batch service upgrades each compute node in the pool. When a compute node is chosen -// for upgrade, any tasks running on that node are removed from the node and returned to the queue to be rerun later -// (or on a different compute node). The node will be unavailable until the upgrade is complete. This operation results -// in temporarily reduced pool capacity as nodes are taken out of service to be upgraded. Although the Batch service -// tries to avoid upgrading all compute nodes at the same time, it does not guarantee to do this (particularly on small -// pools); therefore, the pool may be temporarily unavailable to run tasks. When this operation runs, the pool state -// changes to upgrading. When all compute nodes have finished upgrading, the pool state returns to active. While the -// upgrade is in progress, the pool's currentOSVersion reflects the OS version that nodes are upgrading from, and -// targetOSVersion reflects the OS version that nodes are upgrading to. Once the upgrade is complete, currentOSVersion -// is updated to reflect the OS version now running on all nodes. This operation can only be invoked on pools created -// with the cloudServiceConfiguration property. -// -// poolID is the ID of the pool to upgrade. poolUpgradeOSParameter is the parameters for the request. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client PoolClient) UpgradeOS(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: poolUpgradeOSParameter, - Constraints: []validation.Constraint{{Target: "poolUpgradeOSParameter.TargetOSVersion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("batch.PoolClient", "UpgradeOS", err.Error()) - } - - req, err := client.UpgradeOSPreparer(ctx, poolID, poolUpgradeOSParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", nil, "Failure preparing request") - return - } - - resp, err := client.UpgradeOSSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure sending request") - return - } - - result, err = client.UpgradeOSResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure responding to request") - } - - return -} - -// UpgradeOSPreparer prepares the UpgradeOS request. -func (client PoolClient) UpgradeOSPreparer(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "poolId": autorest.Encode("path", poolID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/pools/{poolId}/upgradeos", pathParameters), - autorest.WithJSON(poolUpgradeOSParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpgradeOSSender sends the UpgradeOS request. The method will close the -// http.Response Body if it receives an error. -func (client PoolClient) UpgradeOSSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpgradeOSResponder handles the response to the UpgradeOS request. The method always -// closes the http.Response Body. -func (client PoolClient) UpgradeOSResponder(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/batch/2017-09-01.6.0/batch/task.go b/services/batch/2017-09-01.6.0/batch/task.go deleted file mode 100644 index f2f82a81ff7b..000000000000 --- a/services/batch/2017-09-01.6.0/batch/task.go +++ /dev/null @@ -1,1081 +0,0 @@ -package batch - -// 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/satori/go.uuid" - "net/http" -) - -// TaskClient is the a client for issuing REST requests to the Azure Batch service. -type TaskClient struct { - BaseClient -} - -// NewTaskClient creates an instance of the TaskClient client. -func NewTaskClient() TaskClient { - return NewTaskClientWithBaseURI(DefaultBaseURI) -} - -// NewTaskClientWithBaseURI creates an instance of the TaskClient client. -func NewTaskClientWithBaseURI(baseURI string) TaskClient { - return TaskClient{NewWithBaseURI(baseURI)} -} - -// Add the maximum lifetime of a task from addition to completion is 7 days. If a task has not completed within 7 days -// of being added it will be terminated by the Batch service and left in whatever state it was in at that time. -// -// jobID is the ID of the job to which the task is to be added. task is the task to be added. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client TaskClient) Add(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: task, - Constraints: []validation.Constraint{{Target: "task.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "task.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "task.ContainerSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "task.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "task.ContainerSettings.Registry", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "task.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "task.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - {Target: "task.AffinityInfo", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "task.AffinityInfo.AffinityID", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "task.MultiInstanceSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "task.MultiInstanceSettings.CoordinationCommandLine", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, jobID, task, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client TaskClient) AddPreparer(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters), - autorest.WithJSON(task), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 TaskClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByClosing()) - result.Response = resp - return -} - -// AddCollection note that each task must have a unique ID. The Batch service may not return the results for each task -// in the same order the tasks were submitted in this request. If the server times out or the connection is closed -// during the request, the request may have been partially or fully processed, or not at all. In such cases, the user -// should re-issue the request. Note that it is up to the user to correctly handle failures when re-issuing a request. -// For example, you should use the same task IDs during a retry so that if the prior operation succeeded, the retry -// will not create extra tasks unexpectedly. If the response contains any tasks which failed to add, a client can retry -// the request. In a retry, it is most efficient to resubmit only tasks that failed to add, and to omit tasks that were -// successfully added on the first attempt. The maximum lifetime of a task from addition to completion is 7 days. If a -// task has not completed within 7 days of being added it will be terminated by the Batch service and left in whatever -// state it was in at that time. -// -// jobID is the ID of the job to which the task collection is to be added. taskCollection is the tasks to be added. -// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30 -// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such -// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should -// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries -// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client TaskClient) AddCollection(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result TaskAddCollectionResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: taskCollection, - Constraints: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "AddCollection", err.Error()) - } - - req, err := client.AddCollectionPreparer(ctx, jobID, taskCollection, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", nil, "Failure preparing request") - return - } - - resp, err := client.AddCollectionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure sending request") - return - } - - result, err = client.AddCollectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure responding to request") - } - - return -} - -// AddCollectionPreparer prepares the AddCollection request. -func (client TaskClient) AddCollectionPreparer(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/addtaskcollection", pathParameters), - autorest.WithJSON(taskCollection), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddCollectionSender sends the AddCollection request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) AddCollectionSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddCollectionResponder handles the response to the AddCollection request. The method always -// closes the http.Response Body. -func (client TaskClient) AddCollectionResponder(resp *http.Response) (result TaskAddCollectionResult, 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 when a task is deleted, all of the files in its directory on the compute node where it ran are also deleted -// (regardless of the retention time). For multi-instance tasks, the delete task operation applies synchronously to the -// primary task; subtasks and their files are then deleted asynchronously in the background. -// -// jobID is the ID of the job from which to delete the task. taskID is the ID of the task to delete. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client TaskClient) Delete(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client TaskClient) DeletePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) 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 for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. -// Use the list subtasks API to retrieve information about subtasks. -// -// jobID is the ID of the job that contains the task. taskID is the ID of the task to get information about. -// selectParameter is an OData $select clause. expand is an OData $expand clause. timeout is the maximum time that -// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the -// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client TaskClient) Get(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudTask, err error) { - req, err := client.GetPreparer(ctx, jobID, taskID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client TaskClient) GetPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) GetResponder(resp *http.Response) (result CloudTask, 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 for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. -// Use the list subtasks API to retrieve information about subtasks. -// -// jobID is the ID of the job. filter is an OData $filter clause. For more information on constructing this filter, -// see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-tasks. selectParameter is -// an OData $select clause. expand is an OData $expand clause. maxResults is the maximum number of items to return -// in the response. A maximum of 1000 tasks can be returned. timeout is the maximum time that the server can spend -// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request -// identity, in the form of a GUID with no decoration such as curly braces, e.g. -// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client TaskClient) List(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batch.TaskClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ctlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure sending request") - return - } - - result.ctlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client TaskClient) ListPreparer(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - 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 TaskClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) ListResponder(resp *http.Response) (result CloudTaskListResult, 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 TaskClient) listNextResults(lastResults CloudTaskListResult) (result CloudTaskListResult, err error) { - req, err := lastResults.cloudTaskListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batch.TaskClient", "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, "batch.TaskClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client TaskClient) ListComplete(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultIterator, err error) { - result.page, err = client.List(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate) - return -} - -// ListSubtasks if the task is not a multi-instance task then this returns an empty collection. -// -// jobID is the ID of the job. taskID is the ID of the task. selectParameter is an OData $select clause. timeout is -// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. -func (client TaskClient) ListSubtasks(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListSubtasksResult, err error) { - req, err := client.ListSubtasksPreparer(ctx, jobID, taskID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", nil, "Failure preparing request") - return - } - - resp, err := client.ListSubtasksSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure sending request") - return - } - - result, err = client.ListSubtasksResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure responding to request") - } - - return -} - -// ListSubtasksPreparer prepares the ListSubtasks request. -func (client TaskClient) ListSubtasksPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/subtasksinfo", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSubtasksSender sends the ListSubtasks request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) ListSubtasksSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListSubtasksResponder handles the response to the ListSubtasks request. The method always -// closes the http.Response Body. -func (client TaskClient) ListSubtasksResponder(resp *http.Response) (result CloudTaskListSubtasksResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Reactivate reactivation makes a task eligible to be retried again up to its maximum retry count. The task's state is -// changed to active. As the task is no longer in the completed state, any previous exit code or failure information is -// no longer available after reactivation. Each time a task is reactivated, its retry count is reset to 0. Reactivation -// will fail for tasks that are not completed or that previously completed successfully (with an exit code of 0). -// Additionally, it will fail if the job has completed (or is terminating or deleting). -// -// jobID is the ID of the job containing the task. taskID is the ID of the task to reactivate. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client TaskClient) Reactivate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.ReactivatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", nil, "Failure preparing request") - return - } - - resp, err := client.ReactivateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure sending request") - return - } - - result, err = client.ReactivateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure responding to request") - } - - return -} - -// ReactivatePreparer prepares the Reactivate request. -func (client TaskClient) ReactivatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/reactivate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReactivateSender sends the Reactivate request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) ReactivateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ReactivateResponder handles the response to the Reactivate request. The method always -// closes the http.Response Body. -func (client TaskClient) ReactivateResponder(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 -} - -// Terminate when the task has been terminated, it moves to the completed state. For multi-instance tasks, the -// terminate task operation applies synchronously to the primary task; subtasks are then terminated asynchronously in -// the background. -// -// jobID is the ID of the job containing the task. taskID is the ID of the task to terminate. timeout is the -// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. -// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly -// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the -// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set -// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an -// ETag value associated with the version of the resource known to the client. The operation will be performed only -// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is -// an ETag value associated with the version of the resource known to the client. The operation will be performed -// only if the resource's current ETag on the service does not match the value specified by the client. -// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has been modified since the specified time. -// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The -// operation will be performed only if the resource on the service has not been modified since the specified time. -func (client TaskClient) Terminate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.TerminatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", nil, "Failure preparing request") - return - } - - resp, err := client.TerminateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure sending request") - return - } - - result, err = client.TerminateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure responding to request") - } - - return -} - -// TerminatePreparer prepares the Terminate request. -func (client TaskClient) TerminatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/terminate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TerminateSender sends the Terminate request. The method will close the -// http.Response Body if it receives an error. -func (client TaskClient) TerminateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TerminateResponder handles the response to the Terminate request. The method always -// closes the http.Response Body. -func (client TaskClient) TerminateResponder(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 -} - -// Update updates the properties of the specified task. -// -// jobID is the ID of the job containing the task. taskID is the ID of the task to update. taskUpdateParameter is -// the parameters for the request. timeout is the maximum time that the server can spend processing the request, in -// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a -// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID -// is whether the server should return the client-request-id in the response. ocpDate is the time the request was -// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are -// calling the REST API directly. ifMatch is an ETag value associated with the version of the resource known to the -// client. The operation will be performed only if the resource's current ETag on the service exactly matches the -// value specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to -// the client. The operation will be performed only if the resource's current ETag on the service does not match -// the value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the -// resource known to the client. The operation will be performed only if the resource on the service has been -// modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the -// resource known to the client. The operation will be performed only if the resource on the service has not been -// modified since the specified time. -func (client TaskClient) Update(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) { - req, err := client.UpdatePreparer(ctx, jobID, taskID, taskUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client TaskClient) UpdatePreparer(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobId": autorest.Encode("path", jobID), - "taskId": autorest.Encode("path", taskID), - } - - const APIVersion = "2017-09-01.6.0" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if timeout != nil { - queryParameters["timeout"] = autorest.Encode("query", *timeout) - } else { - queryParameters["timeout"] = autorest.Encode("query", 30) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters), - autorest.WithJSON(taskUpdateParameter), - autorest.WithQueryParameters(queryParameters)) - if clientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("client-request-id", autorest.String(clientRequestID))) - } - if returnClientRequestID != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID))) - } else { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("return-client-request-id", autorest.String(false))) - } - if ocpDate != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("ocp-date", autorest.String(ocpDate))) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - if len(ifNoneMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) - } - if ifModifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) - } - if ifUnmodifiedSince != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) - } - 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 TaskClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 TaskClient) UpdateResponder(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/batch/2017-09-01.6.0/batch/version.go b/services/batch/2017-09-01.6.0/batch/version.go deleted file mode 100644 index 836672bf5620..000000000000 --- a/services/batch/2017-09-01.6.0/batch/version.go +++ /dev/null @@ -1,30 +0,0 @@ -package batch - -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.Number + " batch/2017-09-01.6.0" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/services/batch/mgmt/2019-08-01/batch/applicationpackage.go b/services/batch/mgmt/2019-08-01/batch/applicationpackage.go index a210f623ea73..b4611bcdad58 100644 --- a/services/batch/mgmt/2019-08-01/batch/applicationpackage.go +++ b/services/batch/mgmt/2019-08-01/batch/applicationpackage.go @@ -41,7 +41,8 @@ func NewApplicationPackageClientWithBaseURI(baseURI string, subscriptionID strin return ApplicationPackageClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Activate activates the specified application package. +// Activate activates the specified application package. This should be done after the `ApplicationPackage` was created +// and uploaded. This needs to be done before an `ApplicationPackage` can be used on Pools or Tasks // Parameters: // resourceGroupName - the name of the resource group that contains the Batch account. // accountName - the name of the Batch account. @@ -143,7 +144,9 @@ func (client ApplicationPackageClient) ActivateResponder(resp *http.Response) (r return } -// Create creates an application package record. +// Create creates an application package record. The record contains the SAS where the package should be uploaded to. +// Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be +// used. // Parameters: // resourceGroupName - the name of the resource group that contains the Batch account. // accountName - the name of the Batch account. diff --git a/services/classic/management/README.md b/services/classic/management/README.md deleted file mode 100644 index d9518b59666f..000000000000 --- a/services/classic/management/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Azure Service Management packages for Go - -The `github.com/Azure/azure-sdk-for-go/services/classic/management` packages are used to perform operations using the Azure Service Management (ASM), aka classic deployment model. Read more about [Azure Resource Manager vs. classic deployment](https://azure.microsoft.com/documentation/articles/resource-manager-deployment-model/). Packages for Azure Resource Manager are in the [arm](../arm) folder. -Note that this package requires Go 1.7+ to build. -This package is in mainteinance mode and will only receive bug fixes. It is recommended to [migrate to Azure Resource Manager](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-deployment-model) deployment model. - -## First a Sidenote: Authentication and the Azure Service Manager - -The client currently supports authentication to the Service Management -API with certificates or Azure `.publishSettings` file. You can -download the `.publishSettings` file for your subscriptions -[here](https://manage.windowsazure.com/publishsettings). diff --git a/services/classic/management/affinitygroup/client.go b/services/classic/management/affinitygroup/client.go deleted file mode 100644 index d527d6d2ac78..000000000000 --- a/services/classic/management/affinitygroup/client.go +++ /dev/null @@ -1,147 +0,0 @@ -// +build go1.7 - -package affinitygroup - -// Copyright 2017 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. - -import ( - "encoding/base64" - "encoding/xml" - "fmt" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -const ( - azureCreateAffinityGroupURL = "/affinitygroups" - azureGetAffinityGroupURL = "/affinitygroups/%s" - azureListAffinityGroupsURL = "/affinitygroups" - azureUpdateAffinityGroupURL = "/affinitygroups/%s" - azureDeleteAffinityGroupURL = "/affinitygroups/%s" - - errParameterNotSpecified = "Parameter %s not specified." -) - -// AffinityGroupClient simply contains a management.Client and has -// methods for doing all affinity group-related API calls to Azure. -type AffinityGroupClient struct { - mgmtClient management.Client -} - -// NewClient returns an AffinityGroupClient with the given management.Client. -func NewClient(mgmtClient management.Client) AffinityGroupClient { - return AffinityGroupClient{mgmtClient} -} - -// CreateAffinityGroup creates a new affinity group. -// -// https://msdn.microsoft.com/en-us/library/azure/gg715317.aspx -func (c AffinityGroupClient) CreateAffinityGroup(params CreateAffinityGroupParams) error { - params.Label = encodeLabel(params.Label) - - req, err := xml.Marshal(params) - if err != nil { - return err - } - - _, err = c.mgmtClient.SendAzurePostRequest(azureCreateAffinityGroupURL, req) - return err -} - -// GetAffinityGroup returns the system properties that are associated with the -// specified affinity group. -// -// https://msdn.microsoft.com/en-us/library/azure/ee460789.aspx -func (c AffinityGroupClient) GetAffinityGroup(name string) (AffinityGroup, error) { - var affgroup AffinityGroup - if name == "" { - return affgroup, fmt.Errorf(errParameterNotSpecified, "name") - } - - url := fmt.Sprintf(azureGetAffinityGroupURL, name) - resp, err := c.mgmtClient.SendAzureGetRequest(url) - if err != nil { - return affgroup, err - } - - err = xml.Unmarshal(resp, &affgroup) - affgroup.Label = decodeLabel(affgroup.Label) - return affgroup, err -} - -// ListAffinityGroups lists the affinity groups off Azure. -// -// https://msdn.microsoft.com/en-us/library/azure/ee460797.aspx -func (c AffinityGroupClient) ListAffinityGroups() (ListAffinityGroupsResponse, error) { - var affinitygroups ListAffinityGroupsResponse - - resp, err := c.mgmtClient.SendAzureGetRequest(azureListAffinityGroupsURL) - if err != nil { - return affinitygroups, err - } - - err = xml.Unmarshal(resp, &affinitygroups) - - for i, grp := range affinitygroups.AffinityGroups { - affinitygroups.AffinityGroups[i].Label = decodeLabel(grp.Label) - } - - return affinitygroups, err -} - -// UpdateAffinityGroup updates the label or description for an the group. -// -// https://msdn.microsoft.com/en-us/library/azure/gg715316.aspx -func (c AffinityGroupClient) UpdateAffinityGroup(name string, params UpdateAffinityGroupParams) error { - if name == "" { - return fmt.Errorf(errParameterNotSpecified, "name") - } - - params.Label = encodeLabel(params.Label) - req, err := xml.Marshal(params) - if err != nil { - return err - } - - url := fmt.Sprintf(azureUpdateAffinityGroupURL, name) - _, err = c.mgmtClient.SendAzurePutRequest(url, "text/xml", req) - return err -} - -// DeleteAffinityGroup deletes the given affinity group. -// -// https://msdn.microsoft.com/en-us/library/azure/gg715314.aspx -func (c AffinityGroupClient) DeleteAffinityGroup(name string) error { - if name == "" { - return fmt.Errorf(errParameterNotSpecified, name) - } - - url := fmt.Sprintf(azureDeleteAffinityGroupURL, name) - _, err := c.mgmtClient.SendAzureDeleteRequest(url) - return err -} - -// encodeLabel is a helper function which encodes the given string -// to the base64 string which will be sent to Azure as a Label. -func encodeLabel(label string) string { - return base64.StdEncoding.EncodeToString([]byte(label)) -} - -// decodeLabel is a helper function which decodes the base64 encoded -// label received from Azure into standard encoding. -func decodeLabel(label string) string { - res, _ := base64.StdEncoding.DecodeString(label) - return string(res) -} diff --git a/services/classic/management/affinitygroup/entities.go b/services/classic/management/affinitygroup/entities.go deleted file mode 100644 index 3c810a000c40..000000000000 --- a/services/classic/management/affinitygroup/entities.go +++ /dev/null @@ -1,96 +0,0 @@ -// +build go1.7 - -package affinitygroup - -// Copyright 2017 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. - -import ( - "encoding/xml" -) - -// CreateAffinityGroupParams respresents the set of parameters required for -// creating an affinity group creation request to Azure. -// -// https://msdn.microsoft.com/en-us/library/azure/gg715317.aspx -type CreateAffinityGroupParams struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure CreateAffinityGroup"` - Name string - Label string - Description string `xml:",omitempty"` - Location string -} - -// HostedService is a struct containing details about a hosted service that is -// part of an affinity group on Azure. -type HostedService struct { - URL string `xml:"Url"` - ServiceName string -} - -// StorageService is a struct containing details about a storage service that is -// part of an affinity group on Azure. -type StorageService struct { - URL string `xml:"Url"` - ServiceName string -} - -// AffinityGroup respresents the properties of an affinity group on Azure. -// -// https://msdn.microsoft.com/en-us/library/azure/ee460789.aspx -type AffinityGroup struct { - Name string - Label string - Description string - Location string - HostedServices []HostedService - StorageServices []StorageService - Capabilities []string -} - -// ComputeCapabilities represents the sets of capabilities of an affinity group -// obtained from an affinity group list call to Azure. -type ComputeCapabilities struct { - VirtualMachineRoleSizes []string - WebWorkerRoleSizes []string -} - -// AffinityGroupListResponse represents the properties obtained for each -// affinity group listed off Azure. -// -// https://msdn.microsoft.com/en-us/library/azure/ee460797.aspx -type AffinityGroupListResponse struct { - Name string - Label string - Description string - Location string - Capabilities []string - ComputeCapabilities ComputeCapabilities -} - -// ListAffinityGroupsResponse contains all the affinity groups obtained from a -// call to the Azure API to list all affinity groups. -type ListAffinityGroupsResponse struct { - AffinityGroups []AffinityGroupListResponse `xml:"AffinityGroup"` -} - -// UpdateAffinityGroupParams if the set of parameters required to update an -// affinity group on Azure. -// -// https://msdn.microsoft.com/en-us/library/azure/gg715316.aspx -type UpdateAffinityGroupParams struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure UpdateAffinityGroup"` - Label string `xml:",omitempty"` - Description string `xml:",omitempty"` -} diff --git a/services/classic/management/client.go b/services/classic/management/client.go deleted file mode 100644 index 6d3d350b6e47..000000000000 --- a/services/classic/management/client.go +++ /dev/null @@ -1,178 +0,0 @@ -// +build go1.7 - -// Package management provides the main API client to construct other clients -// and make requests to the Microsoft Azure Service Management REST API. -package management - -// Copyright 2017 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. - -import ( - "errors" - "fmt" - "net/http" - "runtime" - "time" - - "github.com/Azure/azure-sdk-for-go/version" -) - -var ( - DefaultUserAgent = userAgent() -) - -const ( - DefaultAzureManagementURL = "https://management.core.windows.net" - DefaultOperationPollInterval = time.Second * 30 - DefaultAPIVersion = "2014-10-01" - - errPublishSettingsConfiguration = "PublishSettingsFilePath is set. Consequently ManagementCertificatePath and SubscriptionId must not be set." - errManagementCertificateConfiguration = "Both ManagementCertificatePath and SubscriptionId should be set, and PublishSettingsFilePath must not be set." - errParamNotSpecified = "Parameter %s is not specified." -) - -type client struct { - publishSettings publishSettings - config ClientConfig - httpClient *http.Client -} - -// Client is the base Azure Service Management API client instance that -// can be used to construct client instances for various services. -type Client interface { - // SendAzureGetRequest sends a request to the management API using the HTTP GET method - // and returns the response body or an error. - SendAzureGetRequest(url string) ([]byte, error) - - // SendAzurePostRequest sends a request to the management API using the HTTP POST method - // and returns the request ID or an error. - SendAzurePostRequest(url string, data []byte) (OperationID, error) - - // SendAzurePostRequestWithReturnedResponse sends a request to the management API using - // the HTTP POST method and returns the response body or an error. - SendAzurePostRequestWithReturnedResponse(url string, data []byte) ([]byte, error) - - // SendAzurePutRequest sends a request to the management API using the HTTP PUT method - // and returns the request ID or an error. The content type can be specified, however - // if an empty string is passed, the default of "application/xml" will be used. - SendAzurePutRequest(url, contentType string, data []byte) (OperationID, error) - - // SendAzureDeleteRequest sends a request to the management API using the HTTP DELETE method - // and returns the request ID or an error. - SendAzureDeleteRequest(url string) (OperationID, error) - - // GetOperationStatus gets the status of operation with given Operation ID. - // WaitForOperation utility method can be used for polling for operation status. - GetOperationStatus(operationID OperationID) (GetOperationStatusResponse, error) - - // WaitForOperation polls the Azure API for given operation ID indefinitely - // until the operation is completed with either success or failure. - // It is meant to be used for waiting for the result of the methods that - // return an OperationID value (meaning a long running operation has started). - // - // Cancellation of the polling loop (for instance, timing out) is done through - // cancel channel. If the user does not want to cancel, a nil chan can be provided. - // To cancel the method, it is recommended to close the channel provided to this - // method. - // - // If the operation was not successful or cancelling is signaled, an error - // is returned. - WaitForOperation(operationID OperationID, cancel chan struct{}) error -} - -// ClientConfig provides a configuration for use by a Client. -type ClientConfig struct { - ManagementURL string - OperationPollInterval time.Duration - UserAgent string - APIVersion string -} - -// NewAnonymousClient creates a new azure.Client with no credentials set. -func NewAnonymousClient() Client { - return client{} -} - -// DefaultConfig returns the default client configuration used to construct -// a client. This value can be used to make modifications on the default API -// configuration. -func DefaultConfig() ClientConfig { - return ClientConfig{ - ManagementURL: DefaultAzureManagementURL, - OperationPollInterval: DefaultOperationPollInterval, - APIVersion: DefaultAPIVersion, - UserAgent: DefaultUserAgent, - } -} - -// NewClient creates a new Client using the given subscription ID and -// management certificate. -func NewClient(subscriptionID string, managementCert []byte) (Client, error) { - return NewClientFromConfig(subscriptionID, managementCert, DefaultConfig()) -} - -// NewClientFromConfig creates a new Client using a given ClientConfig. -func NewClientFromConfig(subscriptionID string, managementCert []byte, config ClientConfig) (Client, error) { - return makeClient(subscriptionID, managementCert, config) -} - -func makeClient(subscriptionID string, managementCert []byte, config ClientConfig) (Client, error) { - var c client - - if subscriptionID == "" { - return c, errors.New("azure: subscription ID required") - } - - if len(managementCert) == 0 { - return c, errors.New("azure: management certificate required") - } - - publishSettings := publishSettings{ - SubscriptionID: subscriptionID, - SubscriptionCert: managementCert, - SubscriptionKey: managementCert, - } - - // Validate client configuration - switch { - case config.ManagementURL == "": - return c, errors.New("azure: base URL required") - case config.OperationPollInterval <= 0: - return c, errors.New("azure: operation polling interval must be a positive duration") - case config.APIVersion == "": - return c, errors.New("azure: client configuration must specify an API version") - case config.UserAgent == "": - config.UserAgent = DefaultUserAgent - } - - clientObj := client{ - publishSettings: publishSettings, - config: config, - } - var err error - clientObj.httpClient, err = clientObj.createHTTPClient() - if err != nil { - return nil, err - } - return clientObj, nil -} - -func userAgent() string { - return fmt.Sprintf("Go/%s (%s-%s) Azure-SDK-For-Go/%s asm/%s", - runtime.Version(), - runtime.GOARCH, - runtime.GOOS, - version.Number, - DefaultAPIVersion) -} diff --git a/services/classic/management/errors.go b/services/classic/management/errors.go deleted file mode 100644 index eca555cb4518..000000000000 --- a/services/classic/management/errors.go +++ /dev/null @@ -1,52 +0,0 @@ -// +build go1.7 - -package management - -// Copyright 2017 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. - -import ( - "encoding/xml" - "fmt" -) - -// AzureError represents an error returned by the management API. It has an error -// code (for example, ResourceNotFound) and a descriptive message. -type AzureError struct { - Code string - Message string -} - -//Error implements the error interface for the AzureError type. -func (e AzureError) Error() string { - return fmt.Sprintf("Error response from Azure. Code: %s, Message: %s", e.Code, e.Message) -} - -// IsResourceNotFoundError returns true if the provided error is an AzureError -// reporting that a given resource has not been found. -func IsResourceNotFoundError(err error) bool { - azureErr, ok := err.(AzureError) - return ok && azureErr.Code == "ResourceNotFound" -} - -// getAzureError converts an error response body into an AzureError instance. -func getAzureError(responseBody []byte) error { - var azErr AzureError - err := xml.Unmarshal(responseBody, &azErr) - if err != nil { - return fmt.Errorf("Failed parsing contents to AzureError format: %v", err) - } - return azErr - -} diff --git a/services/classic/management/errors_test.go b/services/classic/management/errors_test.go deleted file mode 100644 index d58a987d2b3a..000000000000 --- a/services/classic/management/errors_test.go +++ /dev/null @@ -1,46 +0,0 @@ -// +build go1.7 - -package management_test - -// Copyright 2017 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. - -import ( - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -// TestIsResourceNotFoundError tests IsResourceNotFoundError with the -// set of given test cases. -func TestIsResourceNotFoundError(t *testing.T) { - // isResourceNotFoundTestCases is a set of structs comprising of the error - // IsResourceNotFoundError should test and the expected result. - var isResourceNotFoundTestCases = []struct { - err error - expected bool - }{ - {nil, false}, - {fmt.Errorf("Some other random error."), false}, - {management.AzureError{Code: "ResourceNotFound"}, true}, - {management.AzureError{Code: "NotAResourceNotFound"}, false}, - } - - for i, testCase := range isResourceNotFoundTestCases { - if res := management.IsResourceNotFoundError(testCase.err); res != testCase.expected { - t.Fatalf("Test %d: error %s - expected %t - got %t", i+1, testCase.err, testCase.expected, res) - } - } -} diff --git a/services/classic/management/hostedservice/client.go b/services/classic/management/hostedservice/client.go deleted file mode 100644 index f6d2a712abc2..000000000000 --- a/services/classic/management/hostedservice/client.go +++ /dev/null @@ -1,141 +0,0 @@ -// +build go1.7 - -// Package hostedservice provides a client for Hosted Services. -package hostedservice - -// Copyright 2017 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. - -import ( - "encoding/base64" - "encoding/xml" - "fmt" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -const ( - azureXmlns = "http://schemas.microsoft.com/windowsazure" - azureDeploymentListURL = "services/hostedservices/%s/deployments" - azureHostedServiceListURL = "services/hostedservices" - azureHostedServiceAvailabilityURL = "services/hostedservices/operations/isavailable/%s" - azureDeploymentURL = "services/hostedservices/%s/deployments/%s" - deleteAzureDeploymentURL = "services/hostedservices/%s/deployments/%s" - getHostedServicePropertiesURL = "services/hostedservices/%s" - azureServiceCertificateURL = "services/hostedservices/%s/certificates" - - errParamNotSpecified = "Parameter %s is not specified." -) - -//NewClient is used to return a handle to the HostedService API -func NewClient(client management.Client) HostedServiceClient { - return HostedServiceClient{client: client} -} - -func (h HostedServiceClient) CreateHostedService(params CreateHostedServiceParameters) error { - req, err := xml.Marshal(params) - if err != nil { - return err - } - - _, err = h.client.SendAzurePostRequest(azureHostedServiceListURL, req) // not a long running operation - return err -} - -func (h HostedServiceClient) CheckHostedServiceNameAvailability(dnsName string) (AvailabilityResponse, error) { - var r AvailabilityResponse - if dnsName == "" { - return r, fmt.Errorf(errParamNotSpecified, "dnsName") - } - - requestURL := fmt.Sprintf(azureHostedServiceAvailabilityURL, dnsName) - response, err := h.client.SendAzureGetRequest(requestURL) - if err != nil { - return r, err - } - - err = xml.Unmarshal(response, &r) - return r, err -} - -func (h HostedServiceClient) DeleteHostedService(dnsName string, deleteDisksAndBlobs bool) (management.OperationID, error) { - if dnsName == "" { - return "", fmt.Errorf(errParamNotSpecified, "dnsName") - } - - requestURL := fmt.Sprintf(getHostedServicePropertiesURL, dnsName) - if deleteDisksAndBlobs { - requestURL += "?comp=media" - } - return h.client.SendAzureDeleteRequest(requestURL) -} - -func (h HostedServiceClient) GetHostedService(name string) (HostedService, error) { - hostedService := HostedService{} - if name == "" { - return hostedService, fmt.Errorf(errParamNotSpecified, "name") - } - - requestURL := fmt.Sprintf(getHostedServicePropertiesURL, name) - response, err := h.client.SendAzureGetRequest(requestURL) - if err != nil { - return hostedService, err - } - - err = xml.Unmarshal(response, &hostedService) - if err != nil { - return hostedService, err - } - - decodedLabel, err := base64.StdEncoding.DecodeString(hostedService.LabelBase64) - if err != nil { - return hostedService, err - } - hostedService.Label = string(decodedLabel) - return hostedService, nil -} - -func (h HostedServiceClient) ListHostedServices() (ListHostedServicesResponse, error) { - var response ListHostedServicesResponse - - data, err := h.client.SendAzureGetRequest(azureHostedServiceListURL) - if err != nil { - return response, err - } - - err = xml.Unmarshal(data, &response) - return response, err -} - -func (h HostedServiceClient) AddCertificate(dnsName string, certData []byte, certificateFormat CertificateFormat, password string) (management.OperationID, error) { - if dnsName == "" { - return "", fmt.Errorf(errParamNotSpecified, "dnsName") - } - - certBase64 := base64.StdEncoding.EncodeToString(certData) - - addCertificate := CertificateFile{ - Data: certBase64, - CertificateFormat: certificateFormat, - Password: password, - Xmlns: azureXmlns, - } - buffer, err := xml.Marshal(addCertificate) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(azureServiceCertificateURL, dnsName) - return h.client.SendAzurePostRequest(requestURL, buffer) -} diff --git a/services/classic/management/hostedservice/entities.go b/services/classic/management/hostedservice/entities.go deleted file mode 100644 index aa5b994515b7..000000000000 --- a/services/classic/management/hostedservice/entities.go +++ /dev/null @@ -1,74 +0,0 @@ -// +build go1.7 - -package hostedservice - -// Copyright 2017 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. - -import ( - "encoding/xml" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -//HostedServiceClient is used to perform operations on Azure Hosted Services -type HostedServiceClient struct { - client management.Client -} - -type CreateHostedServiceParameters struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure CreateHostedService"` - ServiceName string - Label string - Description string - Location string - ReverseDNSFqdn string `xml:"ReverseDnsFqdn,omitempty"` -} - -type AvailabilityResponse struct { - Xmlns string `xml:"xmlns,attr"` - Result bool - Reason string -} - -type HostedService struct { - URL string `xml:"Url"` - ServiceName string - Description string `xml:"HostedServiceProperties>Description"` - AffinityGroup string `xml:"HostedServiceProperties>AffinityGroup"` - Location string `xml:"HostedServiceProperties>Location"` - LabelBase64 string `xml:"HostedServiceProperties>Label"` - Label string - Status string `xml:"HostedServiceProperties>Status"` - ReverseDNSFqdn string `xml:"HostedServiceProperties>ReverseDnsFqdn"` - DefaultWinRmCertificateThumbprint string -} - -type CertificateFile struct { - Xmlns string `xml:"xmlns,attr"` - Data string - CertificateFormat CertificateFormat - Password string `xml:",omitempty"` -} - -type CertificateFormat string - -const ( - CertificateFormatPfx = CertificateFormat("pfx") - CertificateFormatCer = CertificateFormat("cer") -) - -type ListHostedServicesResponse struct { - HostedServices []HostedService `xml:"HostedService"` -} diff --git a/services/classic/management/http.go b/services/classic/management/http.go deleted file mode 100644 index a12f8a156ded..000000000000 --- a/services/classic/management/http.go +++ /dev/null @@ -1,206 +0,0 @@ -// +build go1.7 - -package management - -// Copyright 2017 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. - -import ( - "bytes" - "crypto/tls" - "fmt" - "net/http" - "time" -) - -const ( - msVersionHeader = "x-ms-version" - requestIDHeader = "x-ms-request-id" - uaHeader = "User-Agent" - contentHeader = "Content-Type" - defaultContentHeaderValue = "application/xml" -) - -func (client client) SendAzureGetRequest(url string) ([]byte, error) { - resp, err := client.sendAzureRequest("GET", url, "", nil) - if err != nil { - return nil, err - } - return getResponseBody(resp) -} - -func (client client) SendAzurePostRequest(url string, data []byte) (OperationID, error) { - return client.doAzureOperation("POST", url, "", data) -} - -func (client client) SendAzurePostRequestWithReturnedResponse(url string, data []byte) ([]byte, error) { - resp, err := client.sendAzureRequest("POST", url, "", data) - if err != nil { - return nil, err - } - - return getResponseBody(resp) -} - -func (client client) SendAzurePutRequest(url, contentType string, data []byte) (OperationID, error) { - return client.doAzureOperation("PUT", url, contentType, data) -} - -func (client client) SendAzureDeleteRequest(url string) (OperationID, error) { - return client.doAzureOperation("DELETE", url, "", nil) -} - -func (client client) doAzureOperation(method, url, contentType string, data []byte) (OperationID, error) { - response, err := client.sendAzureRequest(method, url, contentType, data) - if err != nil { - return "", err - } - return getOperationID(response) -} - -func getOperationID(response *http.Response) (OperationID, error) { - requestID := response.Header.Get(requestIDHeader) - if requestID == "" { - return "", fmt.Errorf("Could not retrieve operation id from %q header", requestIDHeader) - } - return OperationID(requestID), nil -} - -// sendAzureRequest constructs an HTTP client for the request, sends it to the -// management API and returns the response or an error. -func (client client) sendAzureRequest(method, url, contentType string, data []byte) (*http.Response, error) { - if method == "" { - return nil, fmt.Errorf(errParamNotSpecified, "method") - } - if url == "" { - return nil, fmt.Errorf(errParamNotSpecified, "url") - } - - response, err := client.sendRequest(client.httpClient, url, method, contentType, data, 5) - if err != nil { - return nil, err - } - - return response, nil -} - -// createHTTPClient creates an HTTP Client configured with the key pair for -// the subscription for this client. -func (client client) createHTTPClient() (*http.Client, error) { - cert, err := tls.X509KeyPair(client.publishSettings.SubscriptionCert, client.publishSettings.SubscriptionKey) - if err != nil { - return nil, err - } - - return &http.Client{ - Transport: &http.Transport{ - Proxy: http.ProxyFromEnvironment, - TLSClientConfig: &tls.Config{ - Renegotiation: tls.RenegotiateOnceAsClient, - Certificates: []tls.Certificate{cert}, - }, - }, - }, nil -} - -// sendRequest sends a request to the Azure management API using the given -// HTTP client and parameters. It returns the response from the call or an -// error. -func (client client) sendRequest(httpClient *http.Client, url, requestType, contentType string, data []byte, numberOfRetries int) (*http.Response, error) { - - absURI := client.createAzureRequestURI(url) - - for { - request, reqErr := client.createAzureRequest(absURI, requestType, contentType, data) - if reqErr != nil { - return nil, reqErr - } - - response, err := httpClient.Do(request) - if err != nil { - if numberOfRetries == 0 { - return nil, err - } - - return client.sendRequest(httpClient, url, requestType, contentType, data, numberOfRetries-1) - } - if response.StatusCode == http.StatusTemporaryRedirect { - // ASM's way of moving traffic around, see https://msdn.microsoft.com/en-us/library/azure/ee460801.aspx - // Only handled automatically for GET/HEAD requests. This is for the rest of the http verbs. - u, err := response.Location() - if err != nil { - return response, fmt.Errorf("Redirect requested but location header could not be retrieved: %v", err) - } - absURI = u.String() - continue // re-issue request - } - - if response.StatusCode >= http.StatusBadRequest { - body, err := getResponseBody(response) - if err != nil { - // Failed to read the response body - return nil, err - } - azureErr := getAzureError(body) - if azureErr != nil { - if numberOfRetries == 0 { - return nil, azureErr - } - if response.StatusCode == http.StatusServiceUnavailable || response.StatusCode == http.StatusTooManyRequests { - // Wait before retrying the operation - time.Sleep(client.config.OperationPollInterval) - } - - return client.sendRequest(httpClient, url, requestType, contentType, data, numberOfRetries-1) - } - } - - return response, nil - } -} - -// createAzureRequestURI constructs the request uri using the management API endpoint and -// subscription ID associated with the client. -func (client client) createAzureRequestURI(url string) string { - return fmt.Sprintf("%s/%s/%s", client.config.ManagementURL, client.publishSettings.SubscriptionID, url) -} - -// createAzureRequest packages up the request with the correct set of headers and returns -// the request object or an error. -func (client client) createAzureRequest(url string, requestType string, contentType string, data []byte) (*http.Request, error) { - var request *http.Request - var err error - - if data != nil { - body := bytes.NewBuffer(data) - request, err = http.NewRequest(requestType, url, body) - } else { - request, err = http.NewRequest(requestType, url, nil) - } - - if err != nil { - return nil, err - } - - request.Header.Set(msVersionHeader, client.config.APIVersion) - request.Header.Set(uaHeader, client.config.UserAgent) - - if contentType != "" { - request.Header.Set(contentHeader, contentType) - } else { - request.Header.Set(contentHeader, defaultContentHeaderValue) - } - - return request, nil -} diff --git a/services/classic/management/location/client.go b/services/classic/management/location/client.go deleted file mode 100644 index aa735a20a5db..000000000000 --- a/services/classic/management/location/client.go +++ /dev/null @@ -1,46 +0,0 @@ -// +build go1.7 - -// Package location provides a client for Locations. -package location - -// Copyright 2017 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. - -import ( - "encoding/xml" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -const ( - azureLocationListURL = "locations" - errParamNotSpecified = "Parameter %s is not specified." -) - -//NewClient is used to instantiate a new LocationClient from an Azure client -func NewClient(client management.Client) LocationClient { - return LocationClient{client: client} -} - -func (c LocationClient) ListLocations() (ListLocationsResponse, error) { - var l ListLocationsResponse - - response, err := c.client.SendAzureGetRequest(azureLocationListURL) - if err != nil { - return l, err - } - - err = xml.Unmarshal(response, &l) - return l, err -} diff --git a/services/classic/management/location/entities.go b/services/classic/management/location/entities.go deleted file mode 100644 index 7b12c1079d8c..000000000000 --- a/services/classic/management/location/entities.go +++ /dev/null @@ -1,53 +0,0 @@ -// +build go1.7 - -package location - -// Copyright 2017 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. - -import ( - "bytes" - "encoding/xml" - "fmt" - "strings" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -//LocationClient is used to perform operations on Azure Locations -type LocationClient struct { - client management.Client -} - -type ListLocationsResponse struct { - XMLName xml.Name `xml:"Locations"` - Locations []Location `xml:"Location"` -} - -type Location struct { - Name string - DisplayName string - AvailableServices []string `xml:"AvailableServices>AvailableService"` - WebWorkerRoleSizes []string `xml:"ComputeCapabilities>WebWorkerRoleSizes>RoleSize"` - VirtualMachineRoleSizes []string `xml:"ComputeCapabilities>VirtualMachinesRoleSizes>RoleSize"` -} - -func (ll ListLocationsResponse) String() string { - var buf bytes.Buffer - for _, l := range ll.Locations { - fmt.Fprintf(&buf, "%s, ", l.Name) - } - - return strings.Trim(buf.String(), ", ") -} diff --git a/services/classic/management/networksecuritygroup/client.go b/services/classic/management/networksecuritygroup/client.go deleted file mode 100644 index 6c7f9ce9c7ab..000000000000 --- a/services/classic/management/networksecuritygroup/client.go +++ /dev/null @@ -1,266 +0,0 @@ -// +build go1.7 - -// Package networksecuritygroup provides a client for Network Security Groups. -package networksecuritygroup - -// Copyright 2017 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. - -import ( - "encoding/xml" - "fmt" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -const ( - createSecurityGroupURL = "services/networking/networksecuritygroups" - deleteSecurityGroupURL = "services/networking/networksecuritygroups/%s" - getSecurityGroupURL = "services/networking/networksecuritygroups/%s?detaillevel=full" - listSecurityGroupsURL = "services/networking/networksecuritygroups" - addSecurityGroupToSubnetURL = "services/networking/virtualnetwork/%s/subnets/%s/networksecuritygroups" - getSecurityGroupForSubnetURL = "services/networking/virtualnetwork/%s/subnets/%s/networksecuritygroups" - removeSecurityGroupFromSubnetURL = "services/networking/virtualnetwork/%s/subnets/%s/networksecuritygroups/%s" - setSecurityGroupRuleURL = "services/networking/networksecuritygroups/%s/rules/%s" - deleteSecurityGroupRuleURL = "services/networking/networksecuritygroups/%s/rules/%s" - - errParamNotSpecified = "Parameter %s is not specified." -) - -// NewClient is used to instantiate a new SecurityGroupClient from an Azure client -func NewClient(client management.Client) SecurityGroupClient { - return SecurityGroupClient{client: client} -} - -// CreateNetworkSecurityGroup creates a new network security group within -// the context of the specified subscription -// -// https://msdn.microsoft.com/en-us/library/azure/dn913818.aspx -func (sg SecurityGroupClient) CreateNetworkSecurityGroup( - name string, - label string, - location string) (management.OperationID, error) { - if name == "" { - return "", fmt.Errorf(errParamNotSpecified, "name") - } - if location == "" { - return "", fmt.Errorf(errParamNotSpecified, "location") - } - - data, err := xml.Marshal(SecurityGroupRequest{ - Name: name, - Label: label, - Location: location, - }) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(createSecurityGroupURL) - return sg.client.SendAzurePostRequest(requestURL, data) -} - -// DeleteNetworkSecurityGroup deletes the specified network security group from the subscription -// -// https://msdn.microsoft.com/en-us/library/azure/dn913825.aspx -func (sg SecurityGroupClient) DeleteNetworkSecurityGroup( - name string) (management.OperationID, error) { - if name == "" { - return "", fmt.Errorf(errParamNotSpecified, "name") - } - - requestURL := fmt.Sprintf(deleteSecurityGroupURL, name) - return sg.client.SendAzureDeleteRequest(requestURL) -} - -// GetNetworkSecurityGroup returns information about the specified network security group -// -// https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx -func (sg SecurityGroupClient) GetNetworkSecurityGroup(name string) (SecurityGroupResponse, error) { - if name == "" { - return SecurityGroupResponse{}, fmt.Errorf(errParamNotSpecified, "name") - } - - var securityGroup SecurityGroupResponse - - requestURL := fmt.Sprintf(getSecurityGroupURL, name) - response, err := sg.client.SendAzureGetRequest(requestURL) - if err != nil { - return securityGroup, err - } - - err = xml.Unmarshal(response, &securityGroup) - return securityGroup, err -} - -// ListNetworkSecurityGroups returns a list of the network security groups -// in the specified subscription -// -// https://msdn.microsoft.com/en-us/library/azure/dn913815.aspx -func (sg SecurityGroupClient) ListNetworkSecurityGroups() (SecurityGroupList, error) { - // the list of NetworkSecurityGroup items is wrapped in a NetworkSecurityGroups - // element so we need an outer struct representing this element. - type NetworkSecurityGroups struct { - SecurityGroupList SecurityGroupList `xml:"http://schemas.microsoft.com/windowsazure NetworkSecurityGroup"` - } - var securityGroups NetworkSecurityGroups - - response, err := sg.client.SendAzureGetRequest(listSecurityGroupsURL) - if err != nil { - return securityGroups.SecurityGroupList, err - } - - err = xml.Unmarshal(response, &securityGroups) - return securityGroups.SecurityGroupList, err -} - -// AddNetworkSecurityToSubnet associates the network security group with -// specified subnet in a virtual network -// -// https://msdn.microsoft.com/en-us/library/azure/dn913822.aspx -func (sg SecurityGroupClient) AddNetworkSecurityToSubnet( - name string, - subnet string, - virtualNetwork string) (management.OperationID, error) { - if name == "" { - return "", fmt.Errorf(errParamNotSpecified, "name") - } - if subnet == "" { - return "", fmt.Errorf(errParamNotSpecified, "subnet") - } - if virtualNetwork == "" { - return "", fmt.Errorf(errParamNotSpecified, "virtualNetwork") - } - - data, err := xml.Marshal(SecurityGroupRequest{Name: name}) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(addSecurityGroupToSubnetURL, virtualNetwork, subnet) - return sg.client.SendAzurePostRequest(requestURL, data) -} - -// GetNetworkSecurityGroupForSubnet returns information about the network -// security group associated with a subnet -// -// https://msdn.microsoft.com/en-us/library/azure/dn913817.aspx -func (sg SecurityGroupClient) GetNetworkSecurityGroupForSubnet( - subnet string, - virtualNetwork string) (SecurityGroupResponse, error) { - if subnet == "" { - return SecurityGroupResponse{}, fmt.Errorf(errParamNotSpecified, "subnet") - } - if virtualNetwork == "" { - return SecurityGroupResponse{}, fmt.Errorf(errParamNotSpecified, "virtualNetwork") - } - - var securityGroup SecurityGroupResponse - - requestURL := fmt.Sprintf(getSecurityGroupForSubnetURL, virtualNetwork, subnet) - response, err := sg.client.SendAzureGetRequest(requestURL) - if err != nil { - return securityGroup, err - } - - err = xml.Unmarshal(response, &securityGroup) - return securityGroup, err -} - -// RemoveNetworkSecurityGroupFromSubnet removes the association of the -// specified network security group from the specified subnet -// -// https://msdn.microsoft.com/en-us/library/azure/dn913820.aspx -func (sg SecurityGroupClient) RemoveNetworkSecurityGroupFromSubnet( - name string, - subnet string, - virtualNetwork string) (management.OperationID, error) { - if name == "" { - return "", fmt.Errorf(errParamNotSpecified, "name") - } - if subnet == "" { - return "", fmt.Errorf(errParamNotSpecified, "subnet") - } - if virtualNetwork == "" { - return "", fmt.Errorf(errParamNotSpecified, "virtualNetwork") - } - - requestURL := fmt.Sprintf(removeSecurityGroupFromSubnetURL, virtualNetwork, subnet, name) - return sg.client.SendAzureDeleteRequest(requestURL) -} - -// SetNetworkSecurityGroupRule adds or updates a network security rule that -// is associated with the specified network security group -// -// https://msdn.microsoft.com/en-us/library/azure/dn913819.aspx -func (sg SecurityGroupClient) SetNetworkSecurityGroupRule( - securityGroup string, - rule RuleRequest) (management.OperationID, error) { - if securityGroup == "" { - return "", fmt.Errorf(errParamNotSpecified, "securityGroup") - } - if rule.Name == "" { - return "", fmt.Errorf(errParamNotSpecified, "Name") - } - if rule.Type == "" { - return "", fmt.Errorf(errParamNotSpecified, "Type") - } - if rule.Priority == 0 { - return "", fmt.Errorf(errParamNotSpecified, "Priority") - } - if rule.Action == "" { - return "", fmt.Errorf(errParamNotSpecified, "Action") - } - if rule.SourceAddressPrefix == "" { - return "", fmt.Errorf(errParamNotSpecified, "SourceAddressPrefix") - } - if rule.SourcePortRange == "" { - return "", fmt.Errorf(errParamNotSpecified, "SourcePortRange") - } - if rule.DestinationAddressPrefix == "" { - return "", fmt.Errorf(errParamNotSpecified, "DestinationAddressPrefix") - } - if rule.DestinationPortRange == "" { - return "", fmt.Errorf(errParamNotSpecified, "DestinationPortRange") - } - if rule.Protocol == "" { - return "", fmt.Errorf(errParamNotSpecified, "Protocol") - } - - data, err := xml.Marshal(rule) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(setSecurityGroupRuleURL, securityGroup, rule.Name) - return sg.client.SendAzurePutRequest(requestURL, "", data) -} - -// DeleteNetworkSecurityGroupRule deletes a network security group rule from -// the specified network security group -// -// https://msdn.microsoft.com/en-us/library/azure/dn913816.aspx -func (sg SecurityGroupClient) DeleteNetworkSecurityGroupRule( - securityGroup string, - rule string) (management.OperationID, error) { - if securityGroup == "" { - return "", fmt.Errorf(errParamNotSpecified, "securityGroup") - } - if rule == "" { - return "", fmt.Errorf(errParamNotSpecified, "rule") - } - - requestURL := fmt.Sprintf(deleteSecurityGroupRuleURL, securityGroup, rule) - return sg.client.SendAzureDeleteRequest(requestURL) -} diff --git a/services/classic/management/networksecuritygroup/entities.go b/services/classic/management/networksecuritygroup/entities.go deleted file mode 100644 index 1073eac79e2c..000000000000 --- a/services/classic/management/networksecuritygroup/entities.go +++ /dev/null @@ -1,131 +0,0 @@ -// +build go1.7 - -// Package networksecuritygroup implements operations for managing network security groups -// using the Service Management REST API -// -// https://msdn.microsoft.com/en-us/library/azure/dn913824.aspx -package networksecuritygroup - -// Copyright 2017 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. - -import ( - "encoding/xml" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -// SecurityGroupClient is used to perform operations on network security groups -type SecurityGroupClient struct { - client management.Client -} - -// SecurityGroupRequest represents a network security group -// -// https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx -type SecurityGroupRequest struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure NetworkSecurityGroup"` - Name string - Label string `xml:",omitempty"` - Location string `xml:",omitempty"` -} - -// SecurityGroupResponse represents a network security group -// -// https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx -type SecurityGroupResponse struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure NetworkSecurityGroup"` - Name string - Label string `xml:",omitempty"` - Location string `xml:",omitempty"` - State SecurityGroupState `xml:",omitempty"` - Rules []RuleResponse `xml:">Rule,omitempty"` -} - -// SecurityGroupList represents a list of security groups -type SecurityGroupList []SecurityGroupResponse - -// SecurityGroupState represents a security group state -type SecurityGroupState string - -// These constants represent the possible security group states -const ( - SecurityGroupStateCreated SecurityGroupState = "Created" - SecurityGroupStateCreating SecurityGroupState = "Creating" - SecurityGroupStateUpdating SecurityGroupState = "Updating" - SecurityGroupStateDeleting SecurityGroupState = "Deleting" - SecurityGroupStateUnavailable SecurityGroupState = "Unavailable" -) - -// RuleRequest represents a single rule of a network security group -// -// https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx#bk_rules -type RuleRequest struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Rule"` - Name string - Type RuleType - Priority int - Action RuleAction - SourceAddressPrefix string - SourcePortRange string - DestinationAddressPrefix string - DestinationPortRange string - Protocol RuleProtocol -} - -// RuleResponse represents a single rule of a network security group -// -// https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx#bk_rules -type RuleResponse struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Rule"` - Name string - Type RuleType - Priority int - Action RuleAction - SourceAddressPrefix string - SourcePortRange string - DestinationAddressPrefix string - DestinationPortRange string - Protocol RuleProtocol - State string `xml:",omitempty"` - IsDefault bool `xml:",omitempty"` -} - -// RuleType represents a rule type -type RuleType string - -// These constants represent the possible rule types -const ( - RuleTypeInbound RuleType = "Inbound" - RuleTypeOutbound RuleType = "Outbound" -) - -// RuleAction represents a rule action -type RuleAction string - -// These constants represent the possible rule actions -const ( - RuleActionAllow RuleAction = "Allow" - RuleActionDeny RuleAction = "Deny" -) - -// RuleProtocol represents a rule protocol -type RuleProtocol string - -// These constants represent the possible rule types -const ( - RuleProtocolTCP RuleProtocol = "TCP" - RuleProtocolUDP RuleProtocol = "UDP" - RuleProtocolAll RuleProtocol = "*" -) diff --git a/services/classic/management/operations.go b/services/classic/management/operations.go deleted file mode 100644 index eb306b8b14bd..000000000000 --- a/services/classic/management/operations.go +++ /dev/null @@ -1,108 +0,0 @@ -// +build go1.7 - -package management - -// Copyright 2017 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. - -import ( - "encoding/xml" - "errors" - "fmt" - "time" -) - -var ( - // ErrOperationCancelled from WaitForOperation when the polling loop is - // cancelled through signaling the channel. - ErrOperationCancelled = errors.New("Polling for operation status cancelled") -) - -// GetOperationStatusResponse represents an in-flight operation. Use -// client.GetOperationStatus() to get the operation given the operation ID, or -// use WaitForOperation() to poll and wait until the operation has completed. -// See https://msdn.microsoft.com/en-us/library/azure/ee460783.aspx -type GetOperationStatusResponse struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Operation"` - ID string - Status OperationStatus - HTTPStatusCode string - Error *AzureError -} - -// OperationStatus describes the states an Microsoft Azure Service Management -// operation an be in. -type OperationStatus string - -// List of states an operation can be reported as -const ( - OperationStatusInProgress OperationStatus = "InProgress" - OperationStatusSucceeded OperationStatus = "Succeeded" - OperationStatusFailed OperationStatus = "Failed" -) - -// OperationID is assigned by Azure API and can be used to look up the status of -// an operation -type OperationID string - -func (c client) GetOperationStatus(operationID OperationID) (GetOperationStatusResponse, error) { - operation := GetOperationStatusResponse{} - if operationID == "" { - return operation, fmt.Errorf(errParamNotSpecified, "operationID") - } - - url := fmt.Sprintf("operations/%s", operationID) - response, azureErr := c.SendAzureGetRequest(url) - if azureErr != nil { - return operation, azureErr - } - - err := xml.Unmarshal(response, &operation) - return operation, err -} - -func (c client) WaitForOperation(operationID OperationID, cancel chan struct{}) error { - for { - done, err := c.checkOperationStatus(operationID) - if err != nil || done { - return err - } - select { - case <-time.After(c.config.OperationPollInterval): - case <-cancel: - return ErrOperationCancelled - } - } -} - -func (c client) checkOperationStatus(id OperationID) (done bool, err error) { - op, err := c.GetOperationStatus(id) - if err != nil { - return false, fmt.Errorf("Failed to get operation status '%s': %v", id, err) - } - - switch op.Status { - case OperationStatusSucceeded: - return true, nil - case OperationStatusFailed: - if op.Error != nil { - return true, op.Error - } - return true, fmt.Errorf("Azure Operation (x-ms-request-id=%s) has failed", id) - case OperationStatusInProgress: - return false, nil - default: - return false, fmt.Errorf("Unknown operation status returned from API: %s (x-ms-request-id=%s)", op.Status, id) - } -} diff --git a/services/classic/management/osimage/client.go b/services/classic/management/osimage/client.go deleted file mode 100644 index 3726abd88634..000000000000 --- a/services/classic/management/osimage/client.go +++ /dev/null @@ -1,60 +0,0 @@ -// +build go1.7 - -// Package osimage provides a client for Operating System Images. -package osimage - -// Copyright 2017 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. - -import ( - "encoding/xml" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -const ( - azureImageListURL = "services/images" - errInvalidImage = "Can not find image %s in specified subscription, please specify another image name." - errParamNotSpecified = "Parameter %s is not specified." -) - -// NewClient is used to instantiate a new OSImageClient from an Azure client. -func NewClient(client management.Client) OSImageClient { - return OSImageClient{client: client} -} - -func (c OSImageClient) ListOSImages() (ListOSImagesResponse, error) { - var l ListOSImagesResponse - - response, err := c.client.SendAzureGetRequest(azureImageListURL) - if err != nil { - return l, err - } - - err = xml.Unmarshal(response, &l) - return l, err -} - -// AddOSImage adds an operating system image to the image repository that is associated with the specified subscription. -// -// See https://msdn.microsoft.com/en-us/library/azure/jj157192.aspx for details. -func (c OSImageClient) AddOSImage(osi *OSImage) (management.OperationID, error) { - data, err := xml.Marshal(osi) - if err != nil { - return "", err - } - - return c.client.SendAzurePostRequest(azureImageListURL, data) - -} diff --git a/services/classic/management/osimage/entities.go b/services/classic/management/osimage/entities.go deleted file mode 100644 index 970f131e8959..000000000000 --- a/services/classic/management/osimage/entities.go +++ /dev/null @@ -1,65 +0,0 @@ -// +build go1.7 - -package osimage - -// Copyright 2017 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. - -import ( - "encoding/xml" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -// OSImageClient is used to perform operations on Azure Locations -type OSImageClient struct { - client management.Client -} - -type ListOSImagesResponse struct { - XMLName xml.Name `xml:"Images"` - OSImages []OSImage `xml:"OSImage"` -} - -type OSImage struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure OSImage"` - Category string // Public || Private || MSDN - Label string // Specifies an identifier for the image. - LogicalSizeInGB float64 //Specifies the size, in GB, of the image. - Name string // Specifies the name of the operating system image. This is the name that is used when creating one or more virtual machines using the image. - OS string // Linux || Windows - Eula string // Specifies the End User License Agreement that is associated with the image. The value for this element is a string, but it is recommended that the value be a URL that points to a EULA. - Description string // Specifies the description of the image. - Location string // The geo-location in which this media is located. The Location value is derived from storage account that contains the blob in which the media is located. If the storage account belongs to an affinity group the value is NULL. - AffinityGroup string // Specifies the affinity in which the media is located. The AffinityGroup value is derived from storage account that contains the blob in which the media is located. If the storage account does not belong to an affinity group the value is NULL and the element is not displayed in the response. This value is NULL for platform images. - MediaLink string // Specifies the location of the vhd file for the image. The storage account where the vhd is located must be associated with the specified subscription. - ImageFamily string // Specifies a value that can be used to group images. - PublishedDate string // Specifies the date when the image was added to the image repository. - IsPremium string // Indicates whether the image contains software or associated services that will incur charges above the core price for the virtual machine. For additional details, see the PricingDetailLink element. - PrivacyURI string `xml:"PrivacyUri"` // Specifies the URI that points to a document that contains the privacy policy related to the image. - RecommendedVMSize string // Specifies the size to use for the virtual machine that is created from the image. - PublisherName string // The name of the publisher of the image. All user images have a publisher name of User. - PricingDetailLink string // Specifies a URL for an image with IsPremium set to true, which contains the pricing details for a virtual machine that is created from the image. - IconURI string `xml:"IconUri"` // Specifies the Uri to the icon that is displayed for the image in the Management Portal. - SmallIconURI string `xml:"SmallIconUri"` // Specifies the URI to the small icon that is displayed when the image is presented in the Microsoft Azure Management Portal. - Language string // Specifies the language of the image. - IOType IOType // Provisioned || Standard -} - -type IOType string - -const ( - IOTypeProvisioned IOType = "Provisioned" - IOTypeStandard IOType = "Standard" -) diff --git a/services/classic/management/publishSettings.go b/services/classic/management/publishSettings.go deleted file mode 100644 index 8effb38eb8c6..000000000000 --- a/services/classic/management/publishSettings.go +++ /dev/null @@ -1,124 +0,0 @@ -// +build go1.7 - -package management - -// Copyright 2017 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. - -import ( - "encoding/base64" - "encoding/pem" - "encoding/xml" - "fmt" - "io/ioutil" - - "golang.org/x/crypto/pkcs12" -) - -// ClientFromPublishSettingsData unmarshalls the contents of a publish settings file -// from https://manage.windowsazure.com/publishsettings. -// If subscriptionID is left empty, the first subscription in the file is used. -func ClientFromPublishSettingsData(settingsData []byte, subscriptionID string) (client Client, err error) { - return ClientFromPublishSettingsDataWithConfig(settingsData, subscriptionID, DefaultConfig()) -} - -// ClientFromPublishSettingsFile reads a publish settings file downloaded from https://manage.windowsazure.com/publishsettings. -// If subscriptionID is left empty, the first subscription in the file is used. -func ClientFromPublishSettingsFile(filePath, subscriptionID string) (client Client, err error) { - return ClientFromPublishSettingsFileWithConfig(filePath, subscriptionID, DefaultConfig()) -} - -// ClientFromPublishSettingsFileWithConfig reads a publish settings file downloaded from https://manage.windowsazure.com/publishsettings. -// If subscriptionID is left empty, the first subscription in the file is used. -func ClientFromPublishSettingsFileWithConfig(filePath, subscriptionID string, config ClientConfig) (client Client, err error) { - if filePath == "" { - return client, fmt.Errorf(errParamNotSpecified, "filePath") - } - - publishSettingsContent, err := ioutil.ReadFile(filePath) - if err != nil { - return client, err - } - - return ClientFromPublishSettingsDataWithConfig(publishSettingsContent, subscriptionID, config) -} - -// ClientFromPublishSettingsDataWithConfig unmarshalls the contents of a publish settings file -// from https://manage.windowsazure.com/publishsettings. -// If subscriptionID is left empty, the first subscription in the string is used. -func ClientFromPublishSettingsDataWithConfig(data []byte, subscriptionID string, config ClientConfig) (client Client, err error) { - publishData := publishData{} - if err = xml.Unmarshal(data, &publishData); err != nil { - return client, err - } - - for _, profile := range publishData.PublishProfiles { - for _, sub := range profile.Subscriptions { - if sub.ID == subscriptionID || subscriptionID == "" { - base64Cert := sub.ManagementCertificate - if base64Cert == "" { - base64Cert = profile.ManagementCertificate - } - - pfxData, err := base64.StdEncoding.DecodeString(base64Cert) - if err != nil { - return client, err - } - - pems, err := pkcs12.ToPEM(pfxData, "") - if err != nil { - return client, err - } - - cert := []byte{} - for _, b := range pems { - cert = append(cert, pem.EncodeToMemory(b)...) - } - - config.ManagementURL = sub.ServiceManagementURL - return makeClient(sub.ID, cert, config) - } - } - } - - return client, fmt.Errorf("could not find subscription '%s' in settings provided", subscriptionID) -} - -type publishSettings struct { - SubscriptionID string - SubscriptionCert []byte - SubscriptionKey []byte -} - -type publishData struct { - XMLName xml.Name `xml:"PublishData"` - PublishProfiles []publishProfile `xml:"PublishProfile"` -} - -type publishProfile struct { - XMLName xml.Name `xml:"PublishProfile"` - SchemaVersion string `xml:",attr"` - PublishMethod string `xml:",attr"` - URL string `xml:"Url,attr"` - ManagementCertificate string `xml:",attr"` - Subscriptions []subscription `xml:"Subscription"` -} - -type subscription struct { - XMLName xml.Name `xml:"Subscription"` - ServiceManagementURL string `xml:"ServiceManagementUrl,attr"` - ID string `xml:"Id,attr"` - Name string `xml:",attr"` - ManagementCertificate string `xml:",attr"` -} diff --git a/services/classic/management/sql/client.go b/services/classic/management/sql/client.go deleted file mode 100644 index 483428a47a07..000000000000 --- a/services/classic/management/sql/client.go +++ /dev/null @@ -1,332 +0,0 @@ -// +build go1.7 - -package sql - -// Copyright 2017 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. - -import ( - "encoding/xml" - "fmt" - "time" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -// Definitions of numerous constants representing API endpoints. -const ( - azureCreateDatabaseServerURL = "services/sqlservers/servers" - azureListDatabaseServersURL = "services/sqlservers/servers" - azureDeleteDatabaseServerURL = "services/sqlservers/servers/%s" - - azureCreateFirewallRuleURL = "services/sqlservers/servers/%s/firewallrules" - azureGetFirewallRuleURL = "services/sqlservers/servers/%s/firewallrules/%s" - azureListFirewallRulesURL = "services/sqlservers/servers/%s/firewallrules" - azureUpdateFirewallRuleURL = "services/sqlservers/servers/%s/firewallrules/%s" - azureDeleteFirewallRuleURL = "services/sqlservers/servers/%s/firewallrules/%s" - - azureCreateDatabaseURL = "services/sqlservers/servers/%s/databases" - azureGetDatabaseURL = "services/sqlservers/servers/%s/databases/%s" - azureListDatabasesURL = "services/sqlservers/servers/%s/databases?contentview=generic" - azureUpdateDatabaseURL = "services/sqlservers/servers/%s/databases/%s" - azureDeleteDatabaseURL = "services/sqlservers/servers/%s/databases/%s" - - errParamNotSpecified = "Parameter %s was not specified." - - DatabaseStateCreating = "Creating" -) - -// SQLDatabaseClient defines various database CRUD operations. -// It contains a management.Client for making the actual http calls. -type SQLDatabaseClient struct { - mgmtClient management.Client -} - -// NewClient returns a new SQLDatabaseClient struct with the provided -// management.Client as the underlying client. -func NewClient(mgmtClient management.Client) SQLDatabaseClient { - return SQLDatabaseClient{mgmtClient} -} - -// CreateServer creates a new Azure SQL Database server and return its name. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505699.aspx -func (c SQLDatabaseClient) CreateServer(params DatabaseServerCreateParams) (string, error) { - req, err := xml.Marshal(params) - if err != nil { - return "", err - } - - resp, err := c.mgmtClient.SendAzurePostRequestWithReturnedResponse(azureCreateDatabaseServerURL, req) - if err != nil { - return "", err - } - - var name string - err = xml.Unmarshal(resp, &name) - - return name, err -} - -// ListServers retrieves the Azure SQL Database servers for this subscription. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505702.aspx -func (c SQLDatabaseClient) ListServers() (ListServersResponse, error) { - var resp ListServersResponse - - data, err := c.mgmtClient.SendAzureGetRequest(azureListDatabaseServersURL) - if err != nil { - return resp, err - } - - err = xml.Unmarshal(data, &resp) - return resp, err -} - -// DeleteServer deletes an Azure SQL Database server (including all its databases). -// -// https://msdn.microsoft.com/en-us/library/azure/dn505695.aspx -func (c SQLDatabaseClient) DeleteServer(name string) error { - if name == "" { - return fmt.Errorf(errParamNotSpecified, "name") - } - - url := fmt.Sprintf(azureDeleteDatabaseServerURL, name) - _, err := c.mgmtClient.SendAzureDeleteRequest(url) - return err -} - -// CreateFirewallRule creates an Azure SQL Database server -// firewall rule. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505712.aspx -func (c SQLDatabaseClient) CreateFirewallRule(server string, params FirewallRuleCreateParams) error { - if server == "" { - return fmt.Errorf(errParamNotSpecified, "server") - } - - req, err := xml.Marshal(params) - if err != nil { - return err - } - - url := fmt.Sprintf(azureCreateFirewallRuleURL, server) - - _, err = c.mgmtClient.SendAzurePostRequest(url, req) - return err -} - -// GetFirewallRule gets the details of an Azure SQL Database Server firewall rule. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505698.aspx -func (c SQLDatabaseClient) GetFirewallRule(server, ruleName string) (FirewallRuleResponse, error) { - var rule FirewallRuleResponse - - if server == "" { - return rule, fmt.Errorf(errParamNotSpecified, "server") - } - if ruleName == "" { - return rule, fmt.Errorf(errParamNotSpecified, "ruleName") - } - - url := fmt.Sprintf(azureGetFirewallRuleURL, server, ruleName) - resp, err := c.mgmtClient.SendAzureGetRequest(url) - if err != nil { - return rule, err - } - - err = xml.Unmarshal(resp, &rule) - return rule, err -} - -// ListFirewallRules retrieves the set of firewall rules for an Azure SQL -// Database Server. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505715.aspx -func (c SQLDatabaseClient) ListFirewallRules(server string) (ListFirewallRulesResponse, error) { - var rules ListFirewallRulesResponse - - if server == "" { - return rules, fmt.Errorf(errParamNotSpecified, "server") - } - - url := fmt.Sprintf(azureListFirewallRulesURL, server) - resp, err := c.mgmtClient.SendAzureGetRequest(url) - if err != nil { - return rules, err - } - - err = xml.Unmarshal(resp, &rules) - return rules, err -} - -// UpdateFirewallRule update a firewall rule for an Azure SQL Database server. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505707.aspx -func (c SQLDatabaseClient) UpdateFirewallRule(server, ruleName string, params FirewallRuleUpdateParams) error { - if server == "" { - return fmt.Errorf(errParamNotSpecified, "server") - } - if ruleName == "" { - return fmt.Errorf(errParamNotSpecified, "ruleName") - } - - req, err := xml.Marshal(params) - if err != nil { - return err - } - - url := fmt.Sprintf(azureUpdateFirewallRuleURL, server, ruleName) - _, err = c.mgmtClient.SendAzurePutRequest(url, "text/xml", req) - return err -} - -// DeleteFirewallRule deletes an Azure SQL Database server firewall rule. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505706.aspx -func (c SQLDatabaseClient) DeleteFirewallRule(server, ruleName string) error { - if server == "" { - return fmt.Errorf(errParamNotSpecified, "server") - } - if ruleName == "" { - return fmt.Errorf(errParamNotSpecified, "ruleName") - } - - url := fmt.Sprintf(azureDeleteFirewallRuleURL, server, ruleName) - - _, err := c.mgmtClient.SendAzureDeleteRequest(url) - return err -} - -// CreateDatabase creates a new Microsoft Azure SQL Database on the given database server. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505701.aspx -func (c SQLDatabaseClient) CreateDatabase(server string, params DatabaseCreateParams) error { - if server == "" { - return fmt.Errorf(errParamNotSpecified, "server") - } - - req, err := xml.Marshal(params) - if err != nil { - return err - } - - target := fmt.Sprintf(azureCreateDatabaseURL, server) - _, err = c.mgmtClient.SendAzurePostRequest(target, req) - return err -} - -// WaitForDatabaseCreation is a helper method which waits -// for the creation of the database on the given server. -func (c SQLDatabaseClient) WaitForDatabaseCreation( - server, database string, - cancel chan struct{}) error { - for { - stat, err := c.GetDatabase(server, database) - if err != nil { - return err - } - if stat.State != DatabaseStateCreating { - return nil - } - - select { - case <-time.After(management.DefaultOperationPollInterval): - case <-cancel: - return management.ErrOperationCancelled - } - } -} - -// GetDatabase gets the details for an Azure SQL Database. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505708.aspx -func (c SQLDatabaseClient) GetDatabase(server, database string) (ServiceResource, error) { - var db ServiceResource - - if database == "" { - return db, fmt.Errorf(errParamNotSpecified, "database") - } - if server == "" { - return db, fmt.Errorf(errParamNotSpecified, "server") - } - - url := fmt.Sprintf(azureGetDatabaseURL, server, database) - resp, err := c.mgmtClient.SendAzureGetRequest(url) - if err != nil { - return db, err - } - - err = xml.Unmarshal(resp, &db) - return db, err -} - -// ListDatabases returns a list of Azure SQL Databases on the given server. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505711.aspx -func (c SQLDatabaseClient) ListDatabases(server string) (ListDatabasesResponse, error) { - var databases ListDatabasesResponse - if server == "" { - return databases, fmt.Errorf(errParamNotSpecified, "server name") - } - - url := fmt.Sprintf(azureListDatabasesURL, server) - resp, err := c.mgmtClient.SendAzureGetRequest(url) - if err != nil { - return databases, err - } - - err = xml.Unmarshal(resp, &databases) - return databases, err -} - -// UpdateDatabase updates the details of the given Database off the given server. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505718.aspx -func (c SQLDatabaseClient) UpdateDatabase( - server, database string, - params ServiceResourceUpdateParams) (management.OperationID, error) { - if database == "" { - return "", fmt.Errorf(errParamNotSpecified, "database") - } - if server == "" { - return "", fmt.Errorf(errParamNotSpecified, "server") - } - - url := fmt.Sprintf(azureUpdateDatabaseURL, server, database) - req, err := xml.Marshal(params) - if err != nil { - return "", err - } - - return c.mgmtClient.SendAzurePutRequest(url, "text/xml", req) -} - -// DeleteDatabase deletes the Azure SQL Database off the given server. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505705.aspx -func (c SQLDatabaseClient) DeleteDatabase(server, database string) error { - if database == "" { - return fmt.Errorf(errParamNotSpecified, "database") - } - if server == "" { - return fmt.Errorf(errParamNotSpecified, "server") - } - - url := fmt.Sprintf(azureDeleteDatabaseURL, server, database) - - _, err := c.mgmtClient.SendAzureDeleteRequest(url) - - return err -} diff --git a/services/classic/management/sql/entities.go b/services/classic/management/sql/entities.go deleted file mode 100644 index 7006e81697c7..000000000000 --- a/services/classic/management/sql/entities.go +++ /dev/null @@ -1,140 +0,0 @@ -// +build go1.7 - -package sql - -// Copyright 2017 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. - -import ( - "encoding/xml" -) - -// DatabaseServerCreateParams represents the set of possible parameters -// when issuing a database server creation request to Azure. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505699.aspx -type DatabaseServerCreateParams struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/sqlazure/2010/12/ Server"` - AdministratorLogin string - AdministratorLoginPassword string - Location string - Version string -} - -// DatabaseServerCreateResponse represents the response following the creation of -// a database server on Azure. -type DatabaseServerCreateResponse struct { - ServerName string -} - -const ( - DatabaseServerVersion11 = "2.0" - DatabaseServerVersion12 = "12.0" -) - -// DatabaseServer represents the set of data received from -// a database server list operation. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505702.aspx -type DatabaseServer struct { - Name string - AdministratorLogin string - Location string - FullyQualifiedDomainName string - Version string - State string -} - -type ListServersResponse struct { - DatabaseServers []DatabaseServer `xml:"Server"` -} - -// FirewallRuleCreateParams represents the set of possible -// parameters when creating a firewall rule on an Azure database server. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505712.aspx -type FirewallRuleCreateParams struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ServiceResource"` - Name string - StartIPAddress string - EndIPAddress string -} - -// FirewallRuleResponse represents the set of data received from -// an Azure database server firewall rule get response. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505698.aspx -type FirewallRuleResponse struct { - Name string - StartIPAddress string - EndIPAddress string -} - -type ListFirewallRulesResponse struct { - FirewallRules []FirewallRuleResponse `xml:"ServiceResource"` -} - -// FirewallRuleUpdateParams represents the set of possible -// parameters when issuing an update of a database server firewall rule. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505707.aspx -type FirewallRuleUpdateParams struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ServiceResource"` - Name string - StartIPAddress string - EndIPAddress string -} - -// DatabaseCreateParams represents the set of possible parameters when issuing -// a database creation to Azure, and reading a list response from Azure. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505701.aspx -type DatabaseCreateParams struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ServiceResource"` - Name string - Edition string `xml:",omitempty"` - CollationName string `xml:",omitempty"` - MaxSizeBytes int64 `xml:",omitempty"` - ServiceObjectiveID string `xml:"ServiceObjectiveId,omitempty"` -} - -// ServiceResource represents the set of parameters obtained from a database -// get or list call. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505708.aspx -type ServiceResource struct { - Name string - State string - SelfLink string - Edition string - CollationName string - MaxSizeBytes int64 - ServiceObjectiveID string `xml:"ServiceObjectiveId,omitempty"` -} - -type ListDatabasesResponse struct { - ServiceResources []ServiceResource `xml:"ServiceResource"` -} - -// ServiceResourceUpdateParams represents the set of parameters available -// for a database service update operation. -// -// https://msdn.microsoft.com/en-us/library/azure/dn505718.aspx -type ServiceResourceUpdateParams struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ServiceResource"` - Name string - Edition string `xml:",omitempty"` - MaxSizeBytes int64 `xml:",omitempty"` - ServiceObjectiveID string `xml:"ServiceObjectiveId,omitempty"` -} diff --git a/services/classic/management/storageservice/client.go b/services/classic/management/storageservice/client.go deleted file mode 100644 index fb08c1403104..000000000000 --- a/services/classic/management/storageservice/client.go +++ /dev/null @@ -1,124 +0,0 @@ -// +build go1.7 - -// Package storageservice provides a client for Storage Services. -package storageservice - -// Copyright 2017 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. - -import ( - "encoding/xml" - "fmt" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -const ( - azureStorageServiceListURL = "services/storageservices" - azureStorageServiceURL = "services/storageservices/%s" - azureStorageServiceKeysURL = "services/storageservices/%s/keys" - azureStorageAccountAvailabilityURL = "services/storageservices/operations/isavailable/%s" - - azureXmlns = "http://schemas.microsoft.com/windowsazure" - - errParamNotSpecified = "Parameter %s is not specified." -) - -// NewClient is used to instantiate a new StorageServiceClient from an Azure -// client. -func NewClient(s management.Client) StorageServiceClient { - return StorageServiceClient{client: s} -} - -func (s StorageServiceClient) ListStorageServices() (ListStorageServicesResponse, error) { - var l ListStorageServicesResponse - response, err := s.client.SendAzureGetRequest(azureStorageServiceListURL) - if err != nil { - return l, err - } - - err = xml.Unmarshal(response, &l) - return l, err -} - -func (s StorageServiceClient) GetStorageService(serviceName string) (StorageServiceResponse, error) { - var svc StorageServiceResponse - if serviceName == "" { - return svc, fmt.Errorf(errParamNotSpecified, "serviceName") - } - - requestURL := fmt.Sprintf(azureStorageServiceURL, serviceName) - response, err := s.client.SendAzureGetRequest(requestURL) - if err != nil { - return svc, err - } - - err = xml.Unmarshal(response, &svc) - return svc, err -} - -func (s StorageServiceClient) GetStorageServiceKeys(serviceName string) (GetStorageServiceKeysResponse, error) { - var r GetStorageServiceKeysResponse - if serviceName == "" { - return r, fmt.Errorf(errParamNotSpecified, "serviceName") - } - - requestURL := fmt.Sprintf(azureStorageServiceKeysURL, serviceName) - data, err := s.client.SendAzureGetRequest(requestURL) - if err != nil { - return r, err - } - - err = xml.Unmarshal(data, &r) - return r, err -} - -func (s StorageServiceClient) CreateStorageService(parameters StorageAccountCreateParameters) (management.OperationID, error) { - data, err := xml.Marshal(CreateStorageServiceInput{ - StorageAccountCreateParameters: parameters}) - if err != nil { - return "", err - } - - return s.client.SendAzurePostRequest(azureStorageServiceListURL, data) -} - -func (s StorageServiceClient) DeleteStorageService(serviceName string) (management.OperationID, error) { - if serviceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "serviceName") - } - - requestURL := fmt.Sprintf(azureStorageServiceURL, serviceName) - return s.client.SendAzureDeleteRequest(requestURL) -} - -// CheckStorageAccountNameAvailability checks to if the specified storage account -// name is available. -// -// See https://msdn.microsoft.com/en-us/library/azure/jj154125.aspx -func (s StorageServiceClient) CheckStorageAccountNameAvailability(name string) (AvailabilityResponse, error) { - var r AvailabilityResponse - if name == "" { - return r, fmt.Errorf(errParamNotSpecified, "name") - } - - requestURL := fmt.Sprintf(azureStorageAccountAvailabilityURL, name) - response, err := s.client.SendAzureGetRequest(requestURL) - if err != nil { - return r, err - } - - err = xml.Unmarshal(response, &r) - return r, err -} diff --git a/services/classic/management/storageservice/entities.go b/services/classic/management/storageservice/entities.go deleted file mode 100644 index 0d928a280eec..000000000000 --- a/services/classic/management/storageservice/entities.go +++ /dev/null @@ -1,95 +0,0 @@ -// +build go1.7 - -package storageservice - -// Copyright 2017 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. - -import ( - "encoding/xml" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -// StorageServiceClient is used to perform operations on Azure Storage -type StorageServiceClient struct { - client management.Client -} - -type ListStorageServicesResponse struct { - StorageServices []StorageServiceResponse `xml:"StorageService"` -} - -type StorageServiceResponse struct { - URL string `xml:"Url"` - ServiceName string - StorageServiceProperties StorageServiceProperties -} - -type StorageServiceProperties struct { - Description string - Location string - Label string - Status string - Endpoints []string `xml:"Endpoints>Endpoint"` - GeoReplicationEnabled string - GeoPrimaryRegion string -} - -type GetStorageServiceKeysResponse struct { - URL string `xml:"Url"` - PrimaryKey string `xml:"StorageServiceKeys>Primary"` - SecondaryKey string `xml:"StorageServiceKeys>Secondary"` -} - -type CreateStorageServiceInput struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure CreateStorageServiceInput"` - StorageAccountCreateParameters -} - -type StorageAccountCreateParameters struct { - ServiceName string - Description string `xml:",omitempty"` - Label string - AffinityGroup string `xml:",omitempty"` - Location string `xml:",omitempty"` - ExtendedProperties ExtendedPropertyList - AccountType AccountType -} - -type AccountType string - -const ( - AccountTypeStandardLRS AccountType = "Standard_LRS" - AccountTypeStandardZRS AccountType = "Standard_ZRS" - AccountTypeStandardGRS AccountType = "Standard_GRS" - AccountTypeStandardRAGRS AccountType = "Standard_RAGRS" - AccountTypePremiumLRS AccountType = "Premium_LRS" -) - -type ExtendedPropertyList struct { - ExtendedProperty []ExtendedProperty -} - -type ExtendedProperty struct { - Name string - Value string -} - -type AvailabilityResponse struct { - XMLName xml.Name `xml:"AvailabilityResponse"` - Xmlns string `xml:"xmlns,attr"` - Result bool - Reason string -} diff --git a/services/classic/management/storageservice/entities_test.go b/services/classic/management/storageservice/entities_test.go deleted file mode 100644 index 23a6e9afc850..000000000000 --- a/services/classic/management/storageservice/entities_test.go +++ /dev/null @@ -1,47 +0,0 @@ -// +build go1.7 - -package storageservice - -// Copyright 2017 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. - -import ( - "encoding/xml" - "testing" -) - -func Test_StorageServiceKeysResponse_Unmarshal(t *testing.T) { - // from https://msdn.microsoft.com/en-us/library/azure/ee460785.aspx - response := []byte(` - - storage-service-url - - primary-key - secondary-key - - `) - - keysResponse := GetStorageServiceKeysResponse{} - err := xml.Unmarshal(response, &keysResponse) - if err != nil { - t.Fatal(err) - } - - if expected := "primary-key"; keysResponse.PrimaryKey != expected { - t.Fatalf("Expected %q but got %q", expected, keysResponse.PrimaryKey) - } - if expected := "secondary-key"; keysResponse.SecondaryKey != expected { - t.Fatalf("Expected %q but got %q", expected, keysResponse.SecondaryKey) - } -} diff --git a/services/classic/management/testutils/managementclient.go b/services/classic/management/testutils/managementclient.go deleted file mode 100644 index 693c9bd15822..000000000000 --- a/services/classic/management/testutils/managementclient.go +++ /dev/null @@ -1,103 +0,0 @@ -// +build go1.7 - -// Package testutils contains some test utilities for the Azure SDK -package testutils - -// Copyright 2017 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. - -import ( - "encoding/base64" - "os" - "testing" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -// GetTestClient returns a management Client for testing. Expects -// AZSUBSCRIPTIONID and AZCERTDATA to be present in the environment. AZCERTDATA -// is the base64encoded binary representation of the PEM certificate data. -func GetTestClient(t *testing.T) management.Client { - subid := os.Getenv("AZSUBSCRIPTIONID") - certdata := os.Getenv("AZCERTDATA") - if subid == "" || certdata == "" { - t.Skip("AZSUBSCRIPTIONID or AZCERTDATA not set, skipping test") - } - cert, err := base64.StdEncoding.DecodeString(certdata) - if err != nil { - t.Fatal(err) - } - - client, err := management.NewClient(subid, cert) - if err != nil { - t.Fatal(err) - } - return testClient{client, t} -} - -type testClient struct { - management.Client - t *testing.T -} - -func chop(d []byte) string { - const maxlen = 5000 - - s := string(d) - - if len(s) > maxlen { - return s[:maxlen] + "..." - } - return s -} - -func (l testClient) SendAzureGetRequest(url string) ([]byte, error) { - d, err := l.Client.SendAzureGetRequest(url) - logOperation(l.t, "GET", url, nil, d, "", err) - return d, err -} - -func (l testClient) SendAzurePostRequest(url string, data []byte) (management.OperationID, error) { - oid, err := l.Client.SendAzurePostRequest(url, data) - logOperation(l.t, "POST", url, data, nil, oid, err) - return oid, err -} - -func (l testClient) SendAzurePutRequest(url string, contentType string, data []byte) (management.OperationID, error) { - oid, err := l.Client.SendAzurePutRequest(url, contentType, data) - logOperation(l.t, "PUT", url, data, nil, oid, err) - return oid, err -} - -func (l testClient) SendAzureDeleteRequest(url string) (management.OperationID, error) { - oid, err := l.Client.SendAzureDeleteRequest(url) - logOperation(l.t, "DELETE", url, nil, nil, oid, err) - return oid, err -} - -func logOperation(t *testing.T, method, url string, requestData, responseData []byte, oid management.OperationID, err error) { - t.Logf("AZURE> %s %s\n", method, url) - if requestData != nil { - t.Logf(" >>> %s\n", chop(requestData)) - } - if err != nil { - t.Logf(" <<< ERROR: %+v\n", err) - } else { - if responseData != nil { - t.Logf(" <<< %s\n", chop(responseData)) - } else { - t.Logf(" <<< OperationID: %s\n", oid) - } - } -} diff --git a/services/classic/management/util.go b/services/classic/management/util.go deleted file mode 100644 index 9a32f20eabae..000000000000 --- a/services/classic/management/util.go +++ /dev/null @@ -1,27 +0,0 @@ -// +build go1.7 - -package management - -// Copyright 2017 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. - -import ( - "io/ioutil" - "net/http" -) - -func getResponseBody(response *http.Response) ([]byte, error) { - defer response.Body.Close() - return ioutil.ReadAll(response.Body) -} diff --git a/services/classic/management/virtualmachine/client.go b/services/classic/management/virtualmachine/client.go deleted file mode 100644 index b9533c8410c7..000000000000 --- a/services/classic/management/virtualmachine/client.go +++ /dev/null @@ -1,606 +0,0 @@ -// +build go1.7 - -// Package virtualmachine provides a client for Virtual Machines. -package virtualmachine - -// Copyright 2017 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. - -import ( - "encoding/xml" - "fmt" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -const ( - azureDeploymentListURL = "services/hostedservices/%s/deployments" - azureDeploymentURL = "services/hostedservices/%s/deployments/%s" - azureUpdateDeploymentURL = "services/hostedservices/%s/deployments/%s?comp=%s" - azureDeploymentSlotSwapURL = "services/hostedservices/%s" - azureDeploymentSlotURL = "services/hostedservices/%s/deploymentslots/%s" - azureUpdateDeploymentSlotConfigurationURL = "services/hostedservices/%s/deploymentslots/%s?comp=%s" - deleteAzureDeploymentURL = "services/hostedservices/%s/deployments/%s?comp=media" - azureDeleteDeploymentBySlotURL = "services/hostedservices/%s/deploymentslots/%s" - azureAddRoleURL = "services/hostedservices/%s/deployments/%s/roles" - azureRoleURL = "services/hostedservices/%s/deployments/%s/roles/%s" - azureOperationsURL = "services/hostedservices/%s/deployments/%s/roleinstances/%s/Operations" - azureRoleSizeListURL = "rolesizes" - - errParamNotSpecified = "Parameter %s is not specified." -) - -//NewClient is used to instantiate a new VirtualMachineClient from an Azure client -func NewClient(client management.Client) VirtualMachineClient { - return VirtualMachineClient{client: client} -} - -// CreateDeploymentOptions can be used to create a customized deployement request -type CreateDeploymentOptions struct { - DNSServers []DNSServer - LoadBalancers []LoadBalancer - ReservedIPName string - VirtualNetworkName string -} - -// CreateDeployment creates a deployment and then creates a virtual machine -// in the deployment based on the specified configuration. -// -// https://msdn.microsoft.com/en-us/library/azure/jj157194.aspx -func (vm VirtualMachineClient) CreateDeployment( - role Role, - cloudServiceName string, - options CreateDeploymentOptions) (management.OperationID, error) { - - req := DeploymentRequest{ - Name: role.RoleName, - DeploymentSlot: "Production", - Label: role.RoleName, - RoleList: []Role{role}, - DNSServers: options.DNSServers, - LoadBalancers: options.LoadBalancers, - ReservedIPName: options.ReservedIPName, - VirtualNetworkName: options.VirtualNetworkName, - } - - data, err := xml.Marshal(req) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(azureDeploymentListURL, cloudServiceName) - return vm.client.SendAzurePostRequest(requestURL, data) -} - -// CreateDeploymentFromPackageOptions can be used to create a customized deployement request -type CreateDeploymentFromPackageOptions struct { - Name string - PackageURL string - Label string - Configuration string - StartDeployment bool - TreatWarningsAsError bool - ExtendedProperties []ExtendedProperty - ExtensionConfiguration ExtensionConfiguration -} - -// CreateDeploymentRequest is the type for creating a deployment of a cloud service package -// in the deployment based on the specified configuration. See -// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-create-deployment -type CreateDeploymentRequest struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure CreateDeployment"` - // Required parameters: - Name string `` // Specifies the name of the deployment. - PackageURL string `xml:"PackageUrl"` // Specifies a URL that refers to the location of the service package in the Blob service. The service package can be located either in a storage account beneath the same subscription or a Shared Access Signature (SAS) URI from any storage account. - Label string `` // Specifies an identifier for the deployment that is base-64 encoded. The identifier can be up to 100 characters in length. It is recommended that the label be unique within the subscription. The label can be used for your tracking purposes. - Configuration string `` // Specifies the base-64 encoded service configuration file for the deployment. - // Optional parameters: - StartDeployment bool `` // Indicates whether to start the deployment immediately after it is created. The default value is false - TreatWarningsAsError bool `` // Indicates whether to treat package validation warnings as errors. The default value is false. If set to true, the Created Deployment operation fails if there are validation warnings on the service package. - ExtendedProperties []ExtendedProperty `xml:">ExtendedProperty,omitempty"` // Array of ExtendedProprties. Each extended property must have both a defined name and value. You can have a maximum of 25 extended property name and value pairs. - ExtensionConfiguration ExtensionConfiguration `xml:",omitempty"` -} - -// CreateDeploymentFromPackage creates a deployment from a cloud services package (.cspkg) and configuration file (.cscfg) -func (vm VirtualMachineClient) CreateDeploymentFromPackage( - cloudServiceName string, - deploymentSlot DeploymentSlot, - options CreateDeploymentFromPackageOptions) (management.OperationID, error) { - - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - - req := CreateDeploymentRequest{ - Name: options.Name, - Label: options.Label, - Configuration: options.Configuration, - PackageURL: options.PackageURL, - StartDeployment: options.StartDeployment, - TreatWarningsAsError: options.TreatWarningsAsError, - ExtendedProperties: options.ExtendedProperties, - ExtensionConfiguration: options.ExtensionConfiguration, - } - - data, err := xml.Marshal(req) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(azureDeploymentSlotURL, cloudServiceName, deploymentSlot) - return vm.client.SendAzurePostRequest(requestURL, data) -} - -// SwapDeploymentRequest is the type used for specifying information to swap the deployments in -// a cloud service -// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-swap-deployment -type SwapDeploymentRequest struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Swap"` - // Required parameters: - Production string - SourceDeployment string -} - -// SwapDeployment initiates a virtual IP address swap between the staging and production deployment environments for a service. -// If the service is currently running in the staging environment, it will be swapped to the production environment. -// If it is running in the production environment, it will be swapped to staging. -func (vm VirtualMachineClient) SwapDeployment( - cloudServiceName string) (management.OperationID, error) { - - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - - productionDeploymentName, err := vm.GetDeploymentNameForSlot(cloudServiceName, DeploymentSlotProduction) - if err != nil { - return "", err - } - - stagingDeploymentName, err := vm.GetDeploymentNameForSlot(cloudServiceName, DeploymentSlotStaging) - if err != nil { - return "", err - } - - req := SwapDeploymentRequest{ - Production: productionDeploymentName, - SourceDeployment: stagingDeploymentName, - } - - data, err := xml.Marshal(req) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(azureDeploymentSlotSwapURL, cloudServiceName) - return vm.client.SendAzurePostRequest(requestURL, data) -} - -// ChangeDeploymentConfigurationRequestOptions can be used to update configuration of a deployment -type ChangeDeploymentConfigurationRequestOptions struct { - Mode UpgradeType - Configuration string - TreatWarningsAsError bool - ExtendedProperties []ExtendedProperty - ExtensionConfiguration ExtensionConfiguration -} - -// ChangeDeploymentConfigurationRequest is the type for changing the configuration of a deployment of a cloud service p -// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-change-deployment-configuration -type ChangeDeploymentConfigurationRequest struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ChangeConfiguration"` - // Required parameters: - Configuration string `` // Specifies the base-64 encoded service configuration file for the deployment. - // Optional parameters: - Mode UpgradeType `` // Specifies the type of Upgrade (Auto | Manual | Simultaneous) . - TreatWarningsAsError bool `` // Indicates whether to treat package validation warnings as errors. The default value is false. If set to true, the Created Deployment operation fails if there are validation warnings on the service package. - ExtendedProperties []ExtendedProperty `xml:">ExtendedProperty,omitempty"` // Array of ExtendedProprties. Each extended property must have both a defined name and value. You can have a maximum of 25 extended property name and value pairs. - ExtensionConfiguration ExtensionConfiguration `xml:",omitempty"` -} - -// ChangeDeploymentConfiguration updates the configuration for a deployment from a configuration file (.cscfg) -func (vm VirtualMachineClient) ChangeDeploymentConfiguration( - cloudServiceName string, - deploymentSlot DeploymentSlot, - options ChangeDeploymentConfigurationRequestOptions) (management.OperationID, error) { - - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - - req := ChangeDeploymentConfigurationRequest{ - Mode: options.Mode, - Configuration: options.Configuration, - TreatWarningsAsError: options.TreatWarningsAsError, - ExtendedProperties: options.ExtendedProperties, - ExtensionConfiguration: options.ExtensionConfiguration, - } - if req.Mode == "" { - req.Mode = UpgradeTypeAuto - } - - data, err := xml.Marshal(req) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(azureUpdateDeploymentSlotConfigurationURL, cloudServiceName, deploymentSlot, "config") - return vm.client.SendAzurePostRequest(requestURL, data) -} - -// UpdateDeploymentStatusRequest is the type used to make UpdateDeploymentStatus requests -type UpdateDeploymentStatusRequest struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure UpdateDeploymentStatus"` - // Required parameters: - Status string -} - -// UpdateDeploymentStatus changes the running status of a deployment. The status of a deployment can be running or suspended. -// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-update-deployment-status -func (vm VirtualMachineClient) UpdateDeploymentStatus( - cloudServiceName string, - deploymentSlot DeploymentSlot, - status string) (management.OperationID, error) { - - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - - if status != "Running" && status != "Suspended" { - return "", fmt.Errorf("Invalid status provided") - } - - req := UpdateDeploymentStatusRequest{ - Status: status, - } - - data, err := xml.Marshal(req) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(azureUpdateDeploymentSlotConfigurationURL, cloudServiceName, deploymentSlot, "status") - return vm.client.SendAzurePostRequest(requestURL, data) -} - -// UpdateDeploymentStatusByName changes the running status of a deployment. The status of a deployment can be running or suspended. -// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-update-deployment-status -func (vm VirtualMachineClient) UpdateDeploymentStatusByName( - cloudServiceName string, - deploymentName string, - status string) (management.OperationID, error) { - - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - - if status != "Running" && status != "Suspended" { - return "", fmt.Errorf("Invalid status provided") - } - - req := UpdateDeploymentStatusRequest{ - Status: status, - } - - data, err := xml.Marshal(req) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(azureUpdateDeploymentURL, cloudServiceName, deploymentName, "status") - return vm.client.SendAzurePostRequest(requestURL, data) -} - -// GetDeploymentName queries an existing Azure cloud service for the name of the Deployment, -// if any, in its 'Production' slot (the only slot possible). If none exists, it returns empty -// string but no error -// -//https://msdn.microsoft.com/en-us/library/azure/ee460804.aspx -func (vm VirtualMachineClient) GetDeploymentName(cloudServiceName string) (string, error) { - return vm.GetDeploymentNameForSlot(cloudServiceName, DeploymentSlotProduction) -} - -// GetDeploymentNameForSlot queries an existing Azure cloud service for the name of the Deployment, -// in a given slot. If none exists, it returns empty -// string but no error -// -//https://msdn.microsoft.com/en-us/library/azure/ee460804.aspx -func (vm VirtualMachineClient) GetDeploymentNameForSlot(cloudServiceName string, deploymentSlot DeploymentSlot) (string, error) { - var deployment DeploymentResponse - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - requestURL := fmt.Sprintf(azureDeploymentSlotURL, cloudServiceName, deploymentSlot) - response, err := vm.client.SendAzureGetRequest(requestURL) - if err != nil { - if management.IsResourceNotFoundError(err) { - return "", nil - } - return "", err - } - err = xml.Unmarshal(response, &deployment) - if err != nil { - return "", err - } - - return deployment.Name, nil -} - -func (vm VirtualMachineClient) GetDeployment(cloudServiceName, deploymentName string) (DeploymentResponse, error) { - var deployment DeploymentResponse - if cloudServiceName == "" { - return deployment, fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if deploymentName == "" { - return deployment, fmt.Errorf(errParamNotSpecified, "deploymentName") - } - requestURL := fmt.Sprintf(azureDeploymentURL, cloudServiceName, deploymentName) - response, azureErr := vm.client.SendAzureGetRequest(requestURL) - if azureErr != nil { - return deployment, azureErr - } - - err := xml.Unmarshal(response, &deployment) - return deployment, err -} - -// GetDeploymentBySlot used to retrieve deployment events for a single deployment slot (staging or production) -func (vm VirtualMachineClient) GetDeploymentBySlot(cloudServiceName string, deploymentSlot DeploymentSlot) (DeploymentResponse, error) { - var deployment DeploymentResponse - if cloudServiceName == "" { - return deployment, fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if deploymentSlot == "" { - return deployment, fmt.Errorf(errParamNotSpecified, "deploymentSlot") - } - requestURL := fmt.Sprintf(azureDeploymentSlotURL, cloudServiceName, deploymentSlot) - response, azureErr := vm.client.SendAzureGetRequest(requestURL) - if azureErr != nil { - return deployment, azureErr - } - - err := xml.Unmarshal(response, &deployment) - return deployment, err -} - -func (vm VirtualMachineClient) DeleteDeployment(cloudServiceName, deploymentName string) (management.OperationID, error) { - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if deploymentName == "" { - return "", fmt.Errorf(errParamNotSpecified, "deploymentName") - } - - requestURL := fmt.Sprintf(deleteAzureDeploymentURL, cloudServiceName, deploymentName) - return vm.client.SendAzureDeleteRequest(requestURL) -} - -func (vm VirtualMachineClient) DeleteDeploymentBySlot(cloudServiceName string, deploymentSlot DeploymentSlot) (management.OperationID, error) { - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if deploymentSlot == "" { - return "", fmt.Errorf(errParamNotSpecified, "deploymentSlot") - } - - requestURL := fmt.Sprintf(azureDeleteDeploymentBySlotURL, cloudServiceName, deploymentSlot) - return vm.client.SendAzureDeleteRequest(requestURL) -} - -func (vm VirtualMachineClient) GetRole(cloudServiceName, deploymentName, roleName string) (*Role, error) { - if cloudServiceName == "" { - return nil, fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if deploymentName == "" { - return nil, fmt.Errorf(errParamNotSpecified, "deploymentName") - } - if roleName == "" { - return nil, fmt.Errorf(errParamNotSpecified, "roleName") - } - - role := new(Role) - - requestURL := fmt.Sprintf(azureRoleURL, cloudServiceName, deploymentName, roleName) - response, azureErr := vm.client.SendAzureGetRequest(requestURL) - if azureErr != nil { - return nil, azureErr - } - - err := xml.Unmarshal(response, role) - if err != nil { - return nil, err - } - - return role, nil -} - -// AddRole adds a Virtual Machine to a deployment of Virtual Machines, where role name = VM name -// See https://msdn.microsoft.com/en-us/library/azure/jj157186.aspx -func (vm VirtualMachineClient) AddRole(cloudServiceName string, deploymentName string, role Role) (management.OperationID, error) { - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if deploymentName == "" { - return "", fmt.Errorf(errParamNotSpecified, "deploymentName") - } - - data, err := xml.Marshal(PersistentVMRole{Role: role}) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(azureAddRoleURL, cloudServiceName, deploymentName) - return vm.client.SendAzurePostRequest(requestURL, data) -} - -// UpdateRole updates the configuration of the specified virtual machine -// See https://msdn.microsoft.com/en-us/library/azure/jj157187.aspx -func (vm VirtualMachineClient) UpdateRole(cloudServiceName, deploymentName, roleName string, role Role) (management.OperationID, error) { - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if deploymentName == "" { - return "", fmt.Errorf(errParamNotSpecified, "deploymentName") - } - if roleName == "" { - return "", fmt.Errorf(errParamNotSpecified, "roleName") - } - - data, err := xml.Marshal(PersistentVMRole{Role: role}) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(azureRoleURL, cloudServiceName, deploymentName, roleName) - return vm.client.SendAzurePutRequest(requestURL, "text/xml", data) -} - -func (vm VirtualMachineClient) StartRole(cloudServiceName, deploymentName, roleName string) (management.OperationID, error) { - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if deploymentName == "" { - return "", fmt.Errorf(errParamNotSpecified, "deploymentName") - } - if roleName == "" { - return "", fmt.Errorf(errParamNotSpecified, "roleName") - } - - startRoleOperationBytes, err := xml.Marshal(StartRoleOperation{ - OperationType: "StartRoleOperation", - }) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(azureOperationsURL, cloudServiceName, deploymentName, roleName) - return vm.client.SendAzurePostRequest(requestURL, startRoleOperationBytes) -} - -func (vm VirtualMachineClient) ShutdownRole(cloudServiceName, deploymentName, roleName string, postaction PostShutdownAction) (management.OperationID, error) { - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if deploymentName == "" { - return "", fmt.Errorf(errParamNotSpecified, "deploymentName") - } - if roleName == "" { - return "", fmt.Errorf(errParamNotSpecified, "roleName") - } - - shutdownRoleOperationBytes, err := xml.Marshal(ShutdownRoleOperation{ - OperationType: "ShutdownRoleOperation", - PostShutdownAction: postaction, - }) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(azureOperationsURL, cloudServiceName, deploymentName, roleName) - return vm.client.SendAzurePostRequest(requestURL, shutdownRoleOperationBytes) -} - -func (vm VirtualMachineClient) RestartRole(cloudServiceName, deploymentName, roleName string) (management.OperationID, error) { - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if deploymentName == "" { - return "", fmt.Errorf(errParamNotSpecified, "deploymentName") - } - if roleName == "" { - return "", fmt.Errorf(errParamNotSpecified, "roleName") - } - - restartRoleOperationBytes, err := xml.Marshal(RestartRoleOperation{ - OperationType: "RestartRoleOperation", - }) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(azureOperationsURL, cloudServiceName, deploymentName, roleName) - return vm.client.SendAzurePostRequest(requestURL, restartRoleOperationBytes) -} - -func (vm VirtualMachineClient) DeleteRole(cloudServiceName, deploymentName, roleName string, deleteVHD bool) (management.OperationID, error) { - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if deploymentName == "" { - return "", fmt.Errorf(errParamNotSpecified, "deploymentName") - } - if roleName == "" { - return "", fmt.Errorf(errParamNotSpecified, "roleName") - } - - requestURL := fmt.Sprintf(azureRoleURL, cloudServiceName, deploymentName, roleName) - if deleteVHD { - requestURL += "?comp=media" - } - return vm.client.SendAzureDeleteRequest(requestURL) -} - -func (vm VirtualMachineClient) GetRoleSizeList() (RoleSizeList, error) { - roleSizeList := RoleSizeList{} - - response, err := vm.client.SendAzureGetRequest(azureRoleSizeListURL) - if err != nil { - return roleSizeList, err - } - - err = xml.Unmarshal(response, &roleSizeList) - return roleSizeList, err -} - -// CaptureRole captures a VM role. If reprovisioningConfigurationSet is non-nil, -// the VM role is redeployed after capturing the image, otherwise, the original -// VM role is deleted. -// -// NOTE: an image resulting from this operation shows up in -// osimage.GetImageList() as images with Category "User". -func (vm VirtualMachineClient) CaptureRole(cloudServiceName, deploymentName, roleName, imageName, imageLabel string, - reprovisioningConfigurationSet *ConfigurationSet) (management.OperationID, error) { - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if deploymentName == "" { - return "", fmt.Errorf(errParamNotSpecified, "deploymentName") - } - if roleName == "" { - return "", fmt.Errorf(errParamNotSpecified, "roleName") - } - - if reprovisioningConfigurationSet != nil && - !(reprovisioningConfigurationSet.ConfigurationSetType == ConfigurationSetTypeLinuxProvisioning || - reprovisioningConfigurationSet.ConfigurationSetType == ConfigurationSetTypeWindowsProvisioning) { - return "", fmt.Errorf("ConfigurationSet type can only be WindowsProvisioningConfiguration or LinuxProvisioningConfiguration") - } - - operation := CaptureRoleOperation{ - OperationType: "CaptureRoleOperation", - PostCaptureAction: PostCaptureActionReprovision, - ProvisioningConfiguration: reprovisioningConfigurationSet, - TargetImageLabel: imageLabel, - TargetImageName: imageName, - } - if reprovisioningConfigurationSet == nil { - operation.PostCaptureAction = PostCaptureActionDelete - } - - data, err := xml.Marshal(operation) - if err != nil { - return "", err - } - - return vm.client.SendAzurePostRequest(fmt.Sprintf(azureOperationsURL, cloudServiceName, deploymentName, roleName), data) -} diff --git a/services/classic/management/virtualmachine/entities.go b/services/classic/management/virtualmachine/entities.go deleted file mode 100644 index 25360223b36e..000000000000 --- a/services/classic/management/virtualmachine/entities.go +++ /dev/null @@ -1,626 +0,0 @@ -// +build go1.7 - -package virtualmachine - -// Copyright 2017 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. - -import ( - "encoding/xml" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" - vmdisk "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachinedisk" -) - -// VirtualMachineClient is used to perform operations on Azure Virtual Machines -type VirtualMachineClient struct { - client management.Client -} - -// DeploymentRequest is the type for creating a deployment and Virtual Machine -// in the deployment based on the specified configuration. See -// https://msdn.microsoft.com/en-us/library/azure/jj157194.aspx -type DeploymentRequest struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Deployment"` - // Required parameters: - Name string `` // Specifies a name for the deployment. The deployment name must be unique among other deployments for the cloud service. - DeploymentSlot string `` // Specifies the environment in which the Virtual Machine is to be deployed. The only allowable value is Production. - Label string `` // Specifies an identifier for the deployment. The label can be up to 100 characters long. The label can be used for tracking purposes. - RoleList []Role `xml:">Role"` // Contains information about the Virtual Machines that are to be deployed. - // Optional parameters: - VirtualNetworkName string `xml:",omitempty"` // Specifies the name of an existing virtual network to which the deployment will belong. - DNSServers []DNSServer `xml:"Dns>DnsServers>DnsServer,omitempty"` // Contains a list of DNS servers to associate with the Virtual Machine. - LoadBalancers []LoadBalancer `xml:">LoadBalancer,omitempty"` // Contains a list of internal load balancers that can be assigned to input endpoints. - ReservedIPName string `xml:",omitempty"` // Specifies the name of a reserved IP address that is to be assigned to the deployment. -} - -// DeploymentResponse is the type for receiving deployment information -// See https://msdn.microsoft.com/en-us/library/azure/ee460804.aspx -type DeploymentResponse struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Deployment"` - - Name string - DeploymentSlot string - PrivateID string - Status DeploymentStatus - Label string - URL string `xml:"Url"` - Configuration string - RoleInstanceList []RoleInstance `xml:">RoleInstance"` - UpgradeStatus UpgradeStatus - UpgradeDomainCount int - RoleList []Role `xml:">Role"` - SdkVersion string - Locked bool - RollbackAllowed bool - CreatedTime string - LastModifiedTime string - VirtualNetworkName string - DNSServers []DNSServer `xml:"Dns>DnsServers>DnsServer"` - LoadBalancers []LoadBalancer `xml:">LoadBalancer"` - ExtendedProperties []ExtendedProperty `xml:">ExtendedProperty"` - PersistentVMDowntime PersistentVMDowntime - VirtualIPs []VirtualIP `xml:">VirtualIP"` - ExtensionConfiguration ExtensionConfiguration - ReservedIPName string - InternalDNSSuffix string `xml:"InternalDnsSuffix"` -} - -type DeploymentStatus string - -const ( - DeploymentStatusRunning DeploymentStatus = "Running" - DeploymentStatusSuspended DeploymentStatus = "Suspended" - DeploymentStatusRunningTransitioning DeploymentStatus = "RunningTransitioning" - DeploymentStatusSuspendedTransitioning DeploymentStatus = "SuspendedTransitioning" - DeploymentStatusStarting DeploymentStatus = "Starting" - DeploymentStatusSuspending DeploymentStatus = "Suspending" - DeploymentStatusDeploying DeploymentStatus = "Deploying" - DeploymentStatusDeleting DeploymentStatus = "Deleting" -) - -// DeploymentSlot for cloud services are either Production or Staging Slots -type DeploymentSlot string - -const ( - // DeploymentSlotProduction represents the Production slot of a cloud service - DeploymentSlotProduction DeploymentSlot = "Production" - // DeploymentSlotStaging represents the Staging slot of a cloud service - DeploymentSlotStaging DeploymentSlot = "Staging" -) - -type RoleInstance struct { - RoleName string - InstanceName string - InstanceStatus InstanceStatus - ExtendedInstanceStatus string - InstanceUpgradeDomain int - InstanceFaultDomain int - InstanceSize string - InstanceStateDetails string - InstanceErrorCode string - IPAddress string `xml:"IpAddress"` - InstanceEndpoints []InstanceEndpoint `xml:">InstanceEndpoint"` - PowerState PowerState - HostName string - RemoteAccessCertificateThumbprint string - GuestAgentStatus string // todo: implement - ResourceExtensionStatusList []ResourceExtensionStatus `xml:">ResourceExtensionStatus"` - PublicIPs []PublicIP `xml:">PublicIP"` -} - -type InstanceStatus string - -const ( - InstanceStatusUnknown = "Unknown" - InstanceStatusCreatingVM = "CreatingVM" - InstanceStatusStartingVM = "StartingVM" - InstanceStatusCreatingRole = "CreatingRole" - InstanceStatusStartingRole = "StartingRole" - InstanceStatusReadyRole = "ReadyRole" - InstanceStatusBusyRole = "BusyRole" - InstanceStatusStoppingRole = "StoppingRole" - InstanceStatusStoppingVM = "StoppingVM" - InstanceStatusDeletingVM = "DeletingVM" - InstanceStatusStoppedVM = "StoppedVM" - InstanceStatusRestartingRole = "RestartingRole" - InstanceStatusCyclingRole = "CyclingRole" - InstanceStatusFailedStartingRole = "FailedStartingRole" - InstanceStatusFailedStartingVM = "FailedStartingVM" - InstanceStatusUnresponsiveRole = "UnresponsiveRole" - InstanceStatusStoppedDeallocated = "StoppedDeallocated" - InstanceStatusPreparing = "Preparing" -) - -type InstanceEndpoint struct { - Name string - Vip string - PublicPort int - LocalPort int - Protocol InputEndpointProtocol -} - -type PowerState string - -const ( - PowerStateStarting PowerState = "Starting" - PowerStateStarted PowerState = "Started" - PowerStateStopping PowerState = "Stopping" - PowerStateStopped PowerState = "Stopped" - PowerStateUnknown PowerState = "Unknown" -) - -type ResourceExtensionStatus struct { - HandlerName string - Version string - Status ResourceExtensionState - Code string - FormattedMessage FormattedMessage - ExtensionSettingStatus ExtensionSettingStatus -} - -type ResourceExtensionState string - -const ( - ResourceExtensionStateInstalling ResourceExtensionState = "Installing" - ResourceExtensionStateReady ResourceExtensionState = "Ready" - ResourceExtensionStateNotReady ResourceExtensionState = "NotReady" - ResourceExtensionStateUnresponsive ResourceExtensionState = "Unresponsive" -) - -type FormattedMessage struct { - Language string - Message string -} - -type ExtensionSettingStatus struct { - Timestamp string - Name string - Operation string - Status ExtensionSettingState - Code string - FormattedMessage FormattedMessage - SubStatusList []SubStatus `xml:">SubStatus"` -} - -type ExtensionSettingState string - -const ( - ExtensionSettingStateTransitioning ExtensionSettingState = "transitioning" - ExtensionSettingStateError ExtensionSettingState = "error" - ExtensionSettingStateSuccess ExtensionSettingState = "success" - ExtensionSettingStateWarning ExtensionSettingState = "warning" -) - -type SubStatus struct { - Name string - Status ExtensionSettingState - FormattedMessage FormattedMessage -} - -type UpgradeStatus struct { - UpgradeType UpgradeType - CurrentUpgradeDomainState CurrentUpgradeDomainState - CurrentUpgradeDomain int -} - -type UpgradeType string - -const ( - UpgradeTypeAuto UpgradeType = "Auto" - UpgradeTypeManual UpgradeType = "Manual" - UpgradeTypeSimultaneous UpgradeType = "Simultaneous" -) - -type CurrentUpgradeDomainState string - -const ( - CurrentUpgradeDomainStateBefore CurrentUpgradeDomainState = "Before" - CurrentUpgradeDomainStateDuring CurrentUpgradeDomainState = "During" -) - -type ExtendedProperty struct { - Name string - Value string -} - -type PersistentVMDowntime struct { - StartTime string - EndTime string - Status string -} - -type VirtualIP struct { - Address string - IsReserved bool - ReservedIPName string - Type IPAddressType -} - -// Role contains the configuration sets that are used to create virtual -// machines. -type Role struct { - RoleName string `xml:",omitempty"` // Specifies the name for the Virtual Machine. - RoleType string `xml:",omitempty"` // Specifies the type of role to use. For Virtual Machines, this must be PersistentVMRole. - ConfigurationSets []ConfigurationSet `xml:"ConfigurationSets>ConfigurationSet,omitempty"` - ResourceExtensionReferences *[]ResourceExtensionReference `xml:"ResourceExtensionReferences>ResourceExtensionReference,omitempty"` - VMImageName string `xml:",omitempty"` // Specifies the name of the VM Image that is to be used to create the Virtual Machine. If this element is used, the ConfigurationSets element is not used. - MediaLocation string `xml:",omitempty"` // Required if the Virtual Machine is being created from a published VM Image. Specifies the location of the VHD file that is created when VMImageName specifies a published VM Image. - AvailabilitySetName string `xml:",omitempty"` // Specifies the name of a collection of Virtual Machines. Virtual Machines specified in the same availability set are allocated to different nodes to maximize availability. - DataVirtualHardDisks []DataVirtualHardDisk `xml:"DataVirtualHardDisks>DataVirtualHardDisk,omitempty"` // Contains the parameters that are used to add a data disk to a Virtual Machine. If you are creating a Virtual Machine by using a VM Image, this element is not used. - OSVirtualHardDisk *OSVirtualHardDisk `xml:",omitempty"` // Contains the parameters that are used to create the operating system disk for a Virtual Machine. If you are creating a Virtual Machine by using a VM Image, this element is not used. - RoleSize string `xml:",omitempty"` // Specifies the size of the Virtual Machine. The default size is Small. - ProvisionGuestAgent bool `xml:",omitempty"` // Indicates whether the VM Agent is installed on the Virtual Machine. To run a resource extension in a Virtual Machine, this service must be installed. - VMImageInput *VMImageInput `xml:",omitempty"` // When a VM Image is used to create a new PersistentVMRole, the DiskConfigurations in the VM Image are used to create new Disks for the new VM. This parameter can be used to resize the newly created Disks to a larger size than the underlying DiskConfigurations in the VM Image. - - UseCertAuth bool `xml:"-"` - CertPath string `xml:"-"` -} - -// VMImageInput is for when a VM Image is used to create a new PersistantVMRole, -// the DiskConfigurations in the VM Image are used to create new Disks for the -// new VM. This parameter can be used to resize the newly created Disks to a -// larger size than the underlying DiskConfigurations in the VM Image. -type VMImageInput struct { - OSDiskConfiguration *OSDiskConfiguration `xml:",omitempty"` // This corresponds to the OSDiskConfiguration of the VM Image used to create a new role. The OSDiskConfiguration element is only available using version 2014-10-01 or higher. - DataDiskConfigurations []DataDiskConfiguration `xml:">DataDiskConfiguration,omitempty"` // This corresponds to the DataDiskConfigurations of the VM Image used to create a new role. The DataDiskConfigurations element is only available using version 2014-10-01 or higher. -} - -// OSDiskConfiguration is used to resize the OS disk of a new VM created from a -// previously saved VM image. -type OSDiskConfiguration struct { - ResizedSizeInGB int -} - -// DataDiskConfiguration is used to resize the data disks of a new VM created -// from a previously saved VM image. -type DataDiskConfiguration struct { - OSDiskConfiguration - Name string // The Name of the DataDiskConfiguration being referenced to. - -} - -// ExtensionConfiguration Contains extensions that are added to the cloud service. -// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-get-deployment#bk_extensionconfig -type ExtensionConfiguration struct { - NamedRoles []NamedRole `xml:"NamedRoles>Role,omitempty"` -} - -// NamedRole specifies a list of extensions that are applied to specific roles in a deployment. -// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-get-deployment#bk_namedroles -type NamedRole struct { - RoleName string `xml:",omitempty"` - Extensions []Extension `xml:"Extensions>Extension,omitempty"` -} - -// Extension Specifies an extension that is to be deployed to a role in a cloud service. -// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-get-deployment#bk_extension -type Extension struct { - ID string `xml:"Id"` - State string -} - -// ResourceExtensionReference contains a collection of resource extensions that -// are to be installed on the Virtual Machine. The VM Agent must be installed on -// the Virtual Machine to install resource extensions. For more information, see -// Manage Extensions: -// -// https://msdn.microsoft.com/en-us/library/dn606311.aspx. -type ResourceExtensionReference struct { - ReferenceName string - Publisher string - Name string - Version string - ParameterValues []ResourceExtensionParameter `xml:"ResourceExtensionParameterValues>ResourceExtensionParameterValue,omitempty"` - State string -} - -// ResourceExtensionParameter specifies the key, value, and type of a parameter that is passed to the -// resource extension when it is installed. -type ResourceExtensionParameter struct { - Key string - Value string - Type ResourceExtensionParameterType // If this value is set to Private, the parameter will not be returned by Get Deployment (). -} - -type ResourceExtensionParameterType string - -// Enum values for ResourceExtensionParameterType -const ( - ResourceExtensionParameterTypePublic ResourceExtensionParameterType = "Public" - ResourceExtensionParameterTypePrivate ResourceExtensionParameterType = "Private" -) - -// DataVirtualHardDisk specifies the properties that are used to create a data -// disk. -type DataVirtualHardDisk struct { - HostCaching vmdisk.HostCachingType `xml:",omitempty"` // Specifies the caching mode of the data disk. The default value is None. - DiskLabel string `xml:",omitempty"` // If the disk that is being added is already registered in the subscription, this element is ignored. If a new disk is being created, this element is used to provide a description of the disk. The value of this element is only obtained programmatically and does not appear in the Management Portal. - DiskName string `xml:",omitempty"` // If the disk that is being added is already registered in the subscription, this element is used to identify the disk to add. If a new disk and the associated VHD are being created by Azure, this element is not used and Azure assigns a unique name that is a combination of the deployment name, role name, and identifying number. The name of the disk must contain only alphanumeric characters, underscores, periods, or dashes. The name must not be longer than 256 characters. The name must not end with period or dash. - Lun int `xml:",omitempty"` // Specifies the Logical Unit Number (LUN) for the data disk. If the disk is the first disk that is added, this element is optional and the default value of 0 is used. If more than one disk is being added, this element is required. Valid LUN values are 0 through 31. - LogicalDiskSizeInGB int `xml:",omitempty"` // Specifies the size, in GB, of an empty disk to be attached to the Virtual Machine. If the disk that is being added is already registered in the subscription, this element is ignored. If the disk and VHD is being created by Azure as it is added, this element defines the size of the new disk. - MediaLink string `xml:",omitempty"` // If the disk that is being added is already registered in the subscription or the VHD for the disk already exists in blob storage, this element is ignored. If a VHD file does not exist in blob storage, this element defines the location of the new VHD that is created when the new disk is added. - SourceMediaLink string `xml:",omitempty"` // If the disk that is being added is already registered in the subscription or the VHD for the disk does not exist in blob storage, this element is ignored. If the VHD file exists in blob storage, this element defines the path to the VHD and a disk is registered from it and attached to the virtual machine. -} - -// OSVirtualHardDisk specifies the properties that are used to create an OS -// disk. -type OSVirtualHardDisk struct { - HostCaching vmdisk.HostCachingType `xml:",omitempty"` // Specifies the caching mode of the data disk. The default value is None. - DiskLabel string `xml:",omitempty"` // If the disk that is being added is already registered in the subscription, this element is ignored. If a new disk is being created, this element is used to provide a description of the disk. The value of this element is only obtained programmatically and does not appear in the Management Portal. - DiskName string `xml:",omitempty"` // If the disk that is being added is already registered in the subscription, this element is used to identify the disk to add. If a new disk and the associated VHD are being created by Azure, this element is not used and Azure assigns a unique name that is a combination of the deployment name, role name, and identifying number. The name of the disk must contain only alphanumeric characters, underscores, periods, or dashes. The name must not be longer than 256 characters. The name must not end with period or dash. - MediaLink string `xml:",omitempty"` // If the disk that is being added is already registered in the subscription or the VHD for the disk already exists in blob storage, this element is ignored. If a VHD file does not exist in blob storage, this element defines the location of the new VHD that is created when the new disk is added. - SourceImageName string `xml:",omitempty"` - OS string `xml:",omitempty"` - RemoteSourceImageLink string `xml:",omitempty"` // Specifies a publicly accessible URI or a SAS URI to the location where an OS image is stored that is used to create the Virtual Machine. This location can be a different location than the user or platform image repositories in Azure. An image is always associated with a VHD, which is a .vhd file stored as a page blob in a storage account in Azure. If you specify the path to an image with this element, an associated VHD is created and you must use the MediaLink element to specify the location in storage where the VHD will be located. If this element is used, SourceImageName is not used. - ResizedSizeInGB int `xml:",omitempty"` -} - -// ConfigurationSet specifies the configuration elements of the Virtual Machine. -// The type attribute is required to prevent the administrator password from -// being written to the operation history file. -type ConfigurationSet struct { - ConfigurationSetType ConfigurationSetType - - // Windows provisioning: - ComputerName string `xml:",omitempty"` // Optional. Specifies the computer name for the Virtual Machine. If you do not specify a computer name, one is assigned that is a combination of the deployment name, role name, and identifying number. Computer names must be 1 to 15 characters long. - AdminPassword string `xml:",omitempty"` // Optional. Specifies the password to use for an administrator account on the Virtual Machine that is being created. If you are creating a Virtual Machine using an image, you must specify a name of an administrator account to be created on the machine using the AdminUsername element. You must use the AdminPassword element to specify the password of the administrator account that is being created. If you are creating a Virtual Machine using an existing specialized disk, this element is not used because the account should already exist on the disk. - EnableAutomaticUpdates bool `xml:",omitempty"` // Optional. Specifies whether automatic updates are enabled for the Virtual Machine. The default value is true. - TimeZone string `xml:",omitempty"` // Optional. Specifies the time zone for the Virtual Machine. - DomainJoin *DomainJoin `xml:",omitempty"` // Optional. Contains properties that define a domain to which the Virtual Machine will be joined. - StoredCertificateSettings []CertificateSetting `xml:">StoredCertificateSetting,omitempty"` // Optional. Contains a list of service certificates with which to provision to the new Virtual Machine. - WinRMListeners *[]WinRMListener `xml:"WinRM>Listeners>Listener,omitempty"` // Optional. Contains configuration settings for the Windows Remote Management service on the Virtual Machine. This enables remote Windows PowerShell. - AdminUsername string `xml:",omitempty"` // Optional. Specifies the name of the administrator account that is created to access the Virtual Machine. If you are creating a Virtual Machine using an image, you must specify a name of an administrator account to be created by using this element. You must use the AdminPassword element to specify the password of the administrator account that is being created. If you are creating a Virtual Machine using an existing specialized disk, this element is not used because the account should already exist on the disk. - AdditionalUnattendContent string `xml:",omitempty"` // Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. - - // Linux provisioning: - HostName string `xml:",omitempty"` // Required. Specifies the host name for the Virtual Machine. Host names must be 1 to 64 characters long. - UserName string `xml:",omitempty"` // Required. Specifies the name of a user account to be created in the sudoer group of the Virtual Machine. User account names must be 1 to 32 characters long. - UserPassword string `xml:",omitempty"` // Required. Specifies the password for the user account. Passwords must be 6 to 72 characters long. - DisableSSHPasswordAuthentication string `xml:"DisableSshPasswordAuthentication,omitempty"` // Optional. Specifies whether SSH password authentication is disabled. By default this value is set to true. - SSH *SSH `xml:",omitempty"` // Optional. Specifies the SSH public keys and key pairs to use with the Virtual Machine. - - // In WindowsProvisioningConfiguration: The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. The file is saved to %SYSTEMDRIVE%\AzureData\CustomData.bin. If the file exists, it is overwritten. The security on directory is set to System:Full Control and Administrators:Full Control. - // In LinuxProvisioningConfiguration: The base-64 encoded string is located in the ovf-env.xml file on the ISO of the Virtual Machine. The file is copied to /var/lib/waagent/ovf-env.xml by the Azure Linux Agent. The Azure Linux Agent will also place the base-64 encoded data in /var/lib/waagent/CustomData during provisioning. The maximum length of the binary array is 65535 bytes. - CustomData string `xml:",omitempty"` // Specifies a base-64 encoded string of custom data. - - // Network configuration: - InputEndpoints []InputEndpoint `xml:">InputEndpoint,omitempty"` // Optional in NetworkConfiguration. Contains a collection of external endpoints for the Virtual Machine. - SubnetNames []string `xml:">SubnetName,omitempty"` // Required if StaticVirtualNetworkIPAddress is specified; otherwise, optional in NetworkConfiguration. Contains a list of subnets to which the Virtual Machine will belong. - StaticVirtualNetworkIPAddress string `xml:",omitempty"` // Specifies the internal IP address for the Virtual Machine in a Virtual Network. If you specify this element, you must also specify the SubnetNames element with only one subnet defined. The IP address specified in this element must belong to the subnet that is defined in SubnetNames and it should not be the one of the first four IP addresses or the last IP address in the subnet. Deploying web roles or worker roles into a subnet that has Virtual Machines with StaticVirtualNetworkIPAddress defined is not supported. - NetworkSecurityGroup string `xml:",omitempty"` // Optional in NetworkConfiguration. Represents the name of the Network Security Group that will be associated with the Virtual Machine. Network Security Group must exist in the context of subscription and be created in same region to which the virtual machine will be deployed. - PublicIPs []PublicIP `xml:">PublicIP,omitempty"` // Contains a public IP address that can be used in addition to the default virtual IP address for the Virtual Machine. -} - -type ConfigurationSetType string - -// Enum values for ConfigurationSetType -const ( - ConfigurationSetTypeWindowsProvisioning ConfigurationSetType = "WindowsProvisioningConfiguration" - ConfigurationSetTypeLinuxProvisioning ConfigurationSetType = "LinuxProvisioningConfiguration" - ConfigurationSetTypeNetwork ConfigurationSetType = "NetworkConfiguration" -) - -// DomainJoin contains properties that define a domain to which the Virtual -// Machine will be joined. -type DomainJoin struct { - Credentials Credentials `xml:",omitempty"` // Specifies the credentials to use to join the Virtual Machine to the domain. - JoinDomain string `xml:",omitempty"` // Specifies the domain to join. - MachineObjectOU string `xml:",omitempty"` // Specifies the Lightweight Directory Access Protocol (LDAP) X 500-distinguished name of the organizational unit (OU) in which the computer account is created. This account is in Active Directory on a domain controller in the domain to which the computer is being joined. -} - -// Credentials specifies the credentials to use to join the Virtual Machine to -// the domain. If Domain is not specified, Username must specify the user -// principal name (UPN) format (user@fully-qualified-DNS-domain) or the fully- -// qualified-DNS-domain\username format. -type Credentials struct { - Domain string // Specifies the name of the domain used to authenticate an account. The value is a fully qualified DNS domain. - Username string // Specifies a user name in the domain that can be used to join the domain. - Password string // Specifies the password to use to join the domain. -} - -// CertificateSetting specifies the parameters for the certificate which to -// provision to the new Virtual Machine. -type CertificateSetting struct { - StoreLocation string // Required. Specifies the certificate store location on the Virtual Machine. The only supported value is "LocalMachine". - StoreName string // Required. Specifies the name of the certificate store from which the certificate is retrieved. For example, "My". - Thumbprint string // Required. Specifies the thumbprint of the certificate. The thumbprint must specify an existing service certificate. -} - -// WinRMListener specifies the protocol and certificate information for a WinRM -// listener. -type WinRMListener struct { - Protocol WinRMProtocol // Specifies the protocol of listener. - CertificateThumbprint string `xml:",omitempty"` // Specifies the certificate thumbprint for the secure connection. If this value is not specified, a self-signed certificate is generated and used for the Virtual Machine. -} - -type WinRMProtocol string - -// Enum values for WinRMProtocol -const ( - WinRMProtocolHTTP WinRMProtocol = "Http" - WinRMProtocolHTTPS WinRMProtocol = "Https" -) - -// SSH specifies the SSH public keys and key pairs to use with the Virtual Machine. -type SSH struct { - PublicKeys []PublicKey `xml:">PublicKey"` - KeyPairs []KeyPair `xml:">KeyPair"` -} - -// PublicKey specifies a public SSH key. -type PublicKey struct { - Fingerprint string // Specifies the SHA1 fingerprint of an X509 certificate associated with the cloud service and includes the SSH public key. - // Specifies the full path of a file, on the Virtual Machine, where the SSH public key is stored. If - // the file already exists, the specified key is appended to the file. - Path string // Usually /home/username/.ssh/authorized_keys -} - -// KeyPair specifies an SSH keypair. -type KeyPair struct { - Fingerprint string // Specifies the SHA1 fingerprint of an X509 certificate that is associated with the cloud service and includes the SSH keypair. - // Specifies the full path of a file, on the virtual machine, which stores the SSH private key. The - // file is overwritten when multiple keys are written to it. The SSH public key is stored in the same - // directory and has the same name as the private key file with .pub suffix. - Path string // Usually /home/username/.ssh/id_rsa -} - -// InputEndpoint specifies the properties that define an external endpoint for -// the Virtual Machine. -type InputEndpoint struct { - LocalPort int // Specifies the internal port on which the Virtual Machine is listening. - Name string // Specifies the name of the external endpoint. - Port int // Specifies the external port to use for the endpoint. - Protocol InputEndpointProtocol //Specifies the transport protocol for the endpoint. - Vip string `xml:",omitempty"` -} - -type InputEndpointProtocol string - -// Enum values for InputEndpointProtocol -const ( - InputEndpointProtocolTCP InputEndpointProtocol = "TCP" - InputEndpointProtocolUDP InputEndpointProtocol = "UDP" -) - -// PublicIP contains a public IP address that can be used in addition to default -// virtual IP address for the Virtual Machine. -type PublicIP struct { - Name string // Specifies the name of the public IP address. - Address string // Specifies the IP address. - IdleTimeoutInMinutes int `xml:",omitempty"` // Specifies the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. -} - -// ServiceCertificate contains a certificate for adding it to a hosted service -type ServiceCertificate struct { - XMLName xml.Name `xml:"CertificateFile"` - Data string - CertificateFormat string - Password string `xml:",omitempty"` -} - -// StartRoleOperation contains the information for starting a Role. -type StartRoleOperation struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure StartRoleOperation"` - OperationType string -} - -type PostShutdownAction string - -// Enum values for PostShutdownAction -const ( - PostShutdownActionStopped PostShutdownAction = "Stopped" - PostShutdownActionStoppedDeallocated PostShutdownAction = "StoppedDeallocated" -) - -// ShutdownRoleOperation contains the information for shutting down a Role. -type ShutdownRoleOperation struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ShutdownRoleOperation"` - OperationType string - PostShutdownAction PostShutdownAction -} - -// RestartRoleOperation contains the information for restarting a Role. -type RestartRoleOperation struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure RestartRoleOperation"` - OperationType string -} - -// CaptureRoleOperation contains the information for capturing a Role -type CaptureRoleOperation struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure CaptureRoleOperation"` - OperationType string - PostCaptureAction PostCaptureAction - ProvisioningConfiguration *ConfigurationSet `xml:",omitempty"` - TargetImageLabel string - TargetImageName string -} - -type PostCaptureAction string - -// Enum values for PostCaptureAction -const ( - PostCaptureActionDelete PostCaptureAction = "Delete" - PostCaptureActionReprovision PostCaptureAction = "Reprovision" -) - -// RoleSizeList contains a list of the available role sizes -type RoleSizeList struct { - XMLName xml.Name `xml:"RoleSizes"` - RoleSizes []RoleSize `xml:"RoleSize"` -} - -// RoleSize contains a detailed explanation of a role size -type RoleSize struct { - Name string - Label string - Cores int - MemoryInMb int - SupportedByWebWorkerRoles bool - SupportedByVirtualMachines bool - MaxDataDiskCount int - WebWorkerResourceDiskSizeInMb int - VirtualMachineResourceDiskSizeInMb int -} - -// DNSServer contains the definition of a DNS server for virtual machine deployment -type DNSServer struct { - Name string - Address string -} - -// LoadBalancer contains the definition of a load balancer for virtual machine deployment -type LoadBalancer struct { - Name string // Specifies the name of the internal load balancer. - Type IPAddressType `xml:"FrontendIpConfiguration>Type"` // Specifies the type of virtual IP address that is provided by the load balancer. The only allowable value is Private. - SubnetName string `xml:"FrontendIpConfiguration>SubnetName,omitempty"` // Required if the deployment exists in a virtual network and a StaticVirtualNetworkIPAddress is assigned. Specifies the subnet of the virtual network that the load balancer uses. The virtual IP address that is managed by the load balancer is contained in this subnet. - StaticVirtualNetworkIPAddress string `xml:"FrontendIpConfiguration>StaticVirtualNetworkIPAddress,omitempty"` // Specifies a specific virtual IP address that the load balancer uses from the subnet in the virtual network. -} - -type IPAddressType string - -// Enum values for IPAddressType -const ( - IPAddressTypePrivate IPAddressType = "Private" // Only allowed value (currently) for IPAddressType -) - -type ResourceExtensions struct { - List []ResourceExtension `xml:"ResourceExtension"` -} - -type ResourceExtension struct { - Publisher string - Name string - Version string - Label string - Description string - PublicConfigurationSchema string - PrivateConfigurationSchema string - SampleConfig string - ReplicationCompleted string - Eula string - PrivacyURI string `xml:"PrivacyUri"` - HomepageURI string `xml:"HomepageUri"` - IsJSONExtension bool `xml:"IsJsonExtension"` - IsInternalExtension bool - DisallowMajorVersionUpgrade bool - CompanyName string - SupportedOS string - PublishedDate string -} - -type PersistentVMRole struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure PersistentVMRole"` - Role -} diff --git a/services/classic/management/virtualmachine/entities_test.go b/services/classic/management/virtualmachine/entities_test.go deleted file mode 100644 index 75002e6f8f80..000000000000 --- a/services/classic/management/virtualmachine/entities_test.go +++ /dev/null @@ -1,315 +0,0 @@ -// +build go1.7 - -package virtualmachine - -// Copyright 2017 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. - -import ( - "encoding/xml" - "testing" -) - -func TestDocumentedDeploymentRequest(t *testing.T) { - // xml based on https://msdn.microsoft.com/en-us/library/azure/jj157194.aspx - // fixed typos, replaced strongly typed fields with values of correct type - xmlString := ` - name-of-deployment - deployment-environment - - - - name-of-the-virtual-machine - PersistentVMRole - - - WindowsProvisioningConfiguration - name-of-computer - administrator-password - true - time-zone - - - domain-to-join - user-name-in-the-domain - password-for-the-user-name - - domain-to-join - distinguished-name-of-the-ou - - - - LocalMachine - name-of-store-on-the-machine - certificate-thumbprint - - - - - - listener-protocol - - - certificate-thumbprint - listener-protocol - - - - name-of-administrator-account - base-64-encoded-data - - - - name-of-pass - - - name-of-component - - - name-of-setting - base-64-encoded-XML-content - - - - - - - - - - LinuxProvisioningConfiguration - host-name-for-the-virtual-machine - new-user-name - password-for-the-new-user - true - - - - certificate-fingerprint - SSH-public-key-storage-location - - - - - certificate-fingerprint - SSH-public-key-storage-location - - - - base-64-encoded-data - - - NetworkConfiguration - - - name-of-load-balanced-set - 22 - ZZH - 33 - - /probe/me - 80 - http - 30 - 5 - - endpoint-protocol - enable-direct-server-return - - - - priority-of-the-rule - permit-rule - subnet-of-the-rule - description-of-the-rule - - - - name-of-internal-loadbalancer - 9 - - - - name-of-subnet - - ip-address - - - name-of-public-ip - 11 - - - - - - - name-of-reference - name-of-publisher - name-of-extension - version-of-extension - - - name-of-parameter-key - parameter-value - type-of-parameter - - - state-of-resource - - - certificate-thumbprint - certificate-algorithm - - - - - name-of-vm-image - path-to-vhd - name-of-availability-set - - - caching-mode - label-of-data-disk - name-of-disk - 0 - 50 - path-to-vhd - - - - caching-mode - label-of-operating-system-disk - name-of-disk - path-to-vhd - name-of-source-image - operating-system-of-image - path-to-source-image - 125 - - size-of-virtual-machine - true - - - 126 - - - - disk-name - 127 - - - - - - name-of-virtual-network - - - - dns-name -
dns-ip-address
-
-
-
- name-of-reserved-ip - - - name-of-internal-load-balancer - - Private - name-of-subnet - static-ip-address - - - -
` - - deployment := DeploymentRequest{} - if err := xml.Unmarshal([]byte(xmlString), &deployment); err != nil { - t.Fatal(err) - } - - if deployment.Name != "name-of-deployment" { - t.Fatalf("Expected deployment.Name=\"name-of-deployment\", but got \"%s\"", - deployment.Name) - } - - // ====== - - t.Logf("deployment.RoleList[0]: %+v", deployment.RoleList[0]) - if expected := "name-of-the-virtual-machine"; deployment.RoleList[0].RoleName != expected { - t.Fatalf("Expected deployment.RoleList[0].RoleName=%v, but got %v", expected, deployment.RoleList[0].RoleName) - } - - // ====== - - t.Logf("deployment.DNSServers[0]: %+v", deployment.DNSServers[0]) - if deployment.DNSServers[0].Name != "dns-name" { - t.Fatalf("Expected deployment.DNSServers[0].Name=\"dns-name\", but got \"%s\"", - deployment.DNSServers[0].Name) - } - - // ====== - - t.Logf("deployment.LoadBalancers[0]: %+v", deployment.LoadBalancers[0]) - if deployment.LoadBalancers[0].Name != "name-of-internal-load-balancer" { - t.Fatalf("Expected deployment.LoadBalancers[0].Name=\"name-of-internal-load-balancer\", but got \"%s\"", - deployment.LoadBalancers[0].Name) - } - - if deployment.LoadBalancers[0].Type != IPAddressTypePrivate { - t.Fatalf("Expected deployment.LoadBalancers[0].Type=IPAddressTypePrivate, but got \"%s\"", - deployment.LoadBalancers[0].Type) - } - - if deployment.LoadBalancers[0].StaticVirtualNetworkIPAddress != "static-ip-address" { - t.Fatalf("Expected deployment.LoadBalancers[0].StaticVirtualNetworkIPAddress=\"static-ip-address\", but got \"%s\"", - deployment.LoadBalancers[0].StaticVirtualNetworkIPAddress) - } - - // ====== - - extensionReferences := (*deployment.RoleList[0].ResourceExtensionReferences) - t.Logf("(*deployment.RoleList[0].ResourceExtensionReferences)[0]: %+v", extensionReferences[0]) - if extensionReferences[0].Name != "name-of-extension" { - t.Fatalf("Expected (*deployment.RoleList[0].ResourceExtensionReferences)[0].Name=\"name-of-extension\", but got \"%s\"", - extensionReferences[0].Name) - } - - if extensionReferences[0].ParameterValues[0].Key != "name-of-parameter-key" { - t.Fatalf("Expected (*deployment.RoleList[0].ResourceExtensionReferences)[0].ParameterValues[0].Key=\"name-of-parameter-key\", but got %v", - extensionReferences[0].ParameterValues[0].Key) - } - - // ====== - - if deployment.RoleList[0].VMImageInput.DataDiskConfigurations[0].ResizedSizeInGB != 127 { - t.Fatalf("Expected deployment.RoleList[0].VMImageInput.DataDiskConfigurations[0].ResizedSizeInGB=127, but got %v", - deployment.RoleList[0].VMImageInput.DataDiskConfigurations[0].ResizedSizeInGB) - } - - // ====== - - winRMlisteners := *deployment.RoleList[0].ConfigurationSets[0].WinRMListeners - if string(winRMlisteners[0].Protocol) != "listener-protocol" { - t.Fatalf("Expected winRMlisteners[0].Protocol to be listener-protocol, but got %s", - string(winRMlisteners[0].Protocol)) - } - - winRMlisteners2 := *deployment.RoleList[0].ConfigurationSets[0].WinRMListeners - if winRMlisteners2[1].CertificateThumbprint != "certificate-thumbprint" { - t.Fatalf("Expected winRMlisteners2[1].CertificateThumbprint to be certificate-thumbprint, but got %s", - winRMlisteners2[1].CertificateThumbprint) - } - -} diff --git a/services/classic/management/virtualmachine/resourceextensions.go b/services/classic/management/virtualmachine/resourceextensions.go deleted file mode 100644 index 03135f95c3df..000000000000 --- a/services/classic/management/virtualmachine/resourceextensions.go +++ /dev/null @@ -1,183 +0,0 @@ -// +build go1.7 - -package virtualmachine - -// Copyright 2017 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. - -import ( - "encoding/xml" - "fmt" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -const ( - azureResourceExtensionsURL = "services/resourceextensions" - azureCloudServiceExtensionsURL = "services/hostedservices/%s/extensions" - azureCloudServiceExtensionURL = "services/hostedservices/%s/extensions/%s" -) - -// GetResourceExtensions lists the resource extensions that are available to add -// to a virtual machine. -// -// See https://msdn.microsoft.com/en-us/library/azure/dn495441.aspx -func (c VirtualMachineClient) GetResourceExtensions() (extensions []ResourceExtension, err error) { - data, err := c.client.SendAzureGetRequest(azureResourceExtensionsURL) - if err != nil { - return extensions, err - } - - var response ResourceExtensions - err = xml.Unmarshal(data, &response) - extensions = response.List - return -} - -// Extensions is a list of extensions returned by the ListExtensions response -type Extensions struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Extensions"` - Extensions []ExtensionInfo `xml:"Extension"` -} - -// ExtensionInfo defined the type retured by GetExtension -// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-get-extension -type ExtensionInfo struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Extension"` - ProviderNameSpace string - Type string - ID string `xml:"Id"` - Version string - Thumbprint string - PublicConfigurationSchema string - ThumbprintAlgorithm string - IsJSONExtension bool `xml:"IsJsonExtension"` - DisallowMajorVersionUpgrade bool -} - -// GetExtension retrieves information about a specified extension that was added to a cloud service. -// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-get-extension -func (c VirtualMachineClient) GetExtension(cloudServiceName string, extensionID string) (extension ExtensionInfo, err error) { - - if cloudServiceName == "" { - return ExtensionInfo{}, fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if extensionID == "" { - return ExtensionInfo{}, fmt.Errorf(errParamNotSpecified, "extensionID") - } - - requestURL := fmt.Sprintf(azureCloudServiceExtensionURL, cloudServiceName, extensionID) - data, err := c.client.SendAzureGetRequest(requestURL) - if err != nil { - return ExtensionInfo{}, err - } - err = xml.Unmarshal(data, &extension) - return -} - -// ListExtensions lists all of the extensions that were added to a cloud service. -// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-list-extensions -func (c VirtualMachineClient) ListExtensions(cloudServiceName string) (extensions []ExtensionInfo, err error) { - - if cloudServiceName == "" { - return []ExtensionInfo{}, fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - - requestURL := fmt.Sprintf(azureCloudServiceExtensionsURL, cloudServiceName) - data, err := c.client.SendAzureGetRequest(requestURL) - if err != nil { - return []ExtensionInfo{}, err - } - var response Extensions - err = xml.Unmarshal(data, &response) - extensions = response.Extensions - return -} - -// AddExtensionOptions defines the options available for adding extensions to a cloud service -type AddExtensionOptions struct { - ProviderNameSpace string - Type string - ID string - Thumbprint string - ThumbprintAlgorithm string - PublicConfiguration string - PrivateConfiguration string - Version string -} - -// AddExtensionRequest is the type used to submit AddExtension requests -type AddExtensionRequest struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Extension"` - ProviderNameSpace string - Type string - ID string `xml:"Id"` - Thumbprint string - ThumbprintAlgorithm string - PublicConfiguration string - PrivateConfiguration string - Version string -} - -// AddExtension addes an extension to the cloud service -// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-add-extension -func (c VirtualMachineClient) AddExtension(cloudServiceName string, options AddExtensionOptions) (management.OperationID, error) { - - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if options.ID == "" { - return "", fmt.Errorf(errParamNotSpecified, "options.ID") - } - if options.ProviderNameSpace == "" { - return "", fmt.Errorf(errParamNotSpecified, "options.ProviderNameSpace") - } - if options.Type == "" { - return "", fmt.Errorf(errParamNotSpecified, "options.Type") - } - - req := AddExtensionRequest{ - ProviderNameSpace: options.ProviderNameSpace, - Type: options.Type, - ID: options.ID, - Thumbprint: options.Thumbprint, - ThumbprintAlgorithm: options.ThumbprintAlgorithm, - PublicConfiguration: options.PublicConfiguration, - PrivateConfiguration: options.PrivateConfiguration, - Version: options.Version, - } - - data, err := xml.Marshal(req) - if err != nil { - return "", err - } - - requestURL := fmt.Sprintf(azureCloudServiceExtensionsURL, cloudServiceName) - return c.client.SendAzurePostRequest(requestURL, data) -} - -// DeleteExtension deletes the specified extension from a cloud service. -// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-delete-extension -func (c VirtualMachineClient) DeleteExtension(cloudServiceName string, extensionID string) (management.OperationID, error) { - - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if extensionID == "" { - return "", fmt.Errorf(errParamNotSpecified, "extensionID") - } - - requestURL := fmt.Sprintf(azureCloudServiceExtensionURL, cloudServiceName, extensionID) - return c.client.SendAzureDeleteRequest(requestURL) -} diff --git a/services/classic/management/virtualmachine/resourceextensions_test.go b/services/classic/management/virtualmachine/resourceextensions_test.go deleted file mode 100644 index a8e6a84032e1..000000000000 --- a/services/classic/management/virtualmachine/resourceextensions_test.go +++ /dev/null @@ -1,43 +0,0 @@ -// +build go1.7 - -package virtualmachine - -// Copyright 2017 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. - -import ( - "testing" - - "github.com/Azure/azure-sdk-for-go/services/classic/management/testutils" -) - -func TestAzureGetResourceExtensions(t *testing.T) { - client := testutils.GetTestClient(t) - - list, err := NewClient(client).GetResourceExtensions() - if err != nil { - t.Fatal(err) - } - - t.Logf("Found %d extensions", len(list)) - if len(list) == 0 { - t.Fatal("Huh, no resource extensions at all? Something must be wrong.") - } - - for _, extension := range list { - if extension.Name == "" { - t.Fatalf("Resource with empty name? Something must have gone wrong with serialization: %+v", extension) - } - } -} diff --git a/services/classic/management/virtualmachinedisk/client.go b/services/classic/management/virtualmachinedisk/client.go deleted file mode 100644 index 89cb7161a303..000000000000 --- a/services/classic/management/virtualmachinedisk/client.go +++ /dev/null @@ -1,246 +0,0 @@ -// +build go1.7 - -// Package virtualmachinedisk provides a client for Virtual Machine Disks. -package virtualmachinedisk - -// Copyright 2017 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. - -import ( - "encoding/xml" - "fmt" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -const ( - addDataDiskURL = "services/hostedservices/%s/deployments/%s/roles/%s/DataDisks" - addDiskURL = "services/disks" - deleteDataDiskURL = "services/hostedservices/%s/deployments/%s/roles/%s/DataDisks/%d" - deleteDiskURL = "services/disks/%s" - getDataDiskURL = "services/hostedservices/%s/deployments/%s/roles/%s/DataDisks/%d" - getDiskURL = "services/disks/%s" - listDisksURL = "services/disks" - updateDataDiskURL = "services/hostedservices/%s/deployments/%s/roles/%s/DataDisks/%d" - updateDiskURL = "services/disks/%s" - - errParamNotSpecified = "Parameter %s is not specified." -) - -//NewClient is used to instantiate a new DiskClient from an Azure client -func NewClient(client management.Client) DiskClient { - return DiskClient{client: client} -} - -// AddDataDisk adds a data disk to a Virtual Machine -// -// https://msdn.microsoft.com/en-us/library/azure/jj157199.aspx -func (c DiskClient) AddDataDisk( - service string, - deployment string, - role string, - params CreateDataDiskParameters) (management.OperationID, error) { - if service == "" { - return "", fmt.Errorf(errParamNotSpecified, "service") - } - if deployment == "" { - return "", fmt.Errorf(errParamNotSpecified, "deployment") - } - if role == "" { - return "", fmt.Errorf(errParamNotSpecified, "role") - } - - requestURL := fmt.Sprintf(addDataDiskURL, service, deployment, role) - - req, err := xml.Marshal(params) - if err != nil { - return "", err - } - - return c.client.SendAzurePostRequest(requestURL, req) -} - -// AddDisk adds an operating system disk or data disk to the user image repository -// -// https://msdn.microsoft.com/en-us/library/azure/jj157178.aspx -func (c DiskClient) AddDisk(params CreateDiskParameters) (management.OperationID, error) { - req, err := xml.Marshal(params) - if err != nil { - return "", err - } - - return c.client.SendAzurePostRequest(addDiskURL, req) -} - -// DeleteDataDisk removes the specified data disk from a Virtual Machine -// -// https://msdn.microsoft.com/en-us/library/azure/jj157179.aspx -func (c DiskClient) DeleteDataDisk( - service string, - deployment string, - role string, - lun int, - deleteVHD bool) (management.OperationID, error) { - if service == "" { - return "", fmt.Errorf(errParamNotSpecified, "service") - } - if deployment == "" { - return "", fmt.Errorf(errParamNotSpecified, "deployment") - } - if role == "" { - return "", fmt.Errorf(errParamNotSpecified, "role") - } - - requestURL := fmt.Sprintf(deleteDataDiskURL, service, deployment, role, lun) - if deleteVHD { - requestURL += "?comp=media" - } - - return c.client.SendAzureDeleteRequest(requestURL) -} - -// DeleteDisk deletes the specified data or operating system disk from the image -// repository that is associated with the specified subscription -// -// https://msdn.microsoft.com/en-us/library/azure/jj157200.aspx -func (c DiskClient) DeleteDisk(name string, deleteVHD bool) error { - if name == "" { - return fmt.Errorf(errParamNotSpecified, "name") - } - - requestURL := fmt.Sprintf(deleteDiskURL, name) - if deleteVHD { - requestURL += "?comp=media" - } - - _, err := c.client.SendAzureDeleteRequest(requestURL) // request is handled synchronously - return err -} - -// GetDataDisk retrieves the specified data disk from a Virtual Machine -// -// https://msdn.microsoft.com/en-us/library/azure/jj157180.aspx -func (c DiskClient) GetDataDisk( - service string, - deployment string, - role string, - lun int) (DataDiskResponse, error) { - var response DataDiskResponse - if service == "" { - return response, fmt.Errorf(errParamNotSpecified, "service") - } - if deployment == "" { - return response, fmt.Errorf(errParamNotSpecified, "deployment") - } - if role == "" { - return response, fmt.Errorf(errParamNotSpecified, "role") - } - - requestURL := fmt.Sprintf(getDataDiskURL, service, deployment, role, lun) - - data, err := c.client.SendAzureGetRequest(requestURL) - if err != nil { - return response, err - } - - err = xml.Unmarshal(data, &response) - return response, err -} - -// GetDisk retrieves information about the specified disk -// -// https://msdn.microsoft.com/en-us/library/azure/dn775053.aspx -func (c DiskClient) GetDisk(name string) (DiskResponse, error) { - var response DiskResponse - if name == "" { - return response, fmt.Errorf(errParamNotSpecified, "name") - } - - requestURL := fmt.Sprintf(getDiskURL, name) - - data, err := c.client.SendAzureGetRequest(requestURL) - if err != nil { - return response, err - } - - err = xml.Unmarshal(data, &response) - return response, err -} - -// ListDisks retrieves a list of the disks in the image repository that is associated -// with the specified subscription -// -// https://msdn.microsoft.com/en-us/library/azure/jj157176.aspx -func (c DiskClient) ListDisks() (ListDiskResponse, error) { - var response ListDiskResponse - - data, err := c.client.SendAzureGetRequest(listDisksURL) - if err != nil { - return response, err - } - - err = xml.Unmarshal(data, &response) - return response, err -} - -// UpdateDataDisk updates the configuration of the specified data disk that is -// attached to the specified Virtual Machine -// -// https://msdn.microsoft.com/en-us/library/azure/jj157190.aspx -func (c DiskClient) UpdateDataDisk( - service string, - deployment string, - role string, - lun int, - params UpdateDataDiskParameters) (management.OperationID, error) { - if service == "" { - return "", fmt.Errorf(errParamNotSpecified, "service") - } - if deployment == "" { - return "", fmt.Errorf(errParamNotSpecified, "deployment") - } - if role == "" { - return "", fmt.Errorf(errParamNotSpecified, "role") - } - - requestURL := fmt.Sprintf(updateDataDiskURL, service, deployment, role, lun) - - req, err := xml.Marshal(params) - if err != nil { - return "", err - } - - return c.client.SendAzurePutRequest(requestURL, "", req) -} - -// UpdateDisk updates the label of an existing disk in the image repository that is -// associated with the specified subscription -// -// https://msdn.microsoft.com/en-us/library/azure/jj157205.aspx -func (c DiskClient) UpdateDisk( - name string, - params UpdateDiskParameters) (management.OperationID, error) { - if name == "" { - return "", fmt.Errorf(errParamNotSpecified, "name") - } - - requestURL := fmt.Sprintf(updateDiskURL, name) - - req, err := xml.Marshal(params) - if err != nil { - return "", err - } - - return c.client.SendAzurePutRequest(requestURL, "", req) -} diff --git a/services/classic/management/virtualmachinedisk/entities.go b/services/classic/management/virtualmachinedisk/entities.go deleted file mode 100644 index ff558e29e29e..000000000000 --- a/services/classic/management/virtualmachinedisk/entities.go +++ /dev/null @@ -1,150 +0,0 @@ -// +build go1.7 - -package virtualmachinedisk - -// Copyright 2017 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. - -import ( - "encoding/xml" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -// DiskClient is used to perform operations on Azure Disks -type DiskClient struct { - client management.Client -} - -// CreateDiskParameters represents a disk -// -// https://msdn.microsoft.com/en-us/library/azure/jj157188.aspx -type CreateDiskParameters struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Disk"` - OS OperatingSystemType `xml:",omitempty"` - Label string - MediaLink string `xml:",omitempty"` - Name string -} - -// UpdateDiskParameters represents a disk -// -// https://msdn.microsoft.com/en-us/library/azure/jj157188.aspx -type UpdateDiskParameters struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Disk"` - Label string `xml:",omitempty"` - Name string - ResizedSizeInGB int `xml:",omitempty"` -} - -// ListDiskResponse represents a disk -// -// https://msdn.microsoft.com/en-us/library/azure/jj157188.aspx -type ListDiskResponse struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Disks"` - Disk []DiskResponse -} - -// DiskResponse represents a disk -// -// https://msdn.microsoft.com/en-us/library/azure/jj157188.aspx -type DiskResponse struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Disk"` - AffinityGroup string - AttachedTo Resource - IsCorrupted bool - OS OperatingSystemType - Location string - LogicalDiskSizeInGB int - MediaLink string - Name string - SourceImageName string - CreatedTime string - IOType IOType -} - -// Resource describes the resource details a disk is currently attached to -type Resource struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure AttachedTo"` - DeploymentName string - HostedServiceName string - RoleName string -} - -// IOType represents an IO type -type IOType string - -// These constants represent the possible IO types -const ( - IOTypeProvisioned IOType = "Provisioned" - IOTypeStandard IOType = "Standard" -) - -// OperatingSystemType represents an operating system type -type OperatingSystemType string - -// These constants represent the valid operating system types -const ( - OperatingSystemTypeNull OperatingSystemType = "NULL" - OperatingSystemTypeLinux OperatingSystemType = "Linux" - OperatingSystemTypeWindows OperatingSystemType = "Windows" -) - -// CreateDataDiskParameters represents a data disk -// -// https://msdn.microsoft.com/en-us/library/azure/jj157188.aspx -type CreateDataDiskParameters struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure DataVirtualHardDisk"` - HostCaching HostCachingType `xml:",omitempty"` - DiskLabel string `xml:",omitempty"` - DiskName string `xml:",omitempty"` - Lun int `xml:",omitempty"` - LogicalDiskSizeInGB int `xml:",omitempty"` - MediaLink string - SourceMediaLink string `xml:",omitempty"` -} - -// UpdateDataDiskParameters represents a data disk -// -// https://msdn.microsoft.com/en-us/library/azure/jj157188.aspx -type UpdateDataDiskParameters struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure DataVirtualHardDisk"` - HostCaching HostCachingType `xml:",omitempty"` - DiskName string - Lun int - MediaLink string -} - -// DataDiskResponse represents a data disk -// -// https://msdn.microsoft.com/en-us/library/azure/jj157188.aspx -type DataDiskResponse struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure DataVirtualHardDisk"` - HostCaching HostCachingType - DiskLabel string - DiskName string - Lun int - LogicalDiskSizeInGB int - MediaLink string -} - -// HostCachingType represents a host caching type -type HostCachingType string - -// These constants represent the valid host caching types -const ( - HostCachingTypeNone HostCachingType = "None" - HostCachingTypeReadOnly HostCachingType = "ReadOnly" - HostCachingTypeReadWrite HostCachingType = "ReadWrite" -) diff --git a/services/classic/management/virtualmachineimage/client.go b/services/classic/management/virtualmachineimage/client.go deleted file mode 100644 index 47f14f23cf78..000000000000 --- a/services/classic/management/virtualmachineimage/client.go +++ /dev/null @@ -1,126 +0,0 @@ -// +build go1.7 - -// Package virtualmachineimage provides a client for Virtual Machine Images. -package virtualmachineimage - -// Copyright 2017 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. - -import ( - "encoding/xml" - "fmt" - "net/url" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -const ( - azureImageListURL = "services/vmimages" - azureImageDeleteURLformat = "services/vmimages/%s" - azureRoleOperationsURL = "services/hostedservices/%s/deployments/%s/roleinstances/%s/operations" - errParamNotSpecified = "Parameter %s is not specified." -) - -//NewClient is used to instantiate a new Client from an Azure client -func NewClient(client management.Client) Client { - return Client{client} -} - -//ListVirtualMachineImages lists the available VM images, filtered by the optional parameters. -//See https://msdn.microsoft.com/en-us/library/azure/dn499770.aspx -func (c Client) ListVirtualMachineImages(parameters ListParameters) (ListVirtualMachineImagesResponse, error) { - var imageList ListVirtualMachineImagesResponse - - listURL := azureImageListURL - - v := url.Values{} - if parameters.Location != "" { - v.Add("location", parameters.Location) - } - - if parameters.Publisher != "" { - v.Add("publisher", parameters.Publisher) - } - - if parameters.Category != "" { - v.Add("category", parameters.Category) - } - - query := v.Encode() - if query != "" { - listURL = listURL + "?" + query - } - - response, err := c.SendAzureGetRequest(listURL) - if err != nil { - return imageList, err - } - err = xml.Unmarshal(response, &imageList) - return imageList, err -} - -//DeleteVirtualMachineImage deletes the named VM image. If deleteVHDs is specified, -//the referenced OS and data disks are also deleted. -//See https://msdn.microsoft.com/en-us/library/azure/dn499769.aspx -func (c Client) DeleteVirtualMachineImage(name string, deleteVHDs bool) error { - if name == "" { - return fmt.Errorf(errParamNotSpecified, "name") - } - - uri := fmt.Sprintf(azureImageDeleteURLformat, name) - - if deleteVHDs { - uri = uri + "?comp=media" - } - - _, err := c.SendAzureDeleteRequest(uri) // delete is synchronous for this operation - return err -} - -type ListParameters struct { - Location string - Publisher string - Category string -} - -const CategoryUser = "User" - -//Capture captures a VM into a VM image. The VM has to be shut down previously. -//See https://msdn.microsoft.com/en-us/library/azure/dn499768.aspx -func (c Client) Capture(cloudServiceName, deploymentName, roleName string, - name, label string, osState OSState, parameters CaptureParameters) (management.OperationID, error) { - if cloudServiceName == "" { - return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName") - } - if deploymentName == "" { - return "", fmt.Errorf(errParamNotSpecified, "deploymentName") - } - if roleName == "" { - return "", fmt.Errorf(errParamNotSpecified, "roleName") - } - - request := CaptureRoleAsVMImageOperation{ - VMImageName: name, - VMImageLabel: label, - OSState: osState, - CaptureParameters: parameters, - } - data, err := xml.Marshal(request) - if err != nil { - return "", err - } - - return c.SendAzurePostRequest(fmt.Sprintf(azureRoleOperationsURL, - cloudServiceName, deploymentName, roleName), data) -} diff --git a/services/classic/management/virtualmachineimage/entities.go b/services/classic/management/virtualmachineimage/entities.go deleted file mode 100644 index ebc868e6b17d..000000000000 --- a/services/classic/management/virtualmachineimage/entities.go +++ /dev/null @@ -1,111 +0,0 @@ -// +build go1.7 - -package virtualmachineimage - -// Copyright 2017 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. - -import ( - "encoding/xml" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" - vmdisk "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachinedisk" -) - -// Client is used to perform operations on Azure VM Images. -type Client struct { - management.Client -} - -type ListVirtualMachineImagesResponse struct { - VMImages []VMImage `xml:"VMImage"` -} - -type VMImage struct { - Name string // Specifies the name of the image. - Label string // Specifies an identifier for the image. - Category string // Specifies the repository classification of the image. All user images have the category User. - Description string // Specifies the description of the image. - OSDiskConfiguration OSDiskConfiguration // Specifies configuration information for the operating system disk that is associated with the image. - DataDiskConfigurations []DataDiskConfiguration `xml:">DataDiskConfiguration"` // Specifies configuration information for the data disks that are associated with the image. A VM Image might not have data disks associated with it. - ServiceName string // Specifies the name of the cloud service that contained the Virtual Machine from which the image was created. - DeploymentName string // Specifies the name of the deployment that contained the Virtual Machine from which the image was created. - RoleName string // Specifies the name of the Virtual Machine from which the image was created. - Location string // Specifies the geo-location in which the media is located. The Location value is derived from the storage account that contains the blob in which the media is located. If the storage account belongs to an affinity group the value is NULL and the element is not displayed in the response. - AffinityGroup string // Specifies the affinity group in which the media is located. The AffinityGroup value is derived from the storage account that contains the blob in which the media is located. If the storage account does not belong to an affinity group the value is NULL and the element is not displayed in the response. - CreatedTime string // Specifies the time that the image was created. - ModifiedTime string // Specifies the time that the image was last updated. - Language string // Specifies the language of the image. - ImageFamily string // Specifies a value that can be used to group VM Images. - RecommendedVMSize string // Optional. Specifies the size to use for the Virtual Machine that is created from the VM Image. - IsPremium string // Indicates whether the image contains software or associated services that will incur charges above the core price for the virtual machine. For additional details, see the PricingDetailLink element. - Eula string // Specifies the End User License Agreement that is associated with the image. The value for this element is a string, but it is recommended that the value be a URL that points to a EULA. - IconURI string `xml:"IconUri"` // Specifies the URI to the icon that is displayed for the image in the Management Portal. - SmallIconURI string `xml:"SmallIconUri"` // Specifies the URI to the small icon that is displayed for the image in the Management Portal. - PrivacyURI string `xml:"PrivacyUri"` // Specifies the URI that points to a document that contains the privacy policy related to the image. - PublishedDate string // Specifies the date when the image was added to the image repository. -} - -type OSState string - -const ( - OSStateGeneralized OSState = "Generalized" - OSStateSpecialized OSState = "Specialized" -) - -type IOType string - -const ( - IOTypeProvisioned IOType = "Provisioned" - IOTypeStandard IOType = "Standard" -) - -// OSDiskConfiguration specifies configuration information for the operating -// system disk that is associated with the image. -type OSDiskConfiguration struct { - Name string // Specifies the name of the operating system disk. - HostCaching vmdisk.HostCachingType // Specifies the caching behavior of the operating system disk. - OSState OSState // Specifies the state of the operating system in the image. - OS string // Specifies the operating system type of the image. - MediaLink string // Specifies the location of the blob in Azure storage. The blob location belongs to a storage account in the subscription specified by the value in the operation call. - LogicalSizeInGB float64 // Specifies the size, in GB, of the operating system disk. - IOType IOType // Identifies the type of the storage account for the backing VHD. If the backing VHD is in an Provisioned Storage account, “Provisioned” is returned otherwise “Standard” is returned. -} - -// DataDiskConfiguration specifies configuration information for the data disks -// that are associated with the image. -type DataDiskConfiguration struct { - Name string // Specifies the name of the data disk. - HostCaching vmdisk.HostCachingType // Specifies the caching behavior of the data disk. - Lun string // Specifies the Logical Unit Number (LUN) for the data disk. - MediaLink string // Specifies the location of the blob in Azure storage. The blob location belongs to a storage account in the subscription specified by the value in the operation call. - LogicalSizeInGB float64 // Specifies the size, in GB, of the data disk. - IOType IOType // Identifies the type of the storage account for the backing VHD. If the backing VHD is in an Provisioned Storage account, “Provisioned” is returned otherwise “Standard” is returned. -} - -type CaptureRoleAsVMImageOperation struct { - XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure CaptureRoleAsVMImageOperation"` - OperationType string //CaptureRoleAsVMImageOperation - OSState OSState - VMImageName string - VMImageLabel string - CaptureParameters -} - -type CaptureParameters struct { - Description string `xml:",omitempty"` - Language string `xml:",omitempty"` - ImageFamily string `xml:",omitempty"` - RecommendedVMSize string `xml:",omitempty"` -} diff --git a/services/classic/management/virtualmachineimage/entities_test.go b/services/classic/management/virtualmachineimage/entities_test.go deleted file mode 100644 index b1b7f0f78a3e..000000000000 --- a/services/classic/management/virtualmachineimage/entities_test.go +++ /dev/null @@ -1,126 +0,0 @@ -// +build go1.7 - -package virtualmachineimage - -// Copyright 2017 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. - -import ( - "encoding/xml" - "testing" -) - -const xml1 = ` - - imgName - - User - packer made image - - OSDisk - ReadWrite - Generalized - Linux - https://sa.blob.core.windows.net/images/PackerMade_Ubuntu_Serv14_2015-12-12.vhd - 30 - Standard - - - PkrSrvf3mz03u4mi - PkrVMf3mz03u4mi - PkrVMf3mz03u4mi - Central US - 2015-12-12T08:59:29.1936858Z - 2015-12-12T08:59:29.1936858Z - PackerMade - Small - false - VMImageReadyForUse - StoppedVM - Small -` -const xml2 = ` - - imgName - - User - packer made image - - OSDisk - ReadWrite - Generalized - Linux - https://sa.blob.core.windows.net/images/PackerMade_Ubuntu_Serv14_2015-12-12.vhd - 30 - Standard - - - - DataDisk1 - ReadWrite - https://sa.blob.core.windows.net/images/PackerMade_Ubuntu_Serv14_2015-12-12-dd1.vhd - 31 - Standard - - - DataDisk2 - ReadWrite - https://sa.blob.core.windows.net/images/PackerMade_Ubuntu_Serv14_2015-12-12-dd2.vhd - 32 - Standard - - - PkrSrvf3mz03u4mi - PkrVMf3mz03u4mi - PkrVMf3mz03u4mi - Central US - 2015-12-12T08:59:29.1936858Z - 2015-12-12T08:59:29.1936858Z - PackerMade - Small - false - VMImageReadyForUse - StoppedVM - Small -` - -func Test_NoDataDisksUnmarshal(t *testing.T) { - var image VMImage - if err := xml.Unmarshal([]byte(xml1), &image); err != nil { - t.Fatal(err) - } - - check := checker{t} - check.Equal(0, len(image.DataDiskConfigurations)) -} - -func Test_DataDiskCountUnmarshal(t *testing.T) { - var image VMImage - if err := xml.Unmarshal([]byte(xml2), &image); err != nil { - t.Fatal(err) - } - - check := checker{t} - check.Equal(2, len(image.DataDiskConfigurations)) - check.Equal("DataDisk1", image.DataDiskConfigurations[0].Name) - check.Equal("DataDisk2", image.DataDiskConfigurations[1].Name) -} - -type checker struct{ *testing.T } - -func (a *checker) Equal(expected, actual interface{}) { - if expected != actual { - a.T.Fatalf("Expected %q, but got %q", expected, actual) - } -} diff --git a/services/classic/management/virtualnetwork/client.go b/services/classic/management/virtualnetwork/client.go deleted file mode 100644 index 5c8dc2d8c2ef..000000000000 --- a/services/classic/management/virtualnetwork/client.go +++ /dev/null @@ -1,63 +0,0 @@ -// +build go1.7 - -// Package virtualnetwork provides a client for Virtual Networks. -package virtualnetwork - -// Copyright 2017 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. - -import ( - "encoding/xml" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -const ( - azureNetworkConfigurationURL = "services/networking/media" -) - -// NewClient is used to return new VirtualNetworkClient instance -func NewClient(client management.Client) VirtualNetworkClient { - return VirtualNetworkClient{client: client} -} - -// GetVirtualNetworkConfiguration retreives the current virtual network -// configuration for the currently active subscription. Note that the -// underlying Azure API means that network related operations are not safe -// for running concurrently. -func (c VirtualNetworkClient) GetVirtualNetworkConfiguration() (NetworkConfiguration, error) { - networkConfiguration := c.NewNetworkConfiguration() - response, err := c.client.SendAzureGetRequest(azureNetworkConfigurationURL) - if err != nil { - return networkConfiguration, err - } - - err = xml.Unmarshal(response, &networkConfiguration) - return networkConfiguration, err - -} - -// SetVirtualNetworkConfiguration configures the virtual networks for the -// currently active subscription according to the NetworkConfiguration given. -// Note that the underlying Azure API means that network related operations -// are not safe for running concurrently. -func (c VirtualNetworkClient) SetVirtualNetworkConfiguration(networkConfiguration NetworkConfiguration) (management.OperationID, error) { - networkConfiguration.setXMLNamespaces() - networkConfigurationBytes, err := xml.Marshal(networkConfiguration) - if err != nil { - return "", err - } - - return c.client.SendAzurePutRequest(azureNetworkConfigurationURL, "text/plain", networkConfigurationBytes) -} diff --git a/services/classic/management/virtualnetwork/entities.go b/services/classic/management/virtualnetwork/entities.go deleted file mode 100644 index 3cb0c9b70a5f..000000000000 --- a/services/classic/management/virtualnetwork/entities.go +++ /dev/null @@ -1,106 +0,0 @@ -// +build go1.7 - -package virtualnetwork - -// Copyright 2017 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. - -import ( - "encoding/xml" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" -) - -const xmlNamespace = "http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration" -const xmlNamespaceXsd = "http://www.w3.org/2001/XMLSchema" -const xmlNamespaceXsi = "http://www.w3.org/2001/XMLSchema-instance" - -// VirtualNetworkClient is used to perform operations on Virtual Networks. -type VirtualNetworkClient struct { - client management.Client -} - -// NetworkConfiguration represents the network configuration for an entire Azure -// subscription. -type NetworkConfiguration struct { - XMLName xml.Name `xml:"NetworkConfiguration"` - XMLNamespaceXsd string `xml:"xmlns:xsd,attr"` - XMLNamespaceXsi string `xml:"xmlns:xsi,attr"` - XMLNs string `xml:"xmlns,attr"` - Configuration VirtualNetworkConfiguration `xml:"VirtualNetworkConfiguration"` - - // TODO: Nicer builder methods for these that abstract away the - // underlying structure. -} - -// NewNetworkConfiguration creates a new empty NetworkConfiguration structure -// for further configuration. The XML namespaces are already set correctly. -func (client *VirtualNetworkClient) NewNetworkConfiguration() NetworkConfiguration { - networkConfiguration := NetworkConfiguration{} - networkConfiguration.setXMLNamespaces() - return networkConfiguration -} - -// setXMLNamespaces ensure that all of the required namespaces are set. It -// should be called prior to marshalling the structure to XML for use with the -// Azure REST endpoint. It is used internally prior to submitting requests, but -// since it is idempotent there is no harm in repeat calls. -func (n *NetworkConfiguration) setXMLNamespaces() { - n.XMLNamespaceXsd = xmlNamespaceXsd - n.XMLNamespaceXsi = xmlNamespaceXsi - n.XMLNs = xmlNamespace -} - -type VirtualNetworkConfiguration struct { - DNS DNS `xml:"Dns,omitempty"` - LocalNetworkSites []LocalNetworkSite `xml:"LocalNetworkSites>LocalNetworkSite"` - VirtualNetworkSites []VirtualNetworkSite `xml:"VirtualNetworkSites>VirtualNetworkSite"` -} - -type DNS struct { - DNSServers []DNSServer `xml:"DnsServers>DnsServer,omitempty"` -} - -type DNSServer struct { - XMLName xml.Name `xml:"DnsServer"` - Name string `xml:"name,attr"` - IPAddress string `xml:"IPAddress,attr"` -} - -type DNSServerRef struct { - Name string `xml:"name,attr"` -} - -type VirtualNetworkSite struct { - Name string `xml:"name,attr"` - Location string `xml:"Location,attr"` - AddressSpace AddressSpace `xml:"AddressSpace"` - Subnets []Subnet `xml:"Subnets>Subnet"` - DNSServersRef []DNSServerRef `xml:"DnsServersRef>DnsServerRef,omitempty"` -} - -type LocalNetworkSite struct { - Name string `xml:"name,attr"` - VPNGatewayAddress string - AddressSpace AddressSpace -} - -type AddressSpace struct { - AddressPrefix []string -} - -type Subnet struct { - Name string `xml:"name,attr"` - AddressPrefix string -} diff --git a/services/classic/management/vmutils/configurationset.go b/services/classic/management/vmutils/configurationset.go deleted file mode 100644 index 623a394ff82b..000000000000 --- a/services/classic/management/vmutils/configurationset.go +++ /dev/null @@ -1,44 +0,0 @@ -// +build go1.7 - -package vmutils - -// Copyright 2017 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. - -import ( - vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine" -) - -func updateOrAddConfig(configs []vm.ConfigurationSet, configType vm.ConfigurationSetType, update func(*vm.ConfigurationSet)) []vm.ConfigurationSet { - config := findConfig(configs, configType) - if config == nil { - configs = append(configs, vm.ConfigurationSet{ConfigurationSetType: configType}) - config = findConfig(configs, configType) - } - update(config) - - return configs -} - -func findConfig(configs []vm.ConfigurationSet, configType vm.ConfigurationSetType) *vm.ConfigurationSet { - for i, config := range configs { - if config.ConfigurationSetType == configType { - // need to return a pointer to the original set in configs, - // not the copy made by the range iterator - return &configs[i] - } - } - - return nil -} diff --git a/services/classic/management/vmutils/datadisks.go b/services/classic/management/vmutils/datadisks.go deleted file mode 100644 index 5e463a3ab1af..000000000000 --- a/services/classic/management/vmutils/datadisks.go +++ /dev/null @@ -1,74 +0,0 @@ -// +build go1.7 - -package vmutils - -// Copyright 2017 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. - -import ( - "fmt" - - vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine" - vmdisk "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachinedisk" -) - -// ConfigureWithNewDataDisk adds configuration for a new (empty) data disk -func ConfigureWithNewDataDisk(role *vm.Role, label, destinationVhdStorageURL string, sizeInGB int, cachingType vmdisk.HostCachingType) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - appendDataDisk(role, vm.DataVirtualHardDisk{ - DiskLabel: label, - HostCaching: cachingType, - LogicalDiskSizeInGB: sizeInGB, - MediaLink: destinationVhdStorageURL, - }) - - return nil -} - -// ConfigureWithExistingDataDisk adds configuration for an existing data disk -func ConfigureWithExistingDataDisk(role *vm.Role, diskName string, cachingType vmdisk.HostCachingType) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - appendDataDisk(role, vm.DataVirtualHardDisk{ - DiskName: diskName, - HostCaching: cachingType, - }) - - return nil -} - -// ConfigureWithVhdDataDisk adds configuration for adding a vhd in a storage -// account as a data disk -func ConfigureWithVhdDataDisk(role *vm.Role, sourceVhdStorageURL string, cachingType vmdisk.HostCachingType) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - appendDataDisk(role, vm.DataVirtualHardDisk{ - SourceMediaLink: sourceVhdStorageURL, - HostCaching: cachingType, - }) - - return nil -} - -func appendDataDisk(role *vm.Role, disk vm.DataVirtualHardDisk) { - disk.Lun = len(role.DataVirtualHardDisks) - role.DataVirtualHardDisks = append(role.DataVirtualHardDisks, disk) -} diff --git a/services/classic/management/vmutils/deployment.go b/services/classic/management/vmutils/deployment.go deleted file mode 100644 index 403897c73e89..000000000000 --- a/services/classic/management/vmutils/deployment.go +++ /dev/null @@ -1,107 +0,0 @@ -// +build go1.7 - -package vmutils - -// Copyright 2017 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. - -import ( - "fmt" - - vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine" -) - -// ConfigureDeploymentFromRemoteImage configures VM Role to deploy from a remote -// image source. "remoteImageSourceURL" can be any publically accessible URL to -// a VHD file, including but not limited to a SAS Azure Storage blob url. "os" -// needs to be either "Linux" or "Windows". "label" is optional. -func ConfigureDeploymentFromRemoteImage( - role *vm.Role, - remoteImageSourceURL string, - os string, - newDiskName string, - destinationVhdStorageURL string, - label string) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - role.OSVirtualHardDisk = &vm.OSVirtualHardDisk{ - RemoteSourceImageLink: remoteImageSourceURL, - MediaLink: destinationVhdStorageURL, - DiskName: newDiskName, - OS: os, - DiskLabel: label, - } - return nil -} - -// ConfigureDeploymentFromPlatformImage configures VM Role to deploy from a -// platform image. See osimage package for methods to retrieve a list of the -// available platform images. "label" is optional. -func ConfigureDeploymentFromPlatformImage( - role *vm.Role, - imageName string, - mediaLink string, - label string) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - role.OSVirtualHardDisk = &vm.OSVirtualHardDisk{ - SourceImageName: imageName, - MediaLink: mediaLink, - } - return nil -} - -// ConfigureDeploymentFromPublishedVMImage configures VM Role to deploy from -// a published (public) VM image. -func ConfigureDeploymentFromPublishedVMImage( - role *vm.Role, - vmImageName string, - mediaLocation string, - provisionGuestAgent bool) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - role.VMImageName = vmImageName - role.MediaLocation = mediaLocation - role.ProvisionGuestAgent = provisionGuestAgent - return nil -} - -// ConfigureDeploymentFromUserVMImage configures VM Role to deploy from a previously -// captured (user generated) VM image. -func ConfigureDeploymentFromUserVMImage( - role *vm.Role, - vmImageName string) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - role.VMImageName = vmImageName - return nil -} - -// ConfigureDeploymentFromExistingOSDisk configures VM Role to deploy from an -// existing disk. 'label' is optional. -func ConfigureDeploymentFromExistingOSDisk(role *vm.Role, osDiskName, label string) error { - role.OSVirtualHardDisk = &vm.OSVirtualHardDisk{ - DiskName: osDiskName, - DiskLabel: label, - } - return nil -} diff --git a/services/classic/management/vmutils/extensions.go b/services/classic/management/vmutils/extensions.go deleted file mode 100644 index e96668dedec6..000000000000 --- a/services/classic/management/vmutils/extensions.go +++ /dev/null @@ -1,106 +0,0 @@ -// +build go1.7 - -package vmutils - -// Copyright 2017 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. - -import ( - "encoding/base64" - "encoding/json" - "fmt" - - vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine" -) - -const ( - dockerPublicConfigVersion = 2 -) - -func AddAzureVMExtensionConfiguration(role *vm.Role, name, publisher, version, referenceName, state string, - publicConfigurationValue, privateConfigurationValue []byte) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - extension := vm.ResourceExtensionReference{ - Name: name, - Publisher: publisher, - Version: version, - ReferenceName: referenceName, - State: state, - } - - if len(privateConfigurationValue) != 0 { - extension.ParameterValues = append(extension.ParameterValues, vm.ResourceExtensionParameter{ - Key: "ignored", - Value: base64.StdEncoding.EncodeToString(privateConfigurationValue), - Type: "Private", - }) - } - - if len(publicConfigurationValue) != 0 { - extension.ParameterValues = append(extension.ParameterValues, vm.ResourceExtensionParameter{ - Key: "ignored", - Value: base64.StdEncoding.EncodeToString(publicConfigurationValue), - Type: "Public", - }) - } - - if role.ResourceExtensionReferences == nil { - role.ResourceExtensionReferences = &[]vm.ResourceExtensionReference{} - } - extensionList := append(*role.ResourceExtensionReferences, extension) - role.ResourceExtensionReferences = &extensionList - return nil -} - -// AddAzureDockerVMExtensionConfiguration adds the DockerExtension to the role -// configuratioon and opens a port "dockerPort" -// TODO(ahmetalpbalkan) Deprecate this and move to 'docker-machine' codebase. -func AddAzureDockerVMExtensionConfiguration(role *vm.Role, dockerPort int, version string) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - if err := ConfigureWithExternalPort(role, "docker", dockerPort, dockerPort, vm.InputEndpointProtocolTCP); err != nil { - return err - } - - publicConfiguration, err := createDockerPublicConfig(dockerPort) - if err != nil { - return err - } - - privateConfiguration, err := json.Marshal(dockerPrivateConfig{}) - if err != nil { - return err - } - - return AddAzureVMExtensionConfiguration(role, - "DockerExtension", "MSOpenTech.Extensions", - version, "DockerExtension", "enable", - publicConfiguration, privateConfiguration) -} - -func createDockerPublicConfig(dockerPort int) ([]byte, error) { - return json.Marshal(dockerPublicConfig{DockerPort: dockerPort, Version: dockerPublicConfigVersion}) -} - -type dockerPublicConfig struct { - DockerPort int `json:"dockerport"` - Version int `json:"version"` -} - -type dockerPrivateConfig struct{} diff --git a/services/classic/management/vmutils/extensions_test.go b/services/classic/management/vmutils/extensions_test.go deleted file mode 100644 index eb158450e7b3..000000000000 --- a/services/classic/management/vmutils/extensions_test.go +++ /dev/null @@ -1,58 +0,0 @@ -// +build go1.7 - -package vmutils - -// Copyright 2017 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. - -import ( - "encoding/xml" - "testing" - - vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine" -) - -func Test_AddAzureVMExtensionConfiguration(t *testing.T) { - - role := vm.Role{} - AddAzureVMExtensionConfiguration(&role, - "nameOfExtension", "nameOfPublisher", "versionOfExtension", "nameOfReference", "state", []byte{1, 2, 3}, []byte{}) - - data, err := xml.MarshalIndent(role, "", " ") - if err != nil { - t.Fatal(err) - } - if expected := ` - - - - nameOfReference - nameOfPublisher - nameOfExtension - versionOfExtension - - - ignored - AQID - Public - - - state - - - -`; string(data) != expected { - t.Fatalf("Expected %q, but got %q", expected, string(data)) - } -} diff --git a/services/classic/management/vmutils/integration_test.go b/services/classic/management/vmutils/integration_test.go deleted file mode 100644 index 5fbc9051435a..000000000000 --- a/services/classic/management/vmutils/integration_test.go +++ /dev/null @@ -1,474 +0,0 @@ -// +build go1.7 - -package vmutils - -// Copyright 2017 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. - -import ( - "encoding/base64" - "fmt" - "math/rand" - "testing" - "time" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" - "github.com/Azure/azure-sdk-for-go/services/classic/management/hostedservice" - "github.com/Azure/azure-sdk-for-go/services/classic/management/location" - "github.com/Azure/azure-sdk-for-go/services/classic/management/osimage" - storage "github.com/Azure/azure-sdk-for-go/services/classic/management/storageservice" - "github.com/Azure/azure-sdk-for-go/services/classic/management/testutils" - vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine" - vmimage "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachineimage" -) - -func TestDeployPlatformImage(t *testing.T) { - client := testutils.GetTestClient(t) - vmname := GenerateName() - sa := GetTestStorageAccount(t, client) - location := sa.StorageServiceProperties.Location - - role := NewVMConfiguration(vmname, "Standard_D3") - ConfigureDeploymentFromPlatformImage(&role, - GetLinuxTestImage(t, client).Name, - fmt.Sprintf("http://%s.blob.core.windows.net/sdktest/%s.vhd", sa.ServiceName, vmname), - GenerateName()) - ConfigureForLinux(&role, "myvm", "azureuser", GeneratePassword()) - ConfigureWithPublicSSH(&role) - - testRoleConfiguration(t, client, role, location) -} - -func TestDeployPlatformWindowsImage(t *testing.T) { - client := testutils.GetTestClient(t) - vmname := GenerateName() - sa := GetTestStorageAccount(t, client) - location := sa.StorageServiceProperties.Location - - role := NewVMConfiguration(vmname, "Standard_D3") - ConfigureDeploymentFromPlatformImage(&role, - GetWindowsTestImage(t, client).Name, - fmt.Sprintf("http://%s.blob.core.windows.net/sdktest/%s.vhd", sa.ServiceName, vmname), - GenerateName()) - ConfigureForWindows(&role, vmname, "azureuser", GeneratePassword(), true, "") - ConfigureWinRMOverHTTP(&role) - ConfigureWinRMOverHTTPS(&role, "") - - testRoleConfiguration(t, client, role, location) -} - -func TestVMImageList(t *testing.T) { - client := testutils.GetTestClient(t) - vmic := vmimage.NewClient(client) - il, _ := vmic.ListVirtualMachineImages(vmimage.ListParameters{}) - for _, im := range il.VMImages { - t.Logf("%s -%s", im.Name, im.Description) - } -} - -func TestDeployPlatformOSImageCaptureRedeploy(t *testing.T) { - client := testutils.GetTestClient(t) - vmname := GenerateName() - sa := GetTestStorageAccount(t, client) - location := sa.StorageServiceProperties.Location - - role := NewVMConfiguration(vmname, "Standard_D3") - ConfigureDeploymentFromPlatformImage(&role, - GetLinuxTestImage(t, client).Name, - fmt.Sprintf("http://%s.blob.core.windows.net/sdktest/%s.vhd", sa.ServiceName, vmname), - GenerateName()) - ConfigureForLinux(&role, "myvm", "azureuser", GeneratePassword()) - ConfigureWithPublicSSH(&role) - - t.Logf("Deploying VM: %s", vmname) - createRoleConfiguration(t, client, role, location) - - t.Logf("Wait for deployment to enter running state") - vmc := vm.NewClient(client) - status := vm.DeploymentStatusDeploying - for status != vm.DeploymentStatusRunning { - deployment, err := vmc.GetDeployment(vmname, vmname) - if err != nil { - t.Error(err) - break - } - status = deployment.Status - } - - t.Logf("Shutting down VM: %s", vmname) - if err := Await(client, func() (management.OperationID, error) { - return vmc.ShutdownRole(vmname, vmname, vmname, vm.PostShutdownActionStopped) - }); err != nil { - t.Error(err) - } - - if err := WaitForDeploymentPowerState(client, vmname, vmname, vm.PowerStateStopped); err != nil { - t.Fatal(err) - } - - imagename := GenerateName() - t.Logf("Capturing OSImage: %s", imagename) - if err := Await(client, func() (management.OperationID, error) { - return vmc.CaptureRole(vmname, vmname, vmname, imagename, imagename, nil) - }); err != nil { - t.Error(err) - } - - im := GetUserOSImage(t, client, imagename) - t.Logf("Found image: %+v", im) - - newvmname := GenerateName() - role = NewVMConfiguration(newvmname, "Standard_D3") - ConfigureDeploymentFromPlatformImage(&role, - im.Name, - fmt.Sprintf("http://%s.blob.core.windows.net/sdktest/%s.vhd", sa.ServiceName, newvmname), - GenerateName()) - ConfigureForLinux(&role, newvmname, "azureuser", GeneratePassword()) - ConfigureWithPublicSSH(&role) - - t.Logf("Deploying new VM from freshly captured OS image: %s", newvmname) - if err := Await(client, func() (management.OperationID, error) { - return vmc.CreateDeployment(role, vmname, vm.CreateDeploymentOptions{}) - }); err != nil { - t.Error(err) - } - - deleteHostedService(t, client, vmname) -} - -func TestDeployPlatformVMImageCaptureRedeploy(t *testing.T) { - client := testutils.GetTestClient(t) - vmname := GenerateName() - sa := GetTestStorageAccount(t, client) - location := sa.StorageServiceProperties.Location - - role := NewVMConfiguration(vmname, "Standard_D3") - ConfigureDeploymentFromPlatformImage(&role, - GetLinuxTestImage(t, client).Name, - fmt.Sprintf("http://%s.blob.core.windows.net/sdktest/%s.vhd", sa.ServiceName, vmname), - GenerateName()) - ConfigureForLinux(&role, "myvm", "azureuser", GeneratePassword()) - ConfigureWithPublicSSH(&role) - - t.Logf("Deploying VM: %s", vmname) - createRoleConfiguration(t, client, role, location) - - t.Logf("Wait for deployment to enter running state") - vmc := vm.NewClient(client) - status := vm.DeploymentStatusDeploying - for status != vm.DeploymentStatusRunning { - deployment, err := vmc.GetDeployment(vmname, vmname) - if err != nil { - t.Error(err) - break - } - status = deployment.Status - } - - t.Logf("Shutting down VM: %s", vmname) - if err := Await(client, func() (management.OperationID, error) { - return vmc.ShutdownRole(vmname, vmname, vmname, vm.PostShutdownActionStopped) - }); err != nil { - t.Error(err) - } - - if err := WaitForDeploymentInstanceStatus(client, vmname, vmname, vm.InstanceStatusStoppedVM); err != nil { - t.Fatal(err) - } - - imagename := GenerateName() - t.Logf("Capturing VMImage: %s", imagename) - if err := Await(client, func() (management.OperationID, error) { - return vmimage.NewClient(client).Capture(vmname, vmname, vmname, imagename, imagename, vmimage.OSStateGeneralized, vmimage.CaptureParameters{}) - }); err != nil { - t.Error(err) - } - - im := GetUserVMImage(t, client, imagename) - t.Logf("Found image: %+v", im) - - newvmname := GenerateName() - role = NewVMConfiguration(newvmname, "Standard_D3") - ConfigureDeploymentFromUserVMImage(&role, im.Name) - ConfigureForLinux(&role, newvmname, "azureuser", GeneratePassword()) - ConfigureWithPublicSSH(&role) - - t.Logf("Deploying new VM from freshly captured VM image: %s", newvmname) - if err := Await(client, func() (management.OperationID, error) { - return vmc.CreateDeployment(role, vmname, vm.CreateDeploymentOptions{}) - }); err != nil { - t.Error(err) - } - - deleteHostedService(t, client, vmname) -} - -func TestDeployFromPublishedVmImage(t *testing.T) { - client := testutils.GetTestClient(t) - vmname := GenerateName() - sa := GetTestStorageAccount(t, client) - location := sa.StorageServiceProperties.Location - - im := GetVMImage(t, client, func(im vmimage.VMImage) bool { - return im.Name == - "fb83b3509582419d99629ce476bcb5c8__SQL-Server-2014-RTM-12.0.2430.0-OLTP-ENU-Win2012R2-cy14su11" - }) - - role := NewVMConfiguration(vmname, "Standard_D4") - ConfigureDeploymentFromPublishedVMImage(&role, im.Name, - fmt.Sprintf("http://%s.blob.core.windows.net/%s", sa.ServiceName, vmname), false) - ConfigureForWindows(&role, vmname, "azureuser", GeneratePassword(), true, "") - ConfigureWithPublicSSH(&role) - - testRoleConfiguration(t, client, role, location) -} - -func TestRoleStateOperations(t *testing.T) { - client := testutils.GetTestClient(t) - vmname := GenerateName() - sa := GetTestStorageAccount(t, client) - location := sa.StorageServiceProperties.Location - - role := NewVMConfiguration(vmname, "Standard_D3") - ConfigureDeploymentFromPlatformImage(&role, - GetLinuxTestImage(t, client).Name, - fmt.Sprintf("http://%s.blob.core.windows.net/sdktest/%s.vhd", sa.ServiceName, vmname), - GenerateName()) - ConfigureForLinux(&role, "myvm", "azureuser", GeneratePassword()) - - createRoleConfiguration(t, client, role, location) - - vmc := vm.NewClient(client) - if err := Await(client, func() (management.OperationID, error) { - return vmc.ShutdownRole(vmname, vmname, vmname, vm.PostShutdownActionStopped) - }); err != nil { - t.Error(err) - } - if err := Await(client, func() (management.OperationID, error) { - return vmc.StartRole(vmname, vmname, vmname) - }); err != nil { - t.Error(err) - } - if err := Await(client, func() (management.OperationID, error) { - return vmc.RestartRole(vmname, vmname, vmname) - }); err != nil { - t.Error(err) - } - - deleteHostedService(t, client, vmname) -} - -func testRoleConfiguration(t *testing.T, client management.Client, role vm.Role, location string) { - createRoleConfiguration(t, client, role, location) - - deleteHostedService(t, client, role.RoleName) -} - -func createRoleConfiguration(t *testing.T, client management.Client, role vm.Role, location string) { - vmc := vm.NewClient(client) - hsc := hostedservice.NewClient(client) - vmname := role.RoleName - - if err := hsc.CreateHostedService(hostedservice.CreateHostedServiceParameters{ - ServiceName: vmname, Location: location, - Label: base64.StdEncoding.EncodeToString([]byte(vmname))}); err != nil { - t.Error(err) - } - - if err := Await(client, func() (management.OperationID, error) { - return vmc.CreateDeployment(role, vmname, vm.CreateDeploymentOptions{}) - }); err != nil { - t.Error(err) - } -} - -func deleteHostedService(t *testing.T, client management.Client, vmname string) { - t.Logf("Deleting hosted service: %s", vmname) - if err := Await(client, func() (management.OperationID, error) { - return hostedservice.NewClient(client).DeleteHostedService(vmname, true) - }); err != nil { - t.Error(err) - } -} - -// === utility funcs === - -func GetTestStorageAccount(t *testing.T, client management.Client) storage.StorageServiceResponse { - t.Log("Retrieving storage account") - sc := storage.NewClient(client) - var sa storage.StorageServiceResponse - ssl, err := sc.ListStorageServices() - if err != nil { - t.Fatal(err) - } - rnd := rand.New(rand.NewSource(time.Now().UnixNano())) - - if len(ssl.StorageServices) == 0 { - t.Log("No storage accounts found, creating a new one") - lc := location.NewClient(client) - ll, err := lc.ListLocations() - if err != nil { - t.Fatal(err) - } - loc := ll.Locations[rnd.Intn(len(ll.Locations))].Name - - t.Logf("Location for new storage account: %s", loc) - name := GenerateName() - op, err := sc.CreateStorageService(storage.StorageAccountCreateParameters{ - ServiceName: name, - Label: base64.StdEncoding.EncodeToString([]byte(name)), - Location: loc, - AccountType: storage.AccountTypeStandardLRS}) - if err != nil { - t.Fatal(err) - } - if err := client.WaitForOperation(op, nil); err != nil { - t.Fatal(err) - } - sa, err = sc.GetStorageService(name) - if err != nil { - t.Fatal(err) - } - } else { - - sa = ssl.StorageServices[rnd.Intn(len(ssl.StorageServices))] - } - - t.Logf("Selected storage account '%s' in location '%s'", - sa.ServiceName, sa.StorageServiceProperties.Location) - - return sa -} - -func GetLinuxTestImage(t *testing.T, client management.Client) osimage.OSImage { - return GetOSImage(t, client, func(im osimage.OSImage) bool { - return im.Category == "Public" && im.ImageFamily == "Ubuntu Server 14.04 LTS" - }) -} - -func GetWindowsTestImage(t *testing.T, client management.Client) osimage.OSImage { - return GetOSImage(t, client, func(im osimage.OSImage) bool { - return im.Category == "Public" && im.ImageFamily == "Windows Server 2012 R2 Datacenter" - }) -} - -func GetUserOSImage(t *testing.T, client management.Client, name string) osimage.OSImage { - return GetOSImage(t, client, func(im osimage.OSImage) bool { - return im.Category == "User" && im.Name == name - }) -} - -func GetOSImage( - t *testing.T, - client management.Client, - filter func(osimage.OSImage) bool) osimage.OSImage { - t.Log("Selecting OS image") - osc := osimage.NewClient(client) - allimages, err := osc.ListOSImages() - if err != nil { - t.Fatal(err) - } - filtered := []osimage.OSImage{} - for _, im := range allimages.OSImages { - if filter(im) { - filtered = append(filtered, im) - } - } - if len(filtered) == 0 { - t.Fatal("Filter too restrictive, no images left?") - } - - image := filtered[0] - for _, im := range filtered { - if im.PublishedDate > image.PublishedDate { - image = im - } - } - - t.Logf("Selecting image '%s'", image.Name) - return image -} - -func GetUserVMImage(t *testing.T, client management.Client, name string) vmimage.VMImage { - return GetVMImage(t, client, func(im vmimage.VMImage) bool { - return im.Category == "User" && im.Name == name - }) -} - -func GetVMImage( - t *testing.T, - client management.Client, - filter func(vmimage.VMImage) bool) vmimage.VMImage { - t.Log("Selecting VM image") - allimages, err := vmimage.NewClient(client).ListVirtualMachineImages(vmimage.ListParameters{}) - if err != nil { - t.Fatal(err) - } - filtered := []vmimage.VMImage{} - for _, im := range allimages.VMImages { - if filter(im) { - filtered = append(filtered, im) - } - } - if len(filtered) == 0 { - t.Fatal("Filter too restrictive, no images left?") - } - - image := filtered[0] - for _, im := range filtered { - if im.PublishedDate > image.PublishedDate { - image = im - } - } - - t.Logf("Selecting image '%s'", image.Name) - return image -} - -func GenerateName() string { - from := "1234567890abcdefghijklmnopqrstuvwxyz" - return "sdk" + GenerateString(12, from) -} - -func GeneratePassword() string { - pw := GenerateString(20, "1234567890") + - GenerateString(20, "abcdefghijklmnopqrstuvwxyz") + - GenerateString(20, "ABCDEFGHIJKLMNOPQRSTUVWXYZ") - - rnd := rand.New(rand.NewSource(time.Now().UnixNano())) - i := rnd.Intn(len(pw)-2) + 1 - - pw = string(append([]uint8(pw[i:]), pw[:i-1]...)) - - return pw -} - -func GenerateString(length int, from string) string { - str := "" - rnd := rand.New(rand.NewSource(time.Now().UnixNano())) - for len(str) < length { - str += string(from[rnd.Intn(len(from))]) - } - return str -} - -type asyncFunc func() (operationId management.OperationID, err error) - -func Await(client management.Client, async asyncFunc) error { - requestID, err := async() - if err != nil { - return err - } - return client.WaitForOperation(requestID, nil) -} diff --git a/services/classic/management/vmutils/network.go b/services/classic/management/vmutils/network.go deleted file mode 100644 index f2145b6878da..000000000000 --- a/services/classic/management/vmutils/network.go +++ /dev/null @@ -1,99 +0,0 @@ -// +build go1.7 - -package vmutils - -// Copyright 2017 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. - -import ( - "fmt" - - vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine" -) - -// ConfigureWithPublicSSH adds configuration exposing port 22 externally -func ConfigureWithPublicSSH(role *vm.Role) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - return ConfigureWithExternalPort(role, "SSH", 22, 22, vm.InputEndpointProtocolTCP) -} - -// ConfigureWithPublicRDP adds configuration exposing port 3389 externally -func ConfigureWithPublicRDP(role *vm.Role) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - return ConfigureWithExternalPort(role, "RDP", 3389, 3389, vm.InputEndpointProtocolTCP) -} - -// ConfigureWithPublicPowerShell adds configuration exposing port 5986 -// externally -func ConfigureWithPublicPowerShell(role *vm.Role) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - return ConfigureWithExternalPort(role, "PowerShell", 5986, 5986, vm.InputEndpointProtocolTCP) -} - -// ConfigureWithExternalPort adds a new InputEndpoint to the Role, exposing a -// port externally -func ConfigureWithExternalPort(role *vm.Role, name string, localport, externalport int, protocol vm.InputEndpointProtocol) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - role.ConfigurationSets = updateOrAddConfig(role.ConfigurationSets, vm.ConfigurationSetTypeNetwork, - func(config *vm.ConfigurationSet) { - config.InputEndpoints = append(config.InputEndpoints, vm.InputEndpoint{ - LocalPort: localport, - Name: name, - Port: externalport, - Protocol: protocol, - }) - }) - - return nil -} - -// ConfigureWithSecurityGroup associates the Role with a specific network security group -func ConfigureWithSecurityGroup(role *vm.Role, networkSecurityGroup string) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - role.ConfigurationSets = updateOrAddConfig(role.ConfigurationSets, vm.ConfigurationSetTypeNetwork, - func(config *vm.ConfigurationSet) { - config.NetworkSecurityGroup = networkSecurityGroup - }) - - return nil -} - -// ConfigureWithSubnet associates the Role with a specific subnet -func ConfigureWithSubnet(role *vm.Role, subnet string) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - role.ConfigurationSets = updateOrAddConfig(role.ConfigurationSets, vm.ConfigurationSetTypeNetwork, - func(config *vm.ConfigurationSet) { - config.SubnetNames = append(config.SubnetNames, subnet) - }) - - return nil -} diff --git a/services/classic/management/vmutils/rolesize.go b/services/classic/management/vmutils/rolesize.go deleted file mode 100644 index a381ca3e73e6..000000000000 --- a/services/classic/management/vmutils/rolesize.go +++ /dev/null @@ -1,92 +0,0 @@ -// +build go1.7 - -package vmutils - -// Copyright 2017 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. - -import ( - "fmt" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" - lc "github.com/Azure/azure-sdk-for-go/services/classic/management/location" - vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine" -) - -// IsRoleSizeValid retrieves the available rolesizes using -// vmclient.GetRoleSizeList() and returns whether that the provided roleSizeName -// is part of that list -func IsRoleSizeValid(vmclient vm.VirtualMachineClient, roleSizeName string) (bool, error) { - if roleSizeName == "" { - return false, fmt.Errorf(errParamNotSpecified, "roleSizeName") - } - - roleSizeList, err := vmclient.GetRoleSizeList() - if err != nil { - return false, err - } - - for _, roleSize := range roleSizeList.RoleSizes { - if roleSize.Name == roleSizeName { - return true, nil - } - } - - return false, nil -} - -// IsRoleSizeAvailableInLocation retrieves all available sizes in the specified -// location and returns whether that the provided roleSizeName is part of that list. -func IsRoleSizeAvailableInLocation(managementclient management.Client, location, roleSizeName string) (bool, error) { - if location == "" { - return false, fmt.Errorf(errParamNotSpecified, "location") - } - if roleSizeName == "" { - return false, fmt.Errorf(errParamNotSpecified, "roleSizeName") - } - - locationClient := lc.NewClient(managementclient) - locationInfo, err := getLocation(locationClient, location) - if err != nil { - return false, err - } - - for _, availableRoleSize := range locationInfo.VirtualMachineRoleSizes { - if availableRoleSize == roleSizeName { - return true, nil - } - } - - return false, nil -} - -func getLocation(c lc.LocationClient, location string) (*lc.Location, error) { - if location == "" { - return nil, fmt.Errorf(errParamNotSpecified, "location") - } - - locations, err := c.ListLocations() - if err != nil { - return nil, err - } - - for _, existingLocation := range locations.Locations { - if existingLocation.Name != location { - continue - } - - return &existingLocation, nil - } - return nil, fmt.Errorf("Invalid location: %s. Available locations: %s", location, locations) -} diff --git a/services/classic/management/vmutils/rolestate.go b/services/classic/management/vmutils/rolestate.go deleted file mode 100644 index 4ae604cd3e91..000000000000 --- a/services/classic/management/vmutils/rolestate.go +++ /dev/null @@ -1,74 +0,0 @@ -// +build go1.7 - -package vmutils - -// Copyright 2017 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. - -import ( - "time" - - "github.com/Azure/azure-sdk-for-go/services/classic/management" - vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine" -) - -// WaitForDeploymentPowerState blocks until all role instances in deployment -// reach desired power state. -func WaitForDeploymentPowerState(client management.Client, cloudServiceName, deploymentName string, desiredPowerstate vm.PowerState) error { - for { - deployment, err := vm.NewClient(client).GetDeployment(cloudServiceName, deploymentName) - if err != nil { - return err - } - if allInstancesInPowerState(deployment.RoleInstanceList, desiredPowerstate) { - return nil - } - time.Sleep(2 * time.Second) - } -} - -func allInstancesInPowerState(instances []vm.RoleInstance, desiredPowerstate vm.PowerState) bool { - for _, r := range instances { - if r.PowerState != desiredPowerstate { - return false - } - } - - return true -} - -// WaitForDeploymentInstanceStatus blocks until all role instances in deployment -// reach desired InstanceStatus. -func WaitForDeploymentInstanceStatus(client management.Client, cloudServiceName, deploymentName string, desiredInstanceStatus vm.InstanceStatus) error { - for { - deployment, err := vm.NewClient(client).GetDeployment(cloudServiceName, deploymentName) - if err != nil { - return err - } - if allInstancesInInstanceStatus(deployment.RoleInstanceList, desiredInstanceStatus) { - return nil - } - time.Sleep(2 * time.Second) - } -} - -func allInstancesInInstanceStatus(instances []vm.RoleInstance, desiredInstancestatus vm.InstanceStatus) bool { - for _, r := range instances { - if r.InstanceStatus != desiredInstancestatus { - return false - } - } - - return true -} diff --git a/services/classic/management/vmutils/vmutils.go b/services/classic/management/vmutils/vmutils.go deleted file mode 100644 index 812851a6c201..000000000000 --- a/services/classic/management/vmutils/vmutils.go +++ /dev/null @@ -1,193 +0,0 @@ -// +build go1.7 - -// Package vmutils provides convenience methods for creating Virtual -// Machine Role configurations. -package vmutils - -// Copyright 2017 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. - -import ( - "fmt" - - vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine" -) - -const ( - errParamNotSpecified = "Parameter %s is not specified." -) - -// NewVMConfiguration creates configuration for a new virtual machine Role. -func NewVMConfiguration(name string, roleSize string) vm.Role { - return vm.Role{ - RoleName: name, - RoleType: "PersistentVMRole", - RoleSize: roleSize, - ProvisionGuestAgent: true, - } -} - -// ConfigureForLinux adds configuration when deploying a generalized Linux -// image. If "password" is left empty, SSH password security will be disabled by -// default. Certificates with SSH public keys should already be uploaded to the -// cloud service where the VM will be deployed and referenced here only by their -// thumbprint. -func ConfigureForLinux(role *vm.Role, hostname, user, password string, sshPubkeyCertificateThumbprint ...string) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - role.ConfigurationSets = updateOrAddConfig(role.ConfigurationSets, vm.ConfigurationSetTypeLinuxProvisioning, - func(config *vm.ConfigurationSet) { - config.HostName = hostname - config.UserName = user - config.UserPassword = password - if password != "" { - config.DisableSSHPasswordAuthentication = "false" - } - if len(sshPubkeyCertificateThumbprint) != 0 { - config.SSH = &vm.SSH{} - for _, k := range sshPubkeyCertificateThumbprint { - config.SSH.PublicKeys = append(config.SSH.PublicKeys, - vm.PublicKey{ - Fingerprint: k, - Path: "/home/" + user + "/.ssh/authorized_keys", - }, - ) - } - } - }, - ) - - return nil -} - -// ConfigureForWindows adds configuration when deploying a generalized -// Windows image. timeZone can be left empty. For a complete list of supported -// time zone entries, you can either refer to the values listed in the registry -// entry "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time -// Zones" or you can use the tzutil command-line tool to list the valid time. -func ConfigureForWindows(role *vm.Role, hostname, user, password string, enableAutomaticUpdates bool, timeZone string) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - role.ConfigurationSets = updateOrAddConfig(role.ConfigurationSets, vm.ConfigurationSetTypeWindowsProvisioning, - func(config *vm.ConfigurationSet) { - config.ComputerName = hostname - config.AdminUsername = user - config.AdminPassword = password - config.EnableAutomaticUpdates = enableAutomaticUpdates - config.TimeZone = timeZone - }, - ) - - return nil -} - -// ConfigureWithCustomDataForLinux configures custom data for Linux-based images. -// The customData contains either cloud-init or shell script to be executed upon start. -// -// The function expects the customData to be base64-encoded. -func ConfigureWithCustomDataForLinux(role *vm.Role, customData string) error { - return configureWithCustomData(role, customData, vm.ConfigurationSetTypeLinuxProvisioning) -} - -// ConfigureWithCustomDataForWindows configures custom data for Windows-based images. -// The customData contains either cloud-init or shell script to be executed upon start. -// -// The function expects the customData to be base64-encoded. -func ConfigureWithCustomDataForWindows(role *vm.Role, customData string) error { - return configureWithCustomData(role, customData, vm.ConfigurationSetTypeWindowsProvisioning) -} - -func configureWithCustomData(role *vm.Role, customData string, typ vm.ConfigurationSetType) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - role.ConfigurationSets = updateOrAddConfig(role.ConfigurationSets, typ, - func(config *vm.ConfigurationSet) { - config.CustomData = customData - }) - - return nil -} - -// ConfigureWindowsToJoinDomain adds configuration to join a new Windows vm to a -// domain. "username" must be in UPN form (user@domain.com), "machineOU" can be -// left empty -func ConfigureWindowsToJoinDomain(role *vm.Role, username, password, domainToJoin, machineOU string) error { - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - winconfig := findConfig(role.ConfigurationSets, vm.ConfigurationSetTypeWindowsProvisioning) - if winconfig != nil { - winconfig.DomainJoin = &vm.DomainJoin{ - Credentials: vm.Credentials{Username: username, Password: password}, - JoinDomain: domainToJoin, - MachineObjectOU: machineOU, - } - } - - return nil -} - -func ConfigureWinRMListener(role *vm.Role, protocol vm.WinRMProtocol, certificateThumbprint string) error { - - if role == nil { - return fmt.Errorf(errParamNotSpecified, "role") - } - - winconfig := findConfig(role.ConfigurationSets, vm.ConfigurationSetTypeWindowsProvisioning) - - if winconfig != nil { - - listener := vm.WinRMListener{ - Protocol: protocol, - CertificateThumbprint: certificateThumbprint, - } - - if winconfig.WinRMListeners == nil { - winconfig.WinRMListeners = &[]vm.WinRMListener{} - } - - currentListeners := *winconfig.WinRMListeners - - // replace existing listener if it's already configured - for i, existingListener := range currentListeners { - if existingListener.Protocol == protocol { - currentListeners[i] = listener - return nil - } - } - - // otherwise append to list of listeners - newListeners := append(currentListeners, listener) - winconfig.WinRMListeners = &newListeners - - return nil - } - - return fmt.Errorf("WindowsProvisioningConfigurationSet not found in 'role'") -} - -func ConfigureWinRMOverHTTP(role *vm.Role) error { - return ConfigureWinRMListener(role, vm.WinRMProtocolHTTP, "") -} - -func ConfigureWinRMOverHTTPS(role *vm.Role, certificateThumbprint string) error { - return ConfigureWinRMListener(role, vm.WinRMProtocolHTTPS, certificateThumbprint) -} diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go index a64fa4de7483..ba2be90e1e99 100644 --- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go @@ -99,6 +99,10 @@ func (client BaseClient) CheckDomainAvailability(ctx context.Context, parameters // CheckDomainAvailabilityPreparer prepares the CheckDomainAvailability request. func (client BaseClient) CheckDomainAvailabilityPreparer(ctx context.Context, parameters CheckDomainAvailabilityParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + const APIVersion = "2017-04-18" queryParameters := map[string]interface{}{ "api-version": APIVersion, @@ -108,7 +112,7 @@ func (client BaseClient) CheckDomainAvailabilityPreparer(ctx context.Context, pa autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.CognitiveServices/checkDomainAvailability"), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -117,7 +121,7 @@ func (client BaseClient) CheckDomainAvailabilityPreparer(ctx context.Context, pa // CheckDomainAvailabilitySender sends the CheckDomainAvailability request. The method will close the // http.Response Body if it receives an error. func (client BaseClient) CheckDomainAvailabilitySender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } diff --git a/services/cognitiveservices/v1.0/computervision/client.go b/services/cognitiveservices/v1.0/computervision/client.go deleted file mode 100644 index 495cefecccd7..000000000000 --- a/services/cognitiveservices/v1.0/computervision/client.go +++ /dev/null @@ -1,1338 +0,0 @@ -// Package computervision implements the Azure ARM Computervision service API version 1.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" - "io" - "net/http" -) - -// BaseClient is the base client for Computervision. -type BaseClient struct { - autorest.Client - AzureRegion AzureRegions -} - -// New creates an instance of the BaseClient client. -func New(azureRegion AzureRegions) BaseClient { - return NewWithoutDefaults(azureRegion) -} - -// NewWithoutDefaults creates an instance of the BaseClient client. -func NewWithoutDefaults(azureRegion AzureRegions) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - AzureRegion: azureRegion, - } -} - -// 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. -// 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). Sexually -// suggestive content is also detected. -// 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. -// 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) AnalyzeImage(ctx context.Context, imageURL ImageURL, visualFeatures []VisualFeatureTypes, details []Details, language string) (result ImageAnalysis, err error) { - 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) - 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) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - 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") - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.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 autorest.SendWithSender(client, 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 only provides a single domain-specific model: celebrities. 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 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{}{ - "AzureRegion": client.AzureRegion, - } - - 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("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.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 autorest.SendWithSender(client, 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 only provides a single domain-specific model: celebrities. 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) { - 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{}{ - "AzureRegion": client.AzureRegion, - } - - 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("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.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 autorest.SendWithSender(client, 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. -// 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). Sexually -// suggestive content is also detected. -// 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. -// 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) AnalyzeImageInStream(ctx context.Context, imageParameter io.ReadCloser, visualFeatures []VisualFeatureTypes, details string, language string) (result ImageAnalysis, err error) { - req, err := client.AnalyzeImageInStreamPreparer(ctx, imageParameter, visualFeatures, details, language) - 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 string, language string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - queryParameters := map[string]interface{}{} - if visualFeatures != nil && len(visualFeatures) > 0 { - queryParameters["visualFeatures"] = autorest.Encode("query", visualFeatures, ",") - } - if len(string(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") - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/octet-stream"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.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 autorest.SendWithSender(client, 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. All descriptions -// are in English. 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. -func (client BaseClient) DescribeImage(ctx context.Context, imageURL ImageURL, maxCandidates string, language string) (result ImageDescription, err error) { - 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) - 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 string, language string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - queryParameters := map[string]interface{}{} - if len(maxCandidates) > 0 { - 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") - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.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 autorest.SendWithSender(client, 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. All -// descriptions are in English. 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. -func (client BaseClient) DescribeImageInStream(ctx context.Context, imageParameter io.ReadCloser, maxCandidates string, language string) (result ImageDescription, err error) { - req, err := client.DescribeImageInStreamPreparer(ctx, imageParameter, maxCandidates, language) - 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 string, language string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - queryParameters := map[string]interface{}{} - if len(maxCandidates) > 0 { - 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") - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/octet-stream"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.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 autorest.SendWithSender(client, 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 -} - -// 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. -// Parameters: -// width - width of the thumbnail. It must be between 1 and 1024. Recommended minimum of 50. -// height - height of the thumbnail. 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 err := validation.Validate([]validation.Validation{ - {TargetValue: width, - Constraints: []validation.Constraint{{Target: "width", Name: validation.InclusiveMaximum, Rule: 1023, Chain: nil}, - {Target: "width", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}, - {TargetValue: height, - Constraints: []validation.Constraint{{Target: "height", Name: validation.InclusiveMaximum, Rule: 1023, Chain: nil}, - {Target: "height", Name: validation.InclusiveMinimum, Rule: 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{}{ - "AzureRegion": client.AzureRegion, - } - - 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("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.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 autorest.SendWithSender(client, 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. -// Parameters: -// width - width of the thumbnail. It must be between 1 and 1024. Recommended minimum of 50. -// height - height of the thumbnail. 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 err := validation.Validate([]validation.Validation{ - {TargetValue: width, - Constraints: []validation.Constraint{{Target: "width", Name: validation.InclusiveMaximum, Rule: 1023, Chain: nil}, - {Target: "width", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}, - {TargetValue: height, - Constraints: []validation.Constraint{{Target: "height", Name: validation.InclusiveMaximum, Rule: 1023, Chain: nil}, - {Target: "height", Name: validation.InclusiveMinimum, Rule: 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{}{ - "AzureRegion": client.AzureRegion, - } - - 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("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.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 autorest.SendWithSender(client, 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 -} - -// GetTextOperationResult this interface is used for getting text operation result. The URL to this interface should be -// retrieved from 'Operation-Location' field returned from Recognize Text interface. -// Parameters: -// operationID - id of the text operation returned in the response of the 'Recognize Handwritten Text' -func (client BaseClient) GetTextOperationResult(ctx context.Context, operationID string) (result TextOperationResult, err error) { - req, err := client.GetTextOperationResultPreparer(ctx, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetTextOperationResult", nil, "Failure preparing request") - return - } - - resp, err := client.GetTextOperationResultSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetTextOperationResult", resp, "Failure sending request") - return - } - - result, err = client.GetTextOperationResultResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetTextOperationResult", resp, "Failure responding to request") - } - - return -} - -// GetTextOperationResultPreparer prepares the GetTextOperationResult request. -func (client BaseClient) GetTextOperationResultPreparer(ctx context.Context, operationID string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "operationId": autorest.Encode("path", operationID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters), - autorest.WithPathParameters("/textOperations/{operationId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetTextOperationResultSender sends the GetTextOperationResult request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetTextOperationResultSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetTextOperationResultResponder handles the response to the GetTextOperationResult request. The method always -// closes the http.Response Body. -func (client BaseClient) GetTextOperationResultResponder(resp *http.Response) (result TextOperationResult, 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 only supports one domain-specific model: a celebrity 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) { - 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{}{ - "AzureRegion": client.AzureRegion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.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 autorest.SendWithSender(client, 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 -} - -// RecognizePrintedText optical Character Recognition (OCR) detects printed 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 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{}{ - "AzureRegion": client.AzureRegion, - } - - 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("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.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 autorest.SendWithSender(client, 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 printed 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) { - 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{}{ - "AzureRegion": client.AzureRegion, - } - - 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("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.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 autorest.SendWithSender(client, 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 -} - -// RecognizeText recognize Text operation. When you use the Recognize Text interface, the response contains a field -// called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get -// Handwritten Text Operation Result operation. -// Parameters: -// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. -// detectHandwriting - if 'true' is specified, handwriting recognition is performed. If this parameter is set -// to 'false' or is not specified, printed text recognition is performed. -func (client BaseClient) RecognizeText(ctx context.Context, imageURL ImageURL, detectHandwriting *bool) (result autorest.Response, err error) { - 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", "RecognizeText", err.Error()) - } - - req, err := client.RecognizeTextPreparer(ctx, imageURL, detectHandwriting) - if err != nil { - err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeText", nil, "Failure preparing request") - return - } - - resp, err := client.RecognizeTextSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeText", resp, "Failure sending request") - return - } - - result, err = client.RecognizeTextResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeText", resp, "Failure responding to request") - } - - return -} - -// RecognizeTextPreparer prepares the RecognizeText request. -func (client BaseClient) RecognizeTextPreparer(ctx context.Context, imageURL ImageURL, detectHandwriting *bool) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - queryParameters := map[string]interface{}{} - if detectHandwriting != nil { - queryParameters["detectHandwriting"] = autorest.Encode("query", *detectHandwriting) - } else { - queryParameters["detectHandwriting"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters), - autorest.WithPath("/recognizeText"), - autorest.WithJSON(imageURL), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RecognizeTextSender sends the RecognizeText request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) RecognizeTextSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// RecognizeTextResponder handles the response to the RecognizeText request. The method always -// closes the http.Response Body. -func (client BaseClient) RecognizeTextResponder(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 -} - -// RecognizeTextInStream recognize Text operation. When you use the Recognize Text interface, the response contains a -// field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get -// Handwritten Text Operation Result operation. -// Parameters: -// imageParameter - an image stream. -// detectHandwriting - if 'true' is specified, handwriting recognition is performed. If this parameter is set -// to 'false' or is not specified, printed text recognition is performed. -func (client BaseClient) RecognizeTextInStream(ctx context.Context, imageParameter io.ReadCloser, detectHandwriting *bool) (result autorest.Response, err error) { - req, err := client.RecognizeTextInStreamPreparer(ctx, imageParameter, detectHandwriting) - if err != nil { - err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeTextInStream", nil, "Failure preparing request") - return - } - - resp, err := client.RecognizeTextInStreamSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeTextInStream", resp, "Failure sending request") - return - } - - result, err = client.RecognizeTextInStreamResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeTextInStream", resp, "Failure responding to request") - } - - return -} - -// RecognizeTextInStreamPreparer prepares the RecognizeTextInStream request. -func (client BaseClient) RecognizeTextInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, detectHandwriting *bool) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - queryParameters := map[string]interface{}{} - if detectHandwriting != nil { - queryParameters["detectHandwriting"] = autorest.Encode("query", *detectHandwriting) - } else { - queryParameters["detectHandwriting"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/octet-stream"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters), - autorest.WithPath("/recognizeText"), - autorest.WithFile(imageParameter), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RecognizeTextInStreamSender sends the RecognizeTextInStream request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) RecognizeTextInStreamSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// RecognizeTextInStreamResponder handles the response to the RecognizeTextInStream request. The method always -// closes the http.Response Body. -func (client BaseClient) RecognizeTextInStreamResponder(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 -} - -// 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 'cello' may be -// accompanied by the hint 'musical instrument'. All tags are in English. -// 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 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{}{ - "AzureRegion": client.AzureRegion, - } - - 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("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.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 autorest.SendWithSender(client, 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 'cello' may be -// accompanied by the hint 'musical instrument'. All tags are in English. -// 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) { - 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{}{ - "AzureRegion": client.AzureRegion, - } - - 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("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.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 autorest.SendWithSender(client, 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/v1.0/computervision/models.go b/services/cognitiveservices/v1.0/computervision/models.go deleted file mode 100644 index d740047c3945..000000000000 --- a/services/cognitiveservices/v1.0/computervision/models.go +++ /dev/null @@ -1,551 +0,0 @@ -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" -) - -// AzureRegions enumerates the values for azure regions. -type AzureRegions string - -const ( - // Australiaeast ... - Australiaeast AzureRegions = "australiaeast" - // Brazilsouth ... - Brazilsouth AzureRegions = "brazilsouth" - // Eastasia ... - Eastasia AzureRegions = "eastasia" - // Eastus ... - Eastus AzureRegions = "eastus" - // Eastus2 ... - Eastus2 AzureRegions = "eastus2" - // Northeurope ... - Northeurope AzureRegions = "northeurope" - // Southcentralus ... - Southcentralus AzureRegions = "southcentralus" - // Southeastasia ... - Southeastasia AzureRegions = "southeastasia" - // Westcentralus ... - Westcentralus AzureRegions = "westcentralus" - // Westeurope ... - Westeurope AzureRegions = "westeurope" - // Westus ... - Westus AzureRegions = "westus" - // Westus2 ... - Westus2 AzureRegions = "westus2" -) - -// PossibleAzureRegionsValues returns an array of possible values for the AzureRegions const type. -func PossibleAzureRegionsValues() []AzureRegions { - return []AzureRegions{Australiaeast, Brazilsouth, Eastasia, Eastus, Eastus2, Northeurope, Southcentralus, Southeastasia, Westcentralus, Westeurope, Westus, Westus2} -} - -// Details enumerates the values for details. -type Details string - -const ( - // Celebrities ... - Celebrities Details = "Celebrities" - // Landmarks ... - Landmarks Details = "Landmarks" -) - -// PossibleDetailsValues returns an array of possible values for the Details const type. -func PossibleDetailsValues() []Details { - return []Details{Celebrities, Landmarks} -} - -// ErrorCodes enumerates the values for error codes. -type ErrorCodes string - -const ( - // BadArgument ... - BadArgument ErrorCodes = "BadArgument" - // FailedToProcess ... - FailedToProcess ErrorCodes = "FailedToProcess" - // InternalServerError ... - InternalServerError ErrorCodes = "InternalServerError" - // InvalidDetails ... - InvalidDetails ErrorCodes = "InvalidDetails" - // InvalidImageFormat ... - InvalidImageFormat ErrorCodes = "InvalidImageFormat" - // InvalidImageSize ... - InvalidImageSize ErrorCodes = "InvalidImageSize" - // InvalidImageURL ... - InvalidImageURL ErrorCodes = "InvalidImageUrl" - // NotSupportedImage ... - NotSupportedImage ErrorCodes = "NotSupportedImage" - // NotSupportedLanguage ... - NotSupportedLanguage ErrorCodes = "NotSupportedLanguage" - // NotSupportedVisualFeature ... - NotSupportedVisualFeature ErrorCodes = "NotSupportedVisualFeature" - // StorageException ... - StorageException ErrorCodes = "StorageException" - // Timeout ... - Timeout ErrorCodes = "Timeout" - // Unspecified ... - Unspecified ErrorCodes = "Unspecified" -) - -// PossibleErrorCodesValues returns an array of possible values for the ErrorCodes const type. -func PossibleErrorCodesValues() []ErrorCodes { - return []ErrorCodes{BadArgument, FailedToProcess, InternalServerError, InvalidDetails, InvalidImageFormat, InvalidImageSize, InvalidImageURL, NotSupportedImage, NotSupportedLanguage, NotSupportedVisualFeature, StorageException, Timeout, Unspecified} -} - -// 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} -} - -// OcrLanguages enumerates the values for ocr languages. -type OcrLanguages string - -const ( - // Ar ... - Ar OcrLanguages = "ar" - // Cs ... - Cs OcrLanguages = "cs" - // Da ... - Da OcrLanguages = "da" - // De ... - De OcrLanguages = "de" - // El ... - El OcrLanguages = "el" - // En ... - En OcrLanguages = "en" - // Es ... - Es OcrLanguages = "es" - // Fi ... - Fi OcrLanguages = "fi" - // Fr ... - Fr OcrLanguages = "fr" - // Hu ... - Hu OcrLanguages = "hu" - // It ... - It OcrLanguages = "it" - // Ja ... - Ja OcrLanguages = "ja" - // Ko ... - Ko OcrLanguages = "ko" - // Nb ... - Nb OcrLanguages = "nb" - // Nl ... - Nl OcrLanguages = "nl" - // Pl ... - Pl OcrLanguages = "pl" - // Pt ... - Pt OcrLanguages = "pt" - // Ro ... - Ro OcrLanguages = "ro" - // Ru ... - Ru OcrLanguages = "ru" - // Sk ... - Sk OcrLanguages = "sk" - // SrCyrl ... - SrCyrl OcrLanguages = "sr-Cyrl" - // SrLatn ... - SrLatn OcrLanguages = "sr-Latn" - // Sv ... - Sv OcrLanguages = "sv" - // Tr ... - Tr OcrLanguages = "tr" - // Unk ... - Unk OcrLanguages = "unk" - // ZhHans ... - ZhHans OcrLanguages = "zh-Hans" - // ZhHant ... - ZhHant OcrLanguages = "zh-Hant" -) - -// PossibleOcrLanguagesValues returns an array of possible values for the OcrLanguages const type. -func PossibleOcrLanguagesValues() []OcrLanguages { - return []OcrLanguages{Ar, Cs, Da, De, El, En, Es, Fi, Fr, Hu, It, Ja, Ko, Nb, Nl, Pl, Pt, Ro, Ru, Sk, SrCyrl, SrLatn, Sv, Tr, Unk, ZhHans, ZhHant} -} - -// TextOperationStatusCodes enumerates the values for text operation status codes. -type TextOperationStatusCodes string - -const ( - // Failed ... - Failed TextOperationStatusCodes = "Failed" - // NotStarted ... - NotStarted TextOperationStatusCodes = "Not Started" - // Running ... - Running TextOperationStatusCodes = "Running" - // Succeeded ... - Succeeded TextOperationStatusCodes = "Succeeded" -) - -// PossibleTextOperationStatusCodesValues returns an array of possible values for the TextOperationStatusCodes const type. -func PossibleTextOperationStatusCodesValues() []TextOperationStatusCodes { - return []TextOperationStatusCodes{Failed, NotStarted, Running, Succeeded} -} - -// VisualFeatureTypes enumerates the values for visual feature types. -type VisualFeatureTypes string - -const ( - // VisualFeatureTypesAdult ... - VisualFeatureTypesAdult VisualFeatureTypes = "Adult" - // VisualFeatureTypesCategories ... - VisualFeatureTypesCategories VisualFeatureTypes = "Categories" - // VisualFeatureTypesColor ... - VisualFeatureTypesColor VisualFeatureTypes = "Color" - // VisualFeatureTypesDescription ... - VisualFeatureTypesDescription VisualFeatureTypes = "Description" - // VisualFeatureTypesFaces ... - VisualFeatureTypesFaces VisualFeatureTypes = "Faces" - // VisualFeatureTypesImageType ... - VisualFeatureTypesImageType VisualFeatureTypes = "ImageType" - // VisualFeatureTypesTags ... - VisualFeatureTypesTags VisualFeatureTypes = "Tags" -) - -// PossibleVisualFeatureTypesValues returns an array of possible values for the VisualFeatureTypes const type. -func PossibleVisualFeatureTypesValues() []VisualFeatureTypes { - return []VisualFeatureTypes{VisualFeatureTypesAdult, VisualFeatureTypesCategories, VisualFeatureTypesColor, VisualFeatureTypesDescription, VisualFeatureTypesFaces, VisualFeatureTypesImageType, 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 race. - IsRacyContent *bool `json:"isRacyContent,omitempty"` - // AdultScore - Score from 0 to 1 that indicates how much of adult content is 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"` -} - -// 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 *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"` -} - -// CelebritiesModel an object describing possible celebrity identification. -type CelebritiesModel struct { - // Name - Name of the celebrity. - Name *string `json:"name,omitempty"` - // Confidence - Level of confidence ranging from 0 to 1. - Confidence *float64 `json:"confidence,omitempty"` - FaceRectangle *FaceRectangle `json:"faceRectangle,omitempty"` -} - -// CelebrityResults list of celebrities recognized in the image. -type CelebrityResults struct { - 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"` -} - -// 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 ... -type Error struct { - // Code - The error code. Possible values include: 'InvalidImageURL', 'InvalidImageFormat', 'InvalidImageSize', 'NotSupportedVisualFeature', 'NotSupportedImage', 'InvalidDetails', 'NotSupportedLanguage', 'BadArgument', 'FailedToProcess', 'Timeout', 'InternalServerError', 'Unspecified', 'StorageException' - Code ErrorCodes `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 *FaceRectangle `json:"faceRectangle,omitempty"` -} - -// FaceRectangle an object describing face rectangle. -type FaceRectangle struct { - // Left - X-coordinate of the top left point of the face. - Left *int32 `json:"left,omitempty"` - // Top - Y-coordinate of the top left point of the face. - Top *int32 `json:"top,omitempty"` - // Width - Width measured from the top-left point of the face. - Width *int32 `json:"width,omitempty"` - // Height - Height measured from the top-left point of the face. - 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 *AdultInfo `json:"adult,omitempty"` - Color *ColorInfo `json:"color,omitempty"` - ImageType *ImageType `json:"imageType,omitempty"` - // Tags - A list of tags with confidence level. - Tags *[]ImageTag `json:"tags,omitempty"` - Description *ImageDescriptionDetails `json:"description,omitempty"` - // Faces - An array of possible faces within the image. - Faces *[]FaceDescription `json:"faces,omitempty"` - // RequestID - Id of the request for tracking purposes. - 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 `json:"description,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 - } - 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 - } - } - } - - 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"` - // RequestID - Id of the REST API request. - RequestID *string `json:"requestId,omitempty"` - Metadata *ImageMetadata `json:"metadata,omitempty"` -} - -// ImageMetadata image metadata -type ImageMetadata struct { - // Width - Image width - Width *int32 `json:"width,omitempty"` - // Height - Image height - Height *int32 `json:"height,omitempty"` - // Format - Image format - Format *string `json:"format,omitempty"` -} - -// ImageTag an image caption, i.e. a brief description of what the image depicts. -type ImageTag struct { - // Name - The tag value - Name *string `json:"name,omitempty"` - // Confidence - The level of confidence the service has in the caption - Confidence *float64 `json:"confidence,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 *float64 `json:"clipArtType,omitempty"` - // LineDrawingType - Confidence level that the image is a line drawing. - LineDrawingType *float64 `json:"lineDrawingType,omitempty"` -} - -// ImageURL ... -type ImageURL struct { - // URL - Publicly reachable URL of an image - URL *string `json:"url,omitempty"` -} - -// LandmarkResults list of landmarks recognized in the image. -type LandmarkResults struct { - Landmarks *[]LandmarkResultsLandmarksItem `json:"landmarks,omitempty"` - // RequestID - Id of the REST API request. - RequestID *string `json:"requestId,omitempty"` - Metadata *ImageMetadata `json:"metadata,omitempty"` -} - -// LandmarkResultsLandmarksItem a landmark recognized in the image -type LandmarkResultsLandmarksItem struct { - // Name - Name of the landmark. - Name *string `json:"name,omitempty"` - // Confidence - Confidence level for the landmark recognition. - Confidence *float64 `json:"confidence,omitempty"` -} - -// Line ... -type Line struct { - BoundingBox *[]int32 `json:"boundingBox,omitempty"` - Text *string `json:"text,omitempty"` - Words *[]Word `json:"words,omitempty"` -} - -// ListModelsResult result of the List Domain Models operation. -type ListModelsResult struct { - autorest.Response `json:"-"` - // ModelsProperty - An array of supported models. - ModelsProperty *[]ModelDescription `json:"models,omitempty"` -} - -// ModelDescription an object describing supported model by name and categories. -type ModelDescription struct { - Name *string `json:"name,omitempty"` - Categories *[]string `json:"categories,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 *[]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 degrees, 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. 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). - 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"` -} - -// RecognitionResult ... -type RecognitionResult struct { - 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"` -} - -// TextOperationResult ... -type TextOperationResult struct { - autorest.Response `json:"-"` - // Status - Status of the text operation. Possible values include: 'NotStarted', 'Running', 'Failed', 'Succeeded' - Status TextOperationStatusCodes `json:"status,omitempty"` - RecognitionResult *RecognitionResult `json:"recognitionResult,omitempty"` -} - -// Word ... -type Word struct { - BoundingBox *[]int32 `json:"boundingBox,omitempty"` - Text *string `json:"text,omitempty"` -} diff --git a/services/cognitiveservices/v1.0/computervision/version.go b/services/cognitiveservices/v1.0/computervision/version.go deleted file mode 100644 index a25f5e0a9ea2..000000000000 --- a/services/cognitiveservices/v1.0/computervision/version.go +++ /dev/null @@ -1,30 +0,0 @@ -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.Number + " computervision/1.0" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/services/cognitiveservices/v1.0/localsearch/client.go b/services/cognitiveservices/v1.0/localsearch/client.go index b23863673898..13b2c0290c80 100644 --- a/services/cognitiveservices/v1.0/localsearch/client.go +++ b/services/cognitiveservices/v1.0/localsearch/client.go @@ -28,7 +28,7 @@ import ( const ( // DefaultBaseURI is the default URI used for the service Localsearch - DefaultBaseURI = "https://api.cognitive.microsoft.com/localbusinesses/v7.0/search" + DefaultBaseURI = "https://api.cognitive.microsoft.com/bing" ) // BaseClient is the base client for Localsearch. diff --git a/services/cognitiveservices/v1.0/localsearch/local.go b/services/cognitiveservices/v1.0/localsearch/local.go index eac55bbe6914..667c0df99d1b 100644 --- a/services/cognitiveservices/v1.0/localsearch/local.go +++ b/services/cognitiveservices/v1.0/localsearch/local.go @@ -226,7 +226,7 @@ func (client LocalClient) SearchPreparer(ctx context.Context, query string, acce preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/localbusinesses/v7.0/search"), + autorest.WithPath("/v7.0/localbusinesses/search"), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("X-BingApis-SDK", "true")) if len(acceptLanguage) > 0 { diff --git a/services/cognitiveservices/v1.0/spellcheck/client.go b/services/cognitiveservices/v1.0/spellcheck/client.go index b76d0d64281b..89cc236c1f2e 100644 --- a/services/cognitiveservices/v1.0/spellcheck/client.go +++ b/services/cognitiveservices/v1.0/spellcheck/client.go @@ -216,7 +216,9 @@ func (client BaseClient) SpellCheckerMethodPreparer(ctx context.Context, textPar "Endpoint": client.Endpoint, } - queryParameters := map[string]interface{}{} + queryParameters := map[string]interface{}{ + "Text": autorest.Encode("query", textParameter), + } if len(string(actionType)) > 0 { queryParameters["ActionType"] = autorest.Encode("query", actionType) } @@ -244,18 +246,14 @@ func (client BaseClient) SpellCheckerMethodPreparer(ctx context.Context, textPar if len(userID) > 0 { queryParameters["UserId"] = autorest.Encode("query", userID) } - - formDataParameters := map[string]interface{}{ - "Text": textParameter, - } if len(string(mode)) > 0 { - formDataParameters["Mode"] = mode + queryParameters["Mode"] = autorest.Encode("query", mode) } if len(preContextText) > 0 { - formDataParameters["PreContextText"] = preContextText + queryParameters["PreContextText"] = autorest.Encode("query", preContextText) } if len(postContextText) > 0 { - formDataParameters["PostContextText"] = postContextText + queryParameters["PostContextText"] = autorest.Encode("query", postContextText) } preparer := autorest.CreatePreparer( @@ -263,7 +261,6 @@ func (client BaseClient) SpellCheckerMethodPreparer(ctx context.Context, textPar autorest.WithCustomBaseURL("{Endpoint}/bing/v7.0", urlParameters), autorest.WithPath("/spellcheck"), autorest.WithQueryParameters(queryParameters), - autorest.WithFormData(autorest.MapToValues(formDataParameters)), autorest.WithHeader("X-BingApis-SDK", "true")) if len(acceptLanguage) > 0 { preparer = autorest.DecoratePreparer(preparer, diff --git a/services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi/interfaces.go b/services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi/interfaces.go deleted file mode 100644 index 8207746acb0f..000000000000 --- a/services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi/interfaces.go +++ /dev/null @@ -1,31 +0,0 @@ -package anomalyfinderapi - -// 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/v2.0/anomalyfinder" -) - -// BaseClientAPI contains the set of methods on the BaseClient type. -type BaseClientAPI interface { - EntireDetect(ctx context.Context, body anomalyfinder.Request) (result anomalyfinder.EntireDetectResponse, err error) - LastDetect(ctx context.Context, body anomalyfinder.Request) (result anomalyfinder.LastDetectResponse, err error) -} - -var _ BaseClientAPI = (*anomalyfinder.BaseClient)(nil) diff --git a/services/cognitiveservices/v2.0/anomalyfinder/client.go b/services/cognitiveservices/v2.0/anomalyfinder/client.go deleted file mode 100644 index b02ba0768ddd..000000000000 --- a/services/cognitiveservices/v2.0/anomalyfinder/client.go +++ /dev/null @@ -1,208 +0,0 @@ -// Package anomalyfinder implements the Azure ARM Anomalyfinder service API version 2.0. -// -// The Anomaly Finder API detects anomalies automatically in time series data. It supports two functionalities, one is -// for detecting the whole series with model trained by the timeseries, another is detecting last point with model -// trained by points before. By using this service, business customers can discover incidents and establish a logic -// flow for root cause analysis. -package anomalyfinder - -// 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" -) - -// BaseClient is the base client for Anomalyfinder. -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, - } -} - -// EntireDetect the operation will generate a model using the entire series, each point will be detected with the same -// model. In this method, points before and after a certain point will be used to determine whether it's an anomaly. -// The entire detection can give user an overall status of the time series. -// Parameters: -// body - time series points and period if needed. Advanced model parameters can also be set in the request. -func (client BaseClient) EntireDetect(ctx context.Context, body Request) (result EntireDetectResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EntireDetect") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Series", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("anomalyfinder.BaseClient", "EntireDetect", err.Error()) - } - - req, err := client.EntireDetectPreparer(ctx, body) - if err != nil { - err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "EntireDetect", nil, "Failure preparing request") - return - } - - resp, err := client.EntireDetectSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "EntireDetect", resp, "Failure sending request") - return - } - - result, err = client.EntireDetectResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "EntireDetect", resp, "Failure responding to request") - } - - return -} - -// EntireDetectPreparer prepares the EntireDetect request. -func (client BaseClient) EntireDetectPreparer(ctx context.Context, body Request) (*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}/anomalyfinder/v2.0", urlParameters), - autorest.WithPath("/timeseries/entire/detect"), - autorest.WithJSON(body)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EntireDetectSender sends the EntireDetect request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) EntireDetectSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// EntireDetectResponder handles the response to the EntireDetect request. The method always -// closes the http.Response Body. -func (client BaseClient) EntireDetectResponder(resp *http.Response) (result EntireDetectResponse, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// LastDetect the operation will generate a model using points before the latest one, In this method, only history -// points are used for determine whether the target point is an anomaly. Latest point detecting matches the scenario of -// real-time monitoring of business metrics. -// Parameters: -// body - time series points and period if needed. Advanced model parameters can also be set in the request. -func (client BaseClient) LastDetect(ctx context.Context, body Request) (result LastDetectResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.LastDetect") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Series", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("anomalyfinder.BaseClient", "LastDetect", err.Error()) - } - - req, err := client.LastDetectPreparer(ctx, body) - if err != nil { - err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "LastDetect", nil, "Failure preparing request") - return - } - - resp, err := client.LastDetectSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "LastDetect", resp, "Failure sending request") - return - } - - result, err = client.LastDetectResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "LastDetect", resp, "Failure responding to request") - } - - return -} - -// LastDetectPreparer prepares the LastDetect request. -func (client BaseClient) LastDetectPreparer(ctx context.Context, body Request) (*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}/anomalyfinder/v2.0", urlParameters), - autorest.WithPath("/timeseries/last/detect"), - autorest.WithJSON(body)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// LastDetectSender sends the LastDetect request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) LastDetectSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// LastDetectResponder handles the response to the LastDetect request. The method always -// closes the http.Response Body. -func (client BaseClient) LastDetectResponder(resp *http.Response) (result LastDetectResponse, 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/v2.0/anomalyfinder/models.go b/services/cognitiveservices/v2.0/anomalyfinder/models.go deleted file mode 100644 index 8ea88ea46f2b..000000000000 --- a/services/cognitiveservices/v2.0/anomalyfinder/models.go +++ /dev/null @@ -1,121 +0,0 @@ -package anomalyfinder - -// 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" - "github.com/Azure/go-autorest/autorest/date" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder" - -// Granularity enumerates the values for granularity. -type Granularity string - -const ( - // Daily ... - Daily Granularity = "daily" - // Hourly ... - Hourly Granularity = "hourly" - // Minutely ... - Minutely Granularity = "minutely" - // Monthly ... - Monthly Granularity = "monthly" - // Weekly ... - Weekly Granularity = "weekly" - // Yearly ... - Yearly Granularity = "yearly" -) - -// PossibleGranularityValues returns an array of possible values for the Granularity const type. -func PossibleGranularityValues() []Granularity { - return []Granularity{Daily, Hourly, Minutely, Monthly, Weekly, Yearly} -} - -// APIError error information returned by the API. -type APIError 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"` -} - -// EntireDetectResponse ... -type EntireDetectResponse struct { - autorest.Response `json:"-"` - // Period - Frequency extracted from the series, zero means no recurrent pattern has been found. - Period *int32 `json:"period,omitempty"` - // ExpectedValues - ExpectedValues contain expected value for each input point. The index of the array is consistent with the input series. - ExpectedValues *[]float64 `json:"expectedValues,omitempty"` - // UpperMargins - UpperMargins contain upper margin of each input point. UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 - sensitivity)*upperMargin. Anomalies in response can be filtered by upperBoundary and lowerBoundary. By adjusting sensitivity value, less significant anomalies can be filtered in client side. The index of the array is consistent with the input series. - UpperMargins *[]float64 `json:"upperMargins,omitempty"` - // LowerMargins - LowerMargins contain lower margin of each input point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - sensitivity)*lowerMargin. Points between the boundary can be marked as normal ones in client side. The index of the array is consistent with the input series. - LowerMargins *[]float64 `json:"lowerMargins,omitempty"` - // IsAnomaly - IsAnomaly contains anomaly properties for each input point. True means an anomaly either negative or positive has been detected. The index of the array is consistent with the input series. - IsAnomaly *[]bool `json:"isAnomaly,omitempty"` - // IsNegativeAnomaly - IsNegativeAnomaly contains anomaly status in negative direction for each input point. True means a negative anomaly has been detected. A negative anomaly means the point is detected as an anomaly and its real value is smaller than the expected one. The index of the array is consistent with the input series. - IsNegativeAnomaly *[]bool `json:"isNegativeAnomaly,omitempty"` - // IsPositiveAnomaly - IsPositiveAnomaly contain anomaly status in positive direction for each input point. True means a positive anomaly has been detected. A positive anomaly means the point is detected as an anomaly and its real value is larger than the expected one. The index of the array is consistent with the input series. - IsPositiveAnomaly *[]bool `json:"isPositiveAnomaly,omitempty"` -} - -// LastDetectResponse ... -type LastDetectResponse struct { - autorest.Response `json:"-"` - // Period - Frequency extracted from the series, zero means no recurrent pattern has been found. - Period *int32 `json:"period,omitempty"` - // SuggestedWindow - Suggested input series points needed for detecting the latest point. - SuggestedWindow *int32 `json:"suggestedWindow,omitempty"` - // ExpectedValue - Expected value of the latest point. - ExpectedValue *float64 `json:"expectedValue,omitempty"` - // UpperMargin - Upper margin of the latest point. UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 - sensitivity)*upperMargin. If the value of latest point is between upperBoundary and lowerBoundary, it should be treated as normal value. By adjusting sensitivity value, anomaly status of latest point can be changed. - UpperMargin *float64 `json:"upperMargin,omitempty"` - // LowerMargin - Lower margin of the latest point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - sensitivity)*lowerMargin. - LowerMargin *float64 `json:"lowerMargin,omitempty"` - // IsAnomaly - Anomaly status of the latest point, true means the latest point is an anomaly either in negative direction or positive direction. - IsAnomaly *bool `json:"isAnomaly,omitempty"` - // IsNegativeAnomaly - Anomaly status in negative direction of the latest point. True means the latest point is an anomaly and its real value is smaller than the expected one. - IsNegativeAnomaly *bool `json:"isNegativeAnomaly,omitempty"` - // IsPositiveAnomaly - Anomaly status in positive direction of the latest point. True means the latest point is an anomaly and its real value is larger than the expected one. - IsPositiveAnomaly *bool `json:"isPositiveAnomaly,omitempty"` -} - -// Point ... -type Point struct { - // Timestamp - Timestamp of a data point (ISO8601 format). - Timestamp *date.Time `json:"timestamp,omitempty"` - // Value - The measurement of that point, should be float. - Value *float64 `json:"value,omitempty"` -} - -// Request ... -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 - 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 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"` - // Period - Optional argument, periodic value of a time series. If the value is null or does not present, the API will determine the period automatically. - Period *int32 `json:"period,omitempty"` - // MaxAnomalyRatio - Optional argument, advanced model parameter, max anomaly ratio in a time series. - MaxAnomalyRatio *float64 `json:"maxAnomalyRatio,omitempty"` - // Sensitivity - Optional argument, advanced model parameter, between 0-99, the lower the value is, the larger the margin value will be which means less anomalies will be accepted. - Sensitivity *int32 `json:"sensitivity,omitempty"` -} diff --git a/services/cognitiveservices/v2.0/anomalyfinder/version.go b/services/cognitiveservices/v2.0/anomalyfinder/version.go deleted file mode 100644 index 1d6689bd944f..000000000000 --- a/services/cognitiveservices/v2.0/anomalyfinder/version.go +++ /dev/null @@ -1,30 +0,0 @@ -package anomalyfinder - -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.Number + " anomalyfinder/2.0" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/services/cognitiveservices/v2.0/luis/programmatic/apps.go b/services/cognitiveservices/v2.0/luis/programmatic/apps.go deleted file mode 100644 index 335c8200384e..000000000000 --- a/services/cognitiveservices/v2.0/luis/programmatic/apps.go +++ /dev/null @@ -1,1165 +0,0 @@ -package programmatic - -// 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/satori/go.uuid" - "net/http" -) - -// AppsClient is the client for the Apps methods of the Programmatic service. -type AppsClient struct { - BaseClient -} - -// NewAppsClient creates an instance of the AppsClient client. -func NewAppsClient(azureRegion AzureRegions) AppsClient { - return AppsClient{New(azureRegion)} -} - -// Add creates a new LUIS app. -// Parameters: -// applicationCreateObject - a model containing Name, Description (optional), Culture, Usage Scenario -// (optional), Domain (optional) and initial version ID (optional) of the application. Default value for the -// version ID is 0.1. Note: the culture cannot be changed after the app is created. -func (client AppsClient) Add(ctx context.Context, applicationCreateObject ApplicationCreateObject) (result UUID, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: applicationCreateObject, - Constraints: []validation.Constraint{{Target: "applicationCreateObject.Culture", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "applicationCreateObject.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("programmatic.AppsClient", "Add", err.Error()) - } - - req, err := client.AddPreparer(ctx, applicationCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client AppsClient) AddPreparer(ctx context.Context, applicationCreateObject ApplicationCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPath("/apps/"), - autorest.WithJSON(applicationCreateObject)) - 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 AppsClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 AppsClient) AddResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// AddCustomPrebuiltDomain adds a prebuilt domain along with its models as a new application. -// Parameters: -// prebuiltDomainCreateObject - a prebuilt domain create object containing the name and culture of the domain. -func (client AppsClient) AddCustomPrebuiltDomain(ctx context.Context, prebuiltDomainCreateObject PrebuiltDomainCreateObject) (result UUID, err error) { - req, err := client.AddCustomPrebuiltDomainPreparer(ctx, prebuiltDomainCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "AddCustomPrebuiltDomain", nil, "Failure preparing request") - return - } - - resp, err := client.AddCustomPrebuiltDomainSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "AddCustomPrebuiltDomain", resp, "Failure sending request") - return - } - - result, err = client.AddCustomPrebuiltDomainResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "AddCustomPrebuiltDomain", resp, "Failure responding to request") - } - - return -} - -// AddCustomPrebuiltDomainPreparer prepares the AddCustomPrebuiltDomain request. -func (client AppsClient) AddCustomPrebuiltDomainPreparer(ctx context.Context, prebuiltDomainCreateObject PrebuiltDomainCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPath("/apps/customprebuiltdomains"), - autorest.WithJSON(prebuiltDomainCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddCustomPrebuiltDomainSender sends the AddCustomPrebuiltDomain request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) AddCustomPrebuiltDomainSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddCustomPrebuiltDomainResponder handles the response to the AddCustomPrebuiltDomain request. The method always -// closes the http.Response Body. -func (client AppsClient) AddCustomPrebuiltDomainResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes an application. -// Parameters: -// appID - the application ID. -func (client AppsClient) Delete(ctx context.Context, appID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeletePreparer(ctx, appID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AppsClient) DeletePreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}", 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 AppsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 AppsClient) 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 -} - -// DownloadQueryLogs gets the query logs of the past month for the application. -// Parameters: -// appID - the application ID. -func (client AppsClient) DownloadQueryLogs(ctx context.Context, appID uuid.UUID) (result ReadCloser, err error) { - req, err := client.DownloadQueryLogsPreparer(ctx, appID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "DownloadQueryLogs", nil, "Failure preparing request") - return - } - - resp, err := client.DownloadQueryLogsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "DownloadQueryLogs", resp, "Failure sending request") - return - } - - result, err = client.DownloadQueryLogsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "DownloadQueryLogs", resp, "Failure responding to request") - } - - return -} - -// DownloadQueryLogsPreparer prepares the DownloadQueryLogs request. -func (client AppsClient) DownloadQueryLogsPreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/querylogs", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DownloadQueryLogsSender sends the DownloadQueryLogs request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) DownloadQueryLogsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DownloadQueryLogsResponder handles the response to the DownloadQueryLogs request. The method always -// closes the http.Response Body. -func (client AppsClient) DownloadQueryLogsResponder(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 -} - -// Get gets the application info. -// Parameters: -// appID - the application ID. -func (client AppsClient) Get(ctx context.Context, appID uuid.UUID) (result ApplicationInfoResponse, err error) { - req, err := client.GetPreparer(ctx, appID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client AppsClient) GetPreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}", 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 AppsClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 AppsClient) GetResponder(resp *http.Response) (result ApplicationInfoResponse, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetSettings get the application settings. -// Parameters: -// appID - the application ID. -func (client AppsClient) GetSettings(ctx context.Context, appID uuid.UUID) (result ApplicationSettings, err error) { - req, err := client.GetSettingsPreparer(ctx, appID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "GetSettings", nil, "Failure preparing request") - return - } - - resp, err := client.GetSettingsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "GetSettings", resp, "Failure sending request") - return - } - - result, err = client.GetSettingsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "GetSettings", resp, "Failure responding to request") - } - - return -} - -// GetSettingsPreparer prepares the GetSettings request. -func (client AppsClient) GetSettingsPreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/settings", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSettingsSender sends the GetSettings request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) GetSettingsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetSettingsResponder handles the response to the GetSettings request. The method always -// closes the http.Response Body. -func (client AppsClient) GetSettingsResponder(resp *http.Response) (result ApplicationSettings, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Import imports an application to LUIS, the application's structure should be included in in the request body. -// Parameters: -// luisApp - a LUIS application structure. -// appName - the application name to create. If not specified, the application name will be read from the -// imported object. -func (client AppsClient) Import(ctx context.Context, luisApp LuisApp, appName string) (result UUID, err error) { - req, err := client.ImportPreparer(ctx, luisApp, appName) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Import", nil, "Failure preparing request") - return - } - - resp, err := client.ImportSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Import", resp, "Failure sending request") - return - } - - result, err = client.ImportResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Import", resp, "Failure responding to request") - } - - return -} - -// ImportPreparer prepares the Import request. -func (client AppsClient) ImportPreparer(ctx context.Context, luisApp LuisApp, appName string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - queryParameters := map[string]interface{}{} - if len(appName) > 0 { - queryParameters["appName"] = autorest.Encode("query", appName) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPath("/apps/import"), - autorest.WithJSON(luisApp), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ImportSender sends the Import request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ImportSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ImportResponder handles the response to the Import request. The method always -// closes the http.Response Body. -func (client AppsClient) ImportResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all of the user applications. -// Parameters: -// 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 AppsClient) List(ctx context.Context, skip *int32, take *int32) (result ListApplicationInfoResponse, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.AppsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client AppsClient) ListPreparer(ctx context.Context, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPath("/apps/"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 AppsClient) ListResponder(resp *http.Response) (result ListApplicationInfoResponse, 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 -} - -// ListAvailableCustomPrebuiltDomains gets all the available custom prebuilt domains for all cultures. -func (client AppsClient) ListAvailableCustomPrebuiltDomains(ctx context.Context) (result ListPrebuiltDomain, err error) { - req, err := client.ListAvailableCustomPrebuiltDomainsPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListAvailableCustomPrebuiltDomains", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableCustomPrebuiltDomainsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListAvailableCustomPrebuiltDomains", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableCustomPrebuiltDomainsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListAvailableCustomPrebuiltDomains", resp, "Failure responding to request") - } - - return -} - -// ListAvailableCustomPrebuiltDomainsPreparer prepares the ListAvailableCustomPrebuiltDomains request. -func (client AppsClient) ListAvailableCustomPrebuiltDomainsPreparer(ctx context.Context) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPath("/apps/customprebuiltdomains")) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableCustomPrebuiltDomainsSender sends the ListAvailableCustomPrebuiltDomains request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListAvailableCustomPrebuiltDomainsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListAvailableCustomPrebuiltDomainsResponder handles the response to the ListAvailableCustomPrebuiltDomains request. The method always -// closes the http.Response Body. -func (client AppsClient) ListAvailableCustomPrebuiltDomainsResponder(resp *http.Response) (result ListPrebuiltDomain, 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 -} - -// ListAvailableCustomPrebuiltDomainsForCulture gets all the available custom prebuilt domains for a specific culture. -// Parameters: -// culture - culture. -func (client AppsClient) ListAvailableCustomPrebuiltDomainsForCulture(ctx context.Context, culture string) (result ListPrebuiltDomain, err error) { - req, err := client.ListAvailableCustomPrebuiltDomainsForCulturePreparer(ctx, culture) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListAvailableCustomPrebuiltDomainsForCulture", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableCustomPrebuiltDomainsForCultureSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListAvailableCustomPrebuiltDomainsForCulture", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableCustomPrebuiltDomainsForCultureResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListAvailableCustomPrebuiltDomainsForCulture", resp, "Failure responding to request") - } - - return -} - -// ListAvailableCustomPrebuiltDomainsForCulturePreparer prepares the ListAvailableCustomPrebuiltDomainsForCulture request. -func (client AppsClient) ListAvailableCustomPrebuiltDomainsForCulturePreparer(ctx context.Context, culture string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "culture": autorest.Encode("path", culture), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/customprebuiltdomains/{culture}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableCustomPrebuiltDomainsForCultureSender sends the ListAvailableCustomPrebuiltDomainsForCulture request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListAvailableCustomPrebuiltDomainsForCultureSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListAvailableCustomPrebuiltDomainsForCultureResponder handles the response to the ListAvailableCustomPrebuiltDomainsForCulture request. The method always -// closes the http.Response Body. -func (client AppsClient) ListAvailableCustomPrebuiltDomainsForCultureResponder(resp *http.Response) (result ListPrebuiltDomain, 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 -} - -// ListCortanaEndpoints gets the endpoint URLs for the prebuilt Cortana applications. -func (client AppsClient) ListCortanaEndpoints(ctx context.Context) (result PersonalAssistantsResponse, err error) { - req, err := client.ListCortanaEndpointsPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListCortanaEndpoints", nil, "Failure preparing request") - return - } - - resp, err := client.ListCortanaEndpointsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListCortanaEndpoints", resp, "Failure sending request") - return - } - - result, err = client.ListCortanaEndpointsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListCortanaEndpoints", resp, "Failure responding to request") - } - - return -} - -// ListCortanaEndpointsPreparer prepares the ListCortanaEndpoints request. -func (client AppsClient) ListCortanaEndpointsPreparer(ctx context.Context) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPath("/apps/assistants")) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListCortanaEndpointsSender sends the ListCortanaEndpoints request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListCortanaEndpointsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListCortanaEndpointsResponder handles the response to the ListCortanaEndpoints request. The method always -// closes the http.Response Body. -func (client AppsClient) ListCortanaEndpointsResponder(resp *http.Response) (result PersonalAssistantsResponse, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListDomains gets the available application domains. -func (client AppsClient) ListDomains(ctx context.Context) (result ListString, err error) { - req, err := client.ListDomainsPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListDomains", nil, "Failure preparing request") - return - } - - resp, err := client.ListDomainsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListDomains", resp, "Failure sending request") - return - } - - result, err = client.ListDomainsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListDomains", resp, "Failure responding to request") - } - - return -} - -// ListDomainsPreparer prepares the ListDomains request. -func (client AppsClient) ListDomainsPreparer(ctx context.Context) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPath("/apps/domains")) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListDomainsSender sends the ListDomains request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListDomainsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListDomainsResponder handles the response to the ListDomains request. The method always -// closes the http.Response Body. -func (client AppsClient) ListDomainsResponder(resp *http.Response) (result ListString, 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 -} - -// ListEndpoints returns the available endpoint deployment regions and URLs. -// Parameters: -// appID - the application ID. -func (client AppsClient) ListEndpoints(ctx context.Context, appID uuid.UUID) (result SetString, err error) { - req, err := client.ListEndpointsPreparer(ctx, appID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListEndpoints", nil, "Failure preparing request") - return - } - - resp, err := client.ListEndpointsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListEndpoints", resp, "Failure sending request") - return - } - - result, err = client.ListEndpointsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListEndpoints", resp, "Failure responding to request") - } - - return -} - -// ListEndpointsPreparer prepares the ListEndpoints request. -func (client AppsClient) ListEndpointsPreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/endpoints", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListEndpointsSender sends the ListEndpoints request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListEndpointsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListEndpointsResponder handles the response to the ListEndpoints request. The method always -// closes the http.Response Body. -func (client AppsClient) ListEndpointsResponder(resp *http.Response) (result SetString, 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 -} - -// ListSupportedCultures gets the supported application cultures. -func (client AppsClient) ListSupportedCultures(ctx context.Context) (result ListAvailableCulture, err error) { - req, err := client.ListSupportedCulturesPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListSupportedCultures", nil, "Failure preparing request") - return - } - - resp, err := client.ListSupportedCulturesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListSupportedCultures", resp, "Failure sending request") - return - } - - result, err = client.ListSupportedCulturesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListSupportedCultures", resp, "Failure responding to request") - } - - return -} - -// ListSupportedCulturesPreparer prepares the ListSupportedCultures request. -func (client AppsClient) ListSupportedCulturesPreparer(ctx context.Context) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPath("/apps/cultures")) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSupportedCulturesSender sends the ListSupportedCultures request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListSupportedCulturesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListSupportedCulturesResponder handles the response to the ListSupportedCultures request. The method always -// closes the http.Response Body. -func (client AppsClient) ListSupportedCulturesResponder(resp *http.Response) (result ListAvailableCulture, 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 -} - -// ListUsageScenarios gets the application available usage scenarios. -func (client AppsClient) ListUsageScenarios(ctx context.Context) (result ListString, err error) { - req, err := client.ListUsageScenariosPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListUsageScenarios", nil, "Failure preparing request") - return - } - - resp, err := client.ListUsageScenariosSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListUsageScenarios", resp, "Failure sending request") - return - } - - result, err = client.ListUsageScenariosResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListUsageScenarios", resp, "Failure responding to request") - } - - return -} - -// ListUsageScenariosPreparer prepares the ListUsageScenarios request. -func (client AppsClient) ListUsageScenariosPreparer(ctx context.Context) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPath("/apps/usagescenarios")) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListUsageScenariosSender sends the ListUsageScenarios request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListUsageScenariosSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListUsageScenariosResponder handles the response to the ListUsageScenarios request. The method always -// closes the http.Response Body. -func (client AppsClient) ListUsageScenariosResponder(resp *http.Response) (result ListString, 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 -} - -// Publish publishes a specific version of the application. -// Parameters: -// appID - the application ID. -// applicationPublishObject - the application publish object. The region is the target region that the -// application is published to. -func (client AppsClient) Publish(ctx context.Context, appID uuid.UUID, applicationPublishObject ApplicationPublishObject) (result ProductionOrStagingEndpointInfo, err error) { - req, err := client.PublishPreparer(ctx, appID, applicationPublishObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Publish", nil, "Failure preparing request") - return - } - - resp, err := client.PublishSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Publish", resp, "Failure sending request") - return - } - - result, err = client.PublishResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Publish", resp, "Failure responding to request") - } - - return -} - -// PublishPreparer prepares the Publish request. -func (client AppsClient) PublishPreparer(ctx context.Context, appID uuid.UUID, applicationPublishObject ApplicationPublishObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/publish", pathParameters), - autorest.WithJSON(applicationPublishObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PublishSender sends the Publish request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) PublishSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PublishResponder handles the response to the Publish request. The method always -// closes the http.Response Body. -func (client AppsClient) PublishResponder(resp *http.Response) (result ProductionOrStagingEndpointInfo, 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 updates the name or description of the application. -// Parameters: -// appID - the application ID. -// applicationUpdateObject - a model containing Name and Description of the application. -func (client AppsClient) Update(ctx context.Context, appID uuid.UUID, applicationUpdateObject ApplicationUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdatePreparer(ctx, appID, applicationUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client AppsClient) UpdatePreparer(ctx context.Context, appID uuid.UUID, applicationUpdateObject ApplicationUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}", pathParameters), - autorest.WithJSON(applicationUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 AppsClient) 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 -} - -// UpdateSettings updates the application settings. -// Parameters: -// appID - the application ID. -// applicationSettingUpdateObject - an object containing the new application settings. -func (client AppsClient) UpdateSettings(ctx context.Context, appID uuid.UUID, applicationSettingUpdateObject ApplicationSettingUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdateSettingsPreparer(ctx, appID, applicationSettingUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "UpdateSettings", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSettingsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "UpdateSettings", resp, "Failure sending request") - return - } - - result, err = client.UpdateSettingsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "UpdateSettings", resp, "Failure responding to request") - } - - return -} - -// UpdateSettingsPreparer prepares the UpdateSettings request. -func (client AppsClient) UpdateSettingsPreparer(ctx context.Context, appID uuid.UUID, applicationSettingUpdateObject ApplicationSettingUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/settings", pathParameters), - autorest.WithJSON(applicationSettingUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSettingsSender sends the UpdateSettings request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) UpdateSettingsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateSettingsResponder handles the response to the UpdateSettings request. The method always -// closes the http.Response Body. -func (client AppsClient) UpdateSettingsResponder(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/cognitiveservices/v2.0/luis/programmatic/examples.go b/services/cognitiveservices/v2.0/luis/programmatic/examples.go deleted file mode 100644 index acd013b03457..000000000000 --- a/services/cognitiveservices/v2.0/luis/programmatic/examples.go +++ /dev/null @@ -1,334 +0,0 @@ -package programmatic - -// 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/satori/go.uuid" - "net/http" -) - -// ExamplesClient is the client for the Examples methods of the Programmatic service. -type ExamplesClient struct { - BaseClient -} - -// NewExamplesClient creates an instance of the ExamplesClient client. -func NewExamplesClient(azureRegion AzureRegions) ExamplesClient { - return ExamplesClient{New(azureRegion)} -} - -// Add adds a labeled example to the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// exampleLabelObject - an example label with the expected intent and entities. -func (client ExamplesClient) Add(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObject ExampleLabelObject) (result LabelExampleResponse, err error) { - req, err := client.AddPreparer(ctx, appID, versionID, exampleLabelObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client ExamplesClient) AddPreparer(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObject ExampleLabelObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/example", pathParameters), - autorest.WithJSON(exampleLabelObject)) - 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 ExamplesClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ExamplesClient) AddResponder(resp *http.Response) (result LabelExampleResponse, 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 -} - -// Batch adds a batch of labeled examples to the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// exampleLabelObjectArray - array of examples. -func (client ExamplesClient) Batch(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObjectArray []ExampleLabelObject) (result ListBatchLabelExample, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: exampleLabelObjectArray, - Constraints: []validation.Constraint{{Target: "exampleLabelObjectArray", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("programmatic.ExamplesClient", "Batch", err.Error()) - } - - req, err := client.BatchPreparer(ctx, appID, versionID, exampleLabelObjectArray) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Batch", nil, "Failure preparing request") - return - } - - resp, err := client.BatchSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Batch", resp, "Failure sending request") - return - } - - result, err = client.BatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Batch", resp, "Failure responding to request") - } - - return -} - -// BatchPreparer prepares the Batch request. -func (client ExamplesClient) BatchPreparer(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObjectArray []ExampleLabelObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/examples", pathParameters), - autorest.WithJSON(exampleLabelObjectArray)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// BatchSender sends the Batch request. The method will close the -// http.Response Body if it receives an error. -func (client ExamplesClient) BatchSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// BatchResponder handles the response to the Batch request. The method always -// closes the http.Response Body. -func (client ExamplesClient) BatchResponder(resp *http.Response) (result ListBatchLabelExample, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusMultiStatus), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the labeled example with the specified ID. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// exampleID - the example ID. -func (client ExamplesClient) Delete(ctx context.Context, appID uuid.UUID, versionID string, exampleID int32) (result OperationStatus, err error) { - req, err := client.DeletePreparer(ctx, appID, versionID, exampleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExamplesClient) DeletePreparer(ctx context.Context, appID uuid.UUID, versionID string, exampleID int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "exampleId": autorest.Encode("path", exampleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/examples/{exampleId}", 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 ExamplesClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ExamplesClient) 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 returns examples to be reviewed. -// Parameters: -// appID - the application ID. -// 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) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.ExamplesClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, appID, versionID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ExamplesClient) ListPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/examples", 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 ExamplesClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ExamplesClient) ListResponder(resp *http.Response) (result ListLabeledUtterance, 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/cognitiveservices/v2.0/luis/programmatic/features.go b/services/cognitiveservices/v2.0/luis/programmatic/features.go deleted file mode 100644 index 794806e2c662..000000000000 --- a/services/cognitiveservices/v2.0/luis/programmatic/features.go +++ /dev/null @@ -1,492 +0,0 @@ -package programmatic - -// 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/satori/go.uuid" - "net/http" -) - -// FeaturesClient is the client for the Features methods of the Programmatic service. -type FeaturesClient struct { - BaseClient -} - -// NewFeaturesClient creates an instance of the FeaturesClient client. -func NewFeaturesClient(azureRegion AzureRegions) FeaturesClient { - return FeaturesClient{New(azureRegion)} -} - -// AddPhraseList creates a new phraselist feature. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// phraselistCreateObject - a Phraselist object containing Name, comma-separated Phrases and the isExchangeable -// boolean. Default value for isExchangeable is true. -func (client FeaturesClient) AddPhraseList(ctx context.Context, appID uuid.UUID, versionID string, phraselistCreateObject PhraselistCreateObject) (result Int32, err error) { - req, err := client.AddPhraseListPreparer(ctx, appID, versionID, phraselistCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "AddPhraseList", nil, "Failure preparing request") - return - } - - resp, err := client.AddPhraseListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "AddPhraseList", resp, "Failure sending request") - return - } - - result, err = client.AddPhraseListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "AddPhraseList", resp, "Failure responding to request") - } - - return -} - -// AddPhraseListPreparer prepares the AddPhraseList request. -func (client FeaturesClient) AddPhraseListPreparer(ctx context.Context, appID uuid.UUID, versionID string, phraselistCreateObject PhraselistCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists", pathParameters), - autorest.WithJSON(phraselistCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddPhraseListSender sends the AddPhraseList request. The method will close the -// http.Response Body if it receives an error. -func (client FeaturesClient) AddPhraseListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddPhraseListResponder handles the response to the AddPhraseList request. The method always -// closes the http.Response Body. -func (client FeaturesClient) AddPhraseListResponder(resp *http.Response) (result Int32, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// DeletePhraseList deletes a phraselist feature. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// phraselistID - the ID of the feature to be deleted. -func (client FeaturesClient) DeletePhraseList(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32) (result OperationStatus, err error) { - req, err := client.DeletePhraseListPreparer(ctx, appID, versionID, phraselistID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "DeletePhraseList", nil, "Failure preparing request") - return - } - - resp, err := client.DeletePhraseListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "DeletePhraseList", resp, "Failure sending request") - return - } - - result, err = client.DeletePhraseListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "DeletePhraseList", resp, "Failure responding to request") - } - - return -} - -// DeletePhraseListPreparer prepares the DeletePhraseList request. -func (client FeaturesClient) DeletePhraseListPreparer(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "phraselistId": autorest.Encode("path", phraselistID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeletePhraseListSender sends the DeletePhraseList request. The method will close the -// http.Response Body if it receives an error. -func (client FeaturesClient) DeletePhraseListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeletePhraseListResponder handles the response to the DeletePhraseList request. The method always -// closes the http.Response Body. -func (client FeaturesClient) DeletePhraseListResponder(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 -} - -// GetPhraseList gets phraselist feature info. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// phraselistID - the ID of the feature to be retrieved. -func (client FeaturesClient) GetPhraseList(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32) (result PhraseListFeatureInfo, err error) { - req, err := client.GetPhraseListPreparer(ctx, appID, versionID, phraselistID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "GetPhraseList", nil, "Failure preparing request") - return - } - - resp, err := client.GetPhraseListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "GetPhraseList", resp, "Failure sending request") - return - } - - result, err = client.GetPhraseListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "GetPhraseList", resp, "Failure responding to request") - } - - return -} - -// GetPhraseListPreparer prepares the GetPhraseList request. -func (client FeaturesClient) GetPhraseListPreparer(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "phraselistId": autorest.Encode("path", phraselistID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPhraseListSender sends the GetPhraseList request. The method will close the -// http.Response Body if it receives an error. -func (client FeaturesClient) GetPhraseListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPhraseListResponder handles the response to the GetPhraseList request. The method always -// closes the http.Response Body. -func (client FeaturesClient) GetPhraseListResponder(resp *http.Response) (result PhraseListFeatureInfo, 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 the extraction features for the specified application version. -// Parameters: -// appID - the application ID. -// 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 FeaturesClient) List(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result FeaturesResponseObject, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.FeaturesClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, appID, versionID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client FeaturesClient) ListPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/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 FeaturesClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 FeaturesClient) ListResponder(resp *http.Response) (result FeaturesResponseObject, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListPhraseLists gets all the phraselist features. -// Parameters: -// appID - the application ID. -// 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 FeaturesClient) ListPhraseLists(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListPhraseListFeatureInfo, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.FeaturesClient", "ListPhraseLists", err.Error()) - } - - req, err := client.ListPhraseListsPreparer(ctx, appID, versionID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "ListPhraseLists", nil, "Failure preparing request") - return - } - - resp, err := client.ListPhraseListsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "ListPhraseLists", resp, "Failure sending request") - return - } - - result, err = client.ListPhraseListsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "ListPhraseLists", resp, "Failure responding to request") - } - - return -} - -// ListPhraseListsPreparer prepares the ListPhraseLists request. -func (client FeaturesClient) ListPhraseListsPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPhraseListsSender sends the ListPhraseLists request. The method will close the -// http.Response Body if it receives an error. -func (client FeaturesClient) ListPhraseListsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListPhraseListsResponder handles the response to the ListPhraseLists request. The method always -// closes the http.Response Body. -func (client FeaturesClient) ListPhraseListsResponder(resp *http.Response) (result ListPhraseListFeatureInfo, 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 -} - -// UpdatePhraseList updates the phrases, the state and the name of the phraselist feature. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// phraselistID - the ID of the feature to be updated. -// phraselistUpdateObject - the new values for: - Just a boolean called IsActive, in which case the status of -// the feature will be changed. - Name, Pattern, Mode, and a boolean called IsActive to update the feature. -func (client FeaturesClient) UpdatePhraseList(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32, phraselistUpdateObject *PhraselistUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdatePhraseListPreparer(ctx, appID, versionID, phraselistID, phraselistUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "UpdatePhraseList", nil, "Failure preparing request") - return - } - - resp, err := client.UpdatePhraseListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "UpdatePhraseList", resp, "Failure sending request") - return - } - - result, err = client.UpdatePhraseListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "UpdatePhraseList", resp, "Failure responding to request") - } - - return -} - -// UpdatePhraseListPreparer prepares the UpdatePhraseList request. -func (client FeaturesClient) UpdatePhraseListPreparer(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32, phraselistUpdateObject *PhraselistUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "phraselistId": autorest.Encode("path", phraselistID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}", pathParameters)) - if phraselistUpdateObject != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(phraselistUpdateObject)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdatePhraseListSender sends the UpdatePhraseList request. The method will close the -// http.Response Body if it receives an error. -func (client FeaturesClient) UpdatePhraseListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdatePhraseListResponder handles the response to the UpdatePhraseList request. The method always -// closes the http.Response Body. -func (client FeaturesClient) UpdatePhraseListResponder(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/cognitiveservices/v2.0/luis/programmatic/model.go b/services/cognitiveservices/v2.0/luis/programmatic/model.go deleted file mode 100644 index 46e9587d519e..000000000000 --- a/services/cognitiveservices/v2.0/luis/programmatic/model.go +++ /dev/null @@ -1,7411 +0,0 @@ -package programmatic - -// 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/satori/go.uuid" - "net/http" -) - -// ModelClient is the client for the Model methods of the Programmatic service. -type ModelClient struct { - BaseClient -} - -// NewModelClient creates an instance of the ModelClient client. -func NewModelClient(azureRegion AzureRegions) ModelClient { - return ModelClient{New(azureRegion)} -} - -// AddClosedList adds a closed list model to the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// closedListModelCreateObject - a model containing the name and words for the new closed list entity -// extractor. -func (client ModelClient) AddClosedList(ctx context.Context, appID uuid.UUID, versionID string, closedListModelCreateObject ClosedListModelCreateObject) (result UUID, err error) { - req, err := client.AddClosedListPreparer(ctx, appID, versionID, closedListModelCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddClosedList", nil, "Failure preparing request") - return - } - - resp, err := client.AddClosedListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddClosedList", resp, "Failure sending request") - return - } - - result, err = client.AddClosedListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddClosedList", resp, "Failure responding to request") - } - - return -} - -// AddClosedListPreparer prepares the AddClosedList request. -func (client ModelClient) AddClosedListPreparer(ctx context.Context, appID uuid.UUID, versionID string, closedListModelCreateObject ClosedListModelCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists", pathParameters), - autorest.WithJSON(closedListModelCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddClosedListSender sends the AddClosedList request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) AddClosedListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddClosedListResponder handles the response to the AddClosedList request. The method always -// closes the http.Response Body. -func (client ModelClient) AddClosedListResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// AddCompositeEntity adds a composite entity extractor to the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// compositeModelCreateObject - a model containing the name and children of the new entity extractor. -func (client ModelClient) AddCompositeEntity(ctx context.Context, appID uuid.UUID, versionID string, compositeModelCreateObject CompositeEntityModel) (result UUID, err error) { - req, err := client.AddCompositeEntityPreparer(ctx, appID, versionID, compositeModelCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCompositeEntity", nil, "Failure preparing request") - return - } - - resp, err := client.AddCompositeEntitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCompositeEntity", resp, "Failure sending request") - return - } - - result, err = client.AddCompositeEntityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCompositeEntity", resp, "Failure responding to request") - } - - return -} - -// AddCompositeEntityPreparer prepares the AddCompositeEntity request. -func (client ModelClient) AddCompositeEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, compositeModelCreateObject CompositeEntityModel) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities", pathParameters), - autorest.WithJSON(compositeModelCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddCompositeEntitySender sends the AddCompositeEntity request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) AddCompositeEntitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddCompositeEntityResponder handles the response to the AddCompositeEntity request. The method always -// closes the http.Response Body. -func (client ModelClient) AddCompositeEntityResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// AddCompositeEntityChild creates a single child in an existing composite entity model. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// cEntityID - the composite entity extractor ID. -// compositeChildModelCreateObject - a model object containing the name of the new composite child model. -func (client ModelClient) AddCompositeEntityChild(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, compositeChildModelCreateObject CompositeChildModelCreateObject) (result UUID, err error) { - req, err := client.AddCompositeEntityChildPreparer(ctx, appID, versionID, cEntityID, compositeChildModelCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCompositeEntityChild", nil, "Failure preparing request") - return - } - - resp, err := client.AddCompositeEntityChildSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCompositeEntityChild", resp, "Failure sending request") - return - } - - result, err = client.AddCompositeEntityChildResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCompositeEntityChild", resp, "Failure responding to request") - } - - return -} - -// AddCompositeEntityChildPreparer prepares the AddCompositeEntityChild request. -func (client ModelClient) AddCompositeEntityChildPreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, compositeChildModelCreateObject CompositeChildModelCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "cEntityId": autorest.Encode("path", cEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children", pathParameters), - autorest.WithJSON(compositeChildModelCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddCompositeEntityChildSender sends the AddCompositeEntityChild request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) AddCompositeEntityChildSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddCompositeEntityChildResponder handles the response to the AddCompositeEntityChild request. The method always -// closes the http.Response Body. -func (client ModelClient) AddCompositeEntityChildResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// AddCustomPrebuiltDomain adds a customizable prebuilt domain along with all of its models to this application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// prebuiltDomainObject - a prebuilt domain create object containing the name of the domain. -func (client ModelClient) AddCustomPrebuiltDomain(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainObject PrebuiltDomainCreateBaseObject) (result ListUUID, err error) { - req, err := client.AddCustomPrebuiltDomainPreparer(ctx, appID, versionID, prebuiltDomainObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltDomain", nil, "Failure preparing request") - return - } - - resp, err := client.AddCustomPrebuiltDomainSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltDomain", resp, "Failure sending request") - return - } - - result, err = client.AddCustomPrebuiltDomainResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltDomain", resp, "Failure responding to request") - } - - return -} - -// AddCustomPrebuiltDomainPreparer prepares the AddCustomPrebuiltDomain request. -func (client ModelClient) AddCustomPrebuiltDomainPreparer(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainObject PrebuiltDomainCreateBaseObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltdomains", pathParameters), - autorest.WithJSON(prebuiltDomainObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddCustomPrebuiltDomainSender sends the AddCustomPrebuiltDomain request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) AddCustomPrebuiltDomainSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddCustomPrebuiltDomainResponder handles the response to the AddCustomPrebuiltDomain request. The method always -// closes the http.Response Body. -func (client ModelClient) AddCustomPrebuiltDomainResponder(resp *http.Response) (result ListUUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// AddCustomPrebuiltEntity adds a custom prebuilt entity model to the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// prebuiltDomainModelCreateObject - a model object containing the name of the custom prebuilt entity and the -// name of the domain to which this model belongs. -func (client ModelClient) AddCustomPrebuiltEntity(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainModelCreateObject PrebuiltDomainModelCreateObject) (result UUID, err error) { - req, err := client.AddCustomPrebuiltEntityPreparer(ctx, appID, versionID, prebuiltDomainModelCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltEntity", nil, "Failure preparing request") - return - } - - resp, err := client.AddCustomPrebuiltEntitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltEntity", resp, "Failure sending request") - return - } - - result, err = client.AddCustomPrebuiltEntityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltEntity", resp, "Failure responding to request") - } - - return -} - -// AddCustomPrebuiltEntityPreparer prepares the AddCustomPrebuiltEntity request. -func (client ModelClient) AddCustomPrebuiltEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainModelCreateObject PrebuiltDomainModelCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities", pathParameters), - autorest.WithJSON(prebuiltDomainModelCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddCustomPrebuiltEntitySender sends the AddCustomPrebuiltEntity request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) AddCustomPrebuiltEntitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddCustomPrebuiltEntityResponder handles the response to the AddCustomPrebuiltEntity request. The method always -// closes the http.Response Body. -func (client ModelClient) AddCustomPrebuiltEntityResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// AddCustomPrebuiltIntent adds a custom prebuilt intent model to the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// prebuiltDomainModelCreateObject - a model object containing the name of the custom prebuilt intent and the -// name of the domain to which this model belongs. -func (client ModelClient) AddCustomPrebuiltIntent(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainModelCreateObject PrebuiltDomainModelCreateObject) (result UUID, err error) { - req, err := client.AddCustomPrebuiltIntentPreparer(ctx, appID, versionID, prebuiltDomainModelCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltIntent", nil, "Failure preparing request") - return - } - - resp, err := client.AddCustomPrebuiltIntentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltIntent", resp, "Failure sending request") - return - } - - result, err = client.AddCustomPrebuiltIntentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltIntent", resp, "Failure responding to request") - } - - return -} - -// AddCustomPrebuiltIntentPreparer prepares the AddCustomPrebuiltIntent request. -func (client ModelClient) AddCustomPrebuiltIntentPreparer(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainModelCreateObject PrebuiltDomainModelCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltintents", pathParameters), - autorest.WithJSON(prebuiltDomainModelCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddCustomPrebuiltIntentSender sends the AddCustomPrebuiltIntent request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) AddCustomPrebuiltIntentSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddCustomPrebuiltIntentResponder handles the response to the AddCustomPrebuiltIntent request. The method always -// closes the http.Response Body. -func (client ModelClient) AddCustomPrebuiltIntentResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// AddEntity adds an entity extractor to the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// modelCreateObject - a model object containing the name for the new entity extractor. -func (client ModelClient) AddEntity(ctx context.Context, appID uuid.UUID, versionID string, modelCreateObject ModelCreateObject) (result UUID, err error) { - req, err := client.AddEntityPreparer(ctx, appID, versionID, modelCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddEntity", nil, "Failure preparing request") - return - } - - resp, err := client.AddEntitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddEntity", resp, "Failure sending request") - return - } - - result, err = client.AddEntityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddEntity", resp, "Failure responding to request") - } - - return -} - -// AddEntityPreparer prepares the AddEntity request. -func (client ModelClient) AddEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, modelCreateObject ModelCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities", pathParameters), - autorest.WithJSON(modelCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddEntitySender sends the AddEntity request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) AddEntitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddEntityResponder handles the response to the AddEntity request. The method always -// closes the http.Response Body. -func (client ModelClient) AddEntityResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// AddExplicitListItem sends the add explicit list item request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the Pattern.Any entity extractor ID. -// item - the new explicit list item. -func (client ModelClient) AddExplicitListItem(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, item ExplicitListItemCreateObject) (result Int32, err error) { - req, err := client.AddExplicitListItemPreparer(ctx, appID, versionID, entityID, item) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddExplicitListItem", nil, "Failure preparing request") - return - } - - resp, err := client.AddExplicitListItemSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddExplicitListItem", resp, "Failure sending request") - return - } - - result, err = client.AddExplicitListItemResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddExplicitListItem", resp, "Failure responding to request") - } - - return -} - -// AddExplicitListItemPreparer prepares the AddExplicitListItem request. -func (client ModelClient) AddExplicitListItemPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, item ExplicitListItemCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist", pathParameters), - autorest.WithJSON(item)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddExplicitListItemSender sends the AddExplicitListItem request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) AddExplicitListItemSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddExplicitListItemResponder handles the response to the AddExplicitListItem request. The method always -// closes the http.Response Body. -func (client ModelClient) AddExplicitListItemResponder(resp *http.Response) (result Int32, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// AddHierarchicalEntity adds a hierarchical entity extractor to the application version. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// hierarchicalModelCreateObject - a model containing the name and children of the new entity extractor. -func (client ModelClient) AddHierarchicalEntity(ctx context.Context, appID uuid.UUID, versionID string, hierarchicalModelCreateObject HierarchicalEntityModel) (result UUID, err error) { - req, err := client.AddHierarchicalEntityPreparer(ctx, appID, versionID, hierarchicalModelCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddHierarchicalEntity", nil, "Failure preparing request") - return - } - - resp, err := client.AddHierarchicalEntitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddHierarchicalEntity", resp, "Failure sending request") - return - } - - result, err = client.AddHierarchicalEntityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddHierarchicalEntity", resp, "Failure responding to request") - } - - return -} - -// AddHierarchicalEntityPreparer prepares the AddHierarchicalEntity request. -func (client ModelClient) AddHierarchicalEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, hierarchicalModelCreateObject HierarchicalEntityModel) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities", pathParameters), - autorest.WithJSON(hierarchicalModelCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddHierarchicalEntitySender sends the AddHierarchicalEntity request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) AddHierarchicalEntitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddHierarchicalEntityResponder handles the response to the AddHierarchicalEntity request. The method always -// closes the http.Response Body. -func (client ModelClient) AddHierarchicalEntityResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// AddHierarchicalEntityChild creates a single child in an existing hierarchical entity model. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// hEntityID - the hierarchical entity extractor ID. -// hierarchicalChildModelCreateObject - a model object containing the name of the new hierarchical child model. -func (client ModelClient) AddHierarchicalEntityChild(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hierarchicalChildModelCreateObject HierarchicalChildModelCreateObject) (result UUID, err error) { - req, err := client.AddHierarchicalEntityChildPreparer(ctx, appID, versionID, hEntityID, hierarchicalChildModelCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddHierarchicalEntityChild", nil, "Failure preparing request") - return - } - - resp, err := client.AddHierarchicalEntityChildSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddHierarchicalEntityChild", resp, "Failure sending request") - return - } - - result, err = client.AddHierarchicalEntityChildResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddHierarchicalEntityChild", resp, "Failure responding to request") - } - - return -} - -// AddHierarchicalEntityChildPreparer prepares the AddHierarchicalEntityChild request. -func (client ModelClient) AddHierarchicalEntityChildPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hierarchicalChildModelCreateObject HierarchicalChildModelCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "hEntityId": autorest.Encode("path", hEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children", pathParameters), - autorest.WithJSON(hierarchicalChildModelCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddHierarchicalEntityChildSender sends the AddHierarchicalEntityChild request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) AddHierarchicalEntityChildSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddHierarchicalEntityChildResponder handles the response to the AddHierarchicalEntityChild request. The method always -// closes the http.Response Body. -func (client ModelClient) AddHierarchicalEntityChildResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// AddIntent adds an intent classifier to the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// intentCreateObject - a model object containing the name of the new intent classifier. -func (client ModelClient) AddIntent(ctx context.Context, appID uuid.UUID, versionID string, intentCreateObject ModelCreateObject) (result UUID, err error) { - req, err := client.AddIntentPreparer(ctx, appID, versionID, intentCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddIntent", nil, "Failure preparing request") - return - } - - resp, err := client.AddIntentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddIntent", resp, "Failure sending request") - return - } - - result, err = client.AddIntentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddIntent", resp, "Failure responding to request") - } - - return -} - -// AddIntentPreparer prepares the AddIntent request. -func (client ModelClient) AddIntentPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentCreateObject ModelCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents", pathParameters), - autorest.WithJSON(intentCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddIntentSender sends the AddIntent request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) AddIntentSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddIntentResponder handles the response to the AddIntent request. The method always -// closes the http.Response Body. -func (client ModelClient) AddIntentResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// AddPrebuilt adds a list of prebuilt entity extractors to the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// prebuiltExtractorNames - an array of prebuilt entity extractor names. -func (client ModelClient) AddPrebuilt(ctx context.Context, appID uuid.UUID, versionID string, prebuiltExtractorNames []string) (result ListPrebuiltEntityExtractor, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: prebuiltExtractorNames, - Constraints: []validation.Constraint{{Target: "prebuiltExtractorNames", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("programmatic.ModelClient", "AddPrebuilt", err.Error()) - } - - req, err := client.AddPrebuiltPreparer(ctx, appID, versionID, prebuiltExtractorNames) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddPrebuilt", nil, "Failure preparing request") - return - } - - resp, err := client.AddPrebuiltSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddPrebuilt", resp, "Failure sending request") - return - } - - result, err = client.AddPrebuiltResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddPrebuilt", resp, "Failure responding to request") - } - - return -} - -// AddPrebuiltPreparer prepares the AddPrebuilt request. -func (client ModelClient) AddPrebuiltPreparer(ctx context.Context, appID uuid.UUID, versionID string, prebuiltExtractorNames []string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts", pathParameters), - autorest.WithJSON(prebuiltExtractorNames)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddPrebuiltSender sends the AddPrebuilt request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) AddPrebuiltSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddPrebuiltResponder handles the response to the AddPrebuilt request. The method always -// closes the http.Response Body. -func (client ModelClient) AddPrebuiltResponder(resp *http.Response) (result ListPrebuiltEntityExtractor, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// AddSubList adds a list to an existing closed list. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// clEntityID - the closed list entity extractor ID. -// wordListCreateObject - words list. -func (client ModelClient) AddSubList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, wordListCreateObject WordListObject) (result Int32, err error) { - req, err := client.AddSubListPreparer(ctx, appID, versionID, clEntityID, wordListCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddSubList", nil, "Failure preparing request") - return - } - - resp, err := client.AddSubListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddSubList", resp, "Failure sending request") - return - } - - result, err = client.AddSubListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddSubList", resp, "Failure responding to request") - } - - return -} - -// AddSubListPreparer prepares the AddSubList request. -func (client ModelClient) AddSubListPreparer(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, wordListCreateObject WordListObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "clEntityId": autorest.Encode("path", clEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists", pathParameters), - autorest.WithJSON(wordListCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddSubListSender sends the AddSubList request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) AddSubListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddSubListResponder handles the response to the AddSubList request. The method always -// closes the http.Response Body. -func (client ModelClient) AddSubListResponder(resp *http.Response) (result Int32, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateClosedListEntityRole sends the create closed list entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity model ID. -// entityRoleCreateObject - an entity role object containing the name of role. -func (client ModelClient) CreateClosedListEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) { - req, err := client.CreateClosedListEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateClosedListEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.CreateClosedListEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateClosedListEntityRole", resp, "Failure sending request") - return - } - - result, err = client.CreateClosedListEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateClosedListEntityRole", resp, "Failure responding to request") - } - - return -} - -// CreateClosedListEntityRolePreparer prepares the CreateClosedListEntityRole request. -func (client ModelClient) CreateClosedListEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles", pathParameters), - autorest.WithJSON(entityRoleCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateClosedListEntityRoleSender sends the CreateClosedListEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) CreateClosedListEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateClosedListEntityRoleResponder handles the response to the CreateClosedListEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) CreateClosedListEntityRoleResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateCompositeEntityRole sends the create composite entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// cEntityID - the composite entity extractor ID. -// entityRoleCreateObject - an entity role object containing the name of role. -func (client ModelClient) CreateCompositeEntityRole(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) { - req, err := client.CreateCompositeEntityRolePreparer(ctx, appID, versionID, cEntityID, entityRoleCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateCompositeEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.CreateCompositeEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateCompositeEntityRole", resp, "Failure sending request") - return - } - - result, err = client.CreateCompositeEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateCompositeEntityRole", resp, "Failure responding to request") - } - - return -} - -// CreateCompositeEntityRolePreparer prepares the CreateCompositeEntityRole request. -func (client ModelClient) CreateCompositeEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "cEntityId": autorest.Encode("path", cEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles", pathParameters), - autorest.WithJSON(entityRoleCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateCompositeEntityRoleSender sends the CreateCompositeEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) CreateCompositeEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateCompositeEntityRoleResponder handles the response to the CreateCompositeEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) CreateCompositeEntityRoleResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateCustomPrebuiltEntityRole sends the create custom prebuilt entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity model ID. -// entityRoleCreateObject - an entity role object containing the name of role. -func (client ModelClient) CreateCustomPrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) { - req, err := client.CreateCustomPrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateCustomPrebuiltEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.CreateCustomPrebuiltEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateCustomPrebuiltEntityRole", resp, "Failure sending request") - return - } - - result, err = client.CreateCustomPrebuiltEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateCustomPrebuiltEntityRole", resp, "Failure responding to request") - } - - return -} - -// CreateCustomPrebuiltEntityRolePreparer prepares the CreateCustomPrebuiltEntityRole request. -func (client ModelClient) CreateCustomPrebuiltEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles", pathParameters), - autorest.WithJSON(entityRoleCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateCustomPrebuiltEntityRoleSender sends the CreateCustomPrebuiltEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) CreateCustomPrebuiltEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateCustomPrebuiltEntityRoleResponder handles the response to the CreateCustomPrebuiltEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) CreateCustomPrebuiltEntityRoleResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateEntityRole sends the create entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity model ID. -// entityRoleCreateObject - an entity role object containing the name of role. -func (client ModelClient) CreateEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) { - req, err := client.CreateEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.CreateEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateEntityRole", resp, "Failure sending request") - return - } - - result, err = client.CreateEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateEntityRole", resp, "Failure responding to request") - } - - return -} - -// CreateEntityRolePreparer prepares the CreateEntityRole request. -func (client ModelClient) CreateEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles", pathParameters), - autorest.WithJSON(entityRoleCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateEntityRoleSender sends the CreateEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) CreateEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateEntityRoleResponder handles the response to the CreateEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) CreateEntityRoleResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateHierarchicalEntityRole sends the create hierarchical entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// hEntityID - the hierarchical entity extractor ID. -// entityRoleCreateObject - an entity role object containing the name of role. -func (client ModelClient) CreateHierarchicalEntityRole(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) { - req, err := client.CreateHierarchicalEntityRolePreparer(ctx, appID, versionID, hEntityID, entityRoleCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateHierarchicalEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.CreateHierarchicalEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateHierarchicalEntityRole", resp, "Failure sending request") - return - } - - result, err = client.CreateHierarchicalEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateHierarchicalEntityRole", resp, "Failure responding to request") - } - - return -} - -// CreateHierarchicalEntityRolePreparer prepares the CreateHierarchicalEntityRole request. -func (client ModelClient) CreateHierarchicalEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "hEntityId": autorest.Encode("path", hEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles", pathParameters), - autorest.WithJSON(entityRoleCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateHierarchicalEntityRoleSender sends the CreateHierarchicalEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) CreateHierarchicalEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateHierarchicalEntityRoleResponder handles the response to the CreateHierarchicalEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) CreateHierarchicalEntityRoleResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreatePatternAnyEntityModel sends the create pattern any entity model request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// extractorCreateObject - a model object containing the name and explicit list for the new Pattern.Any entity -// extractor. -func (client ModelClient) CreatePatternAnyEntityModel(ctx context.Context, appID uuid.UUID, versionID string, extractorCreateObject PatternAnyModelCreateObject) (result UUID, err error) { - req, err := client.CreatePatternAnyEntityModelPreparer(ctx, appID, versionID, extractorCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePatternAnyEntityModel", nil, "Failure preparing request") - return - } - - resp, err := client.CreatePatternAnyEntityModelSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePatternAnyEntityModel", resp, "Failure sending request") - return - } - - result, err = client.CreatePatternAnyEntityModelResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePatternAnyEntityModel", resp, "Failure responding to request") - } - - return -} - -// CreatePatternAnyEntityModelPreparer prepares the CreatePatternAnyEntityModel request. -func (client ModelClient) CreatePatternAnyEntityModelPreparer(ctx context.Context, appID uuid.UUID, versionID string, extractorCreateObject PatternAnyModelCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities", pathParameters), - autorest.WithJSON(extractorCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreatePatternAnyEntityModelSender sends the CreatePatternAnyEntityModel request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) CreatePatternAnyEntityModelSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreatePatternAnyEntityModelResponder handles the response to the CreatePatternAnyEntityModel request. The method always -// closes the http.Response Body. -func (client ModelClient) CreatePatternAnyEntityModelResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreatePatternAnyEntityRole sends the create pattern any entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity model ID. -// entityRoleCreateObject - an entity role object containing the name of role. -func (client ModelClient) CreatePatternAnyEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) { - req, err := client.CreatePatternAnyEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePatternAnyEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.CreatePatternAnyEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePatternAnyEntityRole", resp, "Failure sending request") - return - } - - result, err = client.CreatePatternAnyEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePatternAnyEntityRole", resp, "Failure responding to request") - } - - return -} - -// CreatePatternAnyEntityRolePreparer prepares the CreatePatternAnyEntityRole request. -func (client ModelClient) CreatePatternAnyEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles", pathParameters), - autorest.WithJSON(entityRoleCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreatePatternAnyEntityRoleSender sends the CreatePatternAnyEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) CreatePatternAnyEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreatePatternAnyEntityRoleResponder handles the response to the CreatePatternAnyEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) CreatePatternAnyEntityRoleResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreatePrebuiltEntityRole sends the create prebuilt entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity model ID. -// entityRoleCreateObject - an entity role object containing the name of role. -func (client ModelClient) CreatePrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) { - req, err := client.CreatePrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePrebuiltEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.CreatePrebuiltEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePrebuiltEntityRole", resp, "Failure sending request") - return - } - - result, err = client.CreatePrebuiltEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePrebuiltEntityRole", resp, "Failure responding to request") - } - - return -} - -// CreatePrebuiltEntityRolePreparer prepares the CreatePrebuiltEntityRole request. -func (client ModelClient) CreatePrebuiltEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles", pathParameters), - autorest.WithJSON(entityRoleCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreatePrebuiltEntityRoleSender sends the CreatePrebuiltEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) CreatePrebuiltEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreatePrebuiltEntityRoleResponder handles the response to the CreatePrebuiltEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) CreatePrebuiltEntityRoleResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateRegexEntityModel sends the create regex entity model request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// regexEntityExtractorCreateObj - a model object containing the name and regex pattern for the new regex -// entity extractor. -func (client ModelClient) CreateRegexEntityModel(ctx context.Context, appID uuid.UUID, versionID string, regexEntityExtractorCreateObj RegexModelCreateObject) (result UUID, err error) { - req, err := client.CreateRegexEntityModelPreparer(ctx, appID, versionID, regexEntityExtractorCreateObj) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateRegexEntityModel", nil, "Failure preparing request") - return - } - - resp, err := client.CreateRegexEntityModelSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateRegexEntityModel", resp, "Failure sending request") - return - } - - result, err = client.CreateRegexEntityModelResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateRegexEntityModel", resp, "Failure responding to request") - } - - return -} - -// CreateRegexEntityModelPreparer prepares the CreateRegexEntityModel request. -func (client ModelClient) CreateRegexEntityModelPreparer(ctx context.Context, appID uuid.UUID, versionID string, regexEntityExtractorCreateObj RegexModelCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities", pathParameters), - autorest.WithJSON(regexEntityExtractorCreateObj)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateRegexEntityModelSender sends the CreateRegexEntityModel request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) CreateRegexEntityModelSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateRegexEntityModelResponder handles the response to the CreateRegexEntityModel request. The method always -// closes the http.Response Body. -func (client ModelClient) CreateRegexEntityModelResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateRegexEntityRole sends the create regex entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity model ID. -// entityRoleCreateObject - an entity role object containing the name of role. -func (client ModelClient) CreateRegexEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) { - req, err := client.CreateRegexEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateRegexEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.CreateRegexEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateRegexEntityRole", resp, "Failure sending request") - return - } - - result, err = client.CreateRegexEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateRegexEntityRole", resp, "Failure responding to request") - } - - return -} - -// CreateRegexEntityRolePreparer prepares the CreateRegexEntityRole request. -func (client ModelClient) CreateRegexEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles", pathParameters), - autorest.WithJSON(entityRoleCreateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateRegexEntityRoleSender sends the CreateRegexEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) CreateRegexEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateRegexEntityRoleResponder handles the response to the CreateRegexEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) CreateRegexEntityRoleResponder(resp *http.Response) (result UUID, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// DeleteClosedList deletes a closed list model from the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// clEntityID - the closed list model ID. -func (client ModelClient) DeleteClosedList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeleteClosedListPreparer(ctx, appID, versionID, clEntityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteClosedList", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteClosedListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteClosedList", resp, "Failure sending request") - return - } - - result, err = client.DeleteClosedListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteClosedList", resp, "Failure responding to request") - } - - return -} - -// DeleteClosedListPreparer prepares the DeleteClosedList request. -func (client ModelClient) DeleteClosedListPreparer(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "clEntityId": autorest.Encode("path", clEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteClosedListSender sends the DeleteClosedList request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteClosedListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteClosedListResponder handles the response to the DeleteClosedList request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteClosedListResponder(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 -} - -// DeleteClosedListEntityRole sends the delete closed list entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity ID. -// roleID - the entity role Id. -func (client ModelClient) DeleteClosedListEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeleteClosedListEntityRolePreparer(ctx, appID, versionID, entityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteClosedListEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteClosedListEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteClosedListEntityRole", resp, "Failure sending request") - return - } - - result, err = client.DeleteClosedListEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteClosedListEntityRole", resp, "Failure responding to request") - } - - return -} - -// DeleteClosedListEntityRolePreparer prepares the DeleteClosedListEntityRole request. -func (client ModelClient) DeleteClosedListEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteClosedListEntityRoleSender sends the DeleteClosedListEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteClosedListEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteClosedListEntityRoleResponder handles the response to the DeleteClosedListEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteClosedListEntityRoleResponder(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 -} - -// DeleteCompositeEntity deletes a composite entity extractor from the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// cEntityID - the composite entity extractor ID. -func (client ModelClient) DeleteCompositeEntity(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeleteCompositeEntityPreparer(ctx, appID, versionID, cEntityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntity", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteCompositeEntitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntity", resp, "Failure sending request") - return - } - - result, err = client.DeleteCompositeEntityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntity", resp, "Failure responding to request") - } - - return -} - -// DeleteCompositeEntityPreparer prepares the DeleteCompositeEntity request. -func (client ModelClient) DeleteCompositeEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "cEntityId": autorest.Encode("path", cEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteCompositeEntitySender sends the DeleteCompositeEntity request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteCompositeEntitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteCompositeEntityResponder handles the response to the DeleteCompositeEntity request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteCompositeEntityResponder(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 -} - -// DeleteCompositeEntityChild deletes a composite entity extractor child from the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// cEntityID - the composite entity extractor ID. -// cChildID - the hierarchical entity extractor child ID. -func (client ModelClient) DeleteCompositeEntityChild(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, cChildID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeleteCompositeEntityChildPreparer(ctx, appID, versionID, cEntityID, cChildID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntityChild", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteCompositeEntityChildSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntityChild", resp, "Failure sending request") - return - } - - result, err = client.DeleteCompositeEntityChildResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntityChild", resp, "Failure responding to request") - } - - return -} - -// DeleteCompositeEntityChildPreparer prepares the DeleteCompositeEntityChild request. -func (client ModelClient) DeleteCompositeEntityChildPreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, cChildID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "cChildId": autorest.Encode("path", cChildID), - "cEntityId": autorest.Encode("path", cEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children/{cChildId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteCompositeEntityChildSender sends the DeleteCompositeEntityChild request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteCompositeEntityChildSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteCompositeEntityChildResponder handles the response to the DeleteCompositeEntityChild request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteCompositeEntityChildResponder(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 -} - -// DeleteCompositeEntityRole sends the delete composite entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// cEntityID - the composite entity extractor ID. -// roleID - the entity role Id. -func (client ModelClient) DeleteCompositeEntityRole(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeleteCompositeEntityRolePreparer(ctx, appID, versionID, cEntityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteCompositeEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntityRole", resp, "Failure sending request") - return - } - - result, err = client.DeleteCompositeEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntityRole", resp, "Failure responding to request") - } - - return -} - -// DeleteCompositeEntityRolePreparer prepares the DeleteCompositeEntityRole request. -func (client ModelClient) DeleteCompositeEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "cEntityId": autorest.Encode("path", cEntityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteCompositeEntityRoleSender sends the DeleteCompositeEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteCompositeEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteCompositeEntityRoleResponder handles the response to the DeleteCompositeEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteCompositeEntityRoleResponder(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 -} - -// DeleteCustomEntityRole sends the delete custom entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity ID. -// roleID - the entity role Id. -func (client ModelClient) DeleteCustomEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeleteCustomEntityRolePreparer(ctx, appID, versionID, entityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCustomEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteCustomEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCustomEntityRole", resp, "Failure sending request") - return - } - - result, err = client.DeleteCustomEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCustomEntityRole", resp, "Failure responding to request") - } - - return -} - -// DeleteCustomEntityRolePreparer prepares the DeleteCustomEntityRole request. -func (client ModelClient) DeleteCustomEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteCustomEntityRoleSender sends the DeleteCustomEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteCustomEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteCustomEntityRoleResponder handles the response to the DeleteCustomEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteCustomEntityRoleResponder(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 -} - -// DeleteCustomPrebuiltDomain deletes a prebuilt domain's models from the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// domainName - domain name. -func (client ModelClient) DeleteCustomPrebuiltDomain(ctx context.Context, appID uuid.UUID, versionID string, domainName string) (result OperationStatus, err error) { - req, err := client.DeleteCustomPrebuiltDomainPreparer(ctx, appID, versionID, domainName) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCustomPrebuiltDomain", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteCustomPrebuiltDomainSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCustomPrebuiltDomain", resp, "Failure sending request") - return - } - - result, err = client.DeleteCustomPrebuiltDomainResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCustomPrebuiltDomain", resp, "Failure responding to request") - } - - return -} - -// DeleteCustomPrebuiltDomainPreparer prepares the DeleteCustomPrebuiltDomain request. -func (client ModelClient) DeleteCustomPrebuiltDomainPreparer(ctx context.Context, appID uuid.UUID, versionID string, domainName string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "domainName": autorest.Encode("path", domainName), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltdomains/{domainName}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteCustomPrebuiltDomainSender sends the DeleteCustomPrebuiltDomain request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteCustomPrebuiltDomainSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteCustomPrebuiltDomainResponder handles the response to the DeleteCustomPrebuiltDomain request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteCustomPrebuiltDomainResponder(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 -} - -// DeleteEntity deletes an entity extractor from the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity extractor ID. -func (client ModelClient) DeleteEntity(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeleteEntityPreparer(ctx, appID, versionID, entityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteEntity", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteEntitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteEntity", resp, "Failure sending request") - return - } - - result, err = client.DeleteEntityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteEntity", resp, "Failure responding to request") - } - - return -} - -// DeleteEntityPreparer prepares the DeleteEntity request. -func (client ModelClient) DeleteEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteEntitySender sends the DeleteEntity request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteEntitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteEntityResponder handles the response to the DeleteEntity request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteEntityResponder(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 -} - -// DeleteEntityRole sends the delete entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity ID. -// roleID - the entity role Id. -func (client ModelClient) DeleteEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeleteEntityRolePreparer(ctx, appID, versionID, entityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteEntityRole", resp, "Failure sending request") - return - } - - result, err = client.DeleteEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteEntityRole", resp, "Failure responding to request") - } - - return -} - -// DeleteEntityRolePreparer prepares the DeleteEntityRole request. -func (client ModelClient) DeleteEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteEntityRoleSender sends the DeleteEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteEntityRoleResponder handles the response to the DeleteEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteEntityRoleResponder(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 -} - -// DeleteExplicitListItem sends the delete explicit list item request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the pattern.any entity id. -// itemID - the explicit list item which will be deleted. -func (client ModelClient) DeleteExplicitListItem(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64) (result OperationStatus, err error) { - req, err := client.DeleteExplicitListItemPreparer(ctx, appID, versionID, entityID, itemID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteExplicitListItem", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteExplicitListItemSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteExplicitListItem", resp, "Failure sending request") - return - } - - result, err = client.DeleteExplicitListItemResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteExplicitListItem", resp, "Failure responding to request") - } - - return -} - -// DeleteExplicitListItemPreparer prepares the DeleteExplicitListItem request. -func (client ModelClient) DeleteExplicitListItemPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "itemId": autorest.Encode("path", itemID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteExplicitListItemSender sends the DeleteExplicitListItem request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteExplicitListItemSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteExplicitListItemResponder handles the response to the DeleteExplicitListItem request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteExplicitListItemResponder(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 -} - -// DeleteHierarchicalEntity deletes a hierarchical entity extractor from the application version. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// hEntityID - the hierarchical entity extractor ID. -func (client ModelClient) DeleteHierarchicalEntity(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeleteHierarchicalEntityPreparer(ctx, appID, versionID, hEntityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntity", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteHierarchicalEntitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntity", resp, "Failure sending request") - return - } - - result, err = client.DeleteHierarchicalEntityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntity", resp, "Failure responding to request") - } - - return -} - -// DeleteHierarchicalEntityPreparer prepares the DeleteHierarchicalEntity request. -func (client ModelClient) DeleteHierarchicalEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "hEntityId": autorest.Encode("path", hEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteHierarchicalEntitySender sends the DeleteHierarchicalEntity request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteHierarchicalEntitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteHierarchicalEntityResponder handles the response to the DeleteHierarchicalEntity request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteHierarchicalEntityResponder(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 -} - -// DeleteHierarchicalEntityChild deletes a hierarchical entity extractor child from the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// hEntityID - the hierarchical entity extractor ID. -// hChildID - the hierarchical entity extractor child ID. -func (client ModelClient) DeleteHierarchicalEntityChild(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeleteHierarchicalEntityChildPreparer(ctx, appID, versionID, hEntityID, hChildID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntityChild", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteHierarchicalEntityChildSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntityChild", resp, "Failure sending request") - return - } - - result, err = client.DeleteHierarchicalEntityChildResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntityChild", resp, "Failure responding to request") - } - - return -} - -// DeleteHierarchicalEntityChildPreparer prepares the DeleteHierarchicalEntityChild request. -func (client ModelClient) DeleteHierarchicalEntityChildPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "hChildId": autorest.Encode("path", hChildID), - "hEntityId": autorest.Encode("path", hEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteHierarchicalEntityChildSender sends the DeleteHierarchicalEntityChild request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteHierarchicalEntityChildSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteHierarchicalEntityChildResponder handles the response to the DeleteHierarchicalEntityChild request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteHierarchicalEntityChildResponder(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 -} - -// DeleteHierarchicalEntityRole sends the delete hierarchical entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// hEntityID - the hierarchical entity extractor ID. -// roleID - the entity role Id. -func (client ModelClient) DeleteHierarchicalEntityRole(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeleteHierarchicalEntityRolePreparer(ctx, appID, versionID, hEntityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteHierarchicalEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntityRole", resp, "Failure sending request") - return - } - - result, err = client.DeleteHierarchicalEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntityRole", resp, "Failure responding to request") - } - - return -} - -// DeleteHierarchicalEntityRolePreparer prepares the DeleteHierarchicalEntityRole request. -func (client ModelClient) DeleteHierarchicalEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "hEntityId": autorest.Encode("path", hEntityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteHierarchicalEntityRoleSender sends the DeleteHierarchicalEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteHierarchicalEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteHierarchicalEntityRoleResponder handles the response to the DeleteHierarchicalEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteHierarchicalEntityRoleResponder(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 -} - -// DeleteIntent deletes an intent classifier from the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// intentID - the intent classifier ID. -// deleteUtterances - also delete the intent's utterances (true). Or move the utterances to the None intent -// (false - the default value). -func (client ModelClient) DeleteIntent(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, deleteUtterances *bool) (result OperationStatus, err error) { - req, err := client.DeleteIntentPreparer(ctx, appID, versionID, intentID, deleteUtterances) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteIntent", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteIntentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteIntent", resp, "Failure sending request") - return - } - - result, err = client.DeleteIntentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteIntent", resp, "Failure responding to request") - } - - return -} - -// DeleteIntentPreparer prepares the DeleteIntent request. -func (client ModelClient) DeleteIntentPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, deleteUtterances *bool) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "intentId": autorest.Encode("path", intentID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if deleteUtterances != nil { - queryParameters["deleteUtterances"] = autorest.Encode("query", *deleteUtterances) - } else { - queryParameters["deleteUtterances"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteIntentSender sends the DeleteIntent request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteIntentSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteIntentResponder handles the response to the DeleteIntent request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteIntentResponder(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 -} - -// DeletePatternAnyEntityModel sends the delete pattern any entity model request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the Pattern.Any entity extractor ID. -func (client ModelClient) DeletePatternAnyEntityModel(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeletePatternAnyEntityModelPreparer(ctx, appID, versionID, entityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePatternAnyEntityModel", nil, "Failure preparing request") - return - } - - resp, err := client.DeletePatternAnyEntityModelSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePatternAnyEntityModel", resp, "Failure sending request") - return - } - - result, err = client.DeletePatternAnyEntityModelResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePatternAnyEntityModel", resp, "Failure responding to request") - } - - return -} - -// DeletePatternAnyEntityModelPreparer prepares the DeletePatternAnyEntityModel request. -func (client ModelClient) DeletePatternAnyEntityModelPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeletePatternAnyEntityModelSender sends the DeletePatternAnyEntityModel request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeletePatternAnyEntityModelSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeletePatternAnyEntityModelResponder handles the response to the DeletePatternAnyEntityModel request. The method always -// closes the http.Response Body. -func (client ModelClient) DeletePatternAnyEntityModelResponder(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 -} - -// DeletePatternAnyEntityRole sends the delete pattern any entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity ID. -// roleID - the entity role Id. -func (client ModelClient) DeletePatternAnyEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeletePatternAnyEntityRolePreparer(ctx, appID, versionID, entityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePatternAnyEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.DeletePatternAnyEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePatternAnyEntityRole", resp, "Failure sending request") - return - } - - result, err = client.DeletePatternAnyEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePatternAnyEntityRole", resp, "Failure responding to request") - } - - return -} - -// DeletePatternAnyEntityRolePreparer prepares the DeletePatternAnyEntityRole request. -func (client ModelClient) DeletePatternAnyEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeletePatternAnyEntityRoleSender sends the DeletePatternAnyEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeletePatternAnyEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeletePatternAnyEntityRoleResponder handles the response to the DeletePatternAnyEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) DeletePatternAnyEntityRoleResponder(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 -} - -// DeletePrebuilt deletes a prebuilt entity extractor from the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// prebuiltID - the prebuilt entity extractor ID. -func (client ModelClient) DeletePrebuilt(ctx context.Context, appID uuid.UUID, versionID string, prebuiltID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeletePrebuiltPreparer(ctx, appID, versionID, prebuiltID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePrebuilt", nil, "Failure preparing request") - return - } - - resp, err := client.DeletePrebuiltSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePrebuilt", resp, "Failure sending request") - return - } - - result, err = client.DeletePrebuiltResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePrebuilt", resp, "Failure responding to request") - } - - return -} - -// DeletePrebuiltPreparer prepares the DeletePrebuilt request. -func (client ModelClient) DeletePrebuiltPreparer(ctx context.Context, appID uuid.UUID, versionID string, prebuiltID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "prebuiltId": autorest.Encode("path", prebuiltID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeletePrebuiltSender sends the DeletePrebuilt request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeletePrebuiltSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeletePrebuiltResponder handles the response to the DeletePrebuilt request. The method always -// closes the http.Response Body. -func (client ModelClient) DeletePrebuiltResponder(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 -} - -// DeletePrebuiltEntityRole sends the delete prebuilt entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity ID. -// roleID - the entity role Id. -func (client ModelClient) DeletePrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeletePrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePrebuiltEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.DeletePrebuiltEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePrebuiltEntityRole", resp, "Failure sending request") - return - } - - result, err = client.DeletePrebuiltEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePrebuiltEntityRole", resp, "Failure responding to request") - } - - return -} - -// DeletePrebuiltEntityRolePreparer prepares the DeletePrebuiltEntityRole request. -func (client ModelClient) DeletePrebuiltEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeletePrebuiltEntityRoleSender sends the DeletePrebuiltEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeletePrebuiltEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeletePrebuiltEntityRoleResponder handles the response to the DeletePrebuiltEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) DeletePrebuiltEntityRoleResponder(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 -} - -// DeleteRegexEntityModel sends the delete regex entity model request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// regexEntityID - the regex entity extractor ID. -func (client ModelClient) DeleteRegexEntityModel(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeleteRegexEntityModelPreparer(ctx, appID, versionID, regexEntityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteRegexEntityModel", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteRegexEntityModelSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteRegexEntityModel", resp, "Failure sending request") - return - } - - result, err = client.DeleteRegexEntityModelResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteRegexEntityModel", resp, "Failure responding to request") - } - - return -} - -// DeleteRegexEntityModelPreparer prepares the DeleteRegexEntityModel request. -func (client ModelClient) DeleteRegexEntityModelPreparer(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "regexEntityId": autorest.Encode("path", regexEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteRegexEntityModelSender sends the DeleteRegexEntityModel request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteRegexEntityModelSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteRegexEntityModelResponder handles the response to the DeleteRegexEntityModel request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteRegexEntityModelResponder(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 -} - -// DeleteRegexEntityRole sends the delete regex entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity ID. -// roleID - the entity role Id. -func (client ModelClient) DeleteRegexEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeleteRegexEntityRolePreparer(ctx, appID, versionID, entityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteRegexEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteRegexEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteRegexEntityRole", resp, "Failure sending request") - return - } - - result, err = client.DeleteRegexEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteRegexEntityRole", resp, "Failure responding to request") - } - - return -} - -// DeleteRegexEntityRolePreparer prepares the DeleteRegexEntityRole request. -func (client ModelClient) DeleteRegexEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteRegexEntityRoleSender sends the DeleteRegexEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteRegexEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteRegexEntityRoleResponder handles the response to the DeleteRegexEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteRegexEntityRoleResponder(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 -} - -// DeleteSubList deletes a sublist of a specific closed list model. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// clEntityID - the closed list entity extractor ID. -// subListID - the sublist ID. -func (client ModelClient) DeleteSubList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, subListID int32) (result OperationStatus, err error) { - req, err := client.DeleteSubListPreparer(ctx, appID, versionID, clEntityID, subListID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteSubList", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSubListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteSubList", resp, "Failure sending request") - return - } - - result, err = client.DeleteSubListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteSubList", resp, "Failure responding to request") - } - - return -} - -// DeleteSubListPreparer prepares the DeleteSubList request. -func (client ModelClient) DeleteSubListPreparer(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, subListID int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "clEntityId": autorest.Encode("path", clEntityID), - "subListId": autorest.Encode("path", subListID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSubListSender sends the DeleteSubList request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) DeleteSubListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteSubListResponder handles the response to the DeleteSubList request. The method always -// closes the http.Response Body. -func (client ModelClient) DeleteSubListResponder(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 -} - -// GetClosedList gets information of a closed list model. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// clEntityID - the closed list model ID. -func (client ModelClient) GetClosedList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID) (result ClosedListEntityExtractor, err error) { - req, err := client.GetClosedListPreparer(ctx, appID, versionID, clEntityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedList", nil, "Failure preparing request") - return - } - - resp, err := client.GetClosedListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedList", resp, "Failure sending request") - return - } - - result, err = client.GetClosedListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedList", resp, "Failure responding to request") - } - - return -} - -// GetClosedListPreparer prepares the GetClosedList request. -func (client ModelClient) GetClosedListPreparer(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "clEntityId": autorest.Encode("path", clEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetClosedListSender sends the GetClosedList request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetClosedListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetClosedListResponder handles the response to the GetClosedList request. The method always -// closes the http.Response Body. -func (client ModelClient) GetClosedListResponder(resp *http.Response) (result ClosedListEntityExtractor, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetClosedListEntityRole sends the get closed list entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - entity ID. -// roleID - entity role ID. -func (client ModelClient) GetClosedListEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) { - req, err := client.GetClosedListEntityRolePreparer(ctx, appID, versionID, entityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedListEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.GetClosedListEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedListEntityRole", resp, "Failure sending request") - return - } - - result, err = client.GetClosedListEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedListEntityRole", resp, "Failure responding to request") - } - - return -} - -// GetClosedListEntityRolePreparer prepares the GetClosedListEntityRole request. -func (client ModelClient) GetClosedListEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetClosedListEntityRoleSender sends the GetClosedListEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetClosedListEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetClosedListEntityRoleResponder handles the response to the GetClosedListEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) GetClosedListEntityRoleResponder(resp *http.Response) (result EntityRole, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetClosedListEntityRoles sends the get closed list entity roles request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - entity Id -func (client ModelClient) GetClosedListEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) { - req, err := client.GetClosedListEntityRolesPreparer(ctx, appID, versionID, entityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedListEntityRoles", nil, "Failure preparing request") - return - } - - resp, err := client.GetClosedListEntityRolesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedListEntityRoles", resp, "Failure sending request") - return - } - - result, err = client.GetClosedListEntityRolesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedListEntityRoles", resp, "Failure responding to request") - } - - return -} - -// GetClosedListEntityRolesPreparer prepares the GetClosedListEntityRoles request. -func (client ModelClient) GetClosedListEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetClosedListEntityRolesSender sends the GetClosedListEntityRoles request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetClosedListEntityRolesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetClosedListEntityRolesResponder handles the response to the GetClosedListEntityRoles request. The method always -// closes the http.Response Body. -func (client ModelClient) GetClosedListEntityRolesResponder(resp *http.Response) (result ListEntityRole, 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 -} - -// GetCompositeEntity gets information about the composite entity model. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// cEntityID - the composite entity extractor ID. -func (client ModelClient) GetCompositeEntity(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (result CompositeEntityExtractor, err error) { - req, err := client.GetCompositeEntityPreparer(ctx, appID, versionID, cEntityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntity", nil, "Failure preparing request") - return - } - - resp, err := client.GetCompositeEntitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntity", resp, "Failure sending request") - return - } - - result, err = client.GetCompositeEntityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntity", resp, "Failure responding to request") - } - - return -} - -// GetCompositeEntityPreparer prepares the GetCompositeEntity request. -func (client ModelClient) GetCompositeEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "cEntityId": autorest.Encode("path", cEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetCompositeEntitySender sends the GetCompositeEntity request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetCompositeEntitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetCompositeEntityResponder handles the response to the GetCompositeEntity request. The method always -// closes the http.Response Body. -func (client ModelClient) GetCompositeEntityResponder(resp *http.Response) (result CompositeEntityExtractor, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetCompositeEntityRole sends the get composite entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// cEntityID - the composite entity extractor ID. -// roleID - entity role ID. -func (client ModelClient) GetCompositeEntityRole(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) { - req, err := client.GetCompositeEntityRolePreparer(ctx, appID, versionID, cEntityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.GetCompositeEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntityRole", resp, "Failure sending request") - return - } - - result, err = client.GetCompositeEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntityRole", resp, "Failure responding to request") - } - - return -} - -// GetCompositeEntityRolePreparer prepares the GetCompositeEntityRole request. -func (client ModelClient) GetCompositeEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "cEntityId": autorest.Encode("path", cEntityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetCompositeEntityRoleSender sends the GetCompositeEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetCompositeEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetCompositeEntityRoleResponder handles the response to the GetCompositeEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) GetCompositeEntityRoleResponder(resp *http.Response) (result EntityRole, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetCompositeEntityRoles sends the get composite entity roles request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// cEntityID - the composite entity extractor ID. -func (client ModelClient) GetCompositeEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (result ListEntityRole, err error) { - req, err := client.GetCompositeEntityRolesPreparer(ctx, appID, versionID, cEntityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntityRoles", nil, "Failure preparing request") - return - } - - resp, err := client.GetCompositeEntityRolesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntityRoles", resp, "Failure sending request") - return - } - - result, err = client.GetCompositeEntityRolesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntityRoles", resp, "Failure responding to request") - } - - return -} - -// GetCompositeEntityRolesPreparer prepares the GetCompositeEntityRoles request. -func (client ModelClient) GetCompositeEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "cEntityId": autorest.Encode("path", cEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetCompositeEntityRolesSender sends the GetCompositeEntityRoles request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetCompositeEntityRolesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetCompositeEntityRolesResponder handles the response to the GetCompositeEntityRoles request. The method always -// closes the http.Response Body. -func (client ModelClient) GetCompositeEntityRolesResponder(resp *http.Response) (result ListEntityRole, 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 -} - -// GetCustomEntityRole sends the get custom entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - entity ID. -// roleID - entity role ID. -func (client ModelClient) GetCustomEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) { - req, err := client.GetCustomEntityRolePreparer(ctx, appID, versionID, entityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCustomEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.GetCustomEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCustomEntityRole", resp, "Failure sending request") - return - } - - result, err = client.GetCustomEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCustomEntityRole", resp, "Failure responding to request") - } - - return -} - -// GetCustomEntityRolePreparer prepares the GetCustomEntityRole request. -func (client ModelClient) GetCustomEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetCustomEntityRoleSender sends the GetCustomEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetCustomEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetCustomEntityRoleResponder handles the response to the GetCustomEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) GetCustomEntityRoleResponder(resp *http.Response) (result EntityRole, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetCustomPrebuiltEntityRoles sends the get custom prebuilt entity roles request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - entity Id -func (client ModelClient) GetCustomPrebuiltEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) { - req, err := client.GetCustomPrebuiltEntityRolesPreparer(ctx, appID, versionID, entityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCustomPrebuiltEntityRoles", nil, "Failure preparing request") - return - } - - resp, err := client.GetCustomPrebuiltEntityRolesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCustomPrebuiltEntityRoles", resp, "Failure sending request") - return - } - - result, err = client.GetCustomPrebuiltEntityRolesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCustomPrebuiltEntityRoles", resp, "Failure responding to request") - } - - return -} - -// GetCustomPrebuiltEntityRolesPreparer prepares the GetCustomPrebuiltEntityRoles request. -func (client ModelClient) GetCustomPrebuiltEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetCustomPrebuiltEntityRolesSender sends the GetCustomPrebuiltEntityRoles request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetCustomPrebuiltEntityRolesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetCustomPrebuiltEntityRolesResponder handles the response to the GetCustomPrebuiltEntityRoles request. The method always -// closes the http.Response Body. -func (client ModelClient) GetCustomPrebuiltEntityRolesResponder(resp *http.Response) (result ListEntityRole, 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 -} - -// GetEntity gets information about the entity model. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity extractor ID. -func (client ModelClient) GetEntity(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result EntityExtractor, err error) { - req, err := client.GetEntityPreparer(ctx, appID, versionID, entityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntity", nil, "Failure preparing request") - return - } - - resp, err := client.GetEntitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntity", resp, "Failure sending request") - return - } - - result, err = client.GetEntityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntity", resp, "Failure responding to request") - } - - return -} - -// GetEntityPreparer prepares the GetEntity request. -func (client ModelClient) GetEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetEntitySender sends the GetEntity request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetEntitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetEntityResponder handles the response to the GetEntity request. The method always -// closes the http.Response Body. -func (client ModelClient) GetEntityResponder(resp *http.Response) (result EntityExtractor, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetEntityRole sends the get entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - entity ID. -// roleID - entity role ID. -func (client ModelClient) GetEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) { - req, err := client.GetEntityRolePreparer(ctx, appID, versionID, entityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.GetEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntityRole", resp, "Failure sending request") - return - } - - result, err = client.GetEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntityRole", resp, "Failure responding to request") - } - - return -} - -// GetEntityRolePreparer prepares the GetEntityRole request. -func (client ModelClient) GetEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetEntityRoleSender sends the GetEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetEntityRoleResponder handles the response to the GetEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) GetEntityRoleResponder(resp *http.Response) (result EntityRole, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetEntityRoles sends the get entity roles request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - entity Id -func (client ModelClient) GetEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) { - req, err := client.GetEntityRolesPreparer(ctx, appID, versionID, entityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntityRoles", nil, "Failure preparing request") - return - } - - resp, err := client.GetEntityRolesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntityRoles", resp, "Failure sending request") - return - } - - result, err = client.GetEntityRolesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntityRoles", resp, "Failure responding to request") - } - - return -} - -// GetEntityRolesPreparer prepares the GetEntityRoles request. -func (client ModelClient) GetEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetEntityRolesSender sends the GetEntityRoles request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetEntityRolesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetEntityRolesResponder handles the response to the GetEntityRoles request. The method always -// closes the http.Response Body. -func (client ModelClient) GetEntityRolesResponder(resp *http.Response) (result ListEntityRole, 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 -} - -// GetEntitySuggestions get suggestion examples that would improve the accuracy of the entity model. -// Parameters: -// appID - the application ID. -// 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) GetEntitySuggestions(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, take *int32) (result ListEntitiesSuggestionExample, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.ModelClient", "GetEntitySuggestions", err.Error()) - } - - req, err := client.GetEntitySuggestionsPreparer(ctx, appID, versionID, entityID, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntitySuggestions", nil, "Failure preparing request") - return - } - - resp, err := client.GetEntitySuggestionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntitySuggestions", resp, "Failure sending request") - return - } - - result, err = client.GetEntitySuggestionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntitySuggestions", resp, "Failure responding to request") - } - - return -} - -// GetEntitySuggestionsPreparer prepares the GetEntitySuggestions request. -func (client ModelClient) GetEntitySuggestionsPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/suggest", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetEntitySuggestionsSender sends the GetEntitySuggestions request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetEntitySuggestionsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetEntitySuggestionsResponder handles the response to the GetEntitySuggestions request. The method always -// closes the http.Response Body. -func (client ModelClient) GetEntitySuggestionsResponder(resp *http.Response) (result ListEntitiesSuggestionExample, 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 -} - -// GetExplicitList sends the get explicit list request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the Pattern.Any entity id. -func (client ModelClient) GetExplicitList(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListExplicitListItem, err error) { - req, err := client.GetExplicitListPreparer(ctx, appID, versionID, entityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetExplicitList", nil, "Failure preparing request") - return - } - - resp, err := client.GetExplicitListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetExplicitList", resp, "Failure sending request") - return - } - - result, err = client.GetExplicitListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetExplicitList", resp, "Failure responding to request") - } - - return -} - -// GetExplicitListPreparer prepares the GetExplicitList request. -func (client ModelClient) GetExplicitListPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetExplicitListSender sends the GetExplicitList request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetExplicitListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetExplicitListResponder handles the response to the GetExplicitList request. The method always -// closes the http.Response Body. -func (client ModelClient) GetExplicitListResponder(resp *http.Response) (result ListExplicitListItem, 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 -} - -// GetExplicitListItem sends the get explicit list item request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the Pattern.Any entity Id. -// itemID - the explicit list item Id. -func (client ModelClient) GetExplicitListItem(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64) (result ExplicitListItem, err error) { - req, err := client.GetExplicitListItemPreparer(ctx, appID, versionID, entityID, itemID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetExplicitListItem", nil, "Failure preparing request") - return - } - - resp, err := client.GetExplicitListItemSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetExplicitListItem", resp, "Failure sending request") - return - } - - result, err = client.GetExplicitListItemResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetExplicitListItem", resp, "Failure responding to request") - } - - return -} - -// GetExplicitListItemPreparer prepares the GetExplicitListItem request. -func (client ModelClient) GetExplicitListItemPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "itemId": autorest.Encode("path", itemID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetExplicitListItemSender sends the GetExplicitListItem request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetExplicitListItemSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetExplicitListItemResponder handles the response to the GetExplicitListItem request. The method always -// closes the http.Response Body. -func (client ModelClient) GetExplicitListItemResponder(resp *http.Response) (result ExplicitListItem, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetHierarchicalEntity gets information about the hierarchical entity model. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// hEntityID - the hierarchical entity extractor ID. -func (client ModelClient) GetHierarchicalEntity(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (result HierarchicalEntityExtractor, err error) { - req, err := client.GetHierarchicalEntityPreparer(ctx, appID, versionID, hEntityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntity", nil, "Failure preparing request") - return - } - - resp, err := client.GetHierarchicalEntitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntity", resp, "Failure sending request") - return - } - - result, err = client.GetHierarchicalEntityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntity", resp, "Failure responding to request") - } - - return -} - -// GetHierarchicalEntityPreparer prepares the GetHierarchicalEntity request. -func (client ModelClient) GetHierarchicalEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "hEntityId": autorest.Encode("path", hEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetHierarchicalEntitySender sends the GetHierarchicalEntity request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetHierarchicalEntitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetHierarchicalEntityResponder handles the response to the GetHierarchicalEntity request. The method always -// closes the http.Response Body. -func (client ModelClient) GetHierarchicalEntityResponder(resp *http.Response) (result HierarchicalEntityExtractor, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetHierarchicalEntityChild gets information about the hierarchical entity child model. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// hEntityID - the hierarchical entity extractor ID. -// hChildID - the hierarchical entity extractor child ID. -func (client ModelClient) GetHierarchicalEntityChild(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID) (result HierarchicalChildEntity, err error) { - req, err := client.GetHierarchicalEntityChildPreparer(ctx, appID, versionID, hEntityID, hChildID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityChild", nil, "Failure preparing request") - return - } - - resp, err := client.GetHierarchicalEntityChildSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityChild", resp, "Failure sending request") - return - } - - result, err = client.GetHierarchicalEntityChildResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityChild", resp, "Failure responding to request") - } - - return -} - -// GetHierarchicalEntityChildPreparer prepares the GetHierarchicalEntityChild request. -func (client ModelClient) GetHierarchicalEntityChildPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "hChildId": autorest.Encode("path", hChildID), - "hEntityId": autorest.Encode("path", hEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetHierarchicalEntityChildSender sends the GetHierarchicalEntityChild request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetHierarchicalEntityChildSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetHierarchicalEntityChildResponder handles the response to the GetHierarchicalEntityChild request. The method always -// closes the http.Response Body. -func (client ModelClient) GetHierarchicalEntityChildResponder(resp *http.Response) (result HierarchicalChildEntity, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetHierarchicalEntityRole sends the get hierarchical entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// hEntityID - the hierarchical entity extractor ID. -// roleID - entity role ID. -func (client ModelClient) GetHierarchicalEntityRole(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) { - req, err := client.GetHierarchicalEntityRolePreparer(ctx, appID, versionID, hEntityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.GetHierarchicalEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityRole", resp, "Failure sending request") - return - } - - result, err = client.GetHierarchicalEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityRole", resp, "Failure responding to request") - } - - return -} - -// GetHierarchicalEntityRolePreparer prepares the GetHierarchicalEntityRole request. -func (client ModelClient) GetHierarchicalEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "hEntityId": autorest.Encode("path", hEntityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetHierarchicalEntityRoleSender sends the GetHierarchicalEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetHierarchicalEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetHierarchicalEntityRoleResponder handles the response to the GetHierarchicalEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) GetHierarchicalEntityRoleResponder(resp *http.Response) (result EntityRole, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetHierarchicalEntityRoles sends the get hierarchical entity roles request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// hEntityID - the hierarchical entity extractor ID. -func (client ModelClient) GetHierarchicalEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (result ListEntityRole, err error) { - req, err := client.GetHierarchicalEntityRolesPreparer(ctx, appID, versionID, hEntityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityRoles", nil, "Failure preparing request") - return - } - - resp, err := client.GetHierarchicalEntityRolesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityRoles", resp, "Failure sending request") - return - } - - result, err = client.GetHierarchicalEntityRolesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityRoles", resp, "Failure responding to request") - } - - return -} - -// GetHierarchicalEntityRolesPreparer prepares the GetHierarchicalEntityRoles request. -func (client ModelClient) GetHierarchicalEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "hEntityId": autorest.Encode("path", hEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetHierarchicalEntityRolesSender sends the GetHierarchicalEntityRoles request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetHierarchicalEntityRolesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetHierarchicalEntityRolesResponder handles the response to the GetHierarchicalEntityRoles request. The method always -// closes the http.Response Body. -func (client ModelClient) GetHierarchicalEntityRolesResponder(resp *http.Response) (result ListEntityRole, 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 -} - -// GetIntent gets information about the intent model. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// intentID - the intent classifier ID. -func (client ModelClient) GetIntent(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID) (result IntentClassifier, err error) { - req, err := client.GetIntentPreparer(ctx, appID, versionID, intentID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetIntent", nil, "Failure preparing request") - return - } - - resp, err := client.GetIntentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetIntent", resp, "Failure sending request") - return - } - - result, err = client.GetIntentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetIntent", resp, "Failure responding to request") - } - - return -} - -// GetIntentPreparer prepares the GetIntent request. -func (client ModelClient) GetIntentPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "intentId": autorest.Encode("path", intentID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetIntentSender sends the GetIntent request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetIntentSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetIntentResponder handles the response to the GetIntent request. The method always -// closes the http.Response Body. -func (client ModelClient) GetIntentResponder(resp *http.Response) (result IntentClassifier, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetIntentSuggestions suggests examples that would improve the accuracy of the intent model. -// Parameters: -// appID - the application ID. -// 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) GetIntentSuggestions(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, take *int32) (result ListIntentsSuggestionExample, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.ModelClient", "GetIntentSuggestions", err.Error()) - } - - req, err := client.GetIntentSuggestionsPreparer(ctx, appID, versionID, intentID, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetIntentSuggestions", nil, "Failure preparing request") - return - } - - resp, err := client.GetIntentSuggestionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetIntentSuggestions", resp, "Failure sending request") - return - } - - result, err = client.GetIntentSuggestionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetIntentSuggestions", resp, "Failure responding to request") - } - - return -} - -// GetIntentSuggestionsPreparer prepares the GetIntentSuggestions request. -func (client ModelClient) GetIntentSuggestionsPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "intentId": autorest.Encode("path", intentID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/suggest", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetIntentSuggestionsSender sends the GetIntentSuggestions request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetIntentSuggestionsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetIntentSuggestionsResponder handles the response to the GetIntentSuggestions request. The method always -// closes the http.Response Body. -func (client ModelClient) GetIntentSuggestionsResponder(resp *http.Response) (result ListIntentsSuggestionExample, 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 -} - -// GetPatternAnyEntityInfo sends the get pattern any entity info request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity extractor ID. -func (client ModelClient) GetPatternAnyEntityInfo(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result PatternAnyEntityExtractor, err error) { - req, err := client.GetPatternAnyEntityInfoPreparer(ctx, appID, versionID, entityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityInfo", nil, "Failure preparing request") - return - } - - resp, err := client.GetPatternAnyEntityInfoSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityInfo", resp, "Failure sending request") - return - } - - result, err = client.GetPatternAnyEntityInfoResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityInfo", resp, "Failure responding to request") - } - - return -} - -// GetPatternAnyEntityInfoPreparer prepares the GetPatternAnyEntityInfo request. -func (client ModelClient) GetPatternAnyEntityInfoPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPatternAnyEntityInfoSender sends the GetPatternAnyEntityInfo request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetPatternAnyEntityInfoSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPatternAnyEntityInfoResponder handles the response to the GetPatternAnyEntityInfo request. The method always -// closes the http.Response Body. -func (client ModelClient) GetPatternAnyEntityInfoResponder(resp *http.Response) (result PatternAnyEntityExtractor, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetPatternAnyEntityInfos sends the get pattern any entity infos request. -// Parameters: -// appID - the application ID. -// 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 ModelClient) GetPatternAnyEntityInfos(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListPatternAnyEntityExtractor, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.ModelClient", "GetPatternAnyEntityInfos", err.Error()) - } - - req, err := client.GetPatternAnyEntityInfosPreparer(ctx, appID, versionID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityInfos", nil, "Failure preparing request") - return - } - - resp, err := client.GetPatternAnyEntityInfosSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityInfos", resp, "Failure sending request") - return - } - - result, err = client.GetPatternAnyEntityInfosResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityInfos", resp, "Failure responding to request") - } - - return -} - -// GetPatternAnyEntityInfosPreparer prepares the GetPatternAnyEntityInfos request. -func (client ModelClient) GetPatternAnyEntityInfosPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPatternAnyEntityInfosSender sends the GetPatternAnyEntityInfos request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetPatternAnyEntityInfosSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPatternAnyEntityInfosResponder handles the response to the GetPatternAnyEntityInfos request. The method always -// closes the http.Response Body. -func (client ModelClient) GetPatternAnyEntityInfosResponder(resp *http.Response) (result ListPatternAnyEntityExtractor, 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 -} - -// GetPatternAnyEntityRole sends the get pattern any entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - entity ID. -// roleID - entity role ID. -func (client ModelClient) GetPatternAnyEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) { - req, err := client.GetPatternAnyEntityRolePreparer(ctx, appID, versionID, entityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.GetPatternAnyEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityRole", resp, "Failure sending request") - return - } - - result, err = client.GetPatternAnyEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityRole", resp, "Failure responding to request") - } - - return -} - -// GetPatternAnyEntityRolePreparer prepares the GetPatternAnyEntityRole request. -func (client ModelClient) GetPatternAnyEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPatternAnyEntityRoleSender sends the GetPatternAnyEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetPatternAnyEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPatternAnyEntityRoleResponder handles the response to the GetPatternAnyEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) GetPatternAnyEntityRoleResponder(resp *http.Response) (result EntityRole, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetPatternAnyEntityRoles sends the get pattern any entity roles request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - entity Id -func (client ModelClient) GetPatternAnyEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) { - req, err := client.GetPatternAnyEntityRolesPreparer(ctx, appID, versionID, entityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityRoles", nil, "Failure preparing request") - return - } - - resp, err := client.GetPatternAnyEntityRolesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityRoles", resp, "Failure sending request") - return - } - - result, err = client.GetPatternAnyEntityRolesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityRoles", resp, "Failure responding to request") - } - - return -} - -// GetPatternAnyEntityRolesPreparer prepares the GetPatternAnyEntityRoles request. -func (client ModelClient) GetPatternAnyEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPatternAnyEntityRolesSender sends the GetPatternAnyEntityRoles request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetPatternAnyEntityRolesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPatternAnyEntityRolesResponder handles the response to the GetPatternAnyEntityRoles request. The method always -// closes the http.Response Body. -func (client ModelClient) GetPatternAnyEntityRolesResponder(resp *http.Response) (result ListEntityRole, 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 -} - -// GetPrebuilt gets information about the prebuilt entity model. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// prebuiltID - the prebuilt entity extractor ID. -func (client ModelClient) GetPrebuilt(ctx context.Context, appID uuid.UUID, versionID string, prebuiltID uuid.UUID) (result PrebuiltEntityExtractor, err error) { - req, err := client.GetPrebuiltPreparer(ctx, appID, versionID, prebuiltID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuilt", nil, "Failure preparing request") - return - } - - resp, err := client.GetPrebuiltSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuilt", resp, "Failure sending request") - return - } - - result, err = client.GetPrebuiltResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuilt", resp, "Failure responding to request") - } - - return -} - -// GetPrebuiltPreparer prepares the GetPrebuilt request. -func (client ModelClient) GetPrebuiltPreparer(ctx context.Context, appID uuid.UUID, versionID string, prebuiltID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "prebuiltId": autorest.Encode("path", prebuiltID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPrebuiltSender sends the GetPrebuilt request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetPrebuiltSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPrebuiltResponder handles the response to the GetPrebuilt request. The method always -// closes the http.Response Body. -func (client ModelClient) GetPrebuiltResponder(resp *http.Response) (result PrebuiltEntityExtractor, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetPrebuiltEntityRole sends the get prebuilt entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - entity ID. -// roleID - entity role ID. -func (client ModelClient) GetPrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) { - req, err := client.GetPrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuiltEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.GetPrebuiltEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuiltEntityRole", resp, "Failure sending request") - return - } - - result, err = client.GetPrebuiltEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuiltEntityRole", resp, "Failure responding to request") - } - - return -} - -// GetPrebuiltEntityRolePreparer prepares the GetPrebuiltEntityRole request. -func (client ModelClient) GetPrebuiltEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPrebuiltEntityRoleSender sends the GetPrebuiltEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetPrebuiltEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPrebuiltEntityRoleResponder handles the response to the GetPrebuiltEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) GetPrebuiltEntityRoleResponder(resp *http.Response) (result EntityRole, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetPrebuiltEntityRoles sends the get prebuilt entity roles request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - entity Id -func (client ModelClient) GetPrebuiltEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) { - req, err := client.GetPrebuiltEntityRolesPreparer(ctx, appID, versionID, entityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuiltEntityRoles", nil, "Failure preparing request") - return - } - - resp, err := client.GetPrebuiltEntityRolesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuiltEntityRoles", resp, "Failure sending request") - return - } - - result, err = client.GetPrebuiltEntityRolesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuiltEntityRoles", resp, "Failure responding to request") - } - - return -} - -// GetPrebuiltEntityRolesPreparer prepares the GetPrebuiltEntityRoles request. -func (client ModelClient) GetPrebuiltEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPrebuiltEntityRolesSender sends the GetPrebuiltEntityRoles request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetPrebuiltEntityRolesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPrebuiltEntityRolesResponder handles the response to the GetPrebuiltEntityRoles request. The method always -// closes the http.Response Body. -func (client ModelClient) GetPrebuiltEntityRolesResponder(resp *http.Response) (result ListEntityRole, 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 -} - -// GetRegexEntityEntityInfo sends the get regex entity entity info request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// regexEntityID - the regex entity model ID. -func (client ModelClient) GetRegexEntityEntityInfo(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID) (result RegexEntityExtractor, err error) { - req, err := client.GetRegexEntityEntityInfoPreparer(ctx, appID, versionID, regexEntityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityEntityInfo", nil, "Failure preparing request") - return - } - - resp, err := client.GetRegexEntityEntityInfoSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityEntityInfo", resp, "Failure sending request") - return - } - - result, err = client.GetRegexEntityEntityInfoResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityEntityInfo", resp, "Failure responding to request") - } - - return -} - -// GetRegexEntityEntityInfoPreparer prepares the GetRegexEntityEntityInfo request. -func (client ModelClient) GetRegexEntityEntityInfoPreparer(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "regexEntityId": autorest.Encode("path", regexEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRegexEntityEntityInfoSender sends the GetRegexEntityEntityInfo request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetRegexEntityEntityInfoSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRegexEntityEntityInfoResponder handles the response to the GetRegexEntityEntityInfo request. The method always -// closes the http.Response Body. -func (client ModelClient) GetRegexEntityEntityInfoResponder(resp *http.Response) (result RegexEntityExtractor, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetRegexEntityInfos sends the get regex entity infos request. -// Parameters: -// appID - the application ID. -// 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 ModelClient) GetRegexEntityInfos(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListRegexEntityExtractor, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.ModelClient", "GetRegexEntityInfos", err.Error()) - } - - req, err := client.GetRegexEntityInfosPreparer(ctx, appID, versionID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityInfos", nil, "Failure preparing request") - return - } - - resp, err := client.GetRegexEntityInfosSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityInfos", resp, "Failure sending request") - return - } - - result, err = client.GetRegexEntityInfosResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityInfos", resp, "Failure responding to request") - } - - return -} - -// GetRegexEntityInfosPreparer prepares the GetRegexEntityInfos request. -func (client ModelClient) GetRegexEntityInfosPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRegexEntityInfosSender sends the GetRegexEntityInfos request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetRegexEntityInfosSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRegexEntityInfosResponder handles the response to the GetRegexEntityInfos request. The method always -// closes the http.Response Body. -func (client ModelClient) GetRegexEntityInfosResponder(resp *http.Response) (result ListRegexEntityExtractor, 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 -} - -// GetRegexEntityRole sends the get regex entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - entity ID. -// roleID - entity role ID. -func (client ModelClient) GetRegexEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) { - req, err := client.GetRegexEntityRolePreparer(ctx, appID, versionID, entityID, roleID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.GetRegexEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityRole", resp, "Failure sending request") - return - } - - result, err = client.GetRegexEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityRole", resp, "Failure responding to request") - } - - return -} - -// GetRegexEntityRolePreparer prepares the GetRegexEntityRole request. -func (client ModelClient) GetRegexEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRegexEntityRoleSender sends the GetRegexEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetRegexEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRegexEntityRoleResponder handles the response to the GetRegexEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) GetRegexEntityRoleResponder(resp *http.Response) (result EntityRole, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetRegexEntityRoles sends the get regex entity roles request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - entity Id -func (client ModelClient) GetRegexEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) { - req, err := client.GetRegexEntityRolesPreparer(ctx, appID, versionID, entityID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityRoles", nil, "Failure preparing request") - return - } - - resp, err := client.GetRegexEntityRolesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityRoles", resp, "Failure sending request") - return - } - - result, err = client.GetRegexEntityRolesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityRoles", resp, "Failure responding to request") - } - - return -} - -// GetRegexEntityRolesPreparer prepares the GetRegexEntityRoles request. -func (client ModelClient) GetRegexEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRegexEntityRolesSender sends the GetRegexEntityRoles request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) GetRegexEntityRolesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetRegexEntityRolesResponder handles the response to the GetRegexEntityRoles request. The method always -// closes the http.Response Body. -func (client ModelClient) GetRegexEntityRolesResponder(resp *http.Response) (result ListEntityRole, 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 -} - -// ListClosedLists gets information about the closedlist models. -// Parameters: -// appID - the application ID. -// 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 ModelClient) ListClosedLists(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListClosedListEntityExtractor, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.ModelClient", "ListClosedLists", err.Error()) - } - - req, err := client.ListClosedListsPreparer(ctx, appID, versionID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListClosedLists", nil, "Failure preparing request") - return - } - - resp, err := client.ListClosedListsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListClosedLists", resp, "Failure sending request") - return - } - - result, err = client.ListClosedListsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListClosedLists", resp, "Failure responding to request") - } - - return -} - -// ListClosedListsPreparer prepares the ListClosedLists request. -func (client ModelClient) ListClosedListsPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListClosedListsSender sends the ListClosedLists request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) ListClosedListsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListClosedListsResponder handles the response to the ListClosedLists request. The method always -// closes the http.Response Body. -func (client ModelClient) ListClosedListsResponder(resp *http.Response) (result ListClosedListEntityExtractor, 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 -} - -// ListCompositeEntities gets information about the composite entity models. -// Parameters: -// appID - the application ID. -// 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 ModelClient) ListCompositeEntities(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListCompositeEntityExtractor, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.ModelClient", "ListCompositeEntities", err.Error()) - } - - req, err := client.ListCompositeEntitiesPreparer(ctx, appID, versionID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCompositeEntities", nil, "Failure preparing request") - return - } - - resp, err := client.ListCompositeEntitiesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCompositeEntities", resp, "Failure sending request") - return - } - - result, err = client.ListCompositeEntitiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCompositeEntities", resp, "Failure responding to request") - } - - return -} - -// ListCompositeEntitiesPreparer prepares the ListCompositeEntities request. -func (client ModelClient) ListCompositeEntitiesPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListCompositeEntitiesSender sends the ListCompositeEntities request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) ListCompositeEntitiesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListCompositeEntitiesResponder handles the response to the ListCompositeEntities request. The method always -// closes the http.Response Body. -func (client ModelClient) ListCompositeEntitiesResponder(resp *http.Response) (result ListCompositeEntityExtractor, 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 -} - -// ListCustomPrebuiltEntities gets all custom prebuilt entities information of this application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -func (client ModelClient) ListCustomPrebuiltEntities(ctx context.Context, appID uuid.UUID, versionID string) (result ListEntityExtractor, err error) { - req, err := client.ListCustomPrebuiltEntitiesPreparer(ctx, appID, versionID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltEntities", nil, "Failure preparing request") - return - } - - resp, err := client.ListCustomPrebuiltEntitiesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltEntities", resp, "Failure sending request") - return - } - - result, err = client.ListCustomPrebuiltEntitiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltEntities", resp, "Failure responding to request") - } - - return -} - -// ListCustomPrebuiltEntitiesPreparer prepares the ListCustomPrebuiltEntities request. -func (client ModelClient) ListCustomPrebuiltEntitiesPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListCustomPrebuiltEntitiesSender sends the ListCustomPrebuiltEntities request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) ListCustomPrebuiltEntitiesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListCustomPrebuiltEntitiesResponder handles the response to the ListCustomPrebuiltEntities request. The method always -// closes the http.Response Body. -func (client ModelClient) ListCustomPrebuiltEntitiesResponder(resp *http.Response) (result ListEntityExtractor, 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 -} - -// ListCustomPrebuiltIntents gets custom prebuilt intents information of this application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -func (client ModelClient) ListCustomPrebuiltIntents(ctx context.Context, appID uuid.UUID, versionID string) (result ListIntentClassifier, err error) { - req, err := client.ListCustomPrebuiltIntentsPreparer(ctx, appID, versionID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltIntents", nil, "Failure preparing request") - return - } - - resp, err := client.ListCustomPrebuiltIntentsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltIntents", resp, "Failure sending request") - return - } - - result, err = client.ListCustomPrebuiltIntentsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltIntents", resp, "Failure responding to request") - } - - return -} - -// ListCustomPrebuiltIntentsPreparer prepares the ListCustomPrebuiltIntents request. -func (client ModelClient) ListCustomPrebuiltIntentsPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltintents", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListCustomPrebuiltIntentsSender sends the ListCustomPrebuiltIntents request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) ListCustomPrebuiltIntentsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListCustomPrebuiltIntentsResponder handles the response to the ListCustomPrebuiltIntents request. The method always -// closes the http.Response Body. -func (client ModelClient) ListCustomPrebuiltIntentsResponder(resp *http.Response) (result ListIntentClassifier, 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 -} - -// ListCustomPrebuiltModels gets all custom prebuilt models information of this application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -func (client ModelClient) ListCustomPrebuiltModels(ctx context.Context, appID uuid.UUID, versionID string) (result ListCustomPrebuiltModel, err error) { - req, err := client.ListCustomPrebuiltModelsPreparer(ctx, appID, versionID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltModels", nil, "Failure preparing request") - return - } - - resp, err := client.ListCustomPrebuiltModelsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltModels", resp, "Failure sending request") - return - } - - result, err = client.ListCustomPrebuiltModelsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltModels", resp, "Failure responding to request") - } - - return -} - -// ListCustomPrebuiltModelsPreparer prepares the ListCustomPrebuiltModels request. -func (client ModelClient) ListCustomPrebuiltModelsPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltmodels", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListCustomPrebuiltModelsSender sends the ListCustomPrebuiltModels request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) ListCustomPrebuiltModelsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListCustomPrebuiltModelsResponder handles the response to the ListCustomPrebuiltModels request. The method always -// closes the http.Response Body. -func (client ModelClient) ListCustomPrebuiltModelsResponder(resp *http.Response) (result ListCustomPrebuiltModel, 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 -} - -// ListEntities gets information about the entity models. -// Parameters: -// appID - the application ID. -// 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 ModelClient) ListEntities(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListEntityExtractor, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.ModelClient", "ListEntities", err.Error()) - } - - req, err := client.ListEntitiesPreparer(ctx, appID, versionID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListEntities", nil, "Failure preparing request") - return - } - - resp, err := client.ListEntitiesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListEntities", resp, "Failure sending request") - return - } - - result, err = client.ListEntitiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListEntities", resp, "Failure responding to request") - } - - return -} - -// ListEntitiesPreparer prepares the ListEntities request. -func (client ModelClient) ListEntitiesPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListEntitiesSender sends the ListEntities request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) ListEntitiesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListEntitiesResponder handles the response to the ListEntities request. The method always -// closes the http.Response Body. -func (client ModelClient) ListEntitiesResponder(resp *http.Response) (result ListEntityExtractor, 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 -} - -// ListHierarchicalEntities gets information about the hierarchical entity models. -// Parameters: -// appID - the application ID. -// 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 ModelClient) ListHierarchicalEntities(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListHierarchicalEntityExtractor, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.ModelClient", "ListHierarchicalEntities", err.Error()) - } - - req, err := client.ListHierarchicalEntitiesPreparer(ctx, appID, versionID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListHierarchicalEntities", nil, "Failure preparing request") - return - } - - resp, err := client.ListHierarchicalEntitiesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListHierarchicalEntities", resp, "Failure sending request") - return - } - - result, err = client.ListHierarchicalEntitiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListHierarchicalEntities", resp, "Failure responding to request") - } - - return -} - -// ListHierarchicalEntitiesPreparer prepares the ListHierarchicalEntities request. -func (client ModelClient) ListHierarchicalEntitiesPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListHierarchicalEntitiesSender sends the ListHierarchicalEntities request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) ListHierarchicalEntitiesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListHierarchicalEntitiesResponder handles the response to the ListHierarchicalEntities request. The method always -// closes the http.Response Body. -func (client ModelClient) ListHierarchicalEntitiesResponder(resp *http.Response) (result ListHierarchicalEntityExtractor, 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 -} - -// ListIntents gets information about the intent models. -// Parameters: -// appID - the application ID. -// 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 ModelClient) ListIntents(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListIntentClassifier, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.ModelClient", "ListIntents", err.Error()) - } - - req, err := client.ListIntentsPreparer(ctx, appID, versionID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListIntents", nil, "Failure preparing request") - return - } - - resp, err := client.ListIntentsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListIntents", resp, "Failure sending request") - return - } - - result, err = client.ListIntentsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListIntents", resp, "Failure responding to request") - } - - return -} - -// ListIntentsPreparer prepares the ListIntents request. -func (client ModelClient) ListIntentsPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListIntentsSender sends the ListIntents request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) ListIntentsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListIntentsResponder handles the response to the ListIntents request. The method always -// closes the http.Response Body. -func (client ModelClient) ListIntentsResponder(resp *http.Response) (result ListIntentClassifier, 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 -} - -// ListModels gets information about the application version models. -// Parameters: -// appID - the application ID. -// 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 ModelClient) ListModels(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListModelInfoResponse, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.ModelClient", "ListModels", err.Error()) - } - - req, err := client.ListModelsPreparer(ctx, appID, versionID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListModels", nil, "Failure preparing request") - return - } - - resp, err := client.ListModelsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListModels", resp, "Failure sending request") - return - } - - result, err = client.ListModelsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListModels", resp, "Failure responding to request") - } - - return -} - -// ListModelsPreparer prepares the ListModels request. -func (client ModelClient) ListModelsPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/models", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 ModelClient) ListModelsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 ModelClient) ListModelsResponder(resp *http.Response) (result ListModelInfoResponse, 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 -} - -// ListPrebuiltEntities gets all the available prebuilt entity extractors for the application. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -func (client ModelClient) ListPrebuiltEntities(ctx context.Context, appID uuid.UUID, versionID string) (result ListAvailablePrebuiltEntityModel, err error) { - req, err := client.ListPrebuiltEntitiesPreparer(ctx, appID, versionID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListPrebuiltEntities", nil, "Failure preparing request") - return - } - - resp, err := client.ListPrebuiltEntitiesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListPrebuiltEntities", resp, "Failure sending request") - return - } - - result, err = client.ListPrebuiltEntitiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListPrebuiltEntities", resp, "Failure responding to request") - } - - return -} - -// ListPrebuiltEntitiesPreparer prepares the ListPrebuiltEntities request. -func (client ModelClient) ListPrebuiltEntitiesPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/listprebuilts", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPrebuiltEntitiesSender sends the ListPrebuiltEntities request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) ListPrebuiltEntitiesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListPrebuiltEntitiesResponder handles the response to the ListPrebuiltEntities request. The method always -// closes the http.Response Body. -func (client ModelClient) ListPrebuiltEntitiesResponder(resp *http.Response) (result ListAvailablePrebuiltEntityModel, 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 -} - -// ListPrebuilts gets information about the prebuilt entity models. -// Parameters: -// appID - the application ID. -// 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 ModelClient) ListPrebuilts(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListPrebuiltEntityExtractor, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.ModelClient", "ListPrebuilts", err.Error()) - } - - req, err := client.ListPrebuiltsPreparer(ctx, appID, versionID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListPrebuilts", nil, "Failure preparing request") - return - } - - resp, err := client.ListPrebuiltsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListPrebuilts", resp, "Failure sending request") - return - } - - result, err = client.ListPrebuiltsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListPrebuilts", resp, "Failure responding to request") - } - - return -} - -// ListPrebuiltsPreparer prepares the ListPrebuilts request. -func (client ModelClient) ListPrebuiltsPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPrebuiltsSender sends the ListPrebuilts request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) ListPrebuiltsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListPrebuiltsResponder handles the response to the ListPrebuilts request. The method always -// closes the http.Response Body. -func (client ModelClient) ListPrebuiltsResponder(resp *http.Response) (result ListPrebuiltEntityExtractor, 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 -} - -// PatchClosedList adds a batch of sublists to an existing closedlist. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// clEntityID - the closed list model ID. -// closedListModelPatchObject - a words list batch. -func (client ModelClient) PatchClosedList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, closedListModelPatchObject ClosedListModelPatchObject) (result OperationStatus, err error) { - req, err := client.PatchClosedListPreparer(ctx, appID, versionID, clEntityID, closedListModelPatchObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "PatchClosedList", nil, "Failure preparing request") - return - } - - resp, err := client.PatchClosedListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "PatchClosedList", resp, "Failure sending request") - return - } - - result, err = client.PatchClosedListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "PatchClosedList", resp, "Failure responding to request") - } - - return -} - -// PatchClosedListPreparer prepares the PatchClosedList request. -func (client ModelClient) PatchClosedListPreparer(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, closedListModelPatchObject ClosedListModelPatchObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "clEntityId": autorest.Encode("path", clEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}", pathParameters), - autorest.WithJSON(closedListModelPatchObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchClosedListSender sends the PatchClosedList request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) PatchClosedListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// PatchClosedListResponder handles the response to the PatchClosedList request. The method always -// closes the http.Response Body. -func (client ModelClient) PatchClosedListResponder(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 -} - -// UpdateClosedList updates the closed list model. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// clEntityID - the closed list model ID. -// closedListModelUpdateObject - the new entity name and words list. -func (client ModelClient) UpdateClosedList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, closedListModelUpdateObject ClosedListModelUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdateClosedListPreparer(ctx, appID, versionID, clEntityID, closedListModelUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateClosedList", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateClosedListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateClosedList", resp, "Failure sending request") - return - } - - result, err = client.UpdateClosedListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateClosedList", resp, "Failure responding to request") - } - - return -} - -// UpdateClosedListPreparer prepares the UpdateClosedList request. -func (client ModelClient) UpdateClosedListPreparer(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, closedListModelUpdateObject ClosedListModelUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "clEntityId": autorest.Encode("path", clEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}", pathParameters), - autorest.WithJSON(closedListModelUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateClosedListSender sends the UpdateClosedList request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateClosedListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateClosedListResponder handles the response to the UpdateClosedList request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateClosedListResponder(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 -} - -// UpdateClosedListEntityRole sends the update closed list entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity ID. -// roleID - the entity role ID. -// entityRoleUpdateObject - the new entity role. -func (client ModelClient) UpdateClosedListEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdateClosedListEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateClosedListEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateClosedListEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateClosedListEntityRole", resp, "Failure sending request") - return - } - - result, err = client.UpdateClosedListEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateClosedListEntityRole", resp, "Failure responding to request") - } - - return -} - -// UpdateClosedListEntityRolePreparer prepares the UpdateClosedListEntityRole request. -func (client ModelClient) UpdateClosedListEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}", pathParameters), - autorest.WithJSON(entityRoleUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateClosedListEntityRoleSender sends the UpdateClosedListEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateClosedListEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateClosedListEntityRoleResponder handles the response to the UpdateClosedListEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateClosedListEntityRoleResponder(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 -} - -// UpdateCompositeEntity updates the composite entity extractor. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// cEntityID - the composite entity extractor ID. -// compositeModelUpdateObject - a model object containing the new entity extractor name and children. -func (client ModelClient) UpdateCompositeEntity(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, compositeModelUpdateObject CompositeEntityModel) (result OperationStatus, err error) { - req, err := client.UpdateCompositeEntityPreparer(ctx, appID, versionID, cEntityID, compositeModelUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCompositeEntity", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateCompositeEntitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCompositeEntity", resp, "Failure sending request") - return - } - - result, err = client.UpdateCompositeEntityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCompositeEntity", resp, "Failure responding to request") - } - - return -} - -// UpdateCompositeEntityPreparer prepares the UpdateCompositeEntity request. -func (client ModelClient) UpdateCompositeEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, compositeModelUpdateObject CompositeEntityModel) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "cEntityId": autorest.Encode("path", cEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}", pathParameters), - autorest.WithJSON(compositeModelUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateCompositeEntitySender sends the UpdateCompositeEntity request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateCompositeEntitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateCompositeEntityResponder handles the response to the UpdateCompositeEntity request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateCompositeEntityResponder(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 -} - -// UpdateCompositeEntityRole sends the update composite entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// cEntityID - the composite entity extractor ID. -// roleID - the entity role ID. -// entityRoleUpdateObject - the new entity role. -func (client ModelClient) UpdateCompositeEntityRole(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdateCompositeEntityRolePreparer(ctx, appID, versionID, cEntityID, roleID, entityRoleUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCompositeEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateCompositeEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCompositeEntityRole", resp, "Failure sending request") - return - } - - result, err = client.UpdateCompositeEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCompositeEntityRole", resp, "Failure responding to request") - } - - return -} - -// UpdateCompositeEntityRolePreparer prepares the UpdateCompositeEntityRole request. -func (client ModelClient) UpdateCompositeEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "cEntityId": autorest.Encode("path", cEntityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}", pathParameters), - autorest.WithJSON(entityRoleUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateCompositeEntityRoleSender sends the UpdateCompositeEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateCompositeEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateCompositeEntityRoleResponder handles the response to the UpdateCompositeEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateCompositeEntityRoleResponder(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 -} - -// UpdateCustomPrebuiltEntityRole sends the update custom prebuilt entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity ID. -// roleID - the entity role ID. -// entityRoleUpdateObject - the new entity role. -func (client ModelClient) UpdateCustomPrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdateCustomPrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCustomPrebuiltEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateCustomPrebuiltEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCustomPrebuiltEntityRole", resp, "Failure sending request") - return - } - - result, err = client.UpdateCustomPrebuiltEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCustomPrebuiltEntityRole", resp, "Failure responding to request") - } - - return -} - -// UpdateCustomPrebuiltEntityRolePreparer prepares the UpdateCustomPrebuiltEntityRole request. -func (client ModelClient) UpdateCustomPrebuiltEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}", pathParameters), - autorest.WithJSON(entityRoleUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateCustomPrebuiltEntityRoleSender sends the UpdateCustomPrebuiltEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateCustomPrebuiltEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateCustomPrebuiltEntityRoleResponder handles the response to the UpdateCustomPrebuiltEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateCustomPrebuiltEntityRoleResponder(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 -} - -// UpdateEntity updates the name of an entity extractor. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity extractor ID. -// modelUpdateObject - a model object containing the new entity extractor name. -func (client ModelClient) UpdateEntity(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, modelUpdateObject ModelUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdateEntityPreparer(ctx, appID, versionID, entityID, modelUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateEntity", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateEntitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateEntity", resp, "Failure sending request") - return - } - - result, err = client.UpdateEntityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateEntity", resp, "Failure responding to request") - } - - return -} - -// UpdateEntityPreparer prepares the UpdateEntity request. -func (client ModelClient) UpdateEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, modelUpdateObject ModelUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}", pathParameters), - autorest.WithJSON(modelUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateEntitySender sends the UpdateEntity request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateEntitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateEntityResponder handles the response to the UpdateEntity request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateEntityResponder(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 -} - -// UpdateEntityRole sends the update entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity ID. -// roleID - the entity role ID. -// entityRoleUpdateObject - the new entity role. -func (client ModelClient) UpdateEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdateEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateEntityRole", resp, "Failure sending request") - return - } - - result, err = client.UpdateEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateEntityRole", resp, "Failure responding to request") - } - - return -} - -// UpdateEntityRolePreparer prepares the UpdateEntityRole request. -func (client ModelClient) UpdateEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}", pathParameters), - autorest.WithJSON(entityRoleUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateEntityRoleSender sends the UpdateEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateEntityRoleResponder handles the response to the UpdateEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateEntityRoleResponder(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 -} - -// UpdateExplicitListItem sends the update explicit list item request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the Pattern.Any entity extractor ID. -// itemID - the explicit list item ID. -// item - the new explicit list item. -func (client ModelClient) UpdateExplicitListItem(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64, item ExplicitListItemUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdateExplicitListItemPreparer(ctx, appID, versionID, entityID, itemID, item) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateExplicitListItem", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateExplicitListItemSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateExplicitListItem", resp, "Failure sending request") - return - } - - result, err = client.UpdateExplicitListItemResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateExplicitListItem", resp, "Failure responding to request") - } - - return -} - -// UpdateExplicitListItemPreparer prepares the UpdateExplicitListItem request. -func (client ModelClient) UpdateExplicitListItemPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64, item ExplicitListItemUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "itemId": autorest.Encode("path", itemID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}", pathParameters), - autorest.WithJSON(item)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateExplicitListItemSender sends the UpdateExplicitListItem request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateExplicitListItemSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateExplicitListItemResponder handles the response to the UpdateExplicitListItem request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateExplicitListItemResponder(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 -} - -// UpdateHierarchicalEntity updates the name and children of a hierarchical entity model. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// hEntityID - the hierarchical entity extractor ID. -// hierarchicalModelUpdateObject - model containing names of the children of the hierarchical entity. -func (client ModelClient) UpdateHierarchicalEntity(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hierarchicalModelUpdateObject HierarchicalEntityModel) (result OperationStatus, err error) { - req, err := client.UpdateHierarchicalEntityPreparer(ctx, appID, versionID, hEntityID, hierarchicalModelUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntity", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateHierarchicalEntitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntity", resp, "Failure sending request") - return - } - - result, err = client.UpdateHierarchicalEntityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntity", resp, "Failure responding to request") - } - - return -} - -// UpdateHierarchicalEntityPreparer prepares the UpdateHierarchicalEntity request. -func (client ModelClient) UpdateHierarchicalEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hierarchicalModelUpdateObject HierarchicalEntityModel) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "hEntityId": autorest.Encode("path", hEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}", pathParameters), - autorest.WithJSON(hierarchicalModelUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateHierarchicalEntitySender sends the UpdateHierarchicalEntity request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateHierarchicalEntitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateHierarchicalEntityResponder handles the response to the UpdateHierarchicalEntity request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateHierarchicalEntityResponder(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 -} - -// UpdateHierarchicalEntityChild renames a single child in an existing hierarchical entity model. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// hEntityID - the hierarchical entity extractor ID. -// hChildID - the hierarchical entity extractor child ID. -// hierarchicalChildModelUpdateObject - model object containing new name of the hierarchical entity child. -func (client ModelClient) UpdateHierarchicalEntityChild(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID, hierarchicalChildModelUpdateObject HierarchicalChildModelUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdateHierarchicalEntityChildPreparer(ctx, appID, versionID, hEntityID, hChildID, hierarchicalChildModelUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntityChild", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateHierarchicalEntityChildSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntityChild", resp, "Failure sending request") - return - } - - result, err = client.UpdateHierarchicalEntityChildResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntityChild", resp, "Failure responding to request") - } - - return -} - -// UpdateHierarchicalEntityChildPreparer prepares the UpdateHierarchicalEntityChild request. -func (client ModelClient) UpdateHierarchicalEntityChildPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID, hierarchicalChildModelUpdateObject HierarchicalChildModelUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "hChildId": autorest.Encode("path", hChildID), - "hEntityId": autorest.Encode("path", hEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}", pathParameters), - autorest.WithJSON(hierarchicalChildModelUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateHierarchicalEntityChildSender sends the UpdateHierarchicalEntityChild request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateHierarchicalEntityChildSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateHierarchicalEntityChildResponder handles the response to the UpdateHierarchicalEntityChild request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateHierarchicalEntityChildResponder(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 -} - -// UpdateHierarchicalEntityRole sends the update hierarchical entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// hEntityID - the hierarchical entity extractor ID. -// roleID - the entity role ID. -// entityRoleUpdateObject - the new entity role. -func (client ModelClient) UpdateHierarchicalEntityRole(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdateHierarchicalEntityRolePreparer(ctx, appID, versionID, hEntityID, roleID, entityRoleUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateHierarchicalEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntityRole", resp, "Failure sending request") - return - } - - result, err = client.UpdateHierarchicalEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntityRole", resp, "Failure responding to request") - } - - return -} - -// UpdateHierarchicalEntityRolePreparer prepares the UpdateHierarchicalEntityRole request. -func (client ModelClient) UpdateHierarchicalEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "hEntityId": autorest.Encode("path", hEntityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}", pathParameters), - autorest.WithJSON(entityRoleUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateHierarchicalEntityRoleSender sends the UpdateHierarchicalEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateHierarchicalEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateHierarchicalEntityRoleResponder handles the response to the UpdateHierarchicalEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateHierarchicalEntityRoleResponder(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 -} - -// UpdateIntent updates the name of an intent classifier. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// intentID - the intent classifier ID. -// modelUpdateObject - a model object containing the new intent classifier name. -func (client ModelClient) UpdateIntent(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, modelUpdateObject ModelUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdateIntentPreparer(ctx, appID, versionID, intentID, modelUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateIntent", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateIntentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateIntent", resp, "Failure sending request") - return - } - - result, err = client.UpdateIntentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateIntent", resp, "Failure responding to request") - } - - return -} - -// UpdateIntentPreparer prepares the UpdateIntent request. -func (client ModelClient) UpdateIntentPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, modelUpdateObject ModelUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "intentId": autorest.Encode("path", intentID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}", pathParameters), - autorest.WithJSON(modelUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateIntentSender sends the UpdateIntent request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateIntentSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateIntentResponder handles the response to the UpdateIntent request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateIntentResponder(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 -} - -// UpdatePatternAnyEntityModel sends the update pattern any entity model request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the Pattern.Any entity extractor ID. -// patternAnyUpdateObject - an object containing the explicit list of the Pattern.Any entity. -func (client ModelClient) UpdatePatternAnyEntityModel(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, patternAnyUpdateObject PatternAnyModelUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdatePatternAnyEntityModelPreparer(ctx, appID, versionID, entityID, patternAnyUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePatternAnyEntityModel", nil, "Failure preparing request") - return - } - - resp, err := client.UpdatePatternAnyEntityModelSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePatternAnyEntityModel", resp, "Failure sending request") - return - } - - result, err = client.UpdatePatternAnyEntityModelResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePatternAnyEntityModel", resp, "Failure responding to request") - } - - return -} - -// UpdatePatternAnyEntityModelPreparer prepares the UpdatePatternAnyEntityModel request. -func (client ModelClient) UpdatePatternAnyEntityModelPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, patternAnyUpdateObject PatternAnyModelUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}", pathParameters), - autorest.WithJSON(patternAnyUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdatePatternAnyEntityModelSender sends the UpdatePatternAnyEntityModel request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdatePatternAnyEntityModelSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdatePatternAnyEntityModelResponder handles the response to the UpdatePatternAnyEntityModel request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdatePatternAnyEntityModelResponder(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 -} - -// UpdatePatternAnyEntityRole sends the update pattern any entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity ID. -// roleID - the entity role ID. -// entityRoleUpdateObject - the new entity role. -func (client ModelClient) UpdatePatternAnyEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdatePatternAnyEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePatternAnyEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.UpdatePatternAnyEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePatternAnyEntityRole", resp, "Failure sending request") - return - } - - result, err = client.UpdatePatternAnyEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePatternAnyEntityRole", resp, "Failure responding to request") - } - - return -} - -// UpdatePatternAnyEntityRolePreparer prepares the UpdatePatternAnyEntityRole request. -func (client ModelClient) UpdatePatternAnyEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}", pathParameters), - autorest.WithJSON(entityRoleUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdatePatternAnyEntityRoleSender sends the UpdatePatternAnyEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdatePatternAnyEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdatePatternAnyEntityRoleResponder handles the response to the UpdatePatternAnyEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdatePatternAnyEntityRoleResponder(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 -} - -// UpdatePrebuiltEntityRole sends the update prebuilt entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity ID. -// roleID - the entity role ID. -// entityRoleUpdateObject - the new entity role. -func (client ModelClient) UpdatePrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdatePrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePrebuiltEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.UpdatePrebuiltEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePrebuiltEntityRole", resp, "Failure sending request") - return - } - - result, err = client.UpdatePrebuiltEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePrebuiltEntityRole", resp, "Failure responding to request") - } - - return -} - -// UpdatePrebuiltEntityRolePreparer prepares the UpdatePrebuiltEntityRole request. -func (client ModelClient) UpdatePrebuiltEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}", pathParameters), - autorest.WithJSON(entityRoleUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdatePrebuiltEntityRoleSender sends the UpdatePrebuiltEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdatePrebuiltEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdatePrebuiltEntityRoleResponder handles the response to the UpdatePrebuiltEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdatePrebuiltEntityRoleResponder(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 -} - -// UpdateRegexEntityModel sends the update regex entity model request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// regexEntityID - the regex entity extractor ID. -// regexEntityUpdateObject - an object containing the new entity name and regex pattern. -func (client ModelClient) UpdateRegexEntityModel(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID, regexEntityUpdateObject RegexModelUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdateRegexEntityModelPreparer(ctx, appID, versionID, regexEntityID, regexEntityUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateRegexEntityModel", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateRegexEntityModelSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateRegexEntityModel", resp, "Failure sending request") - return - } - - result, err = client.UpdateRegexEntityModelResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateRegexEntityModel", resp, "Failure responding to request") - } - - return -} - -// UpdateRegexEntityModelPreparer prepares the UpdateRegexEntityModel request. -func (client ModelClient) UpdateRegexEntityModelPreparer(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID, regexEntityUpdateObject RegexModelUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "regexEntityId": autorest.Encode("path", regexEntityID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}", pathParameters), - autorest.WithJSON(regexEntityUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateRegexEntityModelSender sends the UpdateRegexEntityModel request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateRegexEntityModelSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateRegexEntityModelResponder handles the response to the UpdateRegexEntityModel request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateRegexEntityModelResponder(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 -} - -// UpdateRegexEntityRole sends the update regex entity role request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// entityID - the entity ID. -// roleID - the entity role ID. -// entityRoleUpdateObject - the new entity role. -func (client ModelClient) UpdateRegexEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdateRegexEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateRegexEntityRole", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateRegexEntityRoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateRegexEntityRole", resp, "Failure sending request") - return - } - - result, err = client.UpdateRegexEntityRoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateRegexEntityRole", resp, "Failure responding to request") - } - - return -} - -// UpdateRegexEntityRolePreparer prepares the UpdateRegexEntityRole request. -func (client ModelClient) UpdateRegexEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "entityId": autorest.Encode("path", entityID), - "roleId": autorest.Encode("path", roleID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}", pathParameters), - autorest.WithJSON(entityRoleUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateRegexEntityRoleSender sends the UpdateRegexEntityRole request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateRegexEntityRoleSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateRegexEntityRoleResponder handles the response to the UpdateRegexEntityRole request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateRegexEntityRoleResponder(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 -} - -// UpdateSubList updates one of the closed list's sublists. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// clEntityID - the closed list entity extractor ID. -// subListID - the sublist ID. -// wordListBaseUpdateObject - a sublist update object containing the new canonical form and the list of words. -func (client ModelClient) UpdateSubList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, subListID int32, wordListBaseUpdateObject WordListBaseUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdateSubListPreparer(ctx, appID, versionID, clEntityID, subListID, wordListBaseUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateSubList", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSubListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateSubList", resp, "Failure sending request") - return - } - - result, err = client.UpdateSubListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateSubList", resp, "Failure responding to request") - } - - return -} - -// UpdateSubListPreparer prepares the UpdateSubList request. -func (client ModelClient) UpdateSubListPreparer(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, subListID int32, wordListBaseUpdateObject WordListBaseUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "clEntityId": autorest.Encode("path", clEntityID), - "subListId": autorest.Encode("path", subListID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}", pathParameters), - autorest.WithJSON(wordListBaseUpdateObject)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSubListSender sends the UpdateSubList request. The method will close the -// http.Response Body if it receives an error. -func (client ModelClient) UpdateSubListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateSubListResponder handles the response to the UpdateSubList request. The method always -// closes the http.Response Body. -func (client ModelClient) UpdateSubListResponder(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/cognitiveservices/v2.0/luis/programmatic/models.go b/services/cognitiveservices/v2.0/luis/programmatic/models.go deleted file mode 100644 index 20baf248cec5..000000000000 --- a/services/cognitiveservices/v2.0/luis/programmatic/models.go +++ /dev/null @@ -1,1795 +0,0 @@ -package programmatic - -// 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" - "github.com/Azure/go-autorest/autorest/date" - "github.com/satori/go.uuid" - "io" -) - -// AzureRegions enumerates the values for azure regions. -type AzureRegions string - -const ( - // Australiaeast ... - Australiaeast AzureRegions = "australiaeast" - // Brazilsouth ... - Brazilsouth AzureRegions = "brazilsouth" - // Eastasia ... - Eastasia AzureRegions = "eastasia" - // Eastus ... - Eastus AzureRegions = "eastus" - // Eastus2 ... - Eastus2 AzureRegions = "eastus2" - // Northeurope ... - Northeurope AzureRegions = "northeurope" - // Southcentralus ... - Southcentralus AzureRegions = "southcentralus" - // Southeastasia ... - Southeastasia AzureRegions = "southeastasia" - // Westcentralus ... - Westcentralus AzureRegions = "westcentralus" - // Westeurope ... - Westeurope AzureRegions = "westeurope" - // Westus ... - Westus AzureRegions = "westus" - // Westus2 ... - Westus2 AzureRegions = "westus2" -) - -// PossibleAzureRegionsValues returns an array of possible values for the AzureRegions const type. -func PossibleAzureRegionsValues() []AzureRegions { - return []AzureRegions{Australiaeast, Brazilsouth, Eastasia, Eastus, Eastus2, Northeurope, Southcentralus, Southeastasia, Westcentralus, Westeurope, Westus, Westus2} -} - -// OperationStatusType enumerates the values for operation status type. -type OperationStatusType string - -const ( - // Failed ... - Failed OperationStatusType = "Failed" - // FAILED ... - FAILED OperationStatusType = "FAILED" - // Success ... - Success OperationStatusType = "Success" -) - -// PossibleOperationStatusTypeValues returns an array of possible values for the OperationStatusType const type. -func PossibleOperationStatusTypeValues() []OperationStatusType { - return []OperationStatusType{Failed, FAILED, Success} -} - -// ReadableType enumerates the values for readable type. -type ReadableType string - -const ( - // ReadableTypeClosedListEntityExtractor ... - ReadableTypeClosedListEntityExtractor ReadableType = "Closed List Entity Extractor" - // ReadableTypeCompositeEntityExtractor ... - ReadableTypeCompositeEntityExtractor ReadableType = "Composite Entity Extractor" - // ReadableTypeEntityExtractor ... - ReadableTypeEntityExtractor ReadableType = "Entity Extractor" - // ReadableTypeHierarchicalChildEntityExtractor ... - ReadableTypeHierarchicalChildEntityExtractor ReadableType = "Hierarchical Child Entity Extractor" - // ReadableTypeHierarchicalEntityExtractor ... - ReadableTypeHierarchicalEntityExtractor ReadableType = "Hierarchical Entity Extractor" - // ReadableTypeIntentClassifier ... - ReadableTypeIntentClassifier ReadableType = "Intent Classifier" - // ReadableTypePatternAnyEntityExtractor ... - ReadableTypePatternAnyEntityExtractor ReadableType = "Pattern.Any Entity Extractor" - // ReadableTypePrebuiltEntityExtractor ... - ReadableTypePrebuiltEntityExtractor ReadableType = "Prebuilt Entity Extractor" - // ReadableTypeRegexEntityExtractor ... - ReadableTypeRegexEntityExtractor ReadableType = "Regex Entity Extractor" -) - -// PossibleReadableTypeValues returns an array of possible values for the ReadableType const type. -func PossibleReadableTypeValues() []ReadableType { - return []ReadableType{ReadableTypeClosedListEntityExtractor, ReadableTypeCompositeEntityExtractor, ReadableTypeEntityExtractor, ReadableTypeHierarchicalChildEntityExtractor, ReadableTypeHierarchicalEntityExtractor, ReadableTypeIntentClassifier, ReadableTypePatternAnyEntityExtractor, ReadableTypePrebuiltEntityExtractor, ReadableTypeRegexEntityExtractor} -} - -// ReadableType1 enumerates the values for readable type 1. -type ReadableType1 string - -const ( - // ReadableType1ClosedListEntityExtractor ... - ReadableType1ClosedListEntityExtractor ReadableType1 = "Closed List Entity Extractor" - // ReadableType1CompositeEntityExtractor ... - ReadableType1CompositeEntityExtractor ReadableType1 = "Composite Entity Extractor" - // ReadableType1EntityExtractor ... - ReadableType1EntityExtractor ReadableType1 = "Entity Extractor" - // ReadableType1HierarchicalChildEntityExtractor ... - ReadableType1HierarchicalChildEntityExtractor ReadableType1 = "Hierarchical Child Entity Extractor" - // ReadableType1HierarchicalEntityExtractor ... - ReadableType1HierarchicalEntityExtractor ReadableType1 = "Hierarchical Entity Extractor" - // ReadableType1IntentClassifier ... - ReadableType1IntentClassifier ReadableType1 = "Intent Classifier" - // ReadableType1PatternAnyEntityExtractor ... - ReadableType1PatternAnyEntityExtractor ReadableType1 = "Pattern.Any Entity Extractor" - // ReadableType1PrebuiltEntityExtractor ... - ReadableType1PrebuiltEntityExtractor ReadableType1 = "Prebuilt Entity Extractor" - // ReadableType1RegexEntityExtractor ... - ReadableType1RegexEntityExtractor ReadableType1 = "Regex Entity Extractor" -) - -// PossibleReadableType1Values returns an array of possible values for the ReadableType1 const type. -func PossibleReadableType1Values() []ReadableType1 { - return []ReadableType1{ReadableType1ClosedListEntityExtractor, ReadableType1CompositeEntityExtractor, ReadableType1EntityExtractor, ReadableType1HierarchicalChildEntityExtractor, ReadableType1HierarchicalEntityExtractor, ReadableType1IntentClassifier, ReadableType1PatternAnyEntityExtractor, ReadableType1PrebuiltEntityExtractor, ReadableType1RegexEntityExtractor} -} - -// ReadableType10 enumerates the values for readable type 10. -type ReadableType10 string - -const ( - // ReadableType10ClosedListEntityExtractor ... - ReadableType10ClosedListEntityExtractor ReadableType10 = "Closed List Entity Extractor" - // ReadableType10CompositeEntityExtractor ... - ReadableType10CompositeEntityExtractor ReadableType10 = "Composite Entity Extractor" - // ReadableType10EntityExtractor ... - ReadableType10EntityExtractor ReadableType10 = "Entity Extractor" - // ReadableType10HierarchicalChildEntityExtractor ... - ReadableType10HierarchicalChildEntityExtractor ReadableType10 = "Hierarchical Child Entity Extractor" - // ReadableType10HierarchicalEntityExtractor ... - ReadableType10HierarchicalEntityExtractor ReadableType10 = "Hierarchical Entity Extractor" - // ReadableType10IntentClassifier ... - ReadableType10IntentClassifier ReadableType10 = "Intent Classifier" - // ReadableType10PatternAnyEntityExtractor ... - ReadableType10PatternAnyEntityExtractor ReadableType10 = "Pattern.Any Entity Extractor" - // ReadableType10PrebuiltEntityExtractor ... - ReadableType10PrebuiltEntityExtractor ReadableType10 = "Prebuilt Entity Extractor" - // ReadableType10RegexEntityExtractor ... - ReadableType10RegexEntityExtractor ReadableType10 = "Regex Entity Extractor" -) - -// PossibleReadableType10Values returns an array of possible values for the ReadableType10 const type. -func PossibleReadableType10Values() []ReadableType10 { - return []ReadableType10{ReadableType10ClosedListEntityExtractor, ReadableType10CompositeEntityExtractor, ReadableType10EntityExtractor, ReadableType10HierarchicalChildEntityExtractor, ReadableType10HierarchicalEntityExtractor, ReadableType10IntentClassifier, ReadableType10PatternAnyEntityExtractor, ReadableType10PrebuiltEntityExtractor, ReadableType10RegexEntityExtractor} -} - -// ReadableType2 enumerates the values for readable type 2. -type ReadableType2 string - -const ( - // ReadableType2ClosedListEntityExtractor ... - ReadableType2ClosedListEntityExtractor ReadableType2 = "Closed List Entity Extractor" - // ReadableType2CompositeEntityExtractor ... - ReadableType2CompositeEntityExtractor ReadableType2 = "Composite Entity Extractor" - // ReadableType2EntityExtractor ... - ReadableType2EntityExtractor ReadableType2 = "Entity Extractor" - // ReadableType2HierarchicalChildEntityExtractor ... - ReadableType2HierarchicalChildEntityExtractor ReadableType2 = "Hierarchical Child Entity Extractor" - // ReadableType2HierarchicalEntityExtractor ... - ReadableType2HierarchicalEntityExtractor ReadableType2 = "Hierarchical Entity Extractor" - // ReadableType2IntentClassifier ... - ReadableType2IntentClassifier ReadableType2 = "Intent Classifier" - // ReadableType2PatternAnyEntityExtractor ... - ReadableType2PatternAnyEntityExtractor ReadableType2 = "Pattern.Any Entity Extractor" - // ReadableType2PrebuiltEntityExtractor ... - ReadableType2PrebuiltEntityExtractor ReadableType2 = "Prebuilt Entity Extractor" - // ReadableType2RegexEntityExtractor ... - ReadableType2RegexEntityExtractor ReadableType2 = "Regex Entity Extractor" -) - -// PossibleReadableType2Values returns an array of possible values for the ReadableType2 const type. -func PossibleReadableType2Values() []ReadableType2 { - return []ReadableType2{ReadableType2ClosedListEntityExtractor, ReadableType2CompositeEntityExtractor, ReadableType2EntityExtractor, ReadableType2HierarchicalChildEntityExtractor, ReadableType2HierarchicalEntityExtractor, ReadableType2IntentClassifier, ReadableType2PatternAnyEntityExtractor, ReadableType2PrebuiltEntityExtractor, ReadableType2RegexEntityExtractor} -} - -// ReadableType3 enumerates the values for readable type 3. -type ReadableType3 string - -const ( - // ReadableType3ClosedListEntityExtractor ... - ReadableType3ClosedListEntityExtractor ReadableType3 = "Closed List Entity Extractor" - // ReadableType3CompositeEntityExtractor ... - ReadableType3CompositeEntityExtractor ReadableType3 = "Composite Entity Extractor" - // ReadableType3EntityExtractor ... - ReadableType3EntityExtractor ReadableType3 = "Entity Extractor" - // ReadableType3HierarchicalChildEntityExtractor ... - ReadableType3HierarchicalChildEntityExtractor ReadableType3 = "Hierarchical Child Entity Extractor" - // ReadableType3HierarchicalEntityExtractor ... - ReadableType3HierarchicalEntityExtractor ReadableType3 = "Hierarchical Entity Extractor" - // ReadableType3IntentClassifier ... - ReadableType3IntentClassifier ReadableType3 = "Intent Classifier" - // ReadableType3PatternAnyEntityExtractor ... - ReadableType3PatternAnyEntityExtractor ReadableType3 = "Pattern.Any Entity Extractor" - // ReadableType3PrebuiltEntityExtractor ... - ReadableType3PrebuiltEntityExtractor ReadableType3 = "Prebuilt Entity Extractor" - // ReadableType3RegexEntityExtractor ... - ReadableType3RegexEntityExtractor ReadableType3 = "Regex Entity Extractor" -) - -// PossibleReadableType3Values returns an array of possible values for the ReadableType3 const type. -func PossibleReadableType3Values() []ReadableType3 { - return []ReadableType3{ReadableType3ClosedListEntityExtractor, ReadableType3CompositeEntityExtractor, ReadableType3EntityExtractor, ReadableType3HierarchicalChildEntityExtractor, ReadableType3HierarchicalEntityExtractor, ReadableType3IntentClassifier, ReadableType3PatternAnyEntityExtractor, ReadableType3PrebuiltEntityExtractor, ReadableType3RegexEntityExtractor} -} - -// ReadableType4 enumerates the values for readable type 4. -type ReadableType4 string - -const ( - // ReadableType4ClosedListEntityExtractor ... - ReadableType4ClosedListEntityExtractor ReadableType4 = "Closed List Entity Extractor" - // ReadableType4CompositeEntityExtractor ... - ReadableType4CompositeEntityExtractor ReadableType4 = "Composite Entity Extractor" - // ReadableType4EntityExtractor ... - ReadableType4EntityExtractor ReadableType4 = "Entity Extractor" - // ReadableType4HierarchicalChildEntityExtractor ... - ReadableType4HierarchicalChildEntityExtractor ReadableType4 = "Hierarchical Child Entity Extractor" - // ReadableType4HierarchicalEntityExtractor ... - ReadableType4HierarchicalEntityExtractor ReadableType4 = "Hierarchical Entity Extractor" - // ReadableType4IntentClassifier ... - ReadableType4IntentClassifier ReadableType4 = "Intent Classifier" - // ReadableType4PatternAnyEntityExtractor ... - ReadableType4PatternAnyEntityExtractor ReadableType4 = "Pattern.Any Entity Extractor" - // ReadableType4PrebuiltEntityExtractor ... - ReadableType4PrebuiltEntityExtractor ReadableType4 = "Prebuilt Entity Extractor" - // ReadableType4RegexEntityExtractor ... - ReadableType4RegexEntityExtractor ReadableType4 = "Regex Entity Extractor" -) - -// PossibleReadableType4Values returns an array of possible values for the ReadableType4 const type. -func PossibleReadableType4Values() []ReadableType4 { - return []ReadableType4{ReadableType4ClosedListEntityExtractor, ReadableType4CompositeEntityExtractor, ReadableType4EntityExtractor, ReadableType4HierarchicalChildEntityExtractor, ReadableType4HierarchicalEntityExtractor, ReadableType4IntentClassifier, ReadableType4PatternAnyEntityExtractor, ReadableType4PrebuiltEntityExtractor, ReadableType4RegexEntityExtractor} -} - -// ReadableType5 enumerates the values for readable type 5. -type ReadableType5 string - -const ( - // ReadableType5ClosedListEntityExtractor ... - ReadableType5ClosedListEntityExtractor ReadableType5 = "Closed List Entity Extractor" - // ReadableType5CompositeEntityExtractor ... - ReadableType5CompositeEntityExtractor ReadableType5 = "Composite Entity Extractor" - // ReadableType5EntityExtractor ... - ReadableType5EntityExtractor ReadableType5 = "Entity Extractor" - // ReadableType5HierarchicalChildEntityExtractor ... - ReadableType5HierarchicalChildEntityExtractor ReadableType5 = "Hierarchical Child Entity Extractor" - // ReadableType5HierarchicalEntityExtractor ... - ReadableType5HierarchicalEntityExtractor ReadableType5 = "Hierarchical Entity Extractor" - // ReadableType5IntentClassifier ... - ReadableType5IntentClassifier ReadableType5 = "Intent Classifier" - // ReadableType5PatternAnyEntityExtractor ... - ReadableType5PatternAnyEntityExtractor ReadableType5 = "Pattern.Any Entity Extractor" - // ReadableType5PrebuiltEntityExtractor ... - ReadableType5PrebuiltEntityExtractor ReadableType5 = "Prebuilt Entity Extractor" - // ReadableType5RegexEntityExtractor ... - ReadableType5RegexEntityExtractor ReadableType5 = "Regex Entity Extractor" -) - -// PossibleReadableType5Values returns an array of possible values for the ReadableType5 const type. -func PossibleReadableType5Values() []ReadableType5 { - return []ReadableType5{ReadableType5ClosedListEntityExtractor, ReadableType5CompositeEntityExtractor, ReadableType5EntityExtractor, ReadableType5HierarchicalChildEntityExtractor, ReadableType5HierarchicalEntityExtractor, ReadableType5IntentClassifier, ReadableType5PatternAnyEntityExtractor, ReadableType5PrebuiltEntityExtractor, ReadableType5RegexEntityExtractor} -} - -// ReadableType6 enumerates the values for readable type 6. -type ReadableType6 string - -const ( - // ReadableType6ClosedListEntityExtractor ... - ReadableType6ClosedListEntityExtractor ReadableType6 = "Closed List Entity Extractor" - // ReadableType6CompositeEntityExtractor ... - ReadableType6CompositeEntityExtractor ReadableType6 = "Composite Entity Extractor" - // ReadableType6EntityExtractor ... - ReadableType6EntityExtractor ReadableType6 = "Entity Extractor" - // ReadableType6HierarchicalChildEntityExtractor ... - ReadableType6HierarchicalChildEntityExtractor ReadableType6 = "Hierarchical Child Entity Extractor" - // ReadableType6HierarchicalEntityExtractor ... - ReadableType6HierarchicalEntityExtractor ReadableType6 = "Hierarchical Entity Extractor" - // ReadableType6IntentClassifier ... - ReadableType6IntentClassifier ReadableType6 = "Intent Classifier" - // ReadableType6PatternAnyEntityExtractor ... - ReadableType6PatternAnyEntityExtractor ReadableType6 = "Pattern.Any Entity Extractor" - // ReadableType6PrebuiltEntityExtractor ... - ReadableType6PrebuiltEntityExtractor ReadableType6 = "Prebuilt Entity Extractor" - // ReadableType6RegexEntityExtractor ... - ReadableType6RegexEntityExtractor ReadableType6 = "Regex Entity Extractor" -) - -// PossibleReadableType6Values returns an array of possible values for the ReadableType6 const type. -func PossibleReadableType6Values() []ReadableType6 { - return []ReadableType6{ReadableType6ClosedListEntityExtractor, ReadableType6CompositeEntityExtractor, ReadableType6EntityExtractor, ReadableType6HierarchicalChildEntityExtractor, ReadableType6HierarchicalEntityExtractor, ReadableType6IntentClassifier, ReadableType6PatternAnyEntityExtractor, ReadableType6PrebuiltEntityExtractor, ReadableType6RegexEntityExtractor} -} - -// ReadableType7 enumerates the values for readable type 7. -type ReadableType7 string - -const ( - // ReadableType7ClosedListEntityExtractor ... - ReadableType7ClosedListEntityExtractor ReadableType7 = "Closed List Entity Extractor" - // ReadableType7CompositeEntityExtractor ... - ReadableType7CompositeEntityExtractor ReadableType7 = "Composite Entity Extractor" - // ReadableType7EntityExtractor ... - ReadableType7EntityExtractor ReadableType7 = "Entity Extractor" - // ReadableType7HierarchicalChildEntityExtractor ... - ReadableType7HierarchicalChildEntityExtractor ReadableType7 = "Hierarchical Child Entity Extractor" - // ReadableType7HierarchicalEntityExtractor ... - ReadableType7HierarchicalEntityExtractor ReadableType7 = "Hierarchical Entity Extractor" - // ReadableType7IntentClassifier ... - ReadableType7IntentClassifier ReadableType7 = "Intent Classifier" - // ReadableType7PatternAnyEntityExtractor ... - ReadableType7PatternAnyEntityExtractor ReadableType7 = "Pattern.Any Entity Extractor" - // ReadableType7PrebuiltEntityExtractor ... - ReadableType7PrebuiltEntityExtractor ReadableType7 = "Prebuilt Entity Extractor" - // ReadableType7RegexEntityExtractor ... - ReadableType7RegexEntityExtractor ReadableType7 = "Regex Entity Extractor" -) - -// PossibleReadableType7Values returns an array of possible values for the ReadableType7 const type. -func PossibleReadableType7Values() []ReadableType7 { - return []ReadableType7{ReadableType7ClosedListEntityExtractor, ReadableType7CompositeEntityExtractor, ReadableType7EntityExtractor, ReadableType7HierarchicalChildEntityExtractor, ReadableType7HierarchicalEntityExtractor, ReadableType7IntentClassifier, ReadableType7PatternAnyEntityExtractor, ReadableType7PrebuiltEntityExtractor, ReadableType7RegexEntityExtractor} -} - -// ReadableType8 enumerates the values for readable type 8. -type ReadableType8 string - -const ( - // ReadableType8ClosedListEntityExtractor ... - ReadableType8ClosedListEntityExtractor ReadableType8 = "Closed List Entity Extractor" - // ReadableType8CompositeEntityExtractor ... - ReadableType8CompositeEntityExtractor ReadableType8 = "Composite Entity Extractor" - // ReadableType8EntityExtractor ... - ReadableType8EntityExtractor ReadableType8 = "Entity Extractor" - // ReadableType8HierarchicalChildEntityExtractor ... - ReadableType8HierarchicalChildEntityExtractor ReadableType8 = "Hierarchical Child Entity Extractor" - // ReadableType8HierarchicalEntityExtractor ... - ReadableType8HierarchicalEntityExtractor ReadableType8 = "Hierarchical Entity Extractor" - // ReadableType8IntentClassifier ... - ReadableType8IntentClassifier ReadableType8 = "Intent Classifier" - // ReadableType8PatternAnyEntityExtractor ... - ReadableType8PatternAnyEntityExtractor ReadableType8 = "Pattern.Any Entity Extractor" - // ReadableType8PrebuiltEntityExtractor ... - ReadableType8PrebuiltEntityExtractor ReadableType8 = "Prebuilt Entity Extractor" - // ReadableType8RegexEntityExtractor ... - ReadableType8RegexEntityExtractor ReadableType8 = "Regex Entity Extractor" -) - -// PossibleReadableType8Values returns an array of possible values for the ReadableType8 const type. -func PossibleReadableType8Values() []ReadableType8 { - return []ReadableType8{ReadableType8ClosedListEntityExtractor, ReadableType8CompositeEntityExtractor, ReadableType8EntityExtractor, ReadableType8HierarchicalChildEntityExtractor, ReadableType8HierarchicalEntityExtractor, ReadableType8IntentClassifier, ReadableType8PatternAnyEntityExtractor, ReadableType8PrebuiltEntityExtractor, ReadableType8RegexEntityExtractor} -} - -// ReadableType9 enumerates the values for readable type 9. -type ReadableType9 string - -const ( - // ReadableType9ClosedListEntityExtractor ... - ReadableType9ClosedListEntityExtractor ReadableType9 = "Closed List Entity Extractor" - // ReadableType9CompositeEntityExtractor ... - ReadableType9CompositeEntityExtractor ReadableType9 = "Composite Entity Extractor" - // ReadableType9EntityExtractor ... - ReadableType9EntityExtractor ReadableType9 = "Entity Extractor" - // ReadableType9HierarchicalChildEntityExtractor ... - ReadableType9HierarchicalChildEntityExtractor ReadableType9 = "Hierarchical Child Entity Extractor" - // ReadableType9HierarchicalEntityExtractor ... - ReadableType9HierarchicalEntityExtractor ReadableType9 = "Hierarchical Entity Extractor" - // ReadableType9IntentClassifier ... - ReadableType9IntentClassifier ReadableType9 = "Intent Classifier" - // ReadableType9PatternAnyEntityExtractor ... - ReadableType9PatternAnyEntityExtractor ReadableType9 = "Pattern.Any Entity Extractor" - // ReadableType9PrebuiltEntityExtractor ... - ReadableType9PrebuiltEntityExtractor ReadableType9 = "Prebuilt Entity Extractor" - // ReadableType9RegexEntityExtractor ... - ReadableType9RegexEntityExtractor ReadableType9 = "Regex Entity Extractor" -) - -// PossibleReadableType9Values returns an array of possible values for the ReadableType9 const type. -func PossibleReadableType9Values() []ReadableType9 { - return []ReadableType9{ReadableType9ClosedListEntityExtractor, ReadableType9CompositeEntityExtractor, ReadableType9EntityExtractor, ReadableType9HierarchicalChildEntityExtractor, ReadableType9HierarchicalEntityExtractor, ReadableType9IntentClassifier, ReadableType9PatternAnyEntityExtractor, ReadableType9PrebuiltEntityExtractor, ReadableType9RegexEntityExtractor} -} - -// Status enumerates the values for status. -type Status string - -const ( - // StatusFail ... - StatusFail Status = "Fail" - // StatusInProgress ... - StatusInProgress Status = "InProgress" - // StatusQueued ... - StatusQueued Status = "Queued" - // StatusSuccess ... - StatusSuccess Status = "Success" - // StatusUpToDate ... - StatusUpToDate Status = "UpToDate" -) - -// PossibleStatusValues returns an array of possible values for the Status const type. -func PossibleStatusValues() []Status { - return []Status{StatusFail, StatusInProgress, StatusQueued, StatusSuccess, StatusUpToDate} -} - -// Status1 enumerates the values for status 1. -type Status1 string - -const ( - // Status1Fail ... - Status1Fail Status1 = "Fail" - // Status1InProgress ... - Status1InProgress Status1 = "InProgress" - // Status1Queued ... - Status1Queued Status1 = "Queued" - // Status1Success ... - Status1Success Status1 = "Success" - // Status1UpToDate ... - Status1UpToDate Status1 = "UpToDate" -) - -// PossibleStatus1Values returns an array of possible values for the Status1 const type. -func PossibleStatus1Values() []Status1 { - return []Status1{Status1Fail, Status1InProgress, Status1Queued, Status1Success, Status1UpToDate} -} - -// TrainingStatus enumerates the values for training status. -type TrainingStatus string - -const ( - // InProgress ... - InProgress TrainingStatus = "InProgress" - // NeedsTraining ... - NeedsTraining TrainingStatus = "NeedsTraining" - // Trained ... - Trained TrainingStatus = "Trained" -) - -// PossibleTrainingStatusValues returns an array of possible values for the TrainingStatus const type. -func PossibleTrainingStatusValues() []TrainingStatus { - return []TrainingStatus{InProgress, NeedsTraining, Trained} -} - -// ApplicationCreateObject properties for creating a new LUIS Application -type ApplicationCreateObject struct { - // Culture - The culture for the new application. It is the language that your app understands and speaks. E.g.: "en-us". Note: the culture cannot be changed after the app is created. - Culture *string `json:"culture,omitempty"` - // Domain - The domain for the new application. Optional. E.g.: Comics. - Domain *string `json:"domain,omitempty"` - // Description - Description of the new application. Optional. - Description *string `json:"description,omitempty"` - // InitialVersionID - The initial version ID. Optional. Default value is: "0.1" - InitialVersionID *string `json:"initialVersionId,omitempty"` - // UsageScenario - Defines the scenario for the new application. Optional. E.g.: IoT. - UsageScenario *string `json:"usageScenario,omitempty"` - // Name - The name for the new application. - Name *string `json:"name,omitempty"` -} - -// ApplicationInfoResponse response containing the Application Info. -type ApplicationInfoResponse struct { - autorest.Response `json:"-"` - // ID - The ID (GUID) of the application. - ID *uuid.UUID `json:"id,omitempty"` - // Name - The name of the application. - Name *string `json:"name,omitempty"` - // Description - The description of the application. - Description *string `json:"description,omitempty"` - // Culture - The culture of the application. E.g.: en-us. - Culture *string `json:"culture,omitempty"` - // UsageScenario - Defines the scenario for the new application. Optional. E.g.: IoT. - UsageScenario *string `json:"usageScenario,omitempty"` - // Domain - The domain for the new application. Optional. E.g.: Comics. - Domain *string `json:"domain,omitempty"` - // VersionsCount - Amount of model versions within the application. - VersionsCount *int32 `json:"versionsCount,omitempty"` - // CreatedDateTime - The version's creation timestamp. - CreatedDateTime *string `json:"createdDateTime,omitempty"` - // Endpoints - The Runtime endpoint URL for this model version. - Endpoints interface{} `json:"endpoints,omitempty"` - // EndpointHitsCount - Number of calls made to this endpoint. - EndpointHitsCount *int32 `json:"endpointHitsCount,omitempty"` - // ActiveVersion - The version ID currently marked as active. - ActiveVersion *string `json:"activeVersion,omitempty"` -} - -// ApplicationPublishObject object model for publishing a specific application version. -type ApplicationPublishObject struct { - // VersionID - The version ID to publish. - VersionID *string `json:"versionId,omitempty"` - // IsStaging - Indicates if the staging slot should be used, instead of the Production one. - IsStaging *bool `json:"isStaging,omitempty"` - // Region - The target region that the application is published to. - Region *string `json:"region,omitempty"` -} - -// ApplicationSettings the application settings. -type ApplicationSettings struct { - autorest.Response `json:"-"` - // ID - The application ID. - ID *uuid.UUID `json:"id,omitempty"` - // IsPublic - Setting your application as public allows other people to use your application's endpoint using their own keys. - IsPublic *bool `json:"public,omitempty"` -} - -// ApplicationSettingUpdateObject object model for updating an application's settings. -type ApplicationSettingUpdateObject struct { - // Public - Setting your application as public allows other people to use your application's endpoint using their own keys. - Public *bool `json:"public,omitempty"` -} - -// ApplicationUpdateObject object model for updating the name or description of an application. -type ApplicationUpdateObject struct { - // Name - The application's new name. - Name *string `json:"name,omitempty"` - // Description - The application's new description. - Description *string `json:"description,omitempty"` -} - -// AvailableCulture available culture for using in a new application. -type AvailableCulture struct { - // Name - The language name. - Name *string `json:"name,omitempty"` - // Code - The ISO value for the language. - Code *string `json:"code,omitempty"` -} - -// AvailablePrebuiltEntityModel available Prebuilt entity model for using in an application. -type AvailablePrebuiltEntityModel struct { - // Name - The entity name. - Name *string `json:"name,omitempty"` - // Description - The entity description and usage information. - Description *string `json:"description,omitempty"` - // Examples - Usage examples. - Examples *string `json:"examples,omitempty"` -} - -// BatchLabelExample response when adding a batch of labeled examples. -type BatchLabelExample struct { - Value *LabelExampleResponse `json:"value,omitempty"` - HasError *bool `json:"hasError,omitempty"` - Error *OperationStatus `json:"error,omitempty"` -} - -// ChildEntity the base child entity type. -type ChildEntity struct { - // ID - The ID (GUID) belonging to a child entity. - ID *uuid.UUID `json:"id,omitempty"` - // Name - The name of a child entity. - Name *string `json:"name,omitempty"` -} - -// ClosedList exported Model - A Closed List. -type ClosedList struct { - // Name - Name of the closed list feature. - Name *string `json:"name,omitempty"` - // SubLists - Sublists for the feature. - SubLists *[]SubClosedList `json:"subLists,omitempty"` - Roles *[]string `json:"roles,omitempty"` -} - -// ClosedListEntityExtractor closed List Entity Extractor. -type ClosedListEntityExtractor struct { - autorest.Response `json:"-"` - // ID - The ID of the Entity Model. - ID *uuid.UUID `json:"id,omitempty"` - // Name - Name of the Entity Model. - Name *string `json:"name,omitempty"` - // TypeID - The type ID of the Entity Model. - TypeID *int32 `json:"typeId,omitempty"` - // ReadableType - Possible values include: 'ReadableType4EntityExtractor', 'ReadableType4HierarchicalEntityExtractor', 'ReadableType4HierarchicalChildEntityExtractor', 'ReadableType4CompositeEntityExtractor', 'ReadableType4ClosedListEntityExtractor', 'ReadableType4PrebuiltEntityExtractor', 'ReadableType4IntentClassifier', 'ReadableType4PatternAnyEntityExtractor', 'ReadableType4RegexEntityExtractor' - ReadableType ReadableType4 `json:"readableType,omitempty"` - Roles *[]EntityRole `json:"roles,omitempty"` - // SubLists - List of sub-lists. - SubLists *[]SubClosedListResponse `json:"subLists,omitempty"` -} - -// ClosedListModelCreateObject object model for creating a closed list. -type ClosedListModelCreateObject struct { - // SubLists - Sublists for the feature. - SubLists *[]WordListObject `json:"subLists,omitempty"` - // Name - Name of the closed list feature. - Name *string `json:"name,omitempty"` -} - -// ClosedListModelPatchObject object model for adding a batch of sublists to an existing closedlist. -type ClosedListModelPatchObject struct { - // SubLists - Sublists to add. - SubLists *[]WordListObject `json:"subLists,omitempty"` -} - -// ClosedListModelUpdateObject object model for updating a closed list. -type ClosedListModelUpdateObject struct { - // SubLists - The new sublists for the feature. - SubLists *[]WordListObject `json:"subLists,omitempty"` - // Name - The new name of the closed list feature. - Name *string `json:"name,omitempty"` -} - -// CollaboratorsArray ... -type CollaboratorsArray struct { - // Emails - The email address of the users. - Emails *[]string `json:"emails,omitempty"` -} - -// CompositeChildModelCreateObject ... -type CompositeChildModelCreateObject struct { - Name *string `json:"name,omitempty"` -} - -// CompositeEntityExtractor a Composite Entity Extractor. -type CompositeEntityExtractor struct { - autorest.Response `json:"-"` - // ID - The ID of the Entity Model. - ID *uuid.UUID `json:"id,omitempty"` - // Name - Name of the Entity Model. - Name *string `json:"name,omitempty"` - // TypeID - The type ID of the Entity Model. - TypeID *int32 `json:"typeId,omitempty"` - // ReadableType - Possible values include: 'ReadableType3EntityExtractor', 'ReadableType3HierarchicalEntityExtractor', 'ReadableType3HierarchicalChildEntityExtractor', 'ReadableType3CompositeEntityExtractor', 'ReadableType3ClosedListEntityExtractor', 'ReadableType3PrebuiltEntityExtractor', 'ReadableType3IntentClassifier', 'ReadableType3PatternAnyEntityExtractor', 'ReadableType3RegexEntityExtractor' - ReadableType ReadableType3 `json:"readableType,omitempty"` - Roles *[]EntityRole `json:"roles,omitempty"` - // Children - List of child entities. - Children *[]ChildEntity `json:"children,omitempty"` -} - -// CompositeEntityModel a composite entity. -type CompositeEntityModel struct { - // Children - Child entities. - Children *[]string `json:"children,omitempty"` - // Name - Entity name. - Name *string `json:"name,omitempty"` -} - -// CustomPrebuiltModel a Custom Prebuilt model. -type CustomPrebuiltModel struct { - // ID - The ID of the Entity Model. - ID *uuid.UUID `json:"id,omitempty"` - // Name - Name of the Entity Model. - Name *string `json:"name,omitempty"` - // TypeID - The type ID of the Entity Model. - TypeID *int32 `json:"typeId,omitempty"` - // ReadableType - Possible values include: 'ReadableType7EntityExtractor', 'ReadableType7HierarchicalEntityExtractor', 'ReadableType7HierarchicalChildEntityExtractor', 'ReadableType7CompositeEntityExtractor', 'ReadableType7ClosedListEntityExtractor', 'ReadableType7PrebuiltEntityExtractor', 'ReadableType7IntentClassifier', 'ReadableType7PatternAnyEntityExtractor', 'ReadableType7RegexEntityExtractor' - ReadableType ReadableType7 `json:"readableType,omitempty"` - // CustomPrebuiltDomainName - The domain name. - CustomPrebuiltDomainName *string `json:"customPrebuiltDomainName,omitempty"` - // CustomPrebuiltModelName - The intent name or entity name. - CustomPrebuiltModelName *string `json:"customPrebuiltModelName,omitempty"` - Roles *[]EntityRole `json:"roles,omitempty"` -} - -// EndpointInfo the base class "ProductionOrStagingEndpointInfo" inherits from. -type EndpointInfo struct { - // VersionID - The version ID to publish. - VersionID *string `json:"versionId,omitempty"` - // IsStaging - Indicates if the staging slot should be used, instead of the Production one. - IsStaging *bool `json:"isStaging,omitempty"` - // EndpointURL - The Runtime endpoint URL for this model version. - EndpointURL *string `json:"endpointUrl,omitempty"` - // Region - The target region that the application is published to. - Region *string `json:"region,omitempty"` - // AssignedEndpointKey - The endpoint key. - AssignedEndpointKey *string `json:"assignedEndpointKey,omitempty"` - // EndpointRegion - The endpoint's region. - EndpointRegion *string `json:"endpointRegion,omitempty"` - // PublishedDateTime - Timestamp when was last published. - PublishedDateTime *string `json:"publishedDateTime,omitempty"` -} - -// EnqueueTrainingResponse response model when requesting to train the model. -type EnqueueTrainingResponse struct { - autorest.Response `json:"-"` - // StatusID - The train request status ID. - StatusID *int32 `json:"statusId,omitempty"` - // Status - Possible values include: 'StatusQueued', 'StatusInProgress', 'StatusUpToDate', 'StatusFail', 'StatusSuccess' - Status Status `json:"status,omitempty"` -} - -// EntitiesSuggestionExample predicted/suggested entity. -type EntitiesSuggestionExample struct { - // Text - The utterance. E.g.: what's the weather like in seattle? - Text *string `json:"text,omitempty"` - // TokenizedText - The utterance tokenized. - TokenizedText *[]string `json:"tokenizedText,omitempty"` - // IntentPredictions - Predicted/suggested intents. - IntentPredictions *[]IntentPrediction `json:"intentPredictions,omitempty"` - // EntityPredictions - Predicted/suggested entities. - EntityPredictions *[]EntityPrediction `json:"entityPredictions,omitempty"` -} - -// EntityExtractor entity Extractor. -type EntityExtractor struct { - autorest.Response `json:"-"` - // ID - The ID of the Entity Model. - ID *uuid.UUID `json:"id,omitempty"` - // Name - Name of the Entity Model. - Name *string `json:"name,omitempty"` - // TypeID - The type ID of the Entity Model. - TypeID *int32 `json:"typeId,omitempty"` - // ReadableType - Possible values include: 'ReadableType8EntityExtractor', 'ReadableType8HierarchicalEntityExtractor', 'ReadableType8HierarchicalChildEntityExtractor', 'ReadableType8CompositeEntityExtractor', 'ReadableType8ClosedListEntityExtractor', 'ReadableType8PrebuiltEntityExtractor', 'ReadableType8IntentClassifier', 'ReadableType8PatternAnyEntityExtractor', 'ReadableType8RegexEntityExtractor' - ReadableType ReadableType8 `json:"readableType,omitempty"` - Roles *[]EntityRole `json:"roles,omitempty"` - // CustomPrebuiltDomainName - The domain name. - CustomPrebuiltDomainName *string `json:"customPrebuiltDomainName,omitempty"` - // CustomPrebuiltModelName - The intent name or entity name. - CustomPrebuiltModelName *string `json:"customPrebuiltModelName,omitempty"` -} - -// EntityLabel defines the entity type and position of the extracted entity within the example. -type EntityLabel struct { - // EntityName - The entity type. - EntityName *string `json:"entityName,omitempty"` - // StartTokenIndex - The index within the utterance where the extracted entity starts. - StartTokenIndex *int32 `json:"startTokenIndex,omitempty"` - // EndTokenIndex - The index within the utterance where the extracted entity ends. - EndTokenIndex *int32 `json:"endTokenIndex,omitempty"` -} - -// EntityLabelObject defines the entity type and position of the extracted entity within the example. -type EntityLabelObject struct { - // EntityName - The entity type. - EntityName *string `json:"entityName,omitempty"` - // StartCharIndex - The index within the utterance where the extracted entity starts. - StartCharIndex *int32 `json:"startCharIndex,omitempty"` - // EndCharIndex - The index within the utterance where the extracted entity ends. - EndCharIndex *int32 `json:"endCharIndex,omitempty"` -} - -// EntityModelInfo an Entity Extractor model info. -type EntityModelInfo struct { - Roles *[]EntityRole `json:"roles,omitempty"` - // ID - The ID of the Entity Model. - ID *uuid.UUID `json:"id,omitempty"` - // Name - Name of the Entity Model. - Name *string `json:"name,omitempty"` - // TypeID - The type ID of the Entity Model. - TypeID *int32 `json:"typeId,omitempty"` - // ReadableType - Possible values include: 'ReadableTypeEntityExtractor', 'ReadableTypeHierarchicalEntityExtractor', 'ReadableTypeHierarchicalChildEntityExtractor', 'ReadableTypeCompositeEntityExtractor', 'ReadableTypeClosedListEntityExtractor', 'ReadableTypePrebuiltEntityExtractor', 'ReadableTypeIntentClassifier', 'ReadableTypePatternAnyEntityExtractor', 'ReadableTypeRegexEntityExtractor' - ReadableType ReadableType `json:"readableType,omitempty"` -} - -// EntityPrediction a suggested entity. -type EntityPrediction struct { - // EntityName - The entity's name - EntityName *string `json:"entityName,omitempty"` - // StartTokenIndex - The index within the utterance where the extracted entity starts. - StartTokenIndex *int32 `json:"startTokenIndex,omitempty"` - // 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"` -} - -// EntityRole entity extractor role -type EntityRole struct { - autorest.Response `json:"-"` - // ID - The entity role ID. - ID *uuid.UUID `json:"id,omitempty"` - // Name - The entity role name. - Name *string `json:"name,omitempty"` -} - -// EntityRoleCreateObject object model for creating an entity role. -type EntityRoleCreateObject struct { - // Name - The entity role name. - Name *string `json:"name,omitempty"` -} - -// EntityRoleUpdateObject object model for updating an entity role. -type EntityRoleUpdateObject struct { - // Name - The entity role name. - Name *string `json:"name,omitempty"` -} - -// ErrorResponse error response when invoking an operation on the API. -type ErrorResponse struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - ErrorType *string `json:"errorType,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorResponse. -func (er ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if er.ErrorType != nil { - objectMap["errorType"] = er.ErrorType - } - for k, v := range er.AdditionalProperties { - objectMap[k] = v - } - return json.Marshal(objectMap) -} - -// ExampleLabelObject a labeled example. -type ExampleLabelObject struct { - // Text - The sample's utterance. - Text *string `json:"text,omitempty"` - // EntityLabels - The idenfied entities within the utterance. - EntityLabels *[]EntityLabelObject `json:"entityLabels,omitempty"` - // IntentName - The idenfitied intent representing the utterance. - IntentName *string `json:"intentName,omitempty"` -} - -// ExplicitListItem explicit list item -type ExplicitListItem struct { - autorest.Response `json:"-"` - // ID - The explicit list item ID. - ID *int64 `json:"id,omitempty"` - // ExplicitListItem - The explicit list item value. - ExplicitListItem *string `json:"explicitListItem,omitempty"` -} - -// ExplicitListItemCreateObject object model for creating an explicit list item. -type ExplicitListItemCreateObject struct { - // ExplicitListItem - The explicit list item. - ExplicitListItem *string `json:"explicitListItem,omitempty"` -} - -// ExplicitListItemUpdateObject model object for updating an explicit list item. -type ExplicitListItemUpdateObject struct { - // ExplicitListItem - The explicit list item. - ExplicitListItem *string `json:"explicitListItem,omitempty"` -} - -// FeatureInfoObject the base class Features-related response objects inherit from. -type FeatureInfoObject struct { - // ID - A six-digit ID used for Features. - ID *int32 `json:"id,omitempty"` - // Name - The name of the Feature. - Name *string `json:"name,omitempty"` - // IsActive - Indicates if the feature is enabled. - IsActive *bool `json:"isActive,omitempty"` -} - -// FeaturesResponseObject model Features, including Patterns and Phraselists. -type FeaturesResponseObject struct { - autorest.Response `json:"-"` - PhraselistFeatures *[]PhraseListFeatureInfo `json:"phraselistFeatures,omitempty"` - PatternFeatures *[]PatternFeatureInfo `json:"patternFeatures,omitempty"` -} - -// HierarchicalChildEntity a Hierarchical Child Entity. -type HierarchicalChildEntity struct { - autorest.Response `json:"-"` - // TypeID - The type ID of the Entity Model. - TypeID *int32 `json:"typeId,omitempty"` - // ReadableType - Possible values include: 'ReadableType6EntityExtractor', 'ReadableType6HierarchicalEntityExtractor', 'ReadableType6HierarchicalChildEntityExtractor', 'ReadableType6CompositeEntityExtractor', 'ReadableType6ClosedListEntityExtractor', 'ReadableType6PrebuiltEntityExtractor', 'ReadableType6IntentClassifier', 'ReadableType6PatternAnyEntityExtractor', 'ReadableType6RegexEntityExtractor' - ReadableType ReadableType6 `json:"readableType,omitempty"` - // ID - The ID (GUID) belonging to a child entity. - ID *uuid.UUID `json:"id,omitempty"` - // Name - The name of a child entity. - Name *string `json:"name,omitempty"` -} - -// HierarchicalChildModelCreateObject ... -type HierarchicalChildModelCreateObject struct { - Name *string `json:"name,omitempty"` -} - -// HierarchicalChildModelUpdateObject ... -type HierarchicalChildModelUpdateObject struct { - Name *string `json:"name,omitempty"` -} - -// HierarchicalEntityExtractor hierarchical Entity Extractor. -type HierarchicalEntityExtractor struct { - autorest.Response `json:"-"` - // ID - The ID of the Entity Model. - ID *uuid.UUID `json:"id,omitempty"` - // Name - Name of the Entity Model. - Name *string `json:"name,omitempty"` - // TypeID - The type ID of the Entity Model. - TypeID *int32 `json:"typeId,omitempty"` - // ReadableType - Possible values include: 'ReadableType2EntityExtractor', 'ReadableType2HierarchicalEntityExtractor', 'ReadableType2HierarchicalChildEntityExtractor', 'ReadableType2CompositeEntityExtractor', 'ReadableType2ClosedListEntityExtractor', 'ReadableType2PrebuiltEntityExtractor', 'ReadableType2IntentClassifier', 'ReadableType2PatternAnyEntityExtractor', 'ReadableType2RegexEntityExtractor' - ReadableType ReadableType2 `json:"readableType,omitempty"` - Roles *[]EntityRole `json:"roles,omitempty"` - // Children - List of child entities. - Children *[]ChildEntity `json:"children,omitempty"` -} - -// HierarchicalEntityModel a Hierarchical Entity Extractor. -type HierarchicalEntityModel struct { - // Children - Child entities. - Children *[]string `json:"children,omitempty"` - // Name - Entity name. - Name *string `json:"name,omitempty"` -} - -// HierarchicalModel ... -type HierarchicalModel struct { - Name *string `json:"name,omitempty"` - Children *[]string `json:"children,omitempty"` - Inherits *PrebuiltDomainObject `json:"inherits,omitempty"` - Roles *[]string `json:"roles,omitempty"` -} - -// Int32 ... -type Int32 struct { - autorest.Response `json:"-"` - Value *int32 `json:"value,omitempty"` -} - -// IntentClassifier intent Classifier. -type IntentClassifier struct { - autorest.Response `json:"-"` - // CustomPrebuiltDomainName - The domain name. - CustomPrebuiltDomainName *string `json:"customPrebuiltDomainName,omitempty"` - // CustomPrebuiltModelName - The intent name or entity name. - CustomPrebuiltModelName *string `json:"customPrebuiltModelName,omitempty"` - // ID - The ID of the Entity Model. - ID *uuid.UUID `json:"id,omitempty"` - // Name - Name of the Entity Model. - Name *string `json:"name,omitempty"` - // TypeID - The type ID of the Entity Model. - TypeID *int32 `json:"typeId,omitempty"` - // ReadableType - Possible values include: 'ReadableTypeEntityExtractor', 'ReadableTypeHierarchicalEntityExtractor', 'ReadableTypeHierarchicalChildEntityExtractor', 'ReadableTypeCompositeEntityExtractor', 'ReadableTypeClosedListEntityExtractor', 'ReadableTypePrebuiltEntityExtractor', 'ReadableTypeIntentClassifier', 'ReadableTypePatternAnyEntityExtractor', 'ReadableTypeRegexEntityExtractor' - ReadableType ReadableType `json:"readableType,omitempty"` -} - -// IntentPrediction a suggested intent. -type IntentPrediction struct { - // Name - The intent's name - Name *string `json:"name,omitempty"` - // Score - The intent's score, based on the prediction model. - Score *float64 `json:"score,omitempty"` -} - -// IntentsSuggestionExample predicted/suggested intent. -type IntentsSuggestionExample struct { - // Text - The utterance. E.g.: what's the weather like in seattle? - Text *string `json:"text,omitempty"` - // TokenizedText - The utterance tokenized. - TokenizedText *[]string `json:"tokenizedText,omitempty"` - // IntentPredictions - Predicted/suggested intents. - IntentPredictions *[]IntentPrediction `json:"intentPredictions,omitempty"` - // EntityPredictions - Predicted/suggested entities. - EntityPredictions *[]EntityPrediction `json:"entityPredictions,omitempty"` -} - -// JSONEntity exported Model - Extracted Entity from utterance. -type JSONEntity struct { - // StartPos - The index within the utterance where the extracted entity starts. - StartPos *int32 `json:"startPos,omitempty"` - // EndPos - The index within the utterance where the extracted entity ends. - EndPos *int32 `json:"endPos,omitempty"` - // Entity - The entity name. - Entity *string `json:"entity,omitempty"` -} - -// JSONModelFeature exported Model - Phraselist Model Feature. -type JSONModelFeature struct { - // Activated - Indicates if the feature is enabled. - Activated *bool `json:"activated,omitempty"` - // Name - The Phraselist name. - Name *string `json:"name,omitempty"` - // Words - List of comma-separated phrases that represent the Phraselist. - Words *string `json:"words,omitempty"` - // Mode - An exchangeable phrase list feature are serves as single feature to the LUIS underlying training algorithm. It is used as a lexicon lookup feature where its value is 1 if the lexicon contains a given word or 0 if it doesn’t. Think of an exchangeable as a synonyms list. A non-exchangeable phrase list feature has all the phrases in the list serve as separate features to the underlying training algorithm. So, if you your phrase list feature contains 5 phrases, they will be mapped to 5 separate features. You can think of the non-exchangeable phrase list feature as an additional bag of words that you are willing to add to LUIS existing vocabulary features. Think of a non-exchangeable as set of different words. Default value is true. - Mode *bool `json:"mode,omitempty"` -} - -// JSONRegexFeature exported Model - A Pattern feature. -type JSONRegexFeature struct { - // Pattern - The Regular Expression to match. - Pattern *string `json:"pattern,omitempty"` - // Activated - Indicates if the Pattern feature is enabled. - Activated *bool `json:"activated,omitempty"` - // Name - Name of the feature. - Name *string `json:"name,omitempty"` -} - -// JSONUtterance exported Model - Utterance that was used to train the model. -type JSONUtterance struct { - // Text - The utterance. - Text *string `json:"text,omitempty"` - // Intent - The matched intent. - Intent *string `json:"intent,omitempty"` - // Entities - The matched entities. - Entities *[]JSONEntity `json:"entities,omitempty"` -} - -// LabeledUtterance a prediction and label pair of an example. -type LabeledUtterance struct { - // ID - ID of Labeled Utterance. - ID *int32 `json:"id,omitempty"` - // Text - The utterance. E.g.: what's the weather like in seattle? - Text *string `json:"text,omitempty"` - // TokenizedText - The utterance tokenized. - TokenizedText *[]string `json:"tokenizedText,omitempty"` - // IntentLabel - The intent matching the example. - IntentLabel *string `json:"intentLabel,omitempty"` - // EntityLabels - The entities matching the example. - EntityLabels *[]EntityLabel `json:"entityLabels,omitempty"` - // IntentPredictions - List of suggested intents. - IntentPredictions *[]IntentPrediction `json:"intentPredictions,omitempty"` - // EntityPredictions - List of suggested entities. - EntityPredictions *[]EntityPrediction `json:"entityPredictions,omitempty"` -} - -// LabelExampleResponse response when adding a labeled example. -type LabelExampleResponse struct { - autorest.Response `json:"-"` - // UtteranceText - The sample's utterance. - UtteranceText *string `json:"UtteranceText,omitempty"` - // ExampleID - The newly created sample ID. - ExampleID *int32 `json:"ExampleId,omitempty"` -} - -// ListApplicationInfoResponse ... -type ListApplicationInfoResponse struct { - autorest.Response `json:"-"` - Value *[]ApplicationInfoResponse `json:"value,omitempty"` -} - -// ListAvailableCulture ... -type ListAvailableCulture struct { - autorest.Response `json:"-"` - Value *[]AvailableCulture `json:"value,omitempty"` -} - -// ListAvailablePrebuiltEntityModel ... -type ListAvailablePrebuiltEntityModel struct { - autorest.Response `json:"-"` - Value *[]AvailablePrebuiltEntityModel `json:"value,omitempty"` -} - -// ListBatchLabelExample ... -type ListBatchLabelExample struct { - autorest.Response `json:"-"` - Value *[]BatchLabelExample `json:"value,omitempty"` -} - -// ListClosedListEntityExtractor ... -type ListClosedListEntityExtractor struct { - autorest.Response `json:"-"` - Value *[]ClosedListEntityExtractor `json:"value,omitempty"` -} - -// ListCompositeEntityExtractor ... -type ListCompositeEntityExtractor struct { - autorest.Response `json:"-"` - Value *[]CompositeEntityExtractor `json:"value,omitempty"` -} - -// ListCustomPrebuiltModel ... -type ListCustomPrebuiltModel struct { - autorest.Response `json:"-"` - Value *[]CustomPrebuiltModel `json:"value,omitempty"` -} - -// ListEntitiesSuggestionExample ... -type ListEntitiesSuggestionExample struct { - autorest.Response `json:"-"` - Value *[]EntitiesSuggestionExample `json:"value,omitempty"` -} - -// ListEntityExtractor ... -type ListEntityExtractor struct { - autorest.Response `json:"-"` - Value *[]EntityExtractor `json:"value,omitempty"` -} - -// ListEntityRole ... -type ListEntityRole struct { - autorest.Response `json:"-"` - Value *[]EntityRole `json:"value,omitempty"` -} - -// ListExplicitListItem ... -type ListExplicitListItem struct { - autorest.Response `json:"-"` - Value *[]ExplicitListItem `json:"value,omitempty"` -} - -// ListHierarchicalEntityExtractor ... -type ListHierarchicalEntityExtractor struct { - autorest.Response `json:"-"` - Value *[]HierarchicalEntityExtractor `json:"value,omitempty"` -} - -// ListIntentClassifier ... -type ListIntentClassifier struct { - autorest.Response `json:"-"` - Value *[]IntentClassifier `json:"value,omitempty"` -} - -// ListIntentsSuggestionExample ... -type ListIntentsSuggestionExample struct { - autorest.Response `json:"-"` - Value *[]IntentsSuggestionExample `json:"value,omitempty"` -} - -// ListLabeledUtterance ... -type ListLabeledUtterance struct { - autorest.Response `json:"-"` - Value *[]LabeledUtterance `json:"value,omitempty"` -} - -// ListModelInfoResponse ... -type ListModelInfoResponse struct { - autorest.Response `json:"-"` - Value *[]ModelInfoResponse `json:"value,omitempty"` -} - -// ListModelTrainingInfo ... -type ListModelTrainingInfo struct { - autorest.Response `json:"-"` - Value *[]ModelTrainingInfo `json:"value,omitempty"` -} - -// ListPatternAnyEntityExtractor ... -type ListPatternAnyEntityExtractor struct { - autorest.Response `json:"-"` - Value *[]PatternAnyEntityExtractor `json:"value,omitempty"` -} - -// ListPatternRuleInfo ... -type ListPatternRuleInfo struct { - autorest.Response `json:"-"` - Value *[]PatternRuleInfo `json:"value,omitempty"` -} - -// ListPhraseListFeatureInfo ... -type ListPhraseListFeatureInfo struct { - autorest.Response `json:"-"` - Value *[]PhraseListFeatureInfo `json:"value,omitempty"` -} - -// ListPrebuiltDomain ... -type ListPrebuiltDomain struct { - autorest.Response `json:"-"` - Value *[]PrebuiltDomain `json:"value,omitempty"` -} - -// ListPrebuiltEntityExtractor ... -type ListPrebuiltEntityExtractor struct { - autorest.Response `json:"-"` - Value *[]PrebuiltEntityExtractor `json:"value,omitempty"` -} - -// ListRegexEntityExtractor ... -type ListRegexEntityExtractor struct { - autorest.Response `json:"-"` - Value *[]RegexEntityExtractor `json:"value,omitempty"` -} - -// ListString ... -type ListString struct { - autorest.Response `json:"-"` - Value *[]string `json:"value,omitempty"` -} - -// ListUUID ... -type ListUUID struct { - autorest.Response `json:"-"` - Value *[]uuid.UUID `json:"value,omitempty"` -} - -// ListVersionInfo ... -type ListVersionInfo struct { - autorest.Response `json:"-"` - Value *[]VersionInfo `json:"value,omitempty"` -} - -// LuisApp exported Model - An exported LUIS Application. -type LuisApp struct { - autorest.Response `json:"-"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // Name - The name of the application. - Name *string `json:"name,omitempty"` - // VersionID - The version ID of the application that was exported. - VersionID *string `json:"versionId,omitempty"` - // Desc - The description of the application. - Desc *string `json:"desc,omitempty"` - // Culture - The culture of the application. E.g.: en-us. - Culture *string `json:"culture,omitempty"` - // Intents - List of intents. - Intents *[]HierarchicalModel `json:"intents,omitempty"` - // Entities - List of entities. - Entities *[]HierarchicalModel `json:"entities,omitempty"` - // ClosedLists - List of closed lists. - ClosedLists *[]ClosedList `json:"closedLists,omitempty"` - // Composites - List of composite entities. - Composites *[]HierarchicalModel `json:"composites,omitempty"` - // PatternAnyEntities - List of Pattern.Any entities. - PatternAnyEntities *[]PatternAny `json:"patternAnyEntities,omitempty"` - // RegexEntities - List of regular expression entities. - RegexEntities *[]RegexEntity `json:"regex_entities,omitempty"` - // PrebuiltEntities - List of prebuilt entities. - PrebuiltEntities *[]PrebuiltEntity `json:"prebuiltEntities,omitempty"` - // RegexFeatures - List of pattern features. - RegexFeatures *[]JSONRegexFeature `json:"regex_features,omitempty"` - // ModelFeatures - List of model features. - ModelFeatures *[]JSONModelFeature `json:"model_features,omitempty"` - // Patterns - List of patterns. - Patterns *[]PatternRule `json:"patterns,omitempty"` - // Utterances - List of sample utterances. - Utterances *[]JSONUtterance `json:"utterances,omitempty"` -} - -// MarshalJSON is the custom marshaler for LuisApp. -func (la LuisApp) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if la.Name != nil { - objectMap["name"] = la.Name - } - if la.VersionID != nil { - objectMap["versionId"] = la.VersionID - } - if la.Desc != nil { - objectMap["desc"] = la.Desc - } - if la.Culture != nil { - objectMap["culture"] = la.Culture - } - if la.Intents != nil { - objectMap["intents"] = la.Intents - } - if la.Entities != nil { - objectMap["entities"] = la.Entities - } - if la.ClosedLists != nil { - objectMap["closedLists"] = la.ClosedLists - } - if la.Composites != nil { - objectMap["composites"] = la.Composites - } - if la.PatternAnyEntities != nil { - objectMap["patternAnyEntities"] = la.PatternAnyEntities - } - if la.RegexEntities != nil { - objectMap["regex_entities"] = la.RegexEntities - } - if la.PrebuiltEntities != nil { - objectMap["prebuiltEntities"] = la.PrebuiltEntities - } - if la.RegexFeatures != nil { - objectMap["regex_features"] = la.RegexFeatures - } - if la.ModelFeatures != nil { - objectMap["model_features"] = la.ModelFeatures - } - if la.Patterns != nil { - objectMap["patterns"] = la.Patterns - } - if la.Utterances != nil { - objectMap["utterances"] = la.Utterances - } - for k, v := range la.AdditionalProperties { - objectMap[k] = v - } - return json.Marshal(objectMap) -} - -// ModelCreateObject object model for creating a new entity extractor. -type ModelCreateObject struct { - // Name - Name of the new entity extractor. - Name *string `json:"name,omitempty"` -} - -// ModelInfo base type used in entity types. -type ModelInfo struct { - // ID - The ID of the Entity Model. - ID *uuid.UUID `json:"id,omitempty"` - // Name - Name of the Entity Model. - Name *string `json:"name,omitempty"` - // TypeID - The type ID of the Entity Model. - TypeID *int32 `json:"typeId,omitempty"` - // ReadableType - Possible values include: 'ReadableTypeEntityExtractor', 'ReadableTypeHierarchicalEntityExtractor', 'ReadableTypeHierarchicalChildEntityExtractor', 'ReadableTypeCompositeEntityExtractor', 'ReadableTypeClosedListEntityExtractor', 'ReadableTypePrebuiltEntityExtractor', 'ReadableTypeIntentClassifier', 'ReadableTypePatternAnyEntityExtractor', 'ReadableTypeRegexEntityExtractor' - ReadableType ReadableType `json:"readableType,omitempty"` -} - -// ModelInfoResponse an application model info. -type ModelInfoResponse struct { - // ID - The ID of the Entity Model. - ID *uuid.UUID `json:"id,omitempty"` - // Name - Name of the Entity Model. - Name *string `json:"name,omitempty"` - // TypeID - The type ID of the Entity Model. - TypeID *int32 `json:"typeId,omitempty"` - // ReadableType - Possible values include: 'ReadableType1EntityExtractor', 'ReadableType1HierarchicalEntityExtractor', 'ReadableType1HierarchicalChildEntityExtractor', 'ReadableType1CompositeEntityExtractor', 'ReadableType1ClosedListEntityExtractor', 'ReadableType1PrebuiltEntityExtractor', 'ReadableType1IntentClassifier', 'ReadableType1PatternAnyEntityExtractor', 'ReadableType1RegexEntityExtractor' - ReadableType ReadableType1 `json:"readableType,omitempty"` - Roles *[]EntityRole `json:"roles,omitempty"` - // Children - List of child entities. - Children *[]ChildEntity `json:"children,omitempty"` - // SubLists - List of sub-lists. - SubLists *[]SubClosedListResponse `json:"subLists,omitempty"` - // CustomPrebuiltDomainName - The domain name. - CustomPrebuiltDomainName *string `json:"customPrebuiltDomainName,omitempty"` - // CustomPrebuiltModelName - The intent name or entity name. - CustomPrebuiltModelName *string `json:"customPrebuiltModelName,omitempty"` - // RegexPattern - The Regex entity pattern. - RegexPattern *string `json:"regexPattern,omitempty"` - ExplicitList *[]ExplicitListItem `json:"explicitList,omitempty"` -} - -// ModelTrainingDetails model Training Details. -type ModelTrainingDetails struct { - // StatusID - The train request status ID. - StatusID *int32 `json:"statusId,omitempty"` - // Status - Possible values include: 'Status1Queued', 'Status1InProgress', 'Status1UpToDate', 'Status1Fail', 'Status1Success' - Status Status1 `json:"status,omitempty"` - // ExampleCount - The count of examples used to train the model. - ExampleCount *int32 `json:"exampleCount,omitempty"` - // TrainingDateTime - When the model was trained. - TrainingDateTime *date.Time `json:"trainingDateTime,omitempty"` - // FailureReason - Reason for the training failure. - FailureReason *string `json:"failureReason,omitempty"` -} - -// ModelTrainingInfo model Training Info. -type ModelTrainingInfo struct { - // ModelID - The ID (GUID) of the model. - ModelID *uuid.UUID `json:"modelId,omitempty"` - Details *ModelTrainingDetails `json:"details,omitempty"` -} - -// ModelUpdateObject object model for updating an intent classifier. -type ModelUpdateObject struct { - // Name - The entity's new name. - Name *string `json:"name,omitempty"` -} - -// OperationError operation error details when invoking an operation on the API. -type OperationError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` -} - -// OperationStatus response of an Operation status. -type OperationStatus struct { - autorest.Response `json:"-"` - // Code - Status Code. Possible values include: 'Failed', 'FAILED', 'Success' - Code OperationStatusType `json:"code,omitempty"` - // Message - Status details. - Message *string `json:"message,omitempty"` -} - -// PatternAny pattern.Any Entity Extractor. -type PatternAny struct { - Name *string `json:"name,omitempty"` - ExplicitList *[]string `json:"explicitList,omitempty"` - Roles *[]string `json:"roles,omitempty"` -} - -// PatternAnyEntityExtractor pattern.Any Entity Extractor. -type PatternAnyEntityExtractor struct { - autorest.Response `json:"-"` - // ID - The ID of the Entity Model. - ID *uuid.UUID `json:"id,omitempty"` - // Name - Name of the Entity Model. - Name *string `json:"name,omitempty"` - // TypeID - The type ID of the Entity Model. - TypeID *int32 `json:"typeId,omitempty"` - // ReadableType - Possible values include: 'ReadableType10EntityExtractor', 'ReadableType10HierarchicalEntityExtractor', 'ReadableType10HierarchicalChildEntityExtractor', 'ReadableType10CompositeEntityExtractor', 'ReadableType10ClosedListEntityExtractor', 'ReadableType10PrebuiltEntityExtractor', 'ReadableType10IntentClassifier', 'ReadableType10PatternAnyEntityExtractor', 'ReadableType10RegexEntityExtractor' - ReadableType ReadableType10 `json:"readableType,omitempty"` - Roles *[]EntityRole `json:"roles,omitempty"` - ExplicitList *[]ExplicitListItem `json:"explicitList,omitempty"` -} - -// PatternAnyModelCreateObject model object for creating a Pattern.Any entity model. -type PatternAnyModelCreateObject struct { - // Name - The model name. - Name *string `json:"name,omitempty"` - // ExplicitList - The Pattern.Any explicit list. - ExplicitList *[]string `json:"explicitList,omitempty"` -} - -// PatternAnyModelUpdateObject model object for updating a Pattern.Any entity model. -type PatternAnyModelUpdateObject struct { - // Name - The model name. - Name *string `json:"name,omitempty"` - // ExplicitList - The Pattern.Any explicit list. - ExplicitList *[]string `json:"explicitList,omitempty"` -} - -// PatternCreateObject object model for creating a Pattern feature. -type PatternCreateObject struct { - // Pattern - The Regular Expression to match. - Pattern *string `json:"pattern,omitempty"` - // Name - Name of the feature. - Name *string `json:"name,omitempty"` -} - -// PatternFeatureInfo pattern feature. -type PatternFeatureInfo struct { - // Pattern - The Regular Expression to match. - Pattern *string `json:"pattern,omitempty"` - // ID - A six-digit ID used for Features. - ID *int32 `json:"id,omitempty"` - // Name - The name of the Feature. - Name *string `json:"name,omitempty"` - // IsActive - Indicates if the feature is enabled. - IsActive *bool `json:"isActive,omitempty"` -} - -// PatternRule pattern -type PatternRule struct { - // Pattern - The pattern text. - Pattern *string `json:"pattern,omitempty"` - // Intent - The intent's name where the pattern belongs to. - Intent *string `json:"intent,omitempty"` -} - -// PatternRuleCreateObject object model for creating a pattern -type PatternRuleCreateObject struct { - // Pattern - The pattern text. - Pattern *string `json:"pattern,omitempty"` - // Intent - The intent's name which the pattern belongs to. - Intent *string `json:"intent,omitempty"` -} - -// PatternRuleInfo pattern rule -type PatternRuleInfo struct { - autorest.Response `json:"-"` - // ID - The pattern ID. - ID *uuid.UUID `json:"id,omitempty"` - // Pattern - The pattern text. - Pattern *string `json:"pattern,omitempty"` - // Intent - The intent's name where the pattern belongs to. - Intent *string `json:"intent,omitempty"` -} - -// PatternRuleUpdateObject object model for updating a pattern. -type PatternRuleUpdateObject struct { - // ID - The pattern ID. - ID *uuid.UUID `json:"id,omitempty"` - // Pattern - The pattern text. - Pattern *string `json:"pattern,omitempty"` - // Intent - The intent's name which the pattern belongs to. - Intent *string `json:"intent,omitempty"` -} - -// PatternUpdateObject object model for updating an existing Pattern feature. -type PatternUpdateObject struct { - // Pattern - The Regular Expression to match. - Pattern *string `json:"pattern,omitempty"` - // Name - Name of the feature. - Name *string `json:"name,omitempty"` - // IsActive - Indicates if the Pattern feature is enabled. - IsActive *bool `json:"isActive,omitempty"` -} - -// PersonalAssistantsResponse response containing user's endpoint keys and the endpoint URLs of the prebuilt -// Cortana applications. -type PersonalAssistantsResponse struct { - autorest.Response `json:"-"` - EndpointKeys *[]uuid.UUID `json:"endpointKeys,omitempty"` - EndpointUrls map[string]*string `json:"endpointUrls"` -} - -// MarshalJSON is the custom marshaler for PersonalAssistantsResponse. -func (par PersonalAssistantsResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if par.EndpointKeys != nil { - objectMap["endpointKeys"] = par.EndpointKeys - } - if par.EndpointUrls != nil { - objectMap["endpointUrls"] = par.EndpointUrls - } - return json.Marshal(objectMap) -} - -// PhraselistCreateObject object model for creating a phraselist model. -type PhraselistCreateObject struct { - // Phrases - List of comma-separated phrases that represent the Phraselist. - Phrases *string `json:"phrases,omitempty"` - // Name - The Phraselist name. - Name *string `json:"name,omitempty"` - // IsExchangeable - An exchangeable phrase list feature are serves as single feature to the LUIS underlying training algorithm. It is used as a lexicon lookup feature where its value is 1 if the lexicon contains a given word or 0 if it doesn’t. Think of an exchangeable as a synonyms list. A non-exchangeable phrase list feature has all the phrases in the list serve as separate features to the underlying training algorithm. So, if you your phrase list feature contains 5 phrases, they will be mapped to 5 separate features. You can think of the non-exchangeable phrase list feature as an additional bag of words that you are willing to add to LUIS existing vocabulary features. Think of a non-exchangeable as set of different words. Default value is true. - IsExchangeable *bool `json:"isExchangeable,omitempty"` -} - -// PhraseListFeatureInfo phraselist Feature. -type PhraseListFeatureInfo struct { - autorest.Response `json:"-"` - // Phrases - A list of comma-separated values. - Phrases *string `json:"phrases,omitempty"` - // IsExchangeable - An exchangeable phrase list feature are serves as single feature to the LUIS underlying training algorithm. It is used as a lexicon lookup feature where its value is 1 if the lexicon contains a given word or 0 if it doesn’t. Think of an exchangeable as a synonyms list. A non-exchangeable phrase list feature has all the phrases in the list serve as separate features to the underlying training algorithm. So, if you your phrase list feature contains 5 phrases, they will be mapped to 5 separate features. You can think of the non-exchangeable phrase list feature as an additional bag of words that you are willing to add to LUIS existing vocabulary features. Think of a non-exchangeable as set of different words. Default value is true. - IsExchangeable *bool `json:"isExchangeable,omitempty"` - // ID - A six-digit ID used for Features. - ID *int32 `json:"id,omitempty"` - // Name - The name of the Feature. - Name *string `json:"name,omitempty"` - // IsActive - Indicates if the feature is enabled. - IsActive *bool `json:"isActive,omitempty"` -} - -// PhraselistUpdateObject object model for updating a Phraselist. -type PhraselistUpdateObject struct { - // Phrases - List of comma-separated phrases that represent the Phraselist. - Phrases *string `json:"phrases,omitempty"` - // Name - The Phraselist name. - Name *string `json:"name,omitempty"` - // IsActive - Indicates if the Phraselist is enabled. - IsActive *bool `json:"isActive,omitempty"` - // IsExchangeable - An exchangeable phrase list feature are serves as single feature to the LUIS underlying training algorithm. It is used as a lexicon lookup feature where its value is 1 if the lexicon contains a given word or 0 if it doesn’t. Think of an exchangeable as a synonyms list. A non-exchangeable phrase list feature has all the phrases in the list serve as separate features to the underlying training algorithm. So, if you your phrase list feature contains 5 phrases, they will be mapped to 5 separate features. You can think of the non-exchangeable phrase list feature as an additional bag of words that you are willing to add to LUIS existing vocabulary features. Think of a non-exchangeable as set of different words. Default value is true. - IsExchangeable *bool `json:"isExchangeable,omitempty"` -} - -// PrebuiltDomain prebuilt Domain. -type PrebuiltDomain struct { - Name *string `json:"name,omitempty"` - Culture *string `json:"culture,omitempty"` - Description *string `json:"description,omitempty"` - Examples *string `json:"examples,omitempty"` - Intents *[]PrebuiltDomainItem `json:"intents,omitempty"` - Entities *[]PrebuiltDomainItem `json:"entities,omitempty"` -} - -// PrebuiltDomainCreateBaseObject a model object containing the name of the custom prebuilt entity and the name of -// the domain to which this model belongs. -type PrebuiltDomainCreateBaseObject struct { - // DomainName - The domain name. - DomainName *string `json:"domainName,omitempty"` -} - -// PrebuiltDomainCreateObject a prebuilt domain create object containing the name and culture of the domain. -type PrebuiltDomainCreateObject struct { - // DomainName - The domain name. - DomainName *string `json:"domainName,omitempty"` - // Culture - The culture of the new domain. - Culture *string `json:"culture,omitempty"` -} - -// PrebuiltDomainItem ... -type PrebuiltDomainItem struct { - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - Examples *string `json:"examples,omitempty"` -} - -// PrebuiltDomainModelCreateObject a model object containing the name of the custom prebuilt intent or entity and -// the name of the domain to which this model belongs. -type PrebuiltDomainModelCreateObject struct { - // DomainName - The domain name. - DomainName *string `json:"domainName,omitempty"` - // ModelName - The intent name or entity name. - ModelName *string `json:"modelName,omitempty"` -} - -// PrebuiltDomainObject ... -type PrebuiltDomainObject struct { - DomainName *string `json:"domain_name,omitempty"` - ModelName *string `json:"model_name,omitempty"` -} - -// PrebuiltEntity prebuilt Entity Extractor. -type PrebuiltEntity struct { - Name *string `json:"name,omitempty"` - Roles *[]string `json:"roles,omitempty"` -} - -// PrebuiltEntityExtractor prebuilt Entity Extractor. -type PrebuiltEntityExtractor struct { - autorest.Response `json:"-"` - // ID - The ID of the Entity Model. - ID *uuid.UUID `json:"id,omitempty"` - // Name - Name of the Entity Model. - Name *string `json:"name,omitempty"` - // TypeID - The type ID of the Entity Model. - TypeID *int32 `json:"typeId,omitempty"` - // ReadableType - Possible values include: 'ReadableType5EntityExtractor', 'ReadableType5HierarchicalEntityExtractor', 'ReadableType5HierarchicalChildEntityExtractor', 'ReadableType5CompositeEntityExtractor', 'ReadableType5ClosedListEntityExtractor', 'ReadableType5PrebuiltEntityExtractor', 'ReadableType5IntentClassifier', 'ReadableType5PatternAnyEntityExtractor', 'ReadableType5RegexEntityExtractor' - ReadableType ReadableType5 `json:"readableType,omitempty"` - Roles *[]EntityRole `json:"roles,omitempty"` -} - -// ProductionOrStagingEndpointInfo ... -type ProductionOrStagingEndpointInfo struct { - autorest.Response `json:"-"` - // VersionID - The version ID to publish. - VersionID *string `json:"versionId,omitempty"` - // IsStaging - Indicates if the staging slot should be used, instead of the Production one. - IsStaging *bool `json:"isStaging,omitempty"` - // EndpointURL - The Runtime endpoint URL for this model version. - EndpointURL *string `json:"endpointUrl,omitempty"` - // Region - The target region that the application is published to. - Region *string `json:"region,omitempty"` - // AssignedEndpointKey - The endpoint key. - AssignedEndpointKey *string `json:"assignedEndpointKey,omitempty"` - // EndpointRegion - The endpoint's region. - EndpointRegion *string `json:"endpointRegion,omitempty"` - // PublishedDateTime - Timestamp when was last published. - PublishedDateTime *string `json:"publishedDateTime,omitempty"` -} - -// ReadCloser ... -type ReadCloser struct { - autorest.Response `json:"-"` - Value *io.ReadCloser `json:"value,omitempty"` -} - -// RegexEntity regular Expression Entity Extractor. -type RegexEntity struct { - Name *string `json:"name,omitempty"` - RegexPattern *string `json:"regexPattern,omitempty"` - Roles *[]string `json:"roles,omitempty"` -} - -// RegexEntityExtractor regex Entity Extractor. -type RegexEntityExtractor struct { - autorest.Response `json:"-"` - // ID - The ID of the Entity Model. - ID *uuid.UUID `json:"id,omitempty"` - // Name - Name of the Entity Model. - Name *string `json:"name,omitempty"` - // TypeID - The type ID of the Entity Model. - TypeID *int32 `json:"typeId,omitempty"` - // ReadableType - Possible values include: 'ReadableType9EntityExtractor', 'ReadableType9HierarchicalEntityExtractor', 'ReadableType9HierarchicalChildEntityExtractor', 'ReadableType9CompositeEntityExtractor', 'ReadableType9ClosedListEntityExtractor', 'ReadableType9PrebuiltEntityExtractor', 'ReadableType9IntentClassifier', 'ReadableType9PatternAnyEntityExtractor', 'ReadableType9RegexEntityExtractor' - ReadableType ReadableType9 `json:"readableType,omitempty"` - Roles *[]EntityRole `json:"roles,omitempty"` - // RegexPattern - The Regex entity pattern. - RegexPattern *string `json:"regexPattern,omitempty"` -} - -// RegexModelCreateObject model object for creating a regex entity model. -type RegexModelCreateObject struct { - // RegexPattern - The regex entity pattern. - RegexPattern *string `json:"regexPattern,omitempty"` - // Name - The model name. - Name *string `json:"name,omitempty"` -} - -// RegexModelUpdateObject model object for updating a regex entity model. -type RegexModelUpdateObject struct { - // RegexPattern - The regex entity pattern. - RegexPattern *string `json:"regexPattern,omitempty"` - // Name - The model name. - Name *string `json:"name,omitempty"` -} - -// SetString ... -type SetString struct { - autorest.Response `json:"-"` - Value map[string]*string `json:"value"` -} - -// MarshalJSON is the custom marshaler for SetString. -func (ss SetString) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ss.Value != nil { - objectMap["value"] = ss.Value - } - return json.Marshal(objectMap) -} - -// String ... -type String struct { - autorest.Response `json:"-"` - Value *string `json:"value,omitempty"` -} - -// SubClosedList sublist of items for a Closed list. -type SubClosedList struct { - // CanonicalForm - The standard form that the list represents. - CanonicalForm *string `json:"canonicalForm,omitempty"` - // List - List of synonym words. - List *[]string `json:"list,omitempty"` -} - -// SubClosedListResponse sublist of items for a Closed list. -type SubClosedListResponse struct { - // ID - The sublist ID - ID *int32 `json:"id,omitempty"` - // CanonicalForm - The standard form that the list represents. - CanonicalForm *string `json:"canonicalForm,omitempty"` - // List - List of synonym words. - List *[]string `json:"list,omitempty"` -} - -// TaskUpdateObject object model for cloning an application's version. -type TaskUpdateObject struct { - // Version - The new version for the cloned model. - Version *string `json:"version,omitempty"` -} - -// 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"` -} - -// UserCollaborator ... -type UserCollaborator struct { - // Email - The email address of the user. - Email *string `json:"email,omitempty"` -} - -// UUID ... -type UUID struct { - autorest.Response `json:"-"` - Value *uuid.UUID `json:"value,omitempty"` -} - -// VersionInfo object model of an application version. -type VersionInfo struct { - autorest.Response `json:"-"` - // Version - The version ID. E.g.: "0.1" - Version *string `json:"version,omitempty"` - // CreatedDateTime - The version's creation timestamp. - CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` - // LastModifiedDateTime - Timestamp of the last update. - LastModifiedDateTime *date.Time `json:"lastModifiedDateTime,omitempty"` - // LastTrainedDateTime - Timestamp of the last time the model was trained. - LastTrainedDateTime *date.Time `json:"lastTrainedDateTime,omitempty"` - // LastPublishedDateTime - Timestamp when was last published. - LastPublishedDateTime *date.Time `json:"lastPublishedDateTime,omitempty"` - // EndpointURL - The Runtime endpoint URL for this model version. - EndpointURL *string `json:"endpointUrl,omitempty"` - // AssignedEndpointKey - The endpoint key. - AssignedEndpointKey map[string]*string `json:"assignedEndpointKey"` - // ExternalAPIKeys - External keys. - ExternalAPIKeys interface{} `json:"externalApiKeys,omitempty"` - // IntentsCount - Number of intents in this model. - IntentsCount *int32 `json:"intentsCount,omitempty"` - // EntitiesCount - Number of entities in this model. - EntitiesCount *int32 `json:"entitiesCount,omitempty"` - // EndpointHitsCount - Number of calls made to this endpoint. - EndpointHitsCount *int32 `json:"endpointHitsCount,omitempty"` - // TrainingStatus - The current training status. Possible values include: 'NeedsTraining', 'InProgress', 'Trained' - TrainingStatus TrainingStatus `json:"trainingStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for VersionInfo. -func (vi VersionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vi.Version != nil { - objectMap["version"] = vi.Version - } - if vi.CreatedDateTime != nil { - objectMap["createdDateTime"] = vi.CreatedDateTime - } - if vi.LastModifiedDateTime != nil { - objectMap["lastModifiedDateTime"] = vi.LastModifiedDateTime - } - if vi.LastTrainedDateTime != nil { - objectMap["lastTrainedDateTime"] = vi.LastTrainedDateTime - } - if vi.LastPublishedDateTime != nil { - objectMap["lastPublishedDateTime"] = vi.LastPublishedDateTime - } - if vi.EndpointURL != nil { - objectMap["endpointUrl"] = vi.EndpointURL - } - if vi.AssignedEndpointKey != nil { - objectMap["assignedEndpointKey"] = vi.AssignedEndpointKey - } - objectMap["externalApiKeys"] = vi.ExternalAPIKeys - if vi.IntentsCount != nil { - objectMap["intentsCount"] = vi.IntentsCount - } - if vi.EntitiesCount != nil { - objectMap["entitiesCount"] = vi.EntitiesCount - } - if vi.EndpointHitsCount != nil { - objectMap["endpointHitsCount"] = vi.EndpointHitsCount - } - if vi.TrainingStatus != "" { - objectMap["trainingStatus"] = vi.TrainingStatus - } - return json.Marshal(objectMap) -} - -// WordListBaseUpdateObject object model for updating one of the closed list's sublists. -type WordListBaseUpdateObject struct { - // CanonicalForm - The standard form that the list represents. - CanonicalForm *string `json:"canonicalForm,omitempty"` - // List - List of synonym words. - List *[]string `json:"list,omitempty"` -} - -// WordListObject sublist of items for a Closed list. -type WordListObject struct { - // CanonicalForm - The standard form that the list represents. - CanonicalForm *string `json:"canonicalForm,omitempty"` - // List - List of synonym words. - List *[]string `json:"list,omitempty"` -} diff --git a/services/cognitiveservices/v2.0/luis/programmatic/pattern.go b/services/cognitiveservices/v2.0/luis/programmatic/pattern.go deleted file mode 100644 index fc6e4a7d934c..000000000000 --- a/services/cognitiveservices/v2.0/luis/programmatic/pattern.go +++ /dev/null @@ -1,642 +0,0 @@ -package programmatic - -// 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/satori/go.uuid" - "net/http" -) - -// PatternClient is the client for the Pattern methods of the Programmatic service. -type PatternClient struct { - BaseClient -} - -// NewPatternClient creates an instance of the PatternClient client. -func NewPatternClient(azureRegion AzureRegions) PatternClient { - return PatternClient{New(azureRegion)} -} - -// AddPattern sends the add pattern request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// pattern - the input pattern. -func (client PatternClient) AddPattern(ctx context.Context, appID uuid.UUID, versionID string, pattern PatternRuleCreateObject) (result PatternRuleInfo, err error) { - req, err := client.AddPatternPreparer(ctx, appID, versionID, pattern) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "AddPattern", nil, "Failure preparing request") - return - } - - resp, err := client.AddPatternSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "AddPattern", resp, "Failure sending request") - return - } - - result, err = client.AddPatternResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "AddPattern", resp, "Failure responding to request") - } - - return -} - -// AddPatternPreparer prepares the AddPattern request. -func (client PatternClient) AddPatternPreparer(ctx context.Context, appID uuid.UUID, versionID string, pattern PatternRuleCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrule", pathParameters), - autorest.WithJSON(pattern)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddPatternSender sends the AddPattern request. The method will close the -// http.Response Body if it receives an error. -func (client PatternClient) AddPatternSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddPatternResponder handles the response to the AddPattern request. The method always -// closes the http.Response Body. -func (client PatternClient) AddPatternResponder(resp *http.Response) (result PatternRuleInfo, 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 -} - -// BatchAddPatterns sends the batch add patterns request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// patterns - a JSON array containing patterns. -func (client PatternClient) BatchAddPatterns(ctx context.Context, appID uuid.UUID, versionID string, patterns []PatternRuleCreateObject) (result ListPatternRuleInfo, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: patterns, - Constraints: []validation.Constraint{{Target: "patterns", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("programmatic.PatternClient", "BatchAddPatterns", err.Error()) - } - - req, err := client.BatchAddPatternsPreparer(ctx, appID, versionID, patterns) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "BatchAddPatterns", nil, "Failure preparing request") - return - } - - resp, err := client.BatchAddPatternsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "BatchAddPatterns", resp, "Failure sending request") - return - } - - result, err = client.BatchAddPatternsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "BatchAddPatterns", resp, "Failure responding to request") - } - - return -} - -// BatchAddPatternsPreparer prepares the BatchAddPatterns request. -func (client PatternClient) BatchAddPatternsPreparer(ctx context.Context, appID uuid.UUID, versionID string, patterns []PatternRuleCreateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules", pathParameters), - autorest.WithJSON(patterns)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// BatchAddPatternsSender sends the BatchAddPatterns request. The method will close the -// http.Response Body if it receives an error. -func (client PatternClient) BatchAddPatternsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// BatchAddPatternsResponder handles the response to the BatchAddPatterns request. The method always -// closes the http.Response Body. -func (client PatternClient) BatchAddPatternsResponder(resp *http.Response) (result ListPatternRuleInfo, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// DeletePattern sends the delete pattern request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// patternID - the pattern ID. -func (client PatternClient) DeletePattern(ctx context.Context, appID uuid.UUID, versionID string, patternID uuid.UUID) (result OperationStatus, err error) { - req, err := client.DeletePatternPreparer(ctx, appID, versionID, patternID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "DeletePattern", nil, "Failure preparing request") - return - } - - resp, err := client.DeletePatternSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "DeletePattern", resp, "Failure sending request") - return - } - - result, err = client.DeletePatternResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "DeletePattern", resp, "Failure responding to request") - } - - return -} - -// DeletePatternPreparer prepares the DeletePattern request. -func (client PatternClient) DeletePatternPreparer(ctx context.Context, appID uuid.UUID, versionID string, patternID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "patternId": autorest.Encode("path", patternID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules/{patternId}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeletePatternSender sends the DeletePattern request. The method will close the -// http.Response Body if it receives an error. -func (client PatternClient) DeletePatternSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeletePatternResponder handles the response to the DeletePattern request. The method always -// closes the http.Response Body. -func (client PatternClient) DeletePatternResponder(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 -} - -// DeletePatterns sends the delete patterns request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// patternIds - the patterns IDs. -func (client PatternClient) DeletePatterns(ctx context.Context, appID uuid.UUID, versionID string, patternIds []uuid.UUID) (result OperationStatus, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: patternIds, - Constraints: []validation.Constraint{{Target: "patternIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("programmatic.PatternClient", "DeletePatterns", err.Error()) - } - - req, err := client.DeletePatternsPreparer(ctx, appID, versionID, patternIds) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "DeletePatterns", nil, "Failure preparing request") - return - } - - resp, err := client.DeletePatternsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "DeletePatterns", resp, "Failure sending request") - return - } - - result, err = client.DeletePatternsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "DeletePatterns", resp, "Failure responding to request") - } - - return -} - -// DeletePatternsPreparer prepares the DeletePatterns request. -func (client PatternClient) DeletePatternsPreparer(ctx context.Context, appID uuid.UUID, versionID string, patternIds []uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules", pathParameters), - autorest.WithJSON(patternIds)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeletePatternsSender sends the DeletePatterns request. The method will close the -// http.Response Body if it receives an error. -func (client PatternClient) DeletePatternsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeletePatternsResponder handles the response to the DeletePatterns request. The method always -// closes the http.Response Body. -func (client PatternClient) DeletePatternsResponder(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 -} - -// GetIntentPatterns sends the get intent patterns request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// intentID - the intent classifier 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 PatternClient) GetIntentPatterns(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, skip *int32, take *int32) (result ListPatternRuleInfo, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.PatternClient", "GetIntentPatterns", err.Error()) - } - - req, err := client.GetIntentPatternsPreparer(ctx, appID, versionID, intentID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "GetIntentPatterns", nil, "Failure preparing request") - return - } - - resp, err := client.GetIntentPatternsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "GetIntentPatterns", resp, "Failure sending request") - return - } - - result, err = client.GetIntentPatternsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "GetIntentPatterns", resp, "Failure responding to request") - } - - return -} - -// GetIntentPatternsPreparer prepares the GetIntentPatterns request. -func (client PatternClient) GetIntentPatternsPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "intentId": autorest.Encode("path", intentID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/patternrules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetIntentPatternsSender sends the GetIntentPatterns request. The method will close the -// http.Response Body if it receives an error. -func (client PatternClient) GetIntentPatternsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetIntentPatternsResponder handles the response to the GetIntentPatterns request. The method always -// closes the http.Response Body. -func (client PatternClient) GetIntentPatternsResponder(resp *http.Response) (result ListPatternRuleInfo, 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 -} - -// GetPatterns sends the get patterns request. -// Parameters: -// appID - the application ID. -// 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 PatternClient) GetPatterns(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListPatternRuleInfo, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.PatternClient", "GetPatterns", err.Error()) - } - - req, err := client.GetPatternsPreparer(ctx, appID, versionID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "GetPatterns", nil, "Failure preparing request") - return - } - - resp, err := client.GetPatternsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "GetPatterns", resp, "Failure sending request") - return - } - - result, err = client.GetPatternsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "GetPatterns", resp, "Failure responding to request") - } - - return -} - -// GetPatternsPreparer prepares the GetPatterns request. -func (client PatternClient) GetPatternsPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPatternsSender sends the GetPatterns request. The method will close the -// http.Response Body if it receives an error. -func (client PatternClient) GetPatternsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetPatternsResponder handles the response to the GetPatterns request. The method always -// closes the http.Response Body. -func (client PatternClient) GetPatternsResponder(resp *http.Response) (result ListPatternRuleInfo, 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 -} - -// UpdatePattern sends the update pattern request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// patternID - the pattern ID. -// pattern - an object representing a pattern. -func (client PatternClient) UpdatePattern(ctx context.Context, appID uuid.UUID, versionID string, patternID uuid.UUID, pattern PatternRuleUpdateObject) (result PatternRuleInfo, err error) { - req, err := client.UpdatePatternPreparer(ctx, appID, versionID, patternID, pattern) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "UpdatePattern", nil, "Failure preparing request") - return - } - - resp, err := client.UpdatePatternSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "UpdatePattern", resp, "Failure sending request") - return - } - - result, err = client.UpdatePatternResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "UpdatePattern", resp, "Failure responding to request") - } - - return -} - -// UpdatePatternPreparer prepares the UpdatePattern request. -func (client PatternClient) UpdatePatternPreparer(ctx context.Context, appID uuid.UUID, versionID string, patternID uuid.UUID, pattern PatternRuleUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "patternId": autorest.Encode("path", patternID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules/{patternId}", pathParameters), - autorest.WithJSON(pattern)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdatePatternSender sends the UpdatePattern request. The method will close the -// http.Response Body if it receives an error. -func (client PatternClient) UpdatePatternSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdatePatternResponder handles the response to the UpdatePattern request. The method always -// closes the http.Response Body. -func (client PatternClient) UpdatePatternResponder(resp *http.Response) (result PatternRuleInfo, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdatePatterns sends the update patterns request. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// patterns - an array represents the patterns. -func (client PatternClient) UpdatePatterns(ctx context.Context, appID uuid.UUID, versionID string, patterns []PatternRuleUpdateObject) (result ListPatternRuleInfo, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: patterns, - Constraints: []validation.Constraint{{Target: "patterns", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("programmatic.PatternClient", "UpdatePatterns", err.Error()) - } - - req, err := client.UpdatePatternsPreparer(ctx, appID, versionID, patterns) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "UpdatePatterns", nil, "Failure preparing request") - return - } - - resp, err := client.UpdatePatternsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "UpdatePatterns", resp, "Failure sending request") - return - } - - result, err = client.UpdatePatternsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "UpdatePatterns", resp, "Failure responding to request") - } - - return -} - -// UpdatePatternsPreparer prepares the UpdatePatterns request. -func (client PatternClient) UpdatePatternsPreparer(ctx context.Context, appID uuid.UUID, versionID string, patterns []PatternRuleUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules", pathParameters), - autorest.WithJSON(patterns)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdatePatternsSender sends the UpdatePatterns request. The method will close the -// http.Response Body if it receives an error. -func (client PatternClient) UpdatePatternsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdatePatternsResponder handles the response to the UpdatePatterns request. The method always -// closes the http.Response Body. -func (client PatternClient) UpdatePatternsResponder(resp *http.Response) (result ListPatternRuleInfo, 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/cognitiveservices/v2.0/luis/programmatic/permissions.go b/services/cognitiveservices/v2.0/luis/programmatic/permissions.go deleted file mode 100644 index 75c658467f4a..000000000000 --- a/services/cognitiveservices/v2.0/luis/programmatic/permissions.go +++ /dev/null @@ -1,296 +0,0 @@ -package programmatic - -// 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/satori/go.uuid" - "net/http" -) - -// PermissionsClient is the client for the Permissions methods of the Programmatic service. -type PermissionsClient struct { - BaseClient -} - -// NewPermissionsClient creates an instance of the PermissionsClient client. -func NewPermissionsClient(azureRegion AzureRegions) PermissionsClient { - return PermissionsClient{New(azureRegion)} -} - -// 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) { - req, err := client.AddPreparer(ctx, appID, userToAdd) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.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, "programmatic.PermissionsClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.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{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", 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 autorest.SendWithSender(client, 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) { - req, err := client.DeletePreparer(ctx, appID, userToDelete) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.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, "programmatic.PermissionsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.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{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", 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 autorest.SendWithSender(client, 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) { - req, err := client.ListPreparer(ctx, appID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.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, "programmatic.PermissionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.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{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", 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 autorest.SendWithSender(client, 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 users access list with the one 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's email addresses. -func (client PermissionsClient) Update(ctx context.Context, appID uuid.UUID, collaborators CollaboratorsArray) (result OperationStatus, err error) { - req, err := client.UpdatePreparer(ctx, appID, collaborators) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.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, "programmatic.PermissionsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.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{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", 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 autorest.SendWithSender(client, 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/cognitiveservices/v2.0/luis/programmatic/train.go b/services/cognitiveservices/v2.0/luis/programmatic/train.go deleted file mode 100644 index 4ae82bd0d9c5..000000000000 --- a/services/cognitiveservices/v2.0/luis/programmatic/train.go +++ /dev/null @@ -1,170 +0,0 @@ -package programmatic - -// 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/satori/go.uuid" - "net/http" -) - -// TrainClient is the client for the Train methods of the Programmatic service. -type TrainClient struct { - BaseClient -} - -// NewTrainClient creates an instance of the TrainClient client. -func NewTrainClient(azureRegion AzureRegions) TrainClient { - return TrainClient{New(azureRegion)} -} - -// GetStatus gets the training status of all models (intents and entities) for the specified LUIS app. You must call -// the train API to train the LUIS app before you call this API to get training status. "appID" specifies the LUIS app -// ID. "versionId" specifies the version number of the LUIS app. For example, "0.1". -// Parameters: -// appID - the application ID. -// versionID - the version ID. -func (client TrainClient) GetStatus(ctx context.Context, appID uuid.UUID, versionID string) (result ListModelTrainingInfo, err error) { - req, err := client.GetStatusPreparer(ctx, appID, versionID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.TrainClient", "GetStatus", nil, "Failure preparing request") - return - } - - resp, err := client.GetStatusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.TrainClient", "GetStatus", resp, "Failure sending request") - return - } - - result, err = client.GetStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.TrainClient", "GetStatus", resp, "Failure responding to request") - } - - return -} - -// GetStatusPreparer prepares the GetStatus request. -func (client TrainClient) GetStatusPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/train", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetStatusSender sends the GetStatus request. The method will close the -// http.Response Body if it receives an error. -func (client TrainClient) GetStatusSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetStatusResponder handles the response to the GetStatus request. The method always -// closes the http.Response Body. -func (client TrainClient) GetStatusResponder(resp *http.Response) (result ListModelTrainingInfo, 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 -} - -// TrainVersion sends a training request for a version of a specified LUIS app. This POST request initiates a request -// asynchronously. To determine whether the training request is successful, submit a GET request to get training -// status. Note: The application version is not fully trained unless all the models (intents and entities) are trained -// successfully or are up to date. To verify training success, get the training status at least once after training is -// complete. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -func (client TrainClient) TrainVersion(ctx context.Context, appID uuid.UUID, versionID string) (result EnqueueTrainingResponse, err error) { - req, err := client.TrainVersionPreparer(ctx, appID, versionID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.TrainClient", "TrainVersion", nil, "Failure preparing request") - return - } - - resp, err := client.TrainVersionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.TrainClient", "TrainVersion", resp, "Failure sending request") - return - } - - result, err = client.TrainVersionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.TrainClient", "TrainVersion", resp, "Failure responding to request") - } - - return -} - -// TrainVersionPreparer prepares the TrainVersion request. -func (client TrainClient) TrainVersionPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/train", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TrainVersionSender sends the TrainVersion request. The method will close the -// http.Response Body if it receives an error. -func (client TrainClient) TrainVersionSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TrainVersionResponder handles the response to the TrainVersion request. The method always -// closes the http.Response Body. -func (client TrainClient) TrainVersionResponder(resp *http.Response) (result EnqueueTrainingResponse, 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/cognitiveservices/v2.0/luis/programmatic/version.go b/services/cognitiveservices/v2.0/luis/programmatic/version.go deleted file mode 100644 index 5531b718a2f7..000000000000 --- a/services/cognitiveservices/v2.0/luis/programmatic/version.go +++ /dev/null @@ -1,30 +0,0 @@ -package programmatic - -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.Number + " programmatic/v2.0 preview" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/services/cognitiveservices/v2.0/luis/programmatic/versions.go b/services/cognitiveservices/v2.0/luis/programmatic/versions.go deleted file mode 100644 index c6c67c093977..000000000000 --- a/services/cognitiveservices/v2.0/luis/programmatic/versions.go +++ /dev/null @@ -1,595 +0,0 @@ -package programmatic - -// 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/satori/go.uuid" - "net/http" -) - -// VersionsClient is the client for the Versions methods of the Programmatic service. -type VersionsClient struct { - BaseClient -} - -// NewVersionsClient creates an instance of the VersionsClient client. -func NewVersionsClient(azureRegion AzureRegions) VersionsClient { - return VersionsClient{New(azureRegion)} -} - -// Clone creates a new version using the current snapshot of the selected application version. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// versionCloneObject - a model containing the new version ID. -func (client VersionsClient) Clone(ctx context.Context, appID uuid.UUID, versionID string, versionCloneObject *TaskUpdateObject) (result String, err error) { - req, err := client.ClonePreparer(ctx, appID, versionID, versionCloneObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Clone", nil, "Failure preparing request") - return - } - - resp, err := client.CloneSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Clone", resp, "Failure sending request") - return - } - - result, err = client.CloneResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Clone", resp, "Failure responding to request") - } - - return -} - -// ClonePreparer prepares the Clone request. -func (client VersionsClient) ClonePreparer(ctx context.Context, appID uuid.UUID, versionID string, versionCloneObject *TaskUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/clone", pathParameters)) - if versionCloneObject != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(versionCloneObject)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CloneSender sends the Clone request. The method will close the -// http.Response Body if it receives an error. -func (client VersionsClient) CloneSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CloneResponder handles the response to the Clone request. The method always -// closes the http.Response Body. -func (client VersionsClient) CloneResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes an application version. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -func (client VersionsClient) Delete(ctx context.Context, appID uuid.UUID, versionID string) (result OperationStatus, err error) { - req, err := client.DeletePreparer(ctx, appID, versionID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VersionsClient) DeletePreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/", 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 VersionsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 VersionsClient) 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 -} - -// DeleteUnlabelledUtterance deleted an unlabelled utterance. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// utterance - the utterance text to delete. -func (client VersionsClient) DeleteUnlabelledUtterance(ctx context.Context, appID uuid.UUID, versionID string, utterance string) (result OperationStatus, err error) { - req, err := client.DeleteUnlabelledUtterancePreparer(ctx, appID, versionID, utterance) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "DeleteUnlabelledUtterance", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteUnlabelledUtteranceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "DeleteUnlabelledUtterance", resp, "Failure sending request") - return - } - - result, err = client.DeleteUnlabelledUtteranceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "DeleteUnlabelledUtterance", resp, "Failure responding to request") - } - - return -} - -// DeleteUnlabelledUtterancePreparer prepares the DeleteUnlabelledUtterance request. -func (client VersionsClient) DeleteUnlabelledUtterancePreparer(ctx context.Context, appID uuid.UUID, versionID string, utterance string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/suggest", pathParameters), - autorest.WithJSON(utterance)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteUnlabelledUtteranceSender sends the DeleteUnlabelledUtterance request. The method will close the -// http.Response Body if it receives an error. -func (client VersionsClient) DeleteUnlabelledUtteranceSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteUnlabelledUtteranceResponder handles the response to the DeleteUnlabelledUtterance request. The method always -// closes the http.Response Body. -func (client VersionsClient) DeleteUnlabelledUtteranceResponder(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 -} - -// Export exports a LUIS application to JSON format. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -func (client VersionsClient) Export(ctx context.Context, appID uuid.UUID, versionID string) (result LuisApp, err error) { - req, err := client.ExportPreparer(ctx, appID, versionID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Export", nil, "Failure preparing request") - return - } - - resp, err := client.ExportSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Export", resp, "Failure sending request") - return - } - - result, err = client.ExportResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Export", resp, "Failure responding to request") - } - - return -} - -// ExportPreparer prepares the Export request. -func (client VersionsClient) ExportPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/export", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExportSender sends the Export request. The method will close the -// http.Response Body if it receives an error. -func (client VersionsClient) ExportSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExportResponder handles the response to the Export request. The method always -// closes the http.Response Body. -func (client VersionsClient) ExportResponder(resp *http.Response) (result LuisApp, 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 the version info. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -func (client VersionsClient) Get(ctx context.Context, appID uuid.UUID, versionID string) (result VersionInfo, err error) { - req, err := client.GetPreparer(ctx, appID, versionID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client VersionsClient) GetPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/", 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 VersionsClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 VersionsClient) GetResponder(resp *http.Response) (result VersionInfo, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Import imports a new version into a LUIS application. -// Parameters: -// appID - the application ID. -// luisApp - a LUIS application structure. -// versionID - the new versionId to import. If not specified, the versionId will be read from the imported -// object. -func (client VersionsClient) Import(ctx context.Context, appID uuid.UUID, luisApp LuisApp, versionID string) (result String, err error) { - req, err := client.ImportPreparer(ctx, appID, luisApp, versionID) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Import", nil, "Failure preparing request") - return - } - - resp, err := client.ImportSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Import", resp, "Failure sending request") - return - } - - result, err = client.ImportResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Import", resp, "Failure responding to request") - } - - return -} - -// ImportPreparer prepares the Import request. -func (client VersionsClient) ImportPreparer(ctx context.Context, appID uuid.UUID, luisApp LuisApp, versionID string) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - queryParameters := map[string]interface{}{} - if len(versionID) > 0 { - queryParameters["versionId"] = autorest.Encode("query", versionID) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/import", pathParameters), - autorest.WithJSON(luisApp), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ImportSender sends the Import request. The method will close the -// http.Response Body if it receives an error. -func (client VersionsClient) ImportSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ImportResponder handles the response to the Import request. The method always -// closes the http.Response Body. -func (client VersionsClient) ImportResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets the application versions info. -// Parameters: -// appID - the application 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 VersionsClient) List(ctx context.Context, appID uuid.UUID, skip *int32, take *int32) (result ListVersionInfo, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: take, - Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, - {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("programmatic.VersionsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, appID, skip, take) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client VersionsClient) ListPreparer(ctx context.Context, appID uuid.UUID, skip *int32, take *int32) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - queryParameters := map[string]interface{}{} - if skip != nil { - queryParameters["skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["skip"] = autorest.Encode("query", 0) - } - if take != nil { - queryParameters["take"] = autorest.Encode("query", *take) - } else { - queryParameters["take"] = autorest.Encode("query", 100) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions", 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 VersionsClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 VersionsClient) ListResponder(resp *http.Response) (result ListVersionInfo, 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 updates the name or description of the application version. -// Parameters: -// appID - the application ID. -// versionID - the version ID. -// versionUpdateObject - a model containing Name and Description of the application. -func (client VersionsClient) Update(ctx context.Context, appID uuid.UUID, versionID string, versionUpdateObject TaskUpdateObject) (result OperationStatus, err error) { - req, err := client.UpdatePreparer(ctx, appID, versionID, versionUpdateObject) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VersionsClient) UpdatePreparer(ctx context.Context, appID uuid.UUID, versionID string, versionUpdateObject TaskUpdateObject) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - "versionId": autorest.Encode("path", versionID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters), - autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/", pathParameters), - autorest.WithJSON(versionUpdateObject)) - 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 VersionsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, 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 VersionsClient) 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/compute/mgmt/2016-03-30/compute/availabilitysets.go b/services/compute/mgmt/2016-03-30/compute/availabilitysets.go index 39084c30026d..031e9a021fef 100644 --- a/services/compute/mgmt/2016-03-30/compute/availabilitysets.go +++ b/services/compute/mgmt/2016-03-30/compute/availabilitysets.go @@ -466,7 +466,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp } // ListBySubscription lists all availability sets in a subscription. -func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) { +// Parameters: +// expand - the expand expression to apply to the operation. +func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -478,7 +480,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re }() } result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) + req, err := client.ListBySubscriptionPreparer(ctx, expand) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request") return @@ -500,7 +502,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re } // ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { +func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -509,6 +511,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -560,7 +565,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) { +func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -571,6 +576,6 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListBySubscription(ctx) + result.page, err = client.ListBySubscription(ctx, expand) return } diff --git a/services/compute/mgmt/2016-03-30/compute/computeapi/interfaces.go b/services/compute/mgmt/2016-03-30/compute/computeapi/interfaces.go index e7c54a8d1607..f5203bf82a83 100644 --- a/services/compute/mgmt/2016-03-30/compute/computeapi/interfaces.go +++ b/services/compute/mgmt/2016-03-30/compute/computeapi/interfaces.go @@ -29,7 +29,7 @@ type AvailabilitySetsClientAPI interface { Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error) List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error) - ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error) + ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error) } var _ AvailabilitySetsClientAPI = (*compute.AvailabilitySetsClient)(nil) diff --git a/services/compute/mgmt/2017-03-30/compute/availabilitysets.go b/services/compute/mgmt/2017-03-30/compute/availabilitysets.go index 573ffd10687b..f5a559caa404 100644 --- a/services/compute/mgmt/2017-03-30/compute/availabilitysets.go +++ b/services/compute/mgmt/2017-03-30/compute/availabilitysets.go @@ -466,7 +466,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp } // ListBySubscription lists all availability sets in a subscription. -func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) { +// Parameters: +// expand - the expand expression to apply to the operation. +func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -478,7 +480,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re }() } result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) + req, err := client.ListBySubscriptionPreparer(ctx, expand) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request") return @@ -500,7 +502,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re } // ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { +func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -509,6 +511,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -560,7 +565,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) { +func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -571,6 +576,6 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListBySubscription(ctx) + result.page, err = client.ListBySubscription(ctx, expand) return } diff --git a/services/compute/mgmt/2017-03-30/compute/computeapi/interfaces.go b/services/compute/mgmt/2017-03-30/compute/computeapi/interfaces.go index 74509248f485..ffd16dcf7368 100644 --- a/services/compute/mgmt/2017-03-30/compute/computeapi/interfaces.go +++ b/services/compute/mgmt/2017-03-30/compute/computeapi/interfaces.go @@ -29,7 +29,7 @@ type AvailabilitySetsClientAPI interface { Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error) List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error) - ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error) + ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error) } var _ AvailabilitySetsClientAPI = (*compute.AvailabilitySetsClient)(nil) diff --git a/services/compute/mgmt/2017-12-01/compute/availabilitysets.go b/services/compute/mgmt/2017-12-01/compute/availabilitysets.go index d46ad7a984a6..e849b7225857 100644 --- a/services/compute/mgmt/2017-12-01/compute/availabilitysets.go +++ b/services/compute/mgmt/2017-12-01/compute/availabilitysets.go @@ -466,7 +466,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp } // ListBySubscription lists all availability sets in a subscription. -func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) { +// Parameters: +// expand - the expand expression to apply to the operation. +func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -478,7 +480,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re }() } result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) + req, err := client.ListBySubscriptionPreparer(ctx, expand) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request") return @@ -500,7 +502,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re } // ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { +func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -509,6 +511,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -560,7 +565,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) { +func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -571,7 +576,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListBySubscription(ctx) + result.page, err = client.ListBySubscription(ctx, expand) return } diff --git a/services/compute/mgmt/2017-12-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2017-12-01/compute/computeapi/interfaces.go index 1c71e948ee6a..7f26ac6fec7d 100644 --- a/services/compute/mgmt/2017-12-01/compute/computeapi/interfaces.go +++ b/services/compute/mgmt/2017-12-01/compute/computeapi/interfaces.go @@ -36,7 +36,7 @@ type AvailabilitySetsClientAPI interface { Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error) List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error) - ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error) + ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters compute.AvailabilitySetUpdate) (result compute.AvailabilitySet, err error) } diff --git a/services/compute/mgmt/2018-04-01/compute/availabilitysets.go b/services/compute/mgmt/2018-04-01/compute/availabilitysets.go index 59e0e4e9e637..a5c179497f06 100644 --- a/services/compute/mgmt/2018-04-01/compute/availabilitysets.go +++ b/services/compute/mgmt/2018-04-01/compute/availabilitysets.go @@ -465,7 +465,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp } // ListBySubscription lists all availability sets in a subscription. -func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) { +// Parameters: +// expand - the expand expression to apply to the operation. +func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -477,7 +479,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re }() } result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) + req, err := client.ListBySubscriptionPreparer(ctx, expand) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request") return @@ -499,7 +501,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re } // ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { +func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -508,6 +510,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -559,7 +564,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) { +func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -570,7 +575,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListBySubscription(ctx) + result.page, err = client.ListBySubscription(ctx, expand) return } diff --git a/services/compute/mgmt/2018-04-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2018-04-01/compute/computeapi/interfaces.go index cd7eec093716..22f6cd41b575 100644 --- a/services/compute/mgmt/2018-04-01/compute/computeapi/interfaces.go +++ b/services/compute/mgmt/2018-04-01/compute/computeapi/interfaces.go @@ -37,7 +37,7 @@ type AvailabilitySetsClientAPI interface { Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error) List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error) - ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error) + ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters compute.AvailabilitySetUpdate) (result compute.AvailabilitySet, err error) } diff --git a/services/compute/mgmt/2018-06-01/compute/availabilitysets.go b/services/compute/mgmt/2018-06-01/compute/availabilitysets.go index c9acfdd39b65..e5ba6c3c6832 100644 --- a/services/compute/mgmt/2018-06-01/compute/availabilitysets.go +++ b/services/compute/mgmt/2018-06-01/compute/availabilitysets.go @@ -465,7 +465,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp } // ListBySubscription lists all availability sets in a subscription. -func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) { +// Parameters: +// expand - the expand expression to apply to the operation. +func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -477,7 +479,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re }() } result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) + req, err := client.ListBySubscriptionPreparer(ctx, expand) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request") return @@ -499,7 +501,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re } // ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { +func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -508,6 +510,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -559,7 +564,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) { +func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -570,7 +575,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListBySubscription(ctx) + result.page, err = client.ListBySubscription(ctx, expand) return } diff --git a/services/compute/mgmt/2018-06-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2018-06-01/compute/computeapi/interfaces.go index 2e9ac9575fd3..2e815c1740a8 100644 --- a/services/compute/mgmt/2018-06-01/compute/computeapi/interfaces.go +++ b/services/compute/mgmt/2018-06-01/compute/computeapi/interfaces.go @@ -37,7 +37,7 @@ type AvailabilitySetsClientAPI interface { Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error) List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error) - ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error) + ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters compute.AvailabilitySetUpdate) (result compute.AvailabilitySet, err error) } diff --git a/services/compute/mgmt/2018-10-01/compute/availabilitysets.go b/services/compute/mgmt/2018-10-01/compute/availabilitysets.go index 008185e15961..d8e9208e34d2 100644 --- a/services/compute/mgmt/2018-10-01/compute/availabilitysets.go +++ b/services/compute/mgmt/2018-10-01/compute/availabilitysets.go @@ -465,7 +465,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp } // ListBySubscription lists all availability sets in a subscription. -func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) { +// Parameters: +// expand - the expand expression to apply to the operation. +func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -477,7 +479,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re }() } result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) + req, err := client.ListBySubscriptionPreparer(ctx, expand) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request") return @@ -499,7 +501,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re } // ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { +func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -508,6 +510,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -559,7 +564,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) { +func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -570,7 +575,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListBySubscription(ctx) + result.page, err = client.ListBySubscription(ctx, expand) return } diff --git a/services/compute/mgmt/2018-10-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2018-10-01/compute/computeapi/interfaces.go index 3ddbabda869a..790c917d8016 100644 --- a/services/compute/mgmt/2018-10-01/compute/computeapi/interfaces.go +++ b/services/compute/mgmt/2018-10-01/compute/computeapi/interfaces.go @@ -37,7 +37,7 @@ type AvailabilitySetsClientAPI interface { Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error) List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error) - ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error) + ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters compute.AvailabilitySetUpdate) (result compute.AvailabilitySet, err error) } diff --git a/services/compute/mgmt/2019-03-01/compute/availabilitysets.go b/services/compute/mgmt/2019-03-01/compute/availabilitysets.go index 8a6bbaa4a195..853abfc1c95c 100644 --- a/services/compute/mgmt/2019-03-01/compute/availabilitysets.go +++ b/services/compute/mgmt/2019-03-01/compute/availabilitysets.go @@ -465,7 +465,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp } // ListBySubscription lists all availability sets in a subscription. -func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) { +// Parameters: +// expand - the expand expression to apply to the operation. +func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -477,7 +479,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re }() } result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) + req, err := client.ListBySubscriptionPreparer(ctx, expand) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request") return @@ -499,7 +501,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re } // ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { +func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -508,6 +510,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -559,7 +564,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) { +func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -570,7 +575,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListBySubscription(ctx) + result.page, err = client.ListBySubscription(ctx, expand) return } diff --git a/services/compute/mgmt/2019-03-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2019-03-01/compute/computeapi/interfaces.go index 9dd226f0493a..b9cb016a868d 100644 --- a/services/compute/mgmt/2019-03-01/compute/computeapi/interfaces.go +++ b/services/compute/mgmt/2019-03-01/compute/computeapi/interfaces.go @@ -37,7 +37,7 @@ type AvailabilitySetsClientAPI interface { Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error) List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error) - ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error) + ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters compute.AvailabilitySetUpdate) (result compute.AvailabilitySet, err error) } diff --git a/services/compute/mgmt/2019-03-01/compute/models.go b/services/compute/mgmt/2019-03-01/compute/models.go index e5166f2e83e8..debff09eee2e 100644 --- a/services/compute/mgmt/2019-03-01/compute/models.go +++ b/services/compute/mgmt/2019-03-01/compute/models.go @@ -948,6 +948,23 @@ func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { return []VirtualMachinePriorityTypes{Low, Regular} } +// VirtualMachineScaleSetScaleInRules enumerates the values for virtual machine scale set scale in rules. +type VirtualMachineScaleSetScaleInRules string + +const ( + // Default ... + Default VirtualMachineScaleSetScaleInRules = "Default" + // NewestVM ... + NewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" + // OldestVM ... + OldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" +) + +// PossibleVirtualMachineScaleSetScaleInRulesValues returns an array of possible values for the VirtualMachineScaleSetScaleInRules const type. +func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { + return []VirtualMachineScaleSetScaleInRules{Default, NewestVM, OldestVM} +} + // VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. type VirtualMachineScaleSetSkuScaleType string @@ -7291,6 +7308,12 @@ type RunCommandResult struct { Value *[]InstanceViewStatus `json:"value,omitempty"` } +// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. +type ScaleInPolicy struct { + // Rules - The rules to be followed when scaling-in a virtual machine scale set.

Possible values are:

**Default** When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in.

**OldestVM** When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal.

**NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal.

+ Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` +} + // ScheduledEventsProfile ... type ScheduledEventsProfile struct { // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. @@ -10382,6 +10405,8 @@ type VirtualMachineScaleSetProperties struct { ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` + // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. + ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` } // VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP @@ -11191,6 +11216,8 @@ type VirtualMachineScaleSetUpdateProperties struct { SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` + // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. + ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` } // VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP diff --git a/services/compute/mgmt/2019-07-01/compute/availabilitysets.go b/services/compute/mgmt/2019-07-01/compute/availabilitysets.go index 8a6bbaa4a195..853abfc1c95c 100644 --- a/services/compute/mgmt/2019-07-01/compute/availabilitysets.go +++ b/services/compute/mgmt/2019-07-01/compute/availabilitysets.go @@ -465,7 +465,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp } // ListBySubscription lists all availability sets in a subscription. -func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) { +// Parameters: +// expand - the expand expression to apply to the operation. +func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -477,7 +479,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re }() } result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) + req, err := client.ListBySubscriptionPreparer(ctx, expand) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request") return @@ -499,7 +501,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re } // ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { +func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -508,6 +510,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -559,7 +564,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) { +func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { @@ -570,7 +575,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListBySubscription(ctx) + result.page, err = client.ListBySubscription(ctx, expand) return } diff --git a/services/compute/mgmt/2019-07-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2019-07-01/compute/computeapi/interfaces.go index f4658b1dfc43..1a3fc7f1d25a 100644 --- a/services/compute/mgmt/2019-07-01/compute/computeapi/interfaces.go +++ b/services/compute/mgmt/2019-07-01/compute/computeapi/interfaces.go @@ -37,7 +37,7 @@ type AvailabilitySetsClientAPI interface { Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error) List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error) - ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error) + ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters compute.AvailabilitySetUpdate) (result compute.AvailabilitySet, err error) } diff --git a/services/compute/mgmt/2019-07-01/compute/models.go b/services/compute/mgmt/2019-07-01/compute/models.go index 4ec2778a534e..7851df4347d1 100644 --- a/services/compute/mgmt/2019-07-01/compute/models.go +++ b/services/compute/mgmt/2019-07-01/compute/models.go @@ -948,6 +948,23 @@ func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { return []VirtualMachinePriorityTypes{Low, Regular} } +// VirtualMachineScaleSetScaleInRules enumerates the values for virtual machine scale set scale in rules. +type VirtualMachineScaleSetScaleInRules string + +const ( + // Default ... + Default VirtualMachineScaleSetScaleInRules = "Default" + // NewestVM ... + NewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" + // OldestVM ... + OldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" +) + +// PossibleVirtualMachineScaleSetScaleInRulesValues returns an array of possible values for the VirtualMachineScaleSetScaleInRules const type. +func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { + return []VirtualMachineScaleSetScaleInRules{Default, NewestVM, OldestVM} +} + // VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. type VirtualMachineScaleSetSkuScaleType string @@ -7300,6 +7317,12 @@ type RunCommandResult struct { Value *[]InstanceViewStatus `json:"value,omitempty"` } +// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. +type ScaleInPolicy struct { + // Rules - The rules to be followed when scaling-in a virtual machine scale set.

Possible values are:

**Default** When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in.

**OldestVM** When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal.

**NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal.

+ Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` +} + // ScheduledEventsProfile ... type ScheduledEventsProfile struct { // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. @@ -10391,6 +10414,8 @@ type VirtualMachineScaleSetProperties struct { ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` + // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. + ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` } // VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP @@ -11200,6 +11225,8 @@ type VirtualMachineScaleSetUpdateProperties struct { SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` + // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. + ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` } // VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP diff --git a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/models.go b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/models.go index 8078a0cdfe2e..a56ebfb7f3c6 100644 --- a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/models.go +++ b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/models.go @@ -180,21 +180,6 @@ func PossibleSkuTierValues() []SkuTier { return []SkuTier{SkuTierBasic, SkuTierClassic, SkuTierPremium, SkuTierStandard} } -// Status enumerates the values for status. -type Status string - -const ( - // StatusDisabled ... - StatusDisabled Status = "disabled" - // StatusEnabled ... - StatusEnabled Status = "enabled" -) - -// PossibleStatusValues returns an array of possible values for the Status const type. -func PossibleStatusValues() []Status { - return []Status{StatusDisabled, StatusEnabled} -} - // TokenCertificateName enumerates the values for token certificate name. type TokenCertificateName string @@ -225,6 +210,21 @@ func PossibleTokenPasswordNameValues() []TokenPasswordName { return []TokenPasswordName{TokenPasswordNamePassword1, TokenPasswordNamePassword2} } +// TokenStatus enumerates the values for token status. +type TokenStatus string + +const ( + // TokenStatusDisabled ... + TokenStatusDisabled TokenStatus = "disabled" + // TokenStatusEnabled ... + TokenStatusEnabled TokenStatus = "enabled" +) + +// PossibleTokenStatusValues returns an array of possible values for the TokenStatus const type. +func PossibleTokenStatusValues() []TokenStatus { + return []TokenStatus{TokenStatusDisabled, TokenStatusEnabled} +} + // TrustPolicyType enumerates the values for trust policy type. type TrustPolicyType string @@ -1393,7 +1393,7 @@ type RegistryProperties struct { // ProvisioningState - READ-ONLY; The provisioning state of the container registry at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // Status - READ-ONLY; The status of the container registry at the time the operation was called. - Status *Status1 `json:"status,omitempty"` + Status *Status `json:"status,omitempty"` // AdminUserEnabled - The value that indicates whether the admin user is enabled. AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` // StorageAccount - The properties of the storage account for the container registry. Only applicable to Classic SKU. @@ -1750,7 +1750,7 @@ type ReplicationProperties struct { // ProvisioningState - READ-ONLY; The provisioning state of the replication at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // Status - READ-ONLY; The status of the replication at the time the operation was called. - Status *Status1 `json:"status,omitempty"` + Status *Status `json:"status,omitempty"` } // ReplicationsCreateFuture an abstraction for monitoring and retrieving the results of a long-running @@ -2271,8 +2271,8 @@ type Source struct { InstanceID *string `json:"instanceID,omitempty"` } -// Status1 the status of an Azure resource at the time the operation was called. -type Status1 struct { +// Status the status of an Azure resource at the time the operation was called. +type Status struct { // DisplayStatus - READ-ONLY; The short label for the status. DisplayStatus *string `json:"displayStatus,omitempty"` // Message - READ-ONLY; The detailed message for the status, including alerts and error messages. @@ -2550,7 +2550,7 @@ func NewTokenListResultPage(getNextPage func(context.Context, TokenListResult) ( // TokenPassword the password that will be used for authenticating the token of a container registry. type TokenPassword struct { - // CreationTime - The password created datetime of the password. + // CreationTime - The creation datetime of the password. CreationTime *date.Time `json:"creationTime,omitempty"` // Expiry - The expiry datetime of the password. Expiry *date.Time `json:"expiry,omitempty"` @@ -2572,8 +2572,8 @@ type TokenProperties struct { ObjectID *string `json:"objectId,omitempty"` // Credentials - The credentials that can be used for authenticating the token. Credentials *TokenCredentialsProperties `json:"credentials,omitempty"` - // Status - The status of the token example enabled or disabled. Possible values include: 'StatusEnabled', 'StatusDisabled' - Status Status `json:"status,omitempty"` + // Status - The status of the token example enabled or disabled. Possible values include: 'TokenStatusEnabled', 'TokenStatusDisabled' + Status TokenStatus `json:"status,omitempty"` } // TokensCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. @@ -2697,8 +2697,8 @@ func (tup *TokenUpdateParameters) UnmarshalJSON(body []byte) error { type TokenUpdateProperties struct { // ScopeMapID - The resource ID of the scope map to which the token will be associated with. ScopeMapID *string `json:"scopeMapId,omitempty"` - // Status - The status of the token example enabled or disabled. Possible values include: 'StatusEnabled', 'StatusDisabled' - Status Status `json:"status,omitempty"` + // Status - The status of the token example enabled or disabled. Possible values include: 'TokenStatusEnabled', 'TokenStatusDisabled' + Status TokenStatus `json:"status,omitempty"` // Credentials - The credentials that can be used for authenticating the token. Credentials *TokenCredentialsProperties `json:"credentials,omitempty"` } diff --git a/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/containerregistryapi/interfaces.go b/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/containerregistryapi/interfaces.go index 8a80b2ae34d6..56d3e1d0610d 100644 --- a/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/containerregistryapi/interfaces.go +++ b/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/containerregistryapi/interfaces.go @@ -27,6 +27,7 @@ type RegistriesClientAPI interface { CheckNameAvailability(ctx context.Context, registryNameCheckRequest containerregistry.RegistryNameCheckRequest) (result containerregistry.RegistryNameStatus, err error) Create(ctx context.Context, resourceGroupName string, registryName string, registry containerregistry.Registry) (result containerregistry.RegistriesCreateFuture, err error) Delete(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.RegistriesDeleteFuture, err error) + GenerateCredentials(ctx context.Context, resourceGroupName string, registryName string, generateCredentialsParameters containerregistry.GenerateCredentialsParameters) (result containerregistry.RegistriesGenerateCredentialsFuture, err error) Get(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.Registry, err error) GetBuildSourceUploadURL(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.SourceUploadDefinition, err error) ImportImage(ctx context.Context, resourceGroupName string, registryName string, parameters containerregistry.ImportImageParameters) (result containerregistry.RegistriesImportImageFuture, err error) @@ -95,3 +96,25 @@ type TasksClientAPI interface { } var _ TasksClientAPI = (*containerregistry.TasksClient)(nil) + +// ScopeMapsClientAPI contains the set of methods on the ScopeMapsClient type. +type ScopeMapsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string, scopeMapCreateParameters containerregistry.ScopeMap) (result containerregistry.ScopeMapsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string) (result containerregistry.ScopeMapsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string) (result containerregistry.ScopeMap, err error) + List(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.ScopeMapListResultPage, err error) + Update(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string, scopeMapUpdateParameters containerregistry.ScopeMapUpdateParameters) (result containerregistry.ScopeMapsUpdateFuture, err error) +} + +var _ ScopeMapsClientAPI = (*containerregistry.ScopeMapsClient)(nil) + +// TokensClientAPI contains the set of methods on the TokensClient type. +type TokensClientAPI interface { + Create(ctx context.Context, resourceGroupName string, registryName string, tokenName string, tokenCreateParameters containerregistry.Token) (result containerregistry.TokensCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string, tokenName string) (result containerregistry.TokensDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string, tokenName string) (result containerregistry.Token, err error) + List(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.TokenListResultPage, err error) + Update(ctx context.Context, resourceGroupName string, registryName string, tokenName string, tokenUpdateParameters containerregistry.TokenUpdateParameters) (result containerregistry.TokensUpdateFuture, err error) +} + +var _ TokensClientAPI = (*containerregistry.TokensClient)(nil) diff --git a/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/models.go b/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/models.go index f3c40cb85d90..4a08cf77c1a5 100644 --- a/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/models.go +++ b/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/models.go @@ -386,6 +386,51 @@ func PossibleTaskStatusValues() []TaskStatus { return []TaskStatus{TaskStatusDisabled, TaskStatusEnabled} } +// TokenCertificateName enumerates the values for token certificate name. +type TokenCertificateName string + +const ( + // Certificate1 ... + Certificate1 TokenCertificateName = "certificate1" + // Certificate2 ... + Certificate2 TokenCertificateName = "certificate2" +) + +// PossibleTokenCertificateNameValues returns an array of possible values for the TokenCertificateName const type. +func PossibleTokenCertificateNameValues() []TokenCertificateName { + return []TokenCertificateName{Certificate1, Certificate2} +} + +// TokenPasswordName enumerates the values for token password name. +type TokenPasswordName string + +const ( + // TokenPasswordNamePassword1 ... + TokenPasswordNamePassword1 TokenPasswordName = "password1" + // TokenPasswordNamePassword2 ... + TokenPasswordNamePassword2 TokenPasswordName = "password2" +) + +// PossibleTokenPasswordNameValues returns an array of possible values for the TokenPasswordName const type. +func PossibleTokenPasswordNameValues() []TokenPasswordName { + return []TokenPasswordName{TokenPasswordNamePassword1, TokenPasswordNamePassword2} +} + +// TokenStatus enumerates the values for token status. +type TokenStatus string + +const ( + // TokenStatusDisabled ... + TokenStatusDisabled TokenStatus = "disabled" + // TokenStatusEnabled ... + TokenStatusEnabled TokenStatus = "enabled" +) + +// PossibleTokenStatusValues returns an array of possible values for the TokenStatus const type. +func PossibleTokenStatusValues() []TokenStatus { + return []TokenStatus{TokenStatusDisabled, TokenStatusEnabled} +} + // TokenType enumerates the values for token type. type TokenType string @@ -492,15 +537,15 @@ func PossibleTypeBasicTaskStepUpdateParametersValues() []TypeBasicTaskStepUpdate type UpdateTriggerPayloadType string const ( - // Default ... - Default UpdateTriggerPayloadType = "Default" - // Token ... - Token UpdateTriggerPayloadType = "Token" + // UpdateTriggerPayloadTypeDefault ... + UpdateTriggerPayloadTypeDefault UpdateTriggerPayloadType = "Default" + // UpdateTriggerPayloadTypeToken ... + UpdateTriggerPayloadTypeToken UpdateTriggerPayloadType = "Token" ) // PossibleUpdateTriggerPayloadTypeValues returns an array of possible values for the UpdateTriggerPayloadType const type. func PossibleUpdateTriggerPayloadTypeValues() []UpdateTriggerPayloadType { - return []UpdateTriggerPayloadType{Default, Token} + return []UpdateTriggerPayloadType{UpdateTriggerPayloadTypeDefault, UpdateTriggerPayloadTypeToken} } // Variant enumerates the values for variant. @@ -627,7 +672,7 @@ type BaseImageTrigger struct { BaseImageTriggerType BaseImageTriggerType `json:"baseImageTriggerType,omitempty"` // UpdateTriggerEndpoint - The endpoint URL for receiving update triggers. UpdateTriggerEndpoint *string `json:"updateTriggerEndpoint,omitempty"` - // UpdateTriggerPayloadType - Type of Payload body for Base image update triggers. Possible values include: 'Default', 'Token' + // UpdateTriggerPayloadType - Type of Payload body for Base image update triggers. Possible values include: 'UpdateTriggerPayloadTypeDefault', 'UpdateTriggerPayloadTypeToken' UpdateTriggerPayloadType UpdateTriggerPayloadType `json:"updateTriggerPayloadType,omitempty"` // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' Status TriggerStatus `json:"status,omitempty"` @@ -641,7 +686,7 @@ type BaseImageTriggerUpdateParameters struct { BaseImageTriggerType BaseImageTriggerType `json:"baseImageTriggerType,omitempty"` // UpdateTriggerEndpoint - The endpoint URL for receiving update triggers. UpdateTriggerEndpoint *string `json:"updateTriggerEndpoint,omitempty"` - // UpdateTriggerPayloadType - Type of Payload body for Base image update triggers. Possible values include: 'Default', 'Token' + // UpdateTriggerPayloadType - Type of Payload body for Base image update triggers. Possible values include: 'UpdateTriggerPayloadTypeDefault', 'UpdateTriggerPayloadTypeToken' UpdateTriggerPayloadType UpdateTriggerPayloadType `json:"updateTriggerPayloadType,omitempty"` // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' Status TriggerStatus `json:"status,omitempty"` @@ -1682,6 +1727,26 @@ func (ftsup FileTaskStepUpdateParameters) AsBasicTaskStepUpdateParameters() (Bas return &ftsup, true } +// GenerateCredentialsParameters the parameters used to generate credentials for a specified token or user +// of a container registry. +type GenerateCredentialsParameters struct { + // TokenID - The resource ID of the token for which credentials have to be generated. + TokenID *string `json:"tokenId,omitempty"` + // Expiry - The expiry date of the generated credentials after which the credentials become invalid. + Expiry *date.Time `json:"expiry,omitempty"` + // Name - Specifies name of the password which should be regenerated if any -- password or password2. Possible values include: 'TokenPasswordNamePassword1', 'TokenPasswordNamePassword2' + Name TokenPasswordName `json:"name,omitempty"` +} + +// GenerateCredentialsResult the response from the GenerateCredentials operation. +type GenerateCredentialsResult struct { + autorest.Response `json:"-"` + // Username - The username for a container registry. + Username *string `json:"username,omitempty"` + // Passwords - The list of passwords for a container registry. + Passwords *[]TokenPassword `json:"passwords,omitempty"` +} + // IdentityProperties managed identity for the resource. type IdentityProperties struct { // PrincipalID - The principal ID of resource identity. @@ -2179,6 +2244,35 @@ func (future *RegistriesDeleteFuture) Result(client RegistriesClient) (ar autore return } +// RegistriesGenerateCredentialsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type RegistriesGenerateCredentialsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RegistriesGenerateCredentialsFuture) Result(client RegistriesClient) (gcr GenerateCredentialsResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesGenerateCredentialsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesGenerateCredentialsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if gcr.Response.Response, err = future.GetResult(sender); err == nil && gcr.Response.Response.StatusCode != http.StatusNoContent { + gcr, err = client.GenerateCredentialsResponder(gcr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesGenerateCredentialsFuture", "Result", gcr.Response.Response, "Failure responding to request") + } + } + return +} + // RegistriesImportImageFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RegistriesImportImageFuture struct { @@ -3530,208 +3624,30 @@ type RunUpdateParameters struct { IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` } -// SecretObject describes the properties of a secret object value. -type SecretObject struct { - // Value - The value of the secret. The format of this value will be determined - // based on the type of the secret object. If the type is Opaque, the value will be - // used as is without any modification. - Value *string `json:"value,omitempty"` - // Type - The type of the secret object which determines how the value of the secret object has to be - // interpreted. Possible values include: 'Opaque', 'Vaultsecret' - Type SecretObjectType `json:"type,omitempty"` -} - -// SetValue the properties of a overridable value that can be passed to a task template. -type SetValue struct { - // Name - The name of the overridable value. - Name *string `json:"name,omitempty"` - // Value - The overridable value. - Value *string `json:"value,omitempty"` - // IsSecret - Flag to indicate whether the value represents a secret or not. - IsSecret *bool `json:"isSecret,omitempty"` -} - -// Sku the SKU of a container registry. -type Sku struct { - // Name - The SKU name of the container registry. Required for registry creation. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium' - Name SkuName `json:"name,omitempty"` - // Tier - READ-ONLY; The SKU tier based on the SKU name. Possible values include: 'SkuTierClassic', 'SkuTierBasic', 'SkuTierStandard', 'SkuTierPremium' - Tier SkuTier `json:"tier,omitempty"` -} - -// Source the registry node that generated the event. Put differently, while the actor initiates the event, -// the source generates it. -type Source struct { - // Addr - The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. - Addr *string `json:"addr,omitempty"` - // InstanceID - The running instance of an application. Changes after each restart. - InstanceID *string `json:"instanceID,omitempty"` -} - -// SourceProperties the properties of the source code repository. -type SourceProperties struct { - // SourceControlType - The type of source control service. Possible values include: 'Github', 'VisualStudioTeamService' - SourceControlType SourceControlType `json:"sourceControlType,omitempty"` - // RepositoryURL - The full URL to the source code repository - RepositoryURL *string `json:"repositoryUrl,omitempty"` - // Branch - The branch name of the source code. - Branch *string `json:"branch,omitempty"` - // SourceControlAuthProperties - The authorization properties for accessing the source code repository and to set up - // webhooks for notifications. - SourceControlAuthProperties *AuthInfo `json:"sourceControlAuthProperties,omitempty"` -} - -// SourceRegistryCredentials describes the credential parameters for accessing the source registry. -type SourceRegistryCredentials struct { - // LoginMode - The authentication mode which determines the source registry login scope. The credentials for the source registry - // will be generated using the given scope. These credentials will be used to login to - // the source registry during the run. Possible values include: 'SourceRegistryLoginModeNone', 'SourceRegistryLoginModeDefault' - LoginMode SourceRegistryLoginMode `json:"loginMode,omitempty"` -} - -// SourceTrigger the properties of a source based trigger. -type SourceTrigger struct { - // SourceRepository - The properties that describes the source(code) for the task. - SourceRepository *SourceProperties `json:"sourceRepository,omitempty"` - // SourceTriggerEvents - The source event corresponding to the trigger. - SourceTriggerEvents *[]SourceTriggerEvent `json:"sourceTriggerEvents,omitempty"` - // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' - Status TriggerStatus `json:"status,omitempty"` - // Name - The name of the trigger. - Name *string `json:"name,omitempty"` -} - -// SourceTriggerDescriptor the source trigger that caused a run. -type SourceTriggerDescriptor struct { - // ID - The unique ID of the trigger. - ID *string `json:"id,omitempty"` - // EventType - The event type of the trigger. - EventType *string `json:"eventType,omitempty"` - // CommitID - The unique ID that identifies a commit. - CommitID *string `json:"commitId,omitempty"` - // PullRequestID - The unique ID that identifies pull request. - PullRequestID *string `json:"pullRequestId,omitempty"` - // RepositoryURL - The repository URL. - RepositoryURL *string `json:"repositoryUrl,omitempty"` - // BranchName - The branch name in the repository. - BranchName *string `json:"branchName,omitempty"` - // ProviderType - The source control provider type. - ProviderType *string `json:"providerType,omitempty"` -} - -// SourceTriggerUpdateParameters the properties for updating a source based trigger. -type SourceTriggerUpdateParameters struct { - // SourceRepository - The properties that describes the source(code) for the task. - SourceRepository *SourceUpdateParameters `json:"sourceRepository,omitempty"` - // SourceTriggerEvents - The source event corresponding to the trigger. - SourceTriggerEvents *[]SourceTriggerEvent `json:"sourceTriggerEvents,omitempty"` - // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' - Status TriggerStatus `json:"status,omitempty"` - // Name - The name of the trigger. - Name *string `json:"name,omitempty"` -} - -// SourceUpdateParameters the properties for updating the source code repository. -type SourceUpdateParameters struct { - // SourceControlType - The type of source control service. Possible values include: 'Github', 'VisualStudioTeamService' - SourceControlType SourceControlType `json:"sourceControlType,omitempty"` - // RepositoryURL - The full URL to the source code repository - RepositoryURL *string `json:"repositoryUrl,omitempty"` - // Branch - The branch name of the source code. - Branch *string `json:"branch,omitempty"` - // SourceControlAuthProperties - The authorization properties for accessing the source code repository and to set up - // webhooks for notifications. - SourceControlAuthProperties *AuthInfoUpdateParameters `json:"sourceControlAuthProperties,omitempty"` -} - -// SourceUploadDefinition the properties of a response to source upload request. -type SourceUploadDefinition struct { - autorest.Response `json:"-"` - // UploadURL - The URL where the client can upload the source. - UploadURL *string `json:"uploadUrl,omitempty"` - // RelativePath - The relative path to the source. This is used to submit the subsequent queue build request. - RelativePath *string `json:"relativePath,omitempty"` -} - -// Status the status of an Azure resource at the time the operation was called. -type Status struct { - // DisplayStatus - READ-ONLY; The short label for the status. - DisplayStatus *string `json:"displayStatus,omitempty"` - // Message - READ-ONLY; The detailed message for the status, including alerts and error messages. - Message *string `json:"message,omitempty"` - // Timestamp - READ-ONLY; The timestamp when the status was changed to the current value. - Timestamp *date.Time `json:"timestamp,omitempty"` -} - -// StorageAccountProperties the properties of a storage account for a container registry. Only applicable -// to Classic SKU. -type StorageAccountProperties struct { - // ID - The resource ID of the storage account. - ID *string `json:"id,omitempty"` -} - -// Target the target of the event. -type Target struct { - // MediaType - The MIME type of the referenced object. - MediaType *string `json:"mediaType,omitempty"` - // Size - The number of bytes of the content. Same as Length field. - Size *int64 `json:"size,omitempty"` - // Digest - The digest of the content, as defined by the Registry V2 HTTP API Specification. - Digest *string `json:"digest,omitempty"` - // Length - The number of bytes of the content. Same as Size field. - Length *int64 `json:"length,omitempty"` - // Repository - The repository name. - Repository *string `json:"repository,omitempty"` - // URL - The direct URL to the content. - URL *string `json:"url,omitempty"` - // Tag - The tag name. - Tag *string `json:"tag,omitempty"` - // Name - The name of the artifact. - Name *string `json:"name,omitempty"` - // Version - The version of the artifact. - Version *string `json:"version,omitempty"` -} - -// Task the task that has the ARM resource and task properties. -// The task will have all information to schedule a run against it. -type Task struct { +// ScopeMap an object that represents a scope map for a container registry. +type ScopeMap struct { autorest.Response `json:"-"` - // Identity - Identity for the resource. - Identity *IdentityProperties `json:"identity,omitempty"` - // TaskProperties - The properties of a task. - *TaskProperties `json:"properties,omitempty"` + // ScopeMapProperties - The properties of the scope map. + *ScopeMapProperties `json:"properties,omitempty"` // ID - READ-ONLY; The resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource. Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Type *string `json:"type,omitempty"` - // Location - The location of the resource. This cannot be changed after the resource is created. - Location *string `json:"location,omitempty"` - // Tags - The tags of the resource. - Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for Task. -func (t Task) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ScopeMap. +func (sm ScopeMap) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if t.Identity != nil { - objectMap["identity"] = t.Identity - } - if t.TaskProperties != nil { - objectMap["properties"] = t.TaskProperties - } - if t.Location != nil { - objectMap["location"] = t.Location - } - if t.Tags != nil { - objectMap["tags"] = t.Tags + if sm.ScopeMapProperties != nil { + objectMap["properties"] = sm.ScopeMapProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for Task struct. -func (t *Task) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ScopeMap struct. +func (sm *ScopeMap) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3739,23 +3655,14 @@ func (t *Task) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "identity": - if v != nil { - var identity IdentityProperties - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - t.Identity = &identity - } case "properties": if v != nil { - var taskProperties TaskProperties - err = json.Unmarshal(*v, &taskProperties) + var scopeMapProperties ScopeMapProperties + err = json.Unmarshal(*v, &scopeMapProperties) if err != nil { return err } - t.TaskProperties = &taskProperties + sm.ScopeMapProperties = &scopeMapProperties } case "id": if v != nil { @@ -3764,7 +3671,7 @@ func (t *Task) UnmarshalJSON(body []byte) error { if err != nil { return err } - t.ID = &ID + sm.ID = &ID } case "name": if v != nil { @@ -3773,7 +3680,7 @@ func (t *Task) UnmarshalJSON(body []byte) error { if err != nil { return err } - t.Name = &name + sm.Name = &name } case "type": if v != nil { @@ -3782,25 +3689,7 @@ func (t *Task) UnmarshalJSON(body []byte) error { 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 + sm.Type = &typeVar } } } @@ -3808,26 +3697,26 @@ func (t *Task) UnmarshalJSON(body []byte) error { return nil } -// TaskListResult the collection of tasks. -type TaskListResult struct { +// ScopeMapListResult the result of a request to list scope maps for a container registry. +type ScopeMapListResult struct { autorest.Response `json:"-"` - // Value - The collection value. - Value *[]Task `json:"value,omitempty"` - // NextLink - The URI that can be used to request the next set of paged results. + // Value - The list of scope maps. Since this list may be incomplete, the nextLink field should be used to request the next list of scope maps. + Value *[]ScopeMap `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of scope maps. NextLink *string `json:"nextLink,omitempty"` } -// TaskListResultIterator provides access to a complete listing of Task values. -type TaskListResultIterator struct { +// ScopeMapListResultIterator provides access to a complete listing of ScopeMap values. +type ScopeMapListResultIterator struct { i int - page TaskListResultPage + page ScopeMapListResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *TaskListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ScopeMapListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TaskListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeMapListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -3852,62 +3741,62 @@ func (iter *TaskListResultIterator) NextWithContext(ctx context.Context) (err er // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *TaskListResultIterator) Next() error { +func (iter *ScopeMapListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter TaskListResultIterator) NotDone() bool { +func (iter ScopeMapListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter TaskListResultIterator) Response() TaskListResult { +func (iter ScopeMapListResultIterator) Response() ScopeMapListResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter TaskListResultIterator) Value() Task { +func (iter ScopeMapListResultIterator) Value() ScopeMap { if !iter.page.NotDone() { - return Task{} + return ScopeMap{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the TaskListResultIterator type. -func NewTaskListResultIterator(page TaskListResultPage) TaskListResultIterator { - return TaskListResultIterator{page: page} +// Creates a new instance of the ScopeMapListResultIterator type. +func NewScopeMapListResultIterator(page ScopeMapListResultPage) ScopeMapListResultIterator { + return ScopeMapListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (tlr TaskListResult) IsEmpty() bool { - return tlr.Value == nil || len(*tlr.Value) == 0 +func (smlr ScopeMapListResult) IsEmpty() bool { + return smlr.Value == nil || len(*smlr.Value) == 0 } -// taskListResultPreparer prepares a request to retrieve the next set of results. +// scopeMapListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (tlr TaskListResult) taskListResultPreparer(ctx context.Context) (*http.Request, error) { - if tlr.NextLink == nil || len(to.String(tlr.NextLink)) < 1 { +func (smlr ScopeMapListResult) scopeMapListResultPreparer(ctx context.Context) (*http.Request, error) { + if smlr.NextLink == nil || len(to.String(smlr.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(tlr.NextLink))) + autorest.WithBaseURL(to.String(smlr.NextLink))) } -// TaskListResultPage contains a page of Task values. -type TaskListResultPage struct { - fn func(context.Context, TaskListResult) (TaskListResult, error) - tlr TaskListResult +// ScopeMapListResultPage contains a page of ScopeMap values. +type ScopeMapListResultPage struct { + fn func(context.Context, ScopeMapListResult) (ScopeMapListResult, error) + smlr ScopeMapListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *TaskListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *ScopeMapListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TaskListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeMapListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -3916,181 +3805,168 @@ func (page *TaskListResultPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.tlr) + next, err := page.fn(ctx, page.smlr) if err != nil { return err } - page.tlr = next + page.smlr = 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 *TaskListResultPage) Next() error { +func (page *ScopeMapListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page TaskListResultPage) NotDone() bool { - return !page.tlr.IsEmpty() +func (page ScopeMapListResultPage) NotDone() bool { + return !page.smlr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page TaskListResultPage) Response() TaskListResult { - return page.tlr +func (page ScopeMapListResultPage) Response() ScopeMapListResult { + return page.smlr } // Values returns the slice of values for the current page or nil if there are no values. -func (page TaskListResultPage) Values() []Task { - if page.tlr.IsEmpty() { +func (page ScopeMapListResultPage) Values() []ScopeMap { + if page.smlr.IsEmpty() { return nil } - return *page.tlr.Value + return *page.smlr.Value } -// Creates a new instance of the TaskListResultPage type. -func NewTaskListResultPage(getNextPage func(context.Context, TaskListResult) (TaskListResult, error)) TaskListResultPage { - return TaskListResultPage{fn: getNextPage} +// Creates a new instance of the ScopeMapListResultPage type. +func NewScopeMapListResultPage(getNextPage func(context.Context, ScopeMapListResult) (ScopeMapListResult, error)) ScopeMapListResultPage { + return ScopeMapListResultPage{fn: getNextPage} } -// TaskProperties the properties of a task. -type TaskProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the task. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // CreationDate - READ-ONLY; The creation date of task. +// ScopeMapProperties the properties of a scope map. +type ScopeMapProperties struct { + // Description - The user friendly description of the scope map. + Description *string `json:"description,omitempty"` + // Type - READ-ONLY; The type of the scope map. E.g. BuildIn scope map. + Type *string `json:"type,omitempty"` + // CreationDate - READ-ONLY; The creation date of scope map. CreationDate *date.Time `json:"creationDate,omitempty"` - // Status - The current status of task. Possible values include: 'TaskStatusDisabled', 'TaskStatusEnabled' - Status TaskStatus `json:"status,omitempty"` - // Platform - The platform properties against which the run has to happen. - Platform *PlatformProperties `json:"platform,omitempty"` - // AgentConfiguration - The machine configuration of the run agent. - AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` - // Timeout - Run timeout in seconds. - Timeout *int32 `json:"timeout,omitempty"` - // Step - The properties of a task step. - Step BasicTaskStepProperties `json:"step,omitempty"` - // Trigger - The properties that describe all triggers for the task. - Trigger *TriggerProperties `json:"trigger,omitempty"` - // Credentials - The properties that describes a set of credentials that will be used when this run is invoked. - Credentials *Credentials `json:"credentials,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Actions - The list of scoped permissions for registry artifacts. + // E.g. repositories/repository-name/pull, + // repositories/repository-name/delete + Actions *[]string `json:"actions,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for TaskProperties struct. -func (tp *TaskProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// ScopeMapPropertiesUpdateParameters the update parameters for scope map properties. +type ScopeMapPropertiesUpdateParameters struct { + // Description - The user friendly description of the scope map. + Description *string `json:"description,omitempty"` + // Actions - The list of scope permissions for registry artifacts. + // E.g. repositories/repository-name/pull, + // repositories/repository-name/delete + Actions *[]string `json:"actions,omitempty"` +} + +// ScopeMapsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ScopeMapsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ScopeMapsCreateFuture) Result(client ScopeMapsClient) (sm ScopeMap, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) if err != nil { - return err + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsCreateFuture", "Result", future.Response(), "Polling failure") + return } - for k, v := range m { - switch k { - case "provisioningState": - if v != nil { - var provisioningState ProvisioningState - err = json.Unmarshal(*v, &provisioningState) - if err != nil { - return err - } - tp.ProvisioningState = provisioningState - } - case "creationDate": - if v != nil { - var creationDate date.Time - err = json.Unmarshal(*v, &creationDate) - if err != nil { - return err - } - tp.CreationDate = &creationDate - } - case "status": - if v != nil { - var status TaskStatus - err = json.Unmarshal(*v, &status) - if err != nil { - return err - } - tp.Status = status - } - case "platform": - if v != nil { - var platform PlatformProperties - err = json.Unmarshal(*v, &platform) - if err != nil { - return err - } - tp.Platform = &platform - } - case "agentConfiguration": - if v != nil { - var agentConfiguration AgentProperties - err = json.Unmarshal(*v, &agentConfiguration) - if err != nil { - return err - } - tp.AgentConfiguration = &agentConfiguration - } - case "timeout": - if v != nil { - var timeout int32 - err = json.Unmarshal(*v, &timeout) - if err != nil { - return err - } - tp.Timeout = &timeout - } - case "step": - if v != nil { - step, err := unmarshalBasicTaskStepProperties(*v) - if err != nil { - return err - } - tp.Step = step - } - case "trigger": - if v != nil { - var trigger TriggerProperties - err = json.Unmarshal(*v, &trigger) - if err != nil { - return err - } - tp.Trigger = &trigger - } - case "credentials": - if v != nil { - var credentials Credentials - err = json.Unmarshal(*v, &credentials) - if err != nil { - return err - } - tp.Credentials = &credentials - } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.ScopeMapsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sm.Response.Response, err = future.GetResult(sender); err == nil && sm.Response.Response.StatusCode != http.StatusNoContent { + sm, err = client.CreateResponder(sm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsCreateFuture", "Result", sm.Response.Response, "Failure responding to request") } } + return +} - return nil +// ScopeMapsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ScopeMapsDeleteFuture struct { + azure.Future } -// TaskPropertiesUpdateParameters the properties for updating a task. -type TaskPropertiesUpdateParameters struct { - // Status - The current status of task. Possible values include: 'TaskStatusDisabled', 'TaskStatusEnabled' - Status TaskStatus `json:"status,omitempty"` - // Platform - The platform properties against which the run has to happen. - Platform *PlatformUpdateParameters `json:"platform,omitempty"` - // AgentConfiguration - The machine configuration of the run agent. - AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` - // Timeout - Run timeout in seconds. - Timeout *int32 `json:"timeout,omitempty"` - // Step - The properties for updating a task step. - Step BasicTaskStepUpdateParameters `json:"step,omitempty"` - // Trigger - The properties for updating trigger properties. - Trigger *TriggerUpdateParameters `json:"trigger,omitempty"` - // Credentials - The parameters that describes a set of credentials that will be used when this run is invoked. - Credentials *Credentials `json:"credentials,omitempty"` +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ScopeMapsDeleteFuture) Result(client ScopeMapsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.ScopeMapsDeleteFuture") + return + } + ar.Response = future.Response() + return } -// UnmarshalJSON is the custom unmarshaler for TaskPropertiesUpdateParameters struct. -func (tpup *TaskPropertiesUpdateParameters) UnmarshalJSON(body []byte) error { +// ScopeMapsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ScopeMapsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ScopeMapsUpdateFuture) Result(client ScopeMapsClient) (sm ScopeMap, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.ScopeMapsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sm.Response.Response, err = future.GetResult(sender); err == nil && sm.Response.Response.StatusCode != http.StatusNoContent { + sm, err = client.UpdateResponder(sm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsUpdateFuture", "Result", sm.Response.Response, "Failure responding to request") + } + } + return +} + +// ScopeMapUpdateParameters the properties for updating the scope map. +type ScopeMapUpdateParameters struct { + // ScopeMapPropertiesUpdateParameters - The update parameters for scope map properties. + *ScopeMapPropertiesUpdateParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScopeMapUpdateParameters. +func (smup ScopeMapUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if smup.ScopeMapPropertiesUpdateParameters != nil { + objectMap["properties"] = smup.ScopeMapPropertiesUpdateParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ScopeMapUpdateParameters struct. +func (smup *ScopeMapUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4098,23 +3974,606 @@ func (tpup *TaskPropertiesUpdateParameters) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "status": + case "properties": if v != nil { - var status TaskStatus - err = json.Unmarshal(*v, &status) + var scopeMapPropertiesUpdateParameters ScopeMapPropertiesUpdateParameters + err = json.Unmarshal(*v, &scopeMapPropertiesUpdateParameters) if err != nil { return err } - tpup.Status = status + smup.ScopeMapPropertiesUpdateParameters = &scopeMapPropertiesUpdateParameters } - case "platform": - if v != nil { - var platform PlatformUpdateParameters - err = json.Unmarshal(*v, &platform) - if err != nil { - return err - } - tpup.Platform = &platform + } + } + + return nil +} + +// SecretObject describes the properties of a secret object value. +type SecretObject struct { + // Value - The value of the secret. The format of this value will be determined + // based on the type of the secret object. If the type is Opaque, the value will be + // used as is without any modification. + Value *string `json:"value,omitempty"` + // Type - The type of the secret object which determines how the value of the secret object has to be + // interpreted. Possible values include: 'Opaque', 'Vaultsecret' + Type SecretObjectType `json:"type,omitempty"` +} + +// SetValue the properties of a overridable value that can be passed to a task template. +type SetValue struct { + // Name - The name of the overridable value. + Name *string `json:"name,omitempty"` + // Value - The overridable value. + Value *string `json:"value,omitempty"` + // IsSecret - Flag to indicate whether the value represents a secret or not. + IsSecret *bool `json:"isSecret,omitempty"` +} + +// Sku the SKU of a container registry. +type Sku struct { + // Name - The SKU name of the container registry. Required for registry creation. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium' + Name SkuName `json:"name,omitempty"` + // Tier - READ-ONLY; The SKU tier based on the SKU name. Possible values include: 'SkuTierClassic', 'SkuTierBasic', 'SkuTierStandard', 'SkuTierPremium' + Tier SkuTier `json:"tier,omitempty"` +} + +// Source the registry node that generated the event. Put differently, while the actor initiates the event, +// the source generates it. +type Source struct { + // Addr - The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. + Addr *string `json:"addr,omitempty"` + // InstanceID - The running instance of an application. Changes after each restart. + InstanceID *string `json:"instanceID,omitempty"` +} + +// SourceProperties the properties of the source code repository. +type SourceProperties struct { + // SourceControlType - The type of source control service. Possible values include: 'Github', 'VisualStudioTeamService' + SourceControlType SourceControlType `json:"sourceControlType,omitempty"` + // RepositoryURL - The full URL to the source code repository + RepositoryURL *string `json:"repositoryUrl,omitempty"` + // Branch - The branch name of the source code. + Branch *string `json:"branch,omitempty"` + // SourceControlAuthProperties - The authorization properties for accessing the source code repository and to set up + // webhooks for notifications. + SourceControlAuthProperties *AuthInfo `json:"sourceControlAuthProperties,omitempty"` +} + +// SourceRegistryCredentials describes the credential parameters for accessing the source registry. +type SourceRegistryCredentials struct { + // LoginMode - The authentication mode which determines the source registry login scope. The credentials for the source registry + // will be generated using the given scope. These credentials will be used to login to + // the source registry during the run. Possible values include: 'SourceRegistryLoginModeNone', 'SourceRegistryLoginModeDefault' + LoginMode SourceRegistryLoginMode `json:"loginMode,omitempty"` +} + +// SourceTrigger the properties of a source based trigger. +type SourceTrigger struct { + // SourceRepository - The properties that describes the source(code) for the task. + SourceRepository *SourceProperties `json:"sourceRepository,omitempty"` + // SourceTriggerEvents - The source event corresponding to the trigger. + SourceTriggerEvents *[]SourceTriggerEvent `json:"sourceTriggerEvents,omitempty"` + // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' + Status TriggerStatus `json:"status,omitempty"` + // Name - The name of the trigger. + Name *string `json:"name,omitempty"` +} + +// SourceTriggerDescriptor the source trigger that caused a run. +type SourceTriggerDescriptor struct { + // ID - The unique ID of the trigger. + ID *string `json:"id,omitempty"` + // EventType - The event type of the trigger. + EventType *string `json:"eventType,omitempty"` + // CommitID - The unique ID that identifies a commit. + CommitID *string `json:"commitId,omitempty"` + // PullRequestID - The unique ID that identifies pull request. + PullRequestID *string `json:"pullRequestId,omitempty"` + // RepositoryURL - The repository URL. + RepositoryURL *string `json:"repositoryUrl,omitempty"` + // BranchName - The branch name in the repository. + BranchName *string `json:"branchName,omitempty"` + // ProviderType - The source control provider type. + ProviderType *string `json:"providerType,omitempty"` +} + +// SourceTriggerUpdateParameters the properties for updating a source based trigger. +type SourceTriggerUpdateParameters struct { + // SourceRepository - The properties that describes the source(code) for the task. + SourceRepository *SourceUpdateParameters `json:"sourceRepository,omitempty"` + // SourceTriggerEvents - The source event corresponding to the trigger. + SourceTriggerEvents *[]SourceTriggerEvent `json:"sourceTriggerEvents,omitempty"` + // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' + Status TriggerStatus `json:"status,omitempty"` + // Name - The name of the trigger. + Name *string `json:"name,omitempty"` +} + +// SourceUpdateParameters the properties for updating the source code repository. +type SourceUpdateParameters struct { + // SourceControlType - The type of source control service. Possible values include: 'Github', 'VisualStudioTeamService' + SourceControlType SourceControlType `json:"sourceControlType,omitempty"` + // RepositoryURL - The full URL to the source code repository + RepositoryURL *string `json:"repositoryUrl,omitempty"` + // Branch - The branch name of the source code. + Branch *string `json:"branch,omitempty"` + // SourceControlAuthProperties - The authorization properties for accessing the source code repository and to set up + // webhooks for notifications. + SourceControlAuthProperties *AuthInfoUpdateParameters `json:"sourceControlAuthProperties,omitempty"` +} + +// SourceUploadDefinition the properties of a response to source upload request. +type SourceUploadDefinition struct { + autorest.Response `json:"-"` + // UploadURL - The URL where the client can upload the source. + UploadURL *string `json:"uploadUrl,omitempty"` + // RelativePath - The relative path to the source. This is used to submit the subsequent queue build request. + RelativePath *string `json:"relativePath,omitempty"` +} + +// Status the status of an Azure resource at the time the operation was called. +type Status struct { + // DisplayStatus - READ-ONLY; The short label for the status. + DisplayStatus *string `json:"displayStatus,omitempty"` + // Message - READ-ONLY; The detailed message for the status, including alerts and error messages. + Message *string `json:"message,omitempty"` + // Timestamp - READ-ONLY; The timestamp when the status was changed to the current value. + Timestamp *date.Time `json:"timestamp,omitempty"` +} + +// StorageAccountProperties the properties of a storage account for a container registry. Only applicable +// to Classic SKU. +type StorageAccountProperties struct { + // ID - The resource ID of the storage account. + ID *string `json:"id,omitempty"` +} + +// Target the target of the event. +type Target struct { + // MediaType - The MIME type of the referenced object. + MediaType *string `json:"mediaType,omitempty"` + // Size - The number of bytes of the content. Same as Length field. + Size *int64 `json:"size,omitempty"` + // Digest - The digest of the content, as defined by the Registry V2 HTTP API Specification. + Digest *string `json:"digest,omitempty"` + // Length - The number of bytes of the content. Same as Size field. + Length *int64 `json:"length,omitempty"` + // Repository - The repository name. + Repository *string `json:"repository,omitempty"` + // URL - The direct URL to the content. + URL *string `json:"url,omitempty"` + // Tag - The tag name. + Tag *string `json:"tag,omitempty"` + // Name - The name of the artifact. + Name *string `json:"name,omitempty"` + // Version - The version of the artifact. + Version *string `json:"version,omitempty"` +} + +// Task the task that has the ARM resource and task properties. +// The task will have all information to schedule a run against it. +type Task struct { + autorest.Response `json:"-"` + // Identity - Identity for the resource. + Identity *IdentityProperties `json:"identity,omitempty"` + // TaskProperties - The properties of a task. + *TaskProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. This cannot be changed after the resource is created. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Task. +func (t Task) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if t.Identity != nil { + objectMap["identity"] = t.Identity + } + if t.TaskProperties != nil { + objectMap["properties"] = t.TaskProperties + } + if t.Location != nil { + objectMap["location"] = t.Location + } + if t.Tags != nil { + objectMap["tags"] = t.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Task struct. +func (t *Task) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "identity": + if v != nil { + var identity IdentityProperties + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + t.Identity = &identity + } + case "properties": + if v != nil { + var taskProperties TaskProperties + err = json.Unmarshal(*v, &taskProperties) + if err != nil { + return err + } + t.TaskProperties = &taskProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + t.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + t.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + t.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + t.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + t.Tags = tags + } + } + } + + return nil +} + +// TaskListResult the collection of tasks. +type TaskListResult struct { + autorest.Response `json:"-"` + // Value - The collection value. + Value *[]Task `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next set of paged results. + NextLink *string `json:"nextLink,omitempty"` +} + +// TaskListResultIterator provides access to a complete listing of Task values. +type TaskListResultIterator struct { + i int + page TaskListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TaskListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TaskListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TaskListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TaskListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TaskListResultIterator) Response() TaskListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TaskListResultIterator) Value() Task { + if !iter.page.NotDone() { + return Task{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TaskListResultIterator type. +func NewTaskListResultIterator(page TaskListResultPage) TaskListResultIterator { + return TaskListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tlr TaskListResult) IsEmpty() bool { + return tlr.Value == nil || len(*tlr.Value) == 0 +} + +// taskListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tlr TaskListResult) taskListResultPreparer(ctx context.Context) (*http.Request, error) { + if tlr.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))) +} + +// TaskListResultPage contains a page of Task values. +type TaskListResultPage struct { + fn func(context.Context, TaskListResult) (TaskListResult, error) + tlr TaskListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TaskListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TaskListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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 *TaskListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TaskListResultPage) NotDone() bool { + return !page.tlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TaskListResultPage) Response() TaskListResult { + return page.tlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TaskListResultPage) Values() []Task { + if page.tlr.IsEmpty() { + return nil + } + return *page.tlr.Value +} + +// Creates a new instance of the TaskListResultPage type. +func NewTaskListResultPage(getNextPage func(context.Context, TaskListResult) (TaskListResult, error)) TaskListResultPage { + return TaskListResultPage{fn: getNextPage} +} + +// TaskProperties the properties of a task. +type TaskProperties struct { + // ProvisioningState - READ-ONLY; The provisioning state of the task. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // CreationDate - READ-ONLY; The creation date of task. + CreationDate *date.Time `json:"creationDate,omitempty"` + // Status - The current status of task. Possible values include: 'TaskStatusDisabled', 'TaskStatusEnabled' + Status TaskStatus `json:"status,omitempty"` + // Platform - The platform properties against which the run has to happen. + Platform *PlatformProperties `json:"platform,omitempty"` + // AgentConfiguration - The machine configuration of the run agent. + AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` + // Timeout - Run timeout in seconds. + Timeout *int32 `json:"timeout,omitempty"` + // Step - The properties of a task step. + Step BasicTaskStepProperties `json:"step,omitempty"` + // Trigger - The properties that describe all triggers for the task. + Trigger *TriggerProperties `json:"trigger,omitempty"` + // Credentials - The properties that describes a set of credentials that will be used when this run is invoked. + Credentials *Credentials `json:"credentials,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TaskProperties struct. +func (tp *TaskProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + tp.ProvisioningState = provisioningState + } + case "creationDate": + if v != nil { + var creationDate date.Time + err = json.Unmarshal(*v, &creationDate) + if err != nil { + return err + } + tp.CreationDate = &creationDate + } + case "status": + if v != nil { + var status TaskStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + tp.Status = status + } + case "platform": + if v != nil { + var platform PlatformProperties + err = json.Unmarshal(*v, &platform) + if err != nil { + return err + } + tp.Platform = &platform + } + case "agentConfiguration": + if v != nil { + var agentConfiguration AgentProperties + err = json.Unmarshal(*v, &agentConfiguration) + if err != nil { + return err + } + tp.AgentConfiguration = &agentConfiguration + } + case "timeout": + if v != nil { + var timeout int32 + err = json.Unmarshal(*v, &timeout) + if err != nil { + return err + } + tp.Timeout = &timeout + } + case "step": + if v != nil { + step, err := unmarshalBasicTaskStepProperties(*v) + if err != nil { + return err + } + tp.Step = step + } + case "trigger": + if v != nil { + var trigger TriggerProperties + err = json.Unmarshal(*v, &trigger) + if err != nil { + return err + } + tp.Trigger = &trigger + } + case "credentials": + if v != nil { + var credentials Credentials + err = json.Unmarshal(*v, &credentials) + if err != nil { + return err + } + tp.Credentials = &credentials + } + } + } + + return nil +} + +// TaskPropertiesUpdateParameters the properties for updating a task. +type TaskPropertiesUpdateParameters struct { + // Status - The current status of task. Possible values include: 'TaskStatusDisabled', 'TaskStatusEnabled' + Status TaskStatus `json:"status,omitempty"` + // Platform - The platform properties against which the run has to happen. + Platform *PlatformUpdateParameters `json:"platform,omitempty"` + // AgentConfiguration - The machine configuration of the run agent. + AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` + // Timeout - Run timeout in seconds. + Timeout *int32 `json:"timeout,omitempty"` + // Step - The properties for updating a task step. + Step BasicTaskStepUpdateParameters `json:"step,omitempty"` + // Trigger - The properties for updating trigger properties. + Trigger *TriggerUpdateParameters `json:"trigger,omitempty"` + // Credentials - The parameters that describes a set of credentials that will be used when this run is invoked. + Credentials *Credentials `json:"credentials,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TaskPropertiesUpdateParameters struct. +func (tpup *TaskPropertiesUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "status": + if v != nil { + var status TaskStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + tpup.Status = status + } + case "platform": + if v != nil { + var platform PlatformUpdateParameters + err = json.Unmarshal(*v, &platform) + if err != nil { + return err + } + tpup.Platform = &platform } case "agentConfiguration": if v != nil { @@ -4163,385 +4622,814 @@ func (tpup *TaskPropertiesUpdateParameters) UnmarshalJSON(body []byte) error { } } - return nil + return nil +} + +// TaskRunRequest the parameters for a task run request. +type TaskRunRequest struct { + // TaskID - The resource ID of task against which run has to be queued. + TaskID *string `json:"taskId,omitempty"` + // OverrideTaskStepProperties - Set of overridable parameters that can be passed when running a Task. + OverrideTaskStepProperties *OverrideTaskStepProperties `json:"overrideTaskStepProperties,omitempty"` + // IsArchiveEnabled - The value that indicates whether archiving is enabled for the run or not. + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // Type - Possible values include: 'TypeRunRequest', 'TypeDockerBuildRequest', 'TypeFileTaskRunRequest', 'TypeTaskRunRequest', 'TypeEncodedTaskRunRequest' + Type Type `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TaskRunRequest. +func (trr TaskRunRequest) MarshalJSON() ([]byte, error) { + trr.Type = TypeTaskRunRequest + objectMap := make(map[string]interface{}) + if trr.TaskID != nil { + objectMap["taskId"] = trr.TaskID + } + if trr.OverrideTaskStepProperties != nil { + objectMap["overrideTaskStepProperties"] = trr.OverrideTaskStepProperties + } + if trr.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = trr.IsArchiveEnabled + } + if trr.Type != "" { + objectMap["type"] = trr.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildRequest is the BasicRunRequest implementation for TaskRunRequest. +func (trr TaskRunRequest) AsDockerBuildRequest() (*DockerBuildRequest, bool) { + return nil, false +} + +// AsFileTaskRunRequest is the BasicRunRequest implementation for TaskRunRequest. +func (trr TaskRunRequest) AsFileTaskRunRequest() (*FileTaskRunRequest, bool) { + return nil, false +} + +// AsTaskRunRequest is the BasicRunRequest implementation for TaskRunRequest. +func (trr TaskRunRequest) AsTaskRunRequest() (*TaskRunRequest, bool) { + return &trr, true +} + +// AsEncodedTaskRunRequest is the BasicRunRequest implementation for TaskRunRequest. +func (trr TaskRunRequest) AsEncodedTaskRunRequest() (*EncodedTaskRunRequest, bool) { + return nil, false +} + +// AsRunRequest is the BasicRunRequest implementation for TaskRunRequest. +func (trr TaskRunRequest) AsRunRequest() (*RunRequest, bool) { + return nil, false +} + +// AsBasicRunRequest is the BasicRunRequest implementation for TaskRunRequest. +func (trr TaskRunRequest) AsBasicRunRequest() (BasicRunRequest, bool) { + return &trr, true +} + +// TasksCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type TasksCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TasksCreateFuture) Result(client TasksClient) (t Task, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.TasksCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if t.Response.Response, err = future.GetResult(sender); err == nil && t.Response.Response.StatusCode != http.StatusNoContent { + t, err = client.CreateResponder(t.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksCreateFuture", "Result", t.Response.Response, "Failure responding to request") + } + } + return +} + +// TasksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type TasksDeleteFuture struct { + azure.Future } -// TaskRunRequest the parameters for a task run request. -type TaskRunRequest struct { - // TaskID - The resource ID of task against which run has to be queued. - TaskID *string `json:"taskId,omitempty"` - // OverrideTaskStepProperties - Set of overridable parameters that can be passed when running a Task. - OverrideTaskStepProperties *OverrideTaskStepProperties `json:"overrideTaskStepProperties,omitempty"` - // IsArchiveEnabled - The value that indicates whether archiving is enabled for the run or not. - IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` - // Type - Possible values include: 'TypeRunRequest', 'TypeDockerBuildRequest', 'TypeFileTaskRunRequest', 'TypeTaskRunRequest', 'TypeEncodedTaskRunRequest' - Type Type `json:"type,omitempty"` +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TasksDeleteFuture) Result(client TasksClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.TasksDeleteFuture") + return + } + ar.Response = future.Response() + return } -// MarshalJSON is the custom marshaler for TaskRunRequest. -func (trr TaskRunRequest) MarshalJSON() ([]byte, error) { - trr.Type = TypeTaskRunRequest - objectMap := make(map[string]interface{}) - if trr.TaskID != nil { - objectMap["taskId"] = trr.TaskID +// BasicTaskStepProperties base properties for any task step. +type BasicTaskStepProperties interface { + AsDockerBuildStep() (*DockerBuildStep, bool) + AsFileTaskStep() (*FileTaskStep, bool) + AsEncodedTaskStep() (*EncodedTaskStep, bool) + AsTaskStepProperties() (*TaskStepProperties, bool) +} + +// TaskStepProperties base properties for any task step. +type TaskStepProperties struct { + // BaseImageDependencies - READ-ONLY; List of base image dependencies for a step. + BaseImageDependencies *[]BaseImageDependency `json:"baseImageDependencies,omitempty"` + // ContextPath - The URL(absolute or relative) of the source context for the task step. + ContextPath *string `json:"contextPath,omitempty"` + // ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step. + ContextAccessToken *string `json:"contextAccessToken,omitempty"` + // Type - Possible values include: 'TypeTaskStepProperties', 'TypeDocker', 'TypeFileTask', 'TypeEncodedTask' + Type TypeBasicTaskStepProperties `json:"type,omitempty"` +} + +func unmarshalBasicTaskStepProperties(body []byte) (BasicTaskStepProperties, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err } - if trr.OverrideTaskStepProperties != nil { - objectMap["overrideTaskStepProperties"] = trr.OverrideTaskStepProperties + + switch m["type"] { + case string(TypeDocker): + var dbs DockerBuildStep + err := json.Unmarshal(body, &dbs) + return dbs, err + case string(TypeFileTask): + var fts FileTaskStep + err := json.Unmarshal(body, &fts) + return fts, err + case string(TypeEncodedTask): + var ets EncodedTaskStep + err := json.Unmarshal(body, &ets) + return ets, err + default: + var tsp TaskStepProperties + err := json.Unmarshal(body, &tsp) + return tsp, err } - if trr.IsArchiveEnabled != nil { - objectMap["isArchiveEnabled"] = trr.IsArchiveEnabled +} +func unmarshalBasicTaskStepPropertiesArray(body []byte) ([]BasicTaskStepProperties, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err } - if trr.Type != "" { - objectMap["type"] = trr.Type + + tspArray := make([]BasicTaskStepProperties, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tsp, err := unmarshalBasicTaskStepProperties(*rawMessage) + if err != nil { + return nil, err + } + tspArray[index] = tsp + } + return tspArray, nil +} + +// MarshalJSON is the custom marshaler for TaskStepProperties. +func (tsp TaskStepProperties) MarshalJSON() ([]byte, error) { + tsp.Type = TypeTaskStepProperties + objectMap := make(map[string]interface{}) + if tsp.ContextPath != nil { + objectMap["contextPath"] = tsp.ContextPath + } + if tsp.ContextAccessToken != nil { + objectMap["contextAccessToken"] = tsp.ContextAccessToken + } + if tsp.Type != "" { + objectMap["type"] = tsp.Type } return json.Marshal(objectMap) } -// AsDockerBuildRequest is the BasicRunRequest implementation for TaskRunRequest. -func (trr TaskRunRequest) AsDockerBuildRequest() (*DockerBuildRequest, bool) { +// AsDockerBuildStep is the BasicTaskStepProperties implementation for TaskStepProperties. +func (tsp TaskStepProperties) AsDockerBuildStep() (*DockerBuildStep, bool) { return nil, false } -// AsFileTaskRunRequest is the BasicRunRequest implementation for TaskRunRequest. -func (trr TaskRunRequest) AsFileTaskRunRequest() (*FileTaskRunRequest, bool) { +// AsFileTaskStep is the BasicTaskStepProperties implementation for TaskStepProperties. +func (tsp TaskStepProperties) AsFileTaskStep() (*FileTaskStep, bool) { return nil, false } -// AsTaskRunRequest is the BasicRunRequest implementation for TaskRunRequest. -func (trr TaskRunRequest) AsTaskRunRequest() (*TaskRunRequest, bool) { - return &trr, true +// AsEncodedTaskStep is the BasicTaskStepProperties implementation for TaskStepProperties. +func (tsp TaskStepProperties) AsEncodedTaskStep() (*EncodedTaskStep, bool) { + return nil, false } -// AsEncodedTaskRunRequest is the BasicRunRequest implementation for TaskRunRequest. -func (trr TaskRunRequest) AsEncodedTaskRunRequest() (*EncodedTaskRunRequest, bool) { +// AsTaskStepProperties is the BasicTaskStepProperties implementation for TaskStepProperties. +func (tsp TaskStepProperties) AsTaskStepProperties() (*TaskStepProperties, bool) { + return &tsp, true +} + +// AsBasicTaskStepProperties is the BasicTaskStepProperties implementation for TaskStepProperties. +func (tsp TaskStepProperties) AsBasicTaskStepProperties() (BasicTaskStepProperties, bool) { + return &tsp, true +} + +// BasicTaskStepUpdateParameters base properties for updating any task step. +type BasicTaskStepUpdateParameters interface { + AsDockerBuildStepUpdateParameters() (*DockerBuildStepUpdateParameters, bool) + AsFileTaskStepUpdateParameters() (*FileTaskStepUpdateParameters, bool) + AsEncodedTaskStepUpdateParameters() (*EncodedTaskStepUpdateParameters, bool) + AsTaskStepUpdateParameters() (*TaskStepUpdateParameters, bool) +} + +// TaskStepUpdateParameters base properties for updating any task step. +type TaskStepUpdateParameters struct { + // ContextPath - The URL(absolute or relative) of the source context for the task step. + ContextPath *string `json:"contextPath,omitempty"` + // ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step. + ContextAccessToken *string `json:"contextAccessToken,omitempty"` + // Type - Possible values include: 'TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters', 'TypeBasicTaskStepUpdateParametersTypeDocker', 'TypeBasicTaskStepUpdateParametersTypeFileTask', 'TypeBasicTaskStepUpdateParametersTypeEncodedTask' + Type TypeBasicTaskStepUpdateParameters `json:"type,omitempty"` +} + +func unmarshalBasicTaskStepUpdateParameters(body []byte) (BasicTaskStepUpdateParameters, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeBasicTaskStepUpdateParametersTypeDocker): + var dbsup DockerBuildStepUpdateParameters + err := json.Unmarshal(body, &dbsup) + return dbsup, err + case string(TypeBasicTaskStepUpdateParametersTypeFileTask): + var ftsup FileTaskStepUpdateParameters + err := json.Unmarshal(body, &ftsup) + return ftsup, err + case string(TypeBasicTaskStepUpdateParametersTypeEncodedTask): + var etsup EncodedTaskStepUpdateParameters + err := json.Unmarshal(body, &etsup) + return etsup, err + default: + var tsup TaskStepUpdateParameters + err := json.Unmarshal(body, &tsup) + return tsup, err + } +} +func unmarshalBasicTaskStepUpdateParametersArray(body []byte) ([]BasicTaskStepUpdateParameters, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tsupArray := make([]BasicTaskStepUpdateParameters, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tsup, err := unmarshalBasicTaskStepUpdateParameters(*rawMessage) + if err != nil { + return nil, err + } + tsupArray[index] = tsup + } + return tsupArray, nil +} + +// MarshalJSON is the custom marshaler for TaskStepUpdateParameters. +func (tsup TaskStepUpdateParameters) MarshalJSON() ([]byte, error) { + tsup.Type = TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters + objectMap := make(map[string]interface{}) + if tsup.ContextPath != nil { + objectMap["contextPath"] = tsup.ContextPath + } + if tsup.ContextAccessToken != nil { + objectMap["contextAccessToken"] = tsup.ContextAccessToken + } + if tsup.Type != "" { + objectMap["type"] = tsup.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. +func (tsup TaskStepUpdateParameters) AsDockerBuildStepUpdateParameters() (*DockerBuildStepUpdateParameters, bool) { return nil, false } -// AsRunRequest is the BasicRunRequest implementation for TaskRunRequest. -func (trr TaskRunRequest) AsRunRequest() (*RunRequest, bool) { +// AsFileTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. +func (tsup TaskStepUpdateParameters) AsFileTaskStepUpdateParameters() (*FileTaskStepUpdateParameters, bool) { return nil, false } -// AsBasicRunRequest is the BasicRunRequest implementation for TaskRunRequest. -func (trr TaskRunRequest) AsBasicRunRequest() (BasicRunRequest, bool) { - return &trr, true +// AsEncodedTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. +func (tsup TaskStepUpdateParameters) AsEncodedTaskStepUpdateParameters() (*EncodedTaskStepUpdateParameters, bool) { + return nil, false } -// TasksCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type TasksCreateFuture struct { +// AsTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. +func (tsup TaskStepUpdateParameters) AsTaskStepUpdateParameters() (*TaskStepUpdateParameters, bool) { + return &tsup, true +} + +// AsBasicTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. +func (tsup TaskStepUpdateParameters) AsBasicTaskStepUpdateParameters() (BasicTaskStepUpdateParameters, bool) { + return &tsup, true +} + +// TasksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type TasksUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *TasksCreateFuture) Result(client TasksClient) (t Task, err error) { +func (future *TasksUpdateFuture) Result(client TasksClient) (t Task, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.TasksCreateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "containerregistry.TasksUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("containerregistry.TasksCreateFuture") + err = azure.NewAsyncOpIncompleteError("containerregistry.TasksUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if t.Response.Response, err = future.GetResult(sender); err == nil && t.Response.Response.StatusCode != http.StatusNoContent { - t, err = client.CreateResponder(t.Response.Response) + t, err = client.UpdateResponder(t.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.TasksCreateFuture", "Result", t.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "containerregistry.TasksUpdateFuture", "Result", t.Response.Response, "Failure responding to request") } } return } -// TasksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type TasksDeleteFuture struct { - azure.Future +// TaskUpdateParameters the parameters for updating a task. +type TaskUpdateParameters struct { + // Identity - Identity for the resource. + Identity *IdentityProperties `json:"identity,omitempty"` + // TaskPropertiesUpdateParameters - The properties for updating a task. + *TaskPropertiesUpdateParameters `json:"properties,omitempty"` + // Tags - The ARM resource tags. + Tags map[string]*string `json:"tags"` } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *TasksDeleteFuture) Result(client TasksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) +// MarshalJSON is the custom marshaler for TaskUpdateParameters. +func (tup TaskUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tup.Identity != nil { + objectMap["identity"] = tup.Identity + } + if tup.TaskPropertiesUpdateParameters != nil { + objectMap["properties"] = tup.TaskPropertiesUpdateParameters + } + if tup.Tags != nil { + objectMap["tags"] = tup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TaskUpdateParameters struct. +func (tup *TaskUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.TasksDeleteFuture", "Result", future.Response(), "Polling failure") - return + return err } - if !done { - err = azure.NewAsyncOpIncompleteError("containerregistry.TasksDeleteFuture") - return + for k, v := range m { + switch k { + case "identity": + if v != nil { + var identity IdentityProperties + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + tup.Identity = &identity + } + case "properties": + if v != nil { + var taskPropertiesUpdateParameters TaskPropertiesUpdateParameters + err = json.Unmarshal(*v, &taskPropertiesUpdateParameters) + if err != nil { + return err + } + tup.TaskPropertiesUpdateParameters = &taskPropertiesUpdateParameters + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + tup.Tags = tags + } + } } - ar.Response = future.Response() - return + + return nil } -// BasicTaskStepProperties base properties for any task step. -type BasicTaskStepProperties interface { - AsDockerBuildStep() (*DockerBuildStep, bool) - AsFileTaskStep() (*FileTaskStep, bool) - AsEncodedTaskStep() (*EncodedTaskStep, bool) - AsTaskStepProperties() (*TaskStepProperties, bool) +// TimerTrigger the properties of a timer trigger. +type TimerTrigger struct { + // Schedule - The CRON expression for the task schedule + Schedule *string `json:"schedule,omitempty"` + // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' + Status TriggerStatus `json:"status,omitempty"` + // Name - The name of the trigger. + Name *string `json:"name,omitempty"` } -// TaskStepProperties base properties for any task step. -type TaskStepProperties struct { - // BaseImageDependencies - READ-ONLY; List of base image dependencies for a step. - BaseImageDependencies *[]BaseImageDependency `json:"baseImageDependencies,omitempty"` - // ContextPath - The URL(absolute or relative) of the source context for the task step. - ContextPath *string `json:"contextPath,omitempty"` - // ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string `json:"contextAccessToken,omitempty"` - // Type - Possible values include: 'TypeTaskStepProperties', 'TypeDocker', 'TypeFileTask', 'TypeEncodedTask' - Type TypeBasicTaskStepProperties `json:"type,omitempty"` +// TimerTriggerDescriptor ... +type TimerTriggerDescriptor struct { + // TimerTriggerName - The timer trigger name that caused the run. + TimerTriggerName *string `json:"timerTriggerName,omitempty"` + // ScheduleOccurrence - The occurrence that triggered the run. + ScheduleOccurrence *string `json:"scheduleOccurrence,omitempty"` } -func unmarshalBasicTaskStepProperties(body []byte) (BasicTaskStepProperties, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } +// TimerTriggerUpdateParameters the properties for updating a timer trigger. +type TimerTriggerUpdateParameters struct { + // Schedule - The CRON expression for the task schedule + Schedule *string `json:"schedule,omitempty"` + // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' + Status TriggerStatus `json:"status,omitempty"` + // Name - The name of the trigger. + Name *string `json:"name,omitempty"` +} - switch m["type"] { - case string(TypeDocker): - var dbs DockerBuildStep - err := json.Unmarshal(body, &dbs) - return dbs, err - case string(TypeFileTask): - var fts FileTaskStep - err := json.Unmarshal(body, &fts) - return fts, err - case string(TypeEncodedTask): - var ets EncodedTaskStep - err := json.Unmarshal(body, &ets) - return ets, err - default: - var tsp TaskStepProperties - err := json.Unmarshal(body, &tsp) - return tsp, err +// Token an object that represents a token for a container registry. +type Token struct { + autorest.Response `json:"-"` + // TokenProperties - The properties of the token. + *TokenProperties `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 Token. +func (t Token) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if t.TokenProperties != nil { + objectMap["properties"] = t.TokenProperties } + return json.Marshal(objectMap) } -func unmarshalBasicTaskStepPropertiesArray(body []byte) ([]BasicTaskStepProperties, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) + +// UnmarshalJSON is the custom unmarshaler for Token struct. +func (t *Token) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) if err != nil { - return nil, err + return err } - - tspArray := make([]BasicTaskStepProperties, len(rawMessages)) - - for index, rawMessage := range rawMessages { - tsp, err := unmarshalBasicTaskStepProperties(*rawMessage) - if err != nil { - return nil, err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var tokenProperties TokenProperties + err = json.Unmarshal(*v, &tokenProperties) + if err != nil { + return err + } + t.TokenProperties = &tokenProperties + } + 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 + } } - tspArray[index] = tsp } - return tspArray, nil + + return nil } -// MarshalJSON is the custom marshaler for TaskStepProperties. -func (tsp TaskStepProperties) MarshalJSON() ([]byte, error) { - tsp.Type = TypeTaskStepProperties - objectMap := make(map[string]interface{}) - if tsp.ContextPath != nil { - objectMap["contextPath"] = tsp.ContextPath +// TokenCertificate the properties of a certificate used for authenticating a token. +type TokenCertificate struct { + // Name - Possible values include: 'Certificate1', 'Certificate2' + Name TokenCertificateName `json:"name,omitempty"` + // Expiry - The expiry datetime of the certificate. + Expiry *date.Time `json:"expiry,omitempty"` + // Thumbprint - The thumbprint of the certificate. + Thumbprint *string `json:"thumbprint,omitempty"` + // EncodedPemCertificate - Base 64 encoded string of the public certificate1 in PEM format that will be used for authenticating the token. + EncodedPemCertificate *string `json:"encodedPemCertificate,omitempty"` +} + +// TokenCredentialsProperties the properties of the credentials that can be used for authenticating the +// token. +type TokenCredentialsProperties struct { + Certificates *[]TokenCertificate `json:"certificates,omitempty"` + Passwords *[]TokenPassword `json:"passwords,omitempty"` +} + +// TokenListResult the result of a request to list tokens for a container registry. +type TokenListResult struct { + autorest.Response `json:"-"` + // Value - The list of tokens. Since this list may be incomplete, the nextLink field should be used to request the next list of tokens. + Value *[]Token `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of tokens. + NextLink *string `json:"nextLink,omitempty"` +} + +// TokenListResultIterator provides access to a complete listing of Token values. +type TokenListResultIterator struct { + i int + page TokenListResultPage +} + +// 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 *TokenListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TokenListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if tsp.ContextAccessToken != nil { - objectMap["contextAccessToken"] = tsp.ContextAccessToken + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil } - if tsp.Type != "" { - objectMap["type"] = tsp.Type + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err } - return json.Marshal(objectMap) + 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 *TokenListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// AsDockerBuildStep is the BasicTaskStepProperties implementation for TaskStepProperties. -func (tsp TaskStepProperties) AsDockerBuildStep() (*DockerBuildStep, bool) { - return nil, false +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TokenListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// AsFileTaskStep is the BasicTaskStepProperties implementation for TaskStepProperties. -func (tsp TaskStepProperties) AsFileTaskStep() (*FileTaskStep, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (iter TokenListResultIterator) Response() TokenListResult { + return iter.page.Response() } -// AsEncodedTaskStep is the BasicTaskStepProperties implementation for TaskStepProperties. -func (tsp TaskStepProperties) AsEncodedTaskStep() (*EncodedTaskStep, bool) { - return nil, false +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TokenListResultIterator) Value() Token { + if !iter.page.NotDone() { + return Token{} + } + return iter.page.Values()[iter.i] } -// AsTaskStepProperties is the BasicTaskStepProperties implementation for TaskStepProperties. -func (tsp TaskStepProperties) AsTaskStepProperties() (*TaskStepProperties, bool) { - return &tsp, true +// Creates a new instance of the TokenListResultIterator type. +func NewTokenListResultIterator(page TokenListResultPage) TokenListResultIterator { + return TokenListResultIterator{page: page} } -// AsBasicTaskStepProperties is the BasicTaskStepProperties implementation for TaskStepProperties. -func (tsp TaskStepProperties) AsBasicTaskStepProperties() (BasicTaskStepProperties, bool) { - return &tsp, true +// IsEmpty returns true if the ListResult contains no values. +func (tlr TokenListResult) IsEmpty() bool { + return tlr.Value == nil || len(*tlr.Value) == 0 } -// BasicTaskStepUpdateParameters base properties for updating any task step. -type BasicTaskStepUpdateParameters interface { - AsDockerBuildStepUpdateParameters() (*DockerBuildStepUpdateParameters, bool) - AsFileTaskStepUpdateParameters() (*FileTaskStepUpdateParameters, bool) - AsEncodedTaskStepUpdateParameters() (*EncodedTaskStepUpdateParameters, bool) - AsTaskStepUpdateParameters() (*TaskStepUpdateParameters, bool) +// tokenListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tlr TokenListResult) tokenListResultPreparer(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))) } -// TaskStepUpdateParameters base properties for updating any task step. -type TaskStepUpdateParameters struct { - // ContextPath - The URL(absolute or relative) of the source context for the task step. - ContextPath *string `json:"contextPath,omitempty"` - // ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string `json:"contextAccessToken,omitempty"` - // Type - Possible values include: 'TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters', 'TypeBasicTaskStepUpdateParametersTypeDocker', 'TypeBasicTaskStepUpdateParametersTypeFileTask', 'TypeBasicTaskStepUpdateParametersTypeEncodedTask' - Type TypeBasicTaskStepUpdateParameters `json:"type,omitempty"` +// TokenListResultPage contains a page of Token values. +type TokenListResultPage struct { + fn func(context.Context, TokenListResult) (TokenListResult, error) + tlr TokenListResult } -func unmarshalBasicTaskStepUpdateParameters(body []byte) (BasicTaskStepUpdateParameters, error) { - var m map[string]interface{} - 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 *TokenListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TokenListResultPage.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 nil, err + return err } + page.tlr = next + return nil +} - switch m["type"] { - case string(TypeBasicTaskStepUpdateParametersTypeDocker): - var dbsup DockerBuildStepUpdateParameters - err := json.Unmarshal(body, &dbsup) - return dbsup, err - case string(TypeBasicTaskStepUpdateParametersTypeFileTask): - var ftsup FileTaskStepUpdateParameters - err := json.Unmarshal(body, &ftsup) - return ftsup, err - case string(TypeBasicTaskStepUpdateParametersTypeEncodedTask): - var etsup EncodedTaskStepUpdateParameters - err := json.Unmarshal(body, &etsup) - return etsup, err - default: - var tsup TaskStepUpdateParameters - err := json.Unmarshal(body, &tsup) - return tsup, err - } +// 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 *TokenListResultPage) Next() error { + return page.NextWithContext(context.Background()) } -func unmarshalBasicTaskStepUpdateParametersArray(body []byte) ([]BasicTaskStepUpdateParameters, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - tsupArray := make([]BasicTaskStepUpdateParameters, len(rawMessages)) +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TokenListResultPage) NotDone() bool { + return !page.tlr.IsEmpty() +} - for index, rawMessage := range rawMessages { - tsup, err := unmarshalBasicTaskStepUpdateParameters(*rawMessage) - if err != nil { - return nil, err - } - tsupArray[index] = tsup - } - return tsupArray, nil +// Response returns the raw server response from the last page request. +func (page TokenListResultPage) Response() TokenListResult { + return page.tlr } -// MarshalJSON is the custom marshaler for TaskStepUpdateParameters. -func (tsup TaskStepUpdateParameters) MarshalJSON() ([]byte, error) { - tsup.Type = TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters - objectMap := make(map[string]interface{}) - if tsup.ContextPath != nil { - objectMap["contextPath"] = tsup.ContextPath - } - if tsup.ContextAccessToken != nil { - objectMap["contextAccessToken"] = tsup.ContextAccessToken - } - if tsup.Type != "" { - objectMap["type"] = tsup.Type +// Values returns the slice of values for the current page or nil if there are no values. +func (page TokenListResultPage) Values() []Token { + if page.tlr.IsEmpty() { + return nil } - return json.Marshal(objectMap) + return *page.tlr.Value } -// AsDockerBuildStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. -func (tsup TaskStepUpdateParameters) AsDockerBuildStepUpdateParameters() (*DockerBuildStepUpdateParameters, bool) { - return nil, false +// Creates a new instance of the TokenListResultPage type. +func NewTokenListResultPage(getNextPage func(context.Context, TokenListResult) (TokenListResult, error)) TokenListResultPage { + return TokenListResultPage{fn: getNextPage} } -// AsFileTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. -func (tsup TaskStepUpdateParameters) AsFileTaskStepUpdateParameters() (*FileTaskStepUpdateParameters, bool) { - return nil, false +// TokenPassword the password that will be used for authenticating the token of a container registry. +type TokenPassword struct { + // CreationTime - The creation datetime of the password. + CreationTime *date.Time `json:"creationTime,omitempty"` + // Expiry - The expiry datetime of the password. + Expiry *date.Time `json:"expiry,omitempty"` + // Name - The password name "password" or "password2". Possible values include: 'TokenPasswordNamePassword1', 'TokenPasswordNamePassword2' + Name TokenPasswordName `json:"name,omitempty"` + // Value - READ-ONLY; The password value. + Value *string `json:"value,omitempty"` } -// AsEncodedTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. -func (tsup TaskStepUpdateParameters) AsEncodedTaskStepUpdateParameters() (*EncodedTaskStepUpdateParameters, bool) { - return nil, false +// TokenProperties the properties of a token. +type TokenProperties struct { + // CreationDate - READ-ONLY; The creation date of scope map. + CreationDate *date.Time `json:"creationDate,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ScopeMapID - The resource ID of the scope map to which the token will be associated with. + ScopeMapID *string `json:"scopeMapId,omitempty"` + // ObjectID - The user/group/application object ID for which the token has to be created. + ObjectID *string `json:"objectId,omitempty"` + // Credentials - The credentials that can be used for authenticating the token. + Credentials *TokenCredentialsProperties `json:"credentials,omitempty"` + // Status - The status of the token example enabled or disabled. Possible values include: 'TokenStatusEnabled', 'TokenStatusDisabled' + Status TokenStatus `json:"status,omitempty"` +} + +// TokensCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type TokensCreateFuture struct { + azure.Future } -// AsTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. -func (tsup TaskStepUpdateParameters) AsTaskStepUpdateParameters() (*TaskStepUpdateParameters, bool) { - return &tsup, true +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TokensCreateFuture) Result(client TokensClient) (t Token, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TokensCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.TokensCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if t.Response.Response, err = future.GetResult(sender); err == nil && t.Response.Response.StatusCode != http.StatusNoContent { + t, err = client.CreateResponder(t.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TokensCreateFuture", "Result", t.Response.Response, "Failure responding to request") + } + } + return } -// AsBasicTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. -func (tsup TaskStepUpdateParameters) AsBasicTaskStepUpdateParameters() (BasicTaskStepUpdateParameters, bool) { - return &tsup, true +// TokensDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type TokensDeleteFuture struct { + azure.Future } -// TasksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type TasksUpdateFuture struct { +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TokensDeleteFuture) Result(client TokensClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TokensDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.TokensDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// TokensUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type TokensUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *TasksUpdateFuture) Result(client TasksClient) (t Task, err error) { +func (future *TokensUpdateFuture) Result(client TokensClient) (t Token, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.TasksUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "containerregistry.TokensUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("containerregistry.TasksUpdateFuture") + err = azure.NewAsyncOpIncompleteError("containerregistry.TokensUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if t.Response.Response, err = future.GetResult(sender); err == nil && t.Response.Response.StatusCode != http.StatusNoContent { t, err = client.UpdateResponder(t.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.TasksUpdateFuture", "Result", t.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "containerregistry.TokensUpdateFuture", "Result", t.Response.Response, "Failure responding to request") } } return } -// TaskUpdateParameters the parameters for updating a task. -type TaskUpdateParameters struct { - // Identity - Identity for the resource. - Identity *IdentityProperties `json:"identity,omitempty"` - // TaskPropertiesUpdateParameters - The properties for updating a task. - *TaskPropertiesUpdateParameters `json:"properties,omitempty"` - // Tags - The ARM resource tags. - Tags map[string]*string `json:"tags"` +// TokenUpdateParameters the parameters for updating a token. +type TokenUpdateParameters struct { + // TokenUpdateProperties - The properties of the token update parameters. + *TokenUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for TaskUpdateParameters. -func (tup TaskUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for TokenUpdateParameters. +func (tup TokenUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if tup.Identity != nil { - objectMap["identity"] = tup.Identity - } - if tup.TaskPropertiesUpdateParameters != nil { - objectMap["properties"] = tup.TaskPropertiesUpdateParameters - } - if tup.Tags != nil { - objectMap["tags"] = tup.Tags + if tup.TokenUpdateProperties != nil { + objectMap["properties"] = tup.TokenUpdateProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for TaskUpdateParameters struct. -func (tup *TaskUpdateParameters) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for TokenUpdateParameters struct. +func (tup *TokenUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4549,32 +5437,14 @@ func (tup *TaskUpdateParameters) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "identity": - if v != nil { - var identity IdentityProperties - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - tup.Identity = &identity - } case "properties": if v != nil { - var taskPropertiesUpdateParameters TaskPropertiesUpdateParameters - err = json.Unmarshal(*v, &taskPropertiesUpdateParameters) - if err != nil { - return err - } - tup.TaskPropertiesUpdateParameters = &taskPropertiesUpdateParameters - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var tokenUpdateProperties TokenUpdateProperties + err = json.Unmarshal(*v, &tokenUpdateProperties) if err != nil { return err } - tup.Tags = tags + tup.TokenUpdateProperties = &tokenUpdateProperties } } } @@ -4582,32 +5452,14 @@ func (tup *TaskUpdateParameters) UnmarshalJSON(body []byte) error { return nil } -// TimerTrigger the properties of a timer trigger. -type TimerTrigger struct { - // Schedule - The CRON expression for the task schedule - Schedule *string `json:"schedule,omitempty"` - // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' - Status TriggerStatus `json:"status,omitempty"` - // Name - The name of the trigger. - Name *string `json:"name,omitempty"` -} - -// TimerTriggerDescriptor ... -type TimerTriggerDescriptor struct { - // TimerTriggerName - The timer trigger name that caused the run. - TimerTriggerName *string `json:"timerTriggerName,omitempty"` - // ScheduleOccurrence - The occurrence that triggered the run. - ScheduleOccurrence *string `json:"scheduleOccurrence,omitempty"` -} - -// TimerTriggerUpdateParameters the properties for updating a timer trigger. -type TimerTriggerUpdateParameters struct { - // Schedule - The CRON expression for the task schedule - Schedule *string `json:"schedule,omitempty"` - // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' - Status TriggerStatus `json:"status,omitempty"` - // Name - The name of the trigger. - Name *string `json:"name,omitempty"` +// TokenUpdateProperties the parameters for updating token properties. +type TokenUpdateProperties struct { + // ScopeMapID - The resource ID of the scope map to which the token will be associated with. + ScopeMapID *string `json:"scopeMapId,omitempty"` + // Status - The status of the token example enabled or disabled. Possible values include: 'TokenStatusEnabled', 'TokenStatusDisabled' + Status TokenStatus `json:"status,omitempty"` + // Credentials - The credentials that can be used for authenticating the token. + Credentials *TokenCredentialsProperties `json:"credentials,omitempty"` } // TriggerProperties the properties of a trigger. diff --git a/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/registries.go b/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/registries.go index 355fe2dcddb9..16cf6c62c4fa 100644 --- a/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/registries.go +++ b/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/registries.go @@ -311,6 +311,96 @@ func (client RegistriesClient) DeleteResponder(resp *http.Response) (result auto return } +// GenerateCredentials generate keys for a token of a specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// generateCredentialsParameters - the parameters for generating credentials. +func (client RegistriesClient) GenerateCredentials(ctx context.Context, resourceGroupName string, registryName string, generateCredentialsParameters GenerateCredentialsParameters) (result RegistriesGenerateCredentialsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.GenerateCredentials") + 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}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "GenerateCredentials", err.Error()) + } + + req, err := client.GenerateCredentialsPreparer(ctx, resourceGroupName, registryName, generateCredentialsParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GenerateCredentials", nil, "Failure preparing request") + return + } + + result, err = client.GenerateCredentialsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GenerateCredentials", result.Response(), "Failure sending request") + return + } + + return +} + +// GenerateCredentialsPreparer prepares the GenerateCredentials request. +func (client RegistriesClient) GenerateCredentialsPreparer(ctx context.Context, resourceGroupName string, registryName string, generateCredentialsParameters GenerateCredentialsParameters) (*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-05-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/generateCredentials", pathParameters), + autorest.WithJSON(generateCredentialsParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateCredentialsSender sends the GenerateCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) GenerateCredentialsSender(req *http.Request) (future RegistriesGenerateCredentialsFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// GenerateCredentialsResponder handles the response to the GenerateCredentials request. The method always +// closes the http.Response Body. +func (client RegistriesClient) GenerateCredentialsResponder(resp *http.Response) (result GenerateCredentialsResult, 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 the properties of the specified container registry. // Parameters: // resourceGroupName - the name of the resource group to which the container registry belongs. diff --git a/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/scopemaps.go b/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/scopemaps.go new file mode 100644 index 000000000000..90bd1a9ff108 --- /dev/null +++ b/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/scopemaps.go @@ -0,0 +1,547 @@ +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" +) + +// ScopeMapsClient is the client for the ScopeMaps methods of the Containerregistry service. +type ScopeMapsClient struct { + BaseClient +} + +// NewScopeMapsClient creates an instance of the ScopeMapsClient client. +func NewScopeMapsClient(subscriptionID string) ScopeMapsClient { + return NewScopeMapsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewScopeMapsClientWithBaseURI creates an instance of the ScopeMapsClient client. +func NewScopeMapsClientWithBaseURI(baseURI string, subscriptionID string) ScopeMapsClient { + return ScopeMapsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a scope map 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. +// scopeMapName - the name of the scope map. +// scopeMapCreateParameters - the parameters for creating a scope map. +func (client ScopeMapsClient) Create(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string, scopeMapCreateParameters ScopeMap) (result ScopeMapsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeMapsClient.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: scopeMapName, + Constraints: []validation.Constraint{{Target: "scopeMapName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "scopeMapName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "scopeMapName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}, + {TargetValue: scopeMapCreateParameters, + Constraints: []validation.Constraint{{Target: "scopeMapCreateParameters.ScopeMapProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "scopeMapCreateParameters.ScopeMapProperties.Actions", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("containerregistry.ScopeMapsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ScopeMapsClient) CreatePreparer(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string, scopeMapCreateParameters ScopeMap) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scopeMapName": autorest.Encode("path", scopeMapName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-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}/scopeMaps/{scopeMapName}", pathParameters), + autorest.WithJSON(scopeMapCreateParameters), + 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 ScopeMapsClient) CreateSender(req *http.Request) (future ScopeMapsCreateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 ScopeMapsClient) CreateResponder(resp *http.Response) (result ScopeMap, 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 scope map 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. +// scopeMapName - the name of the scope map. +func (client ScopeMapsClient) Delete(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string) (result ScopeMapsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeMapsClient.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: scopeMapName, + Constraints: []validation.Constraint{{Target: "scopeMapName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "scopeMapName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "scopeMapName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ScopeMapsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, scopeMapName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ScopeMapsClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scopeMapName": autorest.Encode("path", scopeMapName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-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}/scopeMaps/{scopeMapName}", 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 ScopeMapsClient) DeleteSender(req *http.Request) (future ScopeMapsDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 ScopeMapsClient) 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 scope map. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// scopeMapName - the name of the scope map. +func (client ScopeMapsClient) Get(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string) (result ScopeMap, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeMapsClient.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: scopeMapName, + Constraints: []validation.Constraint{{Target: "scopeMapName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "scopeMapName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "scopeMapName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ScopeMapsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName, scopeMapName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsClient", "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.ScopeMapsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ScopeMapsClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scopeMapName": autorest.Encode("path", scopeMapName), + "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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}", 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 ScopeMapsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ScopeMapsClient) GetResponder(resp *http.Response) (result ScopeMap, 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 scope maps 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 ScopeMapsClient) List(ctx context.Context, resourceGroupName string, registryName string) (result ScopeMapListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeMapsClient.List") + defer func() { + sc := -1 + if result.smlr.Response.Response != nil { + sc = result.smlr.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.ScopeMapsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.smlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsClient", "List", resp, "Failure sending request") + return + } + + result.smlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ScopeMapsClient) 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-05-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}/scopeMaps", 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 ScopeMapsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ScopeMapsClient) ListResponder(resp *http.Response) (result ScopeMapListResult, 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 ScopeMapsClient) listNextResults(ctx context.Context, lastResults ScopeMapListResult) (result ScopeMapListResult, err error) { + req, err := lastResults.scopeMapListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.ScopeMapsClient", "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.ScopeMapsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ScopeMapsClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result ScopeMapListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeMapsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, registryName) + return +} + +// Update updates a scope map 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. +// scopeMapName - the name of the scope map. +// scopeMapUpdateParameters - the parameters for updating a scope map. +func (client ScopeMapsClient) Update(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string, scopeMapUpdateParameters ScopeMapUpdateParameters) (result ScopeMapsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeMapsClient.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.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: scopeMapName, + Constraints: []validation.Constraint{{Target: "scopeMapName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "scopeMapName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "scopeMapName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ScopeMapsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ScopeMapsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string, scopeMapUpdateParameters ScopeMapUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scopeMapName": autorest.Encode("path", scopeMapName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}", pathParameters), + autorest.WithJSON(scopeMapUpdateParameters), + 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 ScopeMapsClient) UpdateSender(req *http.Request) (future ScopeMapsUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 ScopeMapsClient) UpdateResponder(resp *http.Response) (result ScopeMap, 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/containerregistry/mgmt/2019-06-01-preview/containerregistry/tokens.go b/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/tokens.go new file mode 100644 index 000000000000..8a3dafead703 --- /dev/null +++ b/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/tokens.go @@ -0,0 +1,544 @@ +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" +) + +// TokensClient is the client for the Tokens methods of the Containerregistry service. +type TokensClient struct { + BaseClient +} + +// NewTokensClient creates an instance of the TokensClient client. +func NewTokensClient(subscriptionID string) TokensClient { + return NewTokensClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTokensClientWithBaseURI creates an instance of the TokensClient client. +func NewTokensClientWithBaseURI(baseURI string, subscriptionID string) TokensClient { + return TokensClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a token 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. +// tokenName - the name of the token. +// tokenCreateParameters - the parameters for creating a token. +func (client TokensClient) Create(ctx context.Context, resourceGroupName string, registryName string, tokenName string, tokenCreateParameters Token) (result TokensCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TokensClient.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: tokenName, + Constraints: []validation.Constraint{{Target: "tokenName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "tokenName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "tokenName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TokensClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, tokenName, tokenCreateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TokensClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TokensClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client TokensClient) CreatePreparer(ctx context.Context, resourceGroupName string, registryName string, tokenName string, tokenCreateParameters Token) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tokenName": autorest.Encode("path", tokenName), + } + + const APIVersion = "2019-05-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}/tokens/{tokenName}", pathParameters), + autorest.WithJSON(tokenCreateParameters), + 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 TokensClient) CreateSender(req *http.Request) (future TokensCreateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 TokensClient) CreateResponder(resp *http.Response) (result Token, 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 token 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. +// tokenName - the name of the token. +func (client TokensClient) Delete(ctx context.Context, resourceGroupName string, registryName string, tokenName string) (result TokensDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TokensClient.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: tokenName, + Constraints: []validation.Constraint{{Target: "tokenName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "tokenName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "tokenName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TokensClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, tokenName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TokensClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TokensClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client TokensClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string, tokenName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tokenName": autorest.Encode("path", tokenName), + } + + const APIVersion = "2019-05-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}/tokens/{tokenName}", 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 TokensClient) DeleteSender(req *http.Request) (future TokensDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 TokensClient) 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 token. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// tokenName - the name of the token. +func (client TokensClient) Get(ctx context.Context, resourceGroupName string, registryName string, tokenName string) (result Token, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TokensClient.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: tokenName, + Constraints: []validation.Constraint{{Target: "tokenName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "tokenName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "tokenName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TokensClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName, tokenName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TokensClient", "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.TokensClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TokensClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TokensClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, tokenName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tokenName": autorest.Encode("path", tokenName), + } + + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}", 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 TokensClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TokensClient) GetResponder(resp *http.Response) (result Token, 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 tokens 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 TokensClient) List(ctx context.Context, resourceGroupName string, registryName string) (result TokenListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TokensClient.List") + defer func() { + sc := -1 + if result.tlr.Response.Response != nil { + sc = result.tlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TokensClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TokensClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.tlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.TokensClient", "List", resp, "Failure sending request") + return + } + + result.tlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TokensClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client TokensClient) 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-05-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}/tokens", 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 TokensClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client TokensClient) ListResponder(resp *http.Response) (result TokenListResult, 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 TokensClient) listNextResults(ctx context.Context, lastResults TokenListResult) (result TokenListResult, err error) { + req, err := lastResults.tokenListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.TokensClient", "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.TokensClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TokensClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client TokensClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result TokenListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TokensClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, registryName) + return +} + +// Update updates a token 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. +// tokenName - the name of the token. +// tokenUpdateParameters - the parameters for updating a token. +func (client TokensClient) Update(ctx context.Context, resourceGroupName string, registryName string, tokenName string, tokenUpdateParameters TokenUpdateParameters) (result TokensUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TokensClient.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.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: tokenName, + Constraints: []validation.Constraint{{Target: "tokenName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "tokenName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "tokenName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TokensClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, tokenName, tokenUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TokensClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TokensClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client TokensClient) UpdatePreparer(ctx context.Context, resourceGroupName string, registryName string, tokenName string, tokenUpdateParameters TokenUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tokenName": autorest.Encode("path", tokenName), + } + + const APIVersion = "2019-05-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}", pathParameters), + autorest.WithJSON(tokenUpdateParameters), + 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 TokensClient) UpdateSender(req *http.Request) (future TokensUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 TokensClient) UpdateResponder(resp *http.Response) (result Token, 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/containerservice/mgmt/2019-06-01/containerservice/agentpools.go b/services/containerservice/mgmt/2019-06-01/containerservice/agentpools.go index 2c081639c1c3..da2471917fa4 100644 --- a/services/containerservice/mgmt/2019-06-01/containerservice/agentpools.go +++ b/services/containerservice/mgmt/2019-06-01/containerservice/agentpools.go @@ -321,8 +321,7 @@ func (client AgentPoolsClient) GetResponder(resp *http.Response) (result AgentPo // 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) GetAvailableAgentPoolVersions(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPoolAvailableVersions, err error) { +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() { @@ -343,7 +342,7 @@ func (client AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context return result, validation.NewError("containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", err.Error()) } - req, err := client.GetAvailableAgentPoolVersionsPreparer(ctx, resourceGroupName, resourceName, agentPoolName) + req, err := client.GetAvailableAgentPoolVersionsPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", nil, "Failure preparing request") return @@ -365,9 +364,8 @@ func (client AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context } // GetAvailableAgentPoolVersionsPreparer prepares the GetAvailableAgentPoolVersions request. -func (client AgentPoolsClient) GetAvailableAgentPoolVersionsPreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { +func (client AgentPoolsClient) GetAvailableAgentPoolVersionsPreparer(ctx context.Context, resourceGroupName string, resourceName 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), @@ -381,7 +379,7 @@ func (client AgentPoolsClient) GetAvailableAgentPoolVersionsPreparer(ctx context preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/availableAgentPoolVersions", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/containerservice/mgmt/2019-06-01/containerservice/containerserviceapi/interfaces.go b/services/containerservice/mgmt/2019-06-01/containerservice/containerserviceapi/interfaces.go index b0b214fa4c91..124d366f18ae 100644 --- a/services/containerservice/mgmt/2019-06-01/containerservice/containerserviceapi/interfaces.go +++ b/services/containerservice/mgmt/2019-06-01/containerservice/containerserviceapi/interfaces.go @@ -76,7 +76,7 @@ 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, agentPoolName string) (result containerservice.AgentPoolAvailableVersions, 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) } diff --git a/services/containerservice/mgmt/2019-08-01/containerservice/agentpools.go b/services/containerservice/mgmt/2019-08-01/containerservice/agentpools.go index 9a6f1e9c79a6..0deeb2385425 100644 --- a/services/containerservice/mgmt/2019-08-01/containerservice/agentpools.go +++ b/services/containerservice/mgmt/2019-08-01/containerservice/agentpools.go @@ -321,8 +321,7 @@ func (client AgentPoolsClient) GetResponder(resp *http.Response) (result AgentPo // 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) GetAvailableAgentPoolVersions(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPoolAvailableVersions, err error) { +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() { @@ -343,7 +342,7 @@ func (client AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context return result, validation.NewError("containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", err.Error()) } - req, err := client.GetAvailableAgentPoolVersionsPreparer(ctx, resourceGroupName, resourceName, agentPoolName) + req, err := client.GetAvailableAgentPoolVersionsPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", nil, "Failure preparing request") return @@ -365,9 +364,8 @@ func (client AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context } // GetAvailableAgentPoolVersionsPreparer prepares the GetAvailableAgentPoolVersions request. -func (client AgentPoolsClient) GetAvailableAgentPoolVersionsPreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { +func (client AgentPoolsClient) GetAvailableAgentPoolVersionsPreparer(ctx context.Context, resourceGroupName string, resourceName 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), @@ -381,7 +379,7 @@ func (client AgentPoolsClient) GetAvailableAgentPoolVersionsPreparer(ctx context preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/availableAgentPoolVersions", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/containerservice/mgmt/2019-08-01/containerservice/containerserviceapi/interfaces.go b/services/containerservice/mgmt/2019-08-01/containerservice/containerserviceapi/interfaces.go index 562e17423989..73b71104a658 100644 --- a/services/containerservice/mgmt/2019-08-01/containerservice/containerserviceapi/interfaces.go +++ b/services/containerservice/mgmt/2019-08-01/containerservice/containerserviceapi/interfaces.go @@ -76,7 +76,7 @@ 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, agentPoolName string) (result containerservice.AgentPoolAvailableVersions, 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) } diff --git a/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go b/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go index a5a9a238d4f1..16b7c393ebe4 100644 --- a/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go +++ b/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go @@ -211,8 +211,8 @@ const ( PrimaryAggregationTypeLast PrimaryAggregationType = "Last" // PrimaryAggregationTypeMaximum ... PrimaryAggregationTypeMaximum PrimaryAggregationType = "Maximum" - // PrimaryAggregationTypeMinimimum ... - PrimaryAggregationTypeMinimimum PrimaryAggregationType = "Minimimum" + // PrimaryAggregationTypeMinimum ... + PrimaryAggregationTypeMinimum PrimaryAggregationType = "Minimum" // PrimaryAggregationTypeNone ... PrimaryAggregationTypeNone PrimaryAggregationType = "None" // PrimaryAggregationTypeTotal ... @@ -221,7 +221,7 @@ const ( // PossiblePrimaryAggregationTypeValues returns an array of possible values for the PrimaryAggregationType const type. func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { - return []PrimaryAggregationType{PrimaryAggregationTypeAverage, PrimaryAggregationTypeLast, PrimaryAggregationTypeMaximum, PrimaryAggregationTypeMinimimum, PrimaryAggregationTypeNone, PrimaryAggregationTypeTotal} + return []PrimaryAggregationType{PrimaryAggregationTypeAverage, PrimaryAggregationTypeLast, PrimaryAggregationTypeMaximum, PrimaryAggregationTypeMinimum, PrimaryAggregationTypeNone, PrimaryAggregationTypeTotal} } // UnitType enumerates the values for unit type. @@ -2480,7 +2480,7 @@ type MetricAvailability struct { type MetricDefinition struct { // MetricAvailabilities - READ-ONLY; The list of metric availabilities for the account. MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"` - // PrimaryAggregationType - READ-ONLY; The primary aggregation type of the metric. Possible values include: 'PrimaryAggregationTypeNone', 'PrimaryAggregationTypeAverage', 'PrimaryAggregationTypeTotal', 'PrimaryAggregationTypeMinimimum', 'PrimaryAggregationTypeMaximum', 'PrimaryAggregationTypeLast' + // PrimaryAggregationType - READ-ONLY; The primary aggregation type of the metric. Possible values include: 'PrimaryAggregationTypeNone', 'PrimaryAggregationTypeAverage', 'PrimaryAggregationTypeTotal', 'PrimaryAggregationTypeMinimum', 'PrimaryAggregationTypeMaximum', 'PrimaryAggregationTypeLast' PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"` // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' Unit UnitType `json:"unit,omitempty"` diff --git a/services/cosmos-db/mongodb/client.go b/services/cosmos-db/mongodb/client.go deleted file mode 100644 index 50ac8ae55acd..000000000000 --- a/services/cosmos-db/mongodb/client.go +++ /dev/null @@ -1,117 +0,0 @@ -// Package mongodb provides Mongo DB dataplane clients for Microsoft Azure CosmosDb Services. -package mongodb - -// Copyright 2017 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. - -import ( - "context" - "crypto/tls" - "fmt" - "net" - "strings" - - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/adal" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/globalsign/mgo" -) - -const ( - cosmosDbConnectionPort = 10255 -) - -// NewMongoDBClientWithConnectionString returns a MongoDb session to communicate with CosmosDB using a connection string. -func NewMongoDBClientWithConnectionString(connectionString string) (*mgo.Session, error) { - - // strip out the "ssl=true" option as MongoDb driver does not support by default SSL. - connectionString = strings.Replace(connectionString, "ssl=true", "", -1) - dialInfo, err := mgo.ParseURL(connectionString) - - if err != nil { - return nil, err - } - - return NewMongoDBClient(dialInfo) -} - -// NewMongoDBClientWithCredentials returns a MongoDb session to communicate with CosmosDB using a username and a password. -func NewMongoDBClientWithCredentials(username, password, host string) (*mgo.Session, error) { - - dialInfo := &mgo.DialInfo{ - Addrs: []string{fmt.Sprintf("%s:%d", host, cosmosDbConnectionPort)}, - Username: username, - Password: password, - } - - return NewMongoDBClient(dialInfo) -} - -// NewMongoDBClientWithSPToken returns a session to communicate with CosmosDB using an auth token. -func NewMongoDBClientWithSPToken(spToken *adal.ServicePrincipalToken, subscriptionID, resourceGroup, account string, environment azure.Environment) (*mgo.Session, error) { - - authorizer := autorest.NewBearerAuthorizer(spToken) - - cosmosDbClient := documentdb.NewDatabaseAccountsClientWithBaseURI(environment.ResourceManagerEndpoint, subscriptionID) - cosmosDbClient.Authorizer = authorizer - cosmosDbClient.AddToUserAgent("dataplane mongodb") - - result, err := cosmosDbClient.ListConnectionStrings(context.Background(), resourceGroup, account) - - if err != nil { - return nil, err - } - - connectionStrings := *result.ConnectionStrings - - for _, connectionString := range connectionStrings { - session, err := NewMongoDBClientWithConnectionString(*connectionString.ConnectionString) - - if session != nil && err == nil { - return session, nil - } - } - - return nil, err -} - -// NewMongoDBClientWithMSI returns a MongoDB session to communicate with CosmosDB using MSI. -func NewMongoDBClientWithMSI(subscriptionID, resourceGroup, account string, environment azure.Environment) (*mgo.Session, error) { - - msiEndpoint, err := adal.GetMSIVMEndpoint() - spToken, err := adal.NewServicePrincipalTokenFromMSI(msiEndpoint, environment.ResourceManagerEndpoint) - - if err != nil { - return nil, err - } - - return NewMongoDBClientWithSPToken(spToken, subscriptionID, resourceGroup, account, environment) -} - -// NewMongoDBClient returns a MongoDB session to communicate with CosmosDB. -func NewMongoDBClient(dialInfo *mgo.DialInfo) (*mgo.Session, error) { - - dialInfo.DialServer = func(addr *mgo.ServerAddr) (net.Conn, error) { - return tls.Dial("tcp", addr.String(), &tls.Config{}) - } - - session, err := mgo.DialWithInfo(dialInfo) - - if err != nil { - return nil, err - } - - return session, nil -} diff --git a/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/client.go b/services/databox/mgmt/2019-09-01/databox/client.go similarity index 84% rename from services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/client.go rename to services/databox/mgmt/2019-09-01/databox/client.go index ee2fccaf0732..48425d265a05 100644 --- a/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/client.go +++ b/services/databox/mgmt/2019-09-01/databox/client.go @@ -1,7 +1,7 @@ -// Package devspaces implements the Azure ARM Devspaces service API version 2018-06-01-preview. +// Package databox implements the Azure ARM Databox service API version 2019-09-01. // -// Dev Spaces Client -package devspaces +// +package databox // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,11 +25,11 @@ import ( ) const ( - // DefaultBaseURI is the default URI used for the service Devspaces + // DefaultBaseURI is the default URI used for the service Databox DefaultBaseURI = "https://management.azure.com" ) -// BaseClient is the base client for Devspaces. +// BaseClient is the base client for Databox. type BaseClient struct { autorest.Client BaseURI string diff --git a/services/databox/mgmt/2019-09-01/databox/databoxapi/interfaces.go b/services/databox/mgmt/2019-09-01/databox/databoxapi/interfaces.go new file mode 100644 index 000000000000..6a3e0c9c84da --- /dev/null +++ b/services/databox/mgmt/2019-09-01/databox/databoxapi/interfaces.go @@ -0,0 +1,58 @@ +package databoxapi + +// 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/databox/mgmt/2019-09-01/databox" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result databox.OperationListPage, err error) +} + +var _ OperationsClientAPI = (*databox.OperationsClient)(nil) + +// JobsClientAPI contains the set of methods on the JobsClient type. +type JobsClientAPI interface { + BookShipmentPickUp(ctx context.Context, resourceGroupName string, jobName string, shipmentPickUpRequest databox.ShipmentPickUpRequest) (result databox.ShipmentPickUpResponse, err error) + Cancel(ctx context.Context, resourceGroupName string, jobName string, cancellationReason databox.CancellationReason) (result autorest.Response, err error) + Create(ctx context.Context, resourceGroupName string, jobName string, jobResource databox.JobResource) (result databox.JobsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, jobName string) (result databox.JobsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, jobName string, expand string) (result databox.JobResource, err error) + List(ctx context.Context, skipToken string) (result databox.JobResourceListPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, skipToken string) (result databox.JobResourceListPage, err error) + ListCredentials(ctx context.Context, resourceGroupName string, jobName string) (result databox.UnencryptedCredentialsList, err error) + Update(ctx context.Context, resourceGroupName string, jobName string, jobResourceUpdateParameter databox.JobResourceUpdateParameter, ifMatch string) (result databox.JobsUpdateFuture, err error) +} + +var _ JobsClientAPI = (*databox.JobsClient)(nil) + +// ServiceClientAPI contains the set of methods on the ServiceClient type. +type ServiceClientAPI interface { + ListAvailableSkus(ctx context.Context, location string, availableSkuRequest databox.AvailableSkuRequest) (result databox.AvailableSkusResultPage, err error) + ListAvailableSkusByResourceGroup(ctx context.Context, resourceGroupName string, location string, availableSkuRequest databox.AvailableSkuRequest) (result databox.AvailableSkusResultPage, err error) + RegionConfiguration(ctx context.Context, location string, regionConfigurationRequest databox.RegionConfigurationRequest) (result databox.RegionConfigurationResponse, err error) + ValidateAddressMethod(ctx context.Context, location string, validateAddress databox.ValidateAddress) (result databox.AddressValidationOutput, err error) + ValidateInputs(ctx context.Context, location string, validationRequest databox.BasicValidationRequest) (result databox.ValidationResponse, err error) + ValidateInputsByResourceGroup(ctx context.Context, resourceGroupName string, location string, validationRequest databox.BasicValidationRequest) (result databox.ValidationResponse, err error) +} + +var _ ServiceClientAPI = (*databox.ServiceClient)(nil) diff --git a/services/databox/mgmt/2019-09-01/databox/jobs.go b/services/databox/mgmt/2019-09-01/databox/jobs.go new file mode 100644 index 000000000000..485c00ed6310 --- /dev/null +++ b/services/databox/mgmt/2019-09-01/databox/jobs.go @@ -0,0 +1,922 @@ +package databox + +// 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" +) + +// JobsClient is the client for the Jobs methods of the Databox service. +type JobsClient struct { + BaseClient +} + +// NewJobsClient creates an instance of the JobsClient client. +func NewJobsClient(subscriptionID string) JobsClient { + return NewJobsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewJobsClientWithBaseURI creates an instance of the JobsClient client. +func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient { + return JobsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// BookShipmentPickUp book shipment pick up. +// Parameters: +// resourceGroupName - the Resource Group Name +// jobName - the name of the job Resource within the specified resource group. job names must be between 3 and +// 24 characters in length and use any alphanumeric and underscore only +// shipmentPickUpRequest - details of shipment pick up request. +func (client JobsClient) BookShipmentPickUp(ctx context.Context, resourceGroupName string, jobName string, shipmentPickUpRequest ShipmentPickUpRequest) (result ShipmentPickUpResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.BookShipmentPickUp") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: jobName, + Constraints: []validation.Constraint{{Target: "jobName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "jobName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\.]+$`, Chain: nil}}}, + {TargetValue: shipmentPickUpRequest, + Constraints: []validation.Constraint{{Target: "shipmentPickUpRequest.StartTime", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "shipmentPickUpRequest.EndTime", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "shipmentPickUpRequest.ShipmentLocation", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("databox.JobsClient", "BookShipmentPickUp", err.Error()) + } + + req, err := client.BookShipmentPickUpPreparer(ctx, resourceGroupName, jobName, shipmentPickUpRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "BookShipmentPickUp", nil, "Failure preparing request") + return + } + + resp, err := client.BookShipmentPickUpSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databox.JobsClient", "BookShipmentPickUp", resp, "Failure sending request") + return + } + + result, err = client.BookShipmentPickUpResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "BookShipmentPickUp", resp, "Failure responding to request") + } + + return +} + +// BookShipmentPickUpPreparer prepares the BookShipmentPickUp request. +func (client JobsClient) BookShipmentPickUpPreparer(ctx context.Context, resourceGroupName string, jobName string, shipmentPickUpRequest ShipmentPickUpRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp", pathParameters), + autorest.WithJSON(shipmentPickUpRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BookShipmentPickUpSender sends the BookShipmentPickUp request. The method will close the +// http.Response Body if it receives an error. +func (client JobsClient) BookShipmentPickUpSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// BookShipmentPickUpResponder handles the response to the BookShipmentPickUp request. The method always +// closes the http.Response Body. +func (client JobsClient) BookShipmentPickUpResponder(resp *http.Response) (result ShipmentPickUpResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Cancel cancelJob. +// Parameters: +// resourceGroupName - the Resource Group Name +// jobName - the name of the job Resource within the specified resource group. job names must be between 3 and +// 24 characters in length and use any alphanumeric and underscore only +// cancellationReason - reason for cancellation. +func (client JobsClient) Cancel(ctx context.Context, resourceGroupName string, jobName string, cancellationReason CancellationReason) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.Cancel") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: jobName, + Constraints: []validation.Constraint{{Target: "jobName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "jobName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\.]+$`, Chain: nil}}}, + {TargetValue: cancellationReason, + Constraints: []validation.Constraint{{Target: "cancellationReason.Reason", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("databox.JobsClient", "Cancel", err.Error()) + } + + req, err := client.CancelPreparer(ctx, resourceGroupName, jobName, cancellationReason) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "Cancel", nil, "Failure preparing request") + return + } + + resp, err := client.CancelSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "databox.JobsClient", "Cancel", resp, "Failure sending request") + return + } + + result, err = client.CancelResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "Cancel", resp, "Failure responding to request") + } + + return +} + +// CancelPreparer prepares the Cancel request. +func (client JobsClient) CancelPreparer(ctx context.Context, resourceGroupName string, jobName string, cancellationReason CancellationReason) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel", pathParameters), + autorest.WithJSON(cancellationReason), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSender sends the Cancel request. The method will close the +// http.Response Body if it receives an error. +func (client JobsClient) CancelSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CancelResponder handles the response to the Cancel request. The method always +// closes the http.Response Body. +func (client JobsClient) CancelResponder(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 +} + +// Create creates a new job with the specified parameters. Existing job cannot be updated with this API and should +// instead be updated with the Update job API. +// Parameters: +// resourceGroupName - the Resource Group Name +// jobName - the name of the job Resource within the specified resource group. job names must be between 3 and +// 24 characters in length and use any alphanumeric and underscore only +// jobResource - job details from request body. +func (client JobsClient) Create(ctx context.Context, resourceGroupName string, jobName string, jobResource JobResource) (result JobsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.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: jobName, + Constraints: []validation.Constraint{{Target: "jobName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "jobName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\.]+$`, Chain: nil}}}, + {TargetValue: jobResource, + Constraints: []validation.Constraint{{Target: "jobResource.JobProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "jobResource.JobProperties.Details", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "jobResource.JobProperties.Details.ContactDetails", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "jobResource.JobProperties.Details.ContactDetails.ContactName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "jobResource.JobProperties.Details.ContactDetails.Phone", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "jobResource.JobProperties.Details.ContactDetails.EmailList", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "jobResource.JobProperties.Details.ShippingAddress", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "jobResource.JobProperties.Details.ShippingAddress.StreetAddress1", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "jobResource.JobProperties.Details.ShippingAddress.Country", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "jobResource.JobProperties.Details.ShippingAddress.PostalCode", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "jobResource.JobProperties.Details.DestinationAccountDetails", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("databox.JobsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, jobName, jobResource) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client JobsClient) CreatePreparer(ctx context.Context, resourceGroupName string, jobName string, jobResource JobResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + jobResource.Name = nil + jobResource.ID = nil + jobResource.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.DataBox/jobs/{jobName}", pathParameters), + autorest.WithJSON(jobResource), + 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 JobsClient) CreateSender(req *http.Request) (future JobsCreateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 JobsClient) CreateResponder(resp *http.Response) (result JobResource, 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 +} + +// Delete deletes a job. +// Parameters: +// resourceGroupName - the Resource Group Name +// jobName - the name of the job Resource within the specified resource group. job names must be between 3 and +// 24 characters in length and use any alphanumeric and underscore only +func (client JobsClient) Delete(ctx context.Context, resourceGroupName string, jobName string) (result JobsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.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: jobName, + Constraints: []validation.Constraint{{Target: "jobName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "jobName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\.]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("databox.JobsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client JobsClient) DeletePreparer(ctx context.Context, resourceGroupName string, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}", 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 JobsClient) DeleteSender(req *http.Request) (future JobsDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 JobsClient) 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 information about the specified job. +// Parameters: +// resourceGroupName - the Resource Group Name +// jobName - the name of the job Resource within the specified resource group. job names must be between 3 and +// 24 characters in length and use any alphanumeric and underscore only +// expand - $expand is supported on details parameter for job, which provides details on the job stages. +func (client JobsClient) Get(ctx context.Context, resourceGroupName string, jobName string, expand string) (result JobResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.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: jobName, + Constraints: []validation.Constraint{{Target: "jobName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "jobName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\.]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("databox.JobsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, jobName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databox.JobsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client JobsClient) GetPreparer(ctx context.Context, resourceGroupName string, jobName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-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.DataBox/jobs/{jobName}", 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 JobsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client JobsClient) GetResponder(resp *http.Response) (result JobResource, 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 jobs available under the subscription. +// Parameters: +// skipToken - $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. +func (client JobsClient) List(ctx context.Context, skipToken string) (result JobResourceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.List") + defer func() { + sc := -1 + if result.jrl.Response.Response != nil { + sc = result.jrl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.jrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databox.JobsClient", "List", resp, "Failure sending request") + return + } + + result.jrl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client JobsClient) ListPreparer(ctx context.Context, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-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.DataBox/jobs", 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 JobsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client JobsClient) ListResponder(resp *http.Response) (result JobResourceList, 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 JobsClient) listNextResults(ctx context.Context, lastResults JobResourceList) (result JobResourceList, err error) { + req, err := lastResults.jobResourceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databox.JobsClient", "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, "databox.JobsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client JobsClient) ListComplete(ctx context.Context, skipToken string) (result JobResourceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.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, skipToken) + return +} + +// ListByResourceGroup lists all the jobs available under the given resource group. +// Parameters: +// resourceGroupName - the Resource Group Name +// skipToken - $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. +func (client JobsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, skipToken string) (result JobResourceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.jrl.Response.Response != nil { + sc = result.jrl.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, "databox.JobsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.jrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databox.JobsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.jrl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client JobsClient) 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 = "2019-09-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.DataBox/jobs", 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 JobsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client JobsClient) ListByResourceGroupResponder(resp *http.Response) (result JobResourceList, 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 JobsClient) listByResourceGroupNextResults(ctx context.Context, lastResults JobResourceList) (result JobResourceList, err error) { + req, err := lastResults.jobResourceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databox.JobsClient", "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, "databox.JobsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client JobsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, skipToken string) (result JobResourceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.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 +} + +// ListCredentials this method gets the unencrypted secrets related to the job. +// Parameters: +// resourceGroupName - the Resource Group Name +// jobName - the name of the job Resource within the specified resource group. job names must be between 3 and +// 24 characters in length and use any alphanumeric and underscore only +func (client JobsClient) ListCredentials(ctx context.Context, resourceGroupName string, jobName string) (result UnencryptedCredentialsList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.ListCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: jobName, + Constraints: []validation.Constraint{{Target: "jobName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "jobName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\.]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("databox.JobsClient", "ListCredentials", err.Error()) + } + + req, err := client.ListCredentialsPreparer(ctx, resourceGroupName, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "ListCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databox.JobsClient", "ListCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "ListCredentials", resp, "Failure responding to request") + } + + return +} + +// ListCredentialsPreparer prepares the ListCredentials request. +func (client JobsClient) ListCredentialsPreparer(ctx context.Context, resourceGroupName string, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCredentialsSender sends the ListCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client JobsClient) ListCredentialsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListCredentialsResponder handles the response to the ListCredentials request. The method always +// closes the http.Response Body. +func (client JobsClient) ListCredentialsResponder(resp *http.Response) (result UnencryptedCredentialsList, 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 properties of an existing job. +// Parameters: +// resourceGroupName - the Resource Group Name +// jobName - the name of the job Resource within the specified resource group. job names must be between 3 and +// 24 characters in length and use any alphanumeric and underscore only +// jobResourceUpdateParameter - job update parameters from request body. +// ifMatch - defines the If-Match condition. The patch will be performed only if the ETag of the job on the +// server matches this value. +func (client JobsClient) Update(ctx context.Context, resourceGroupName string, jobName string, jobResourceUpdateParameter JobResourceUpdateParameter, ifMatch string) (result JobsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.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: jobName, + Constraints: []validation.Constraint{{Target: "jobName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "jobName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\.]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("databox.JobsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, jobName, jobResourceUpdateParameter, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client JobsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, jobName string, jobResourceUpdateParameter JobResourceUpdateParameter, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}", pathParameters), + autorest.WithJSON(jobResourceUpdateParameter), + 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)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client JobsClient) UpdateSender(req *http.Request) (future JobsUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 JobsClient) UpdateResponder(resp *http.Response) (result JobResource, 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/databox/mgmt/2019-09-01/databox/models.go b/services/databox/mgmt/2019-09-01/databox/models.go new file mode 100644 index 000000000000..31c896fda21d --- /dev/null +++ b/services/databox/mgmt/2019-09-01/databox/models.go @@ -0,0 +1,5220 @@ +package databox + +// 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/databox/mgmt/2019-09-01/databox" + +// AccessProtocol enumerates the values for access protocol. +type AccessProtocol string + +const ( + // NFS Network File System protocol(NFS). + NFS AccessProtocol = "NFS" + // SMB Server Message Block protocol(SMB). + SMB AccessProtocol = "SMB" +) + +// PossibleAccessProtocolValues returns an array of possible values for the AccessProtocol const type. +func PossibleAccessProtocolValues() []AccessProtocol { + return []AccessProtocol{NFS, SMB} +} + +// AddressType enumerates the values for address type. +type AddressType string + +const ( + // Commercial Commercial Address. + Commercial AddressType = "Commercial" + // None Address type not known. + None AddressType = "None" + // Residential Residential Address. + Residential AddressType = "Residential" +) + +// PossibleAddressTypeValues returns an array of possible values for the AddressType const type. +func PossibleAddressTypeValues() []AddressType { + return []AddressType{Commercial, None, Residential} +} + +// AddressValidationStatus enumerates the values for address validation status. +type AddressValidationStatus string + +const ( + // Ambiguous Address provided is ambiguous, please choose one of the alternate addresses returned. + Ambiguous AddressValidationStatus = "Ambiguous" + // Invalid Address provided is invalid or not supported. + Invalid AddressValidationStatus = "Invalid" + // Valid Address provided is valid. + Valid AddressValidationStatus = "Valid" +) + +// PossibleAddressValidationStatusValues returns an array of possible values for the AddressValidationStatus const type. +func PossibleAddressValidationStatusValues() []AddressValidationStatus { + return []AddressValidationStatus{Ambiguous, Invalid, Valid} +} + +// CopyLogDetailsType enumerates the values for copy log details type. +type CopyLogDetailsType string + +const ( + // CopyLogDetailsTypeCopyLogDetails ... + CopyLogDetailsTypeCopyLogDetails CopyLogDetailsType = "CopyLogDetails" + // CopyLogDetailsTypeDataBox ... + CopyLogDetailsTypeDataBox CopyLogDetailsType = "DataBox" + // CopyLogDetailsTypeDataBoxDisk ... + CopyLogDetailsTypeDataBoxDisk CopyLogDetailsType = "DataBoxDisk" + // CopyLogDetailsTypeDataBoxHeavy ... + CopyLogDetailsTypeDataBoxHeavy CopyLogDetailsType = "DataBoxHeavy" +) + +// PossibleCopyLogDetailsTypeValues returns an array of possible values for the CopyLogDetailsType const type. +func PossibleCopyLogDetailsTypeValues() []CopyLogDetailsType { + return []CopyLogDetailsType{CopyLogDetailsTypeCopyLogDetails, CopyLogDetailsTypeDataBox, CopyLogDetailsTypeDataBoxDisk, CopyLogDetailsTypeDataBoxHeavy} +} + +// CopyStatus enumerates the values for copy status. +type CopyStatus string + +const ( + // Completed Data copy completed. + Completed CopyStatus = "Completed" + // CompletedWithErrors Data copy completed with errors. + CompletedWithErrors CopyStatus = "CompletedWithErrors" + // DeviceFormatted Data copy failed. The Device was formatted by user. + DeviceFormatted CopyStatus = "DeviceFormatted" + // DeviceMetadataModified Data copy failed. Device metadata was modified by user. + DeviceMetadataModified CopyStatus = "DeviceMetadataModified" + // Failed Data copy failed. No data was copied. + Failed CopyStatus = "Failed" + // HardwareError The Device has hit hardware issues. + HardwareError CopyStatus = "HardwareError" + // InProgress Data copy is in progress. + InProgress CopyStatus = "InProgress" + // NotReturned No copy triggered as device was not returned. + NotReturned CopyStatus = "NotReturned" + // NotStarted Data copy hasn't started yet. + NotStarted CopyStatus = "NotStarted" + // StorageAccountNotAccessible Data copy failed. Storage Account was not accessible during copy. + StorageAccountNotAccessible CopyStatus = "StorageAccountNotAccessible" + // UnsupportedData Data copy failed. The Device data content is not supported. + UnsupportedData CopyStatus = "UnsupportedData" +) + +// PossibleCopyStatusValues returns an array of possible values for the CopyStatus const type. +func PossibleCopyStatusValues() []CopyStatus { + return []CopyStatus{Completed, CompletedWithErrors, DeviceFormatted, DeviceMetadataModified, Failed, HardwareError, InProgress, NotReturned, NotStarted, StorageAccountNotAccessible, UnsupportedData} +} + +// DataDestinationType enumerates the values for data destination type. +type DataDestinationType string + +const ( + // ManagedDisk Azure Managed disk storage. + ManagedDisk DataDestinationType = "ManagedDisk" + // StorageAccount Storage Accounts . + StorageAccount DataDestinationType = "StorageAccount" +) + +// PossibleDataDestinationTypeValues returns an array of possible values for the DataDestinationType const type. +func PossibleDataDestinationTypeValues() []DataDestinationType { + return []DataDestinationType{ManagedDisk, StorageAccount} +} + +// DataDestinationTypeBasicDestinationAccountDetails enumerates the values for data destination type basic +// destination account details. +type DataDestinationTypeBasicDestinationAccountDetails string + +const ( + // DataDestinationTypeDestinationAccountDetails ... + DataDestinationTypeDestinationAccountDetails DataDestinationTypeBasicDestinationAccountDetails = "DestinationAccountDetails" + // DataDestinationTypeManagedDisk ... + DataDestinationTypeManagedDisk DataDestinationTypeBasicDestinationAccountDetails = "ManagedDisk" + // DataDestinationTypeStorageAccount ... + DataDestinationTypeStorageAccount DataDestinationTypeBasicDestinationAccountDetails = "StorageAccount" +) + +// PossibleDataDestinationTypeBasicDestinationAccountDetailsValues returns an array of possible values for the DataDestinationTypeBasicDestinationAccountDetails const type. +func PossibleDataDestinationTypeBasicDestinationAccountDetailsValues() []DataDestinationTypeBasicDestinationAccountDetails { + return []DataDestinationTypeBasicDestinationAccountDetails{DataDestinationTypeDestinationAccountDetails, DataDestinationTypeManagedDisk, DataDestinationTypeStorageAccount} +} + +// JobDeliveryType enumerates the values for job delivery type. +type JobDeliveryType string + +const ( + // NonScheduled Non Scheduled job. + NonScheduled JobDeliveryType = "NonScheduled" + // Scheduled Scheduled job. + Scheduled JobDeliveryType = "Scheduled" +) + +// PossibleJobDeliveryTypeValues returns an array of possible values for the JobDeliveryType const type. +func PossibleJobDeliveryTypeValues() []JobDeliveryType { + return []JobDeliveryType{NonScheduled, Scheduled} +} + +// JobDetailsTypeEnum enumerates the values for job details type enum. +type JobDetailsTypeEnum string + +const ( + // JobDetailsTypeDataBox ... + JobDetailsTypeDataBox JobDetailsTypeEnum = "DataBox" + // JobDetailsTypeDataBoxDisk ... + JobDetailsTypeDataBoxDisk JobDetailsTypeEnum = "DataBoxDisk" + // JobDetailsTypeDataBoxHeavy ... + JobDetailsTypeDataBoxHeavy JobDetailsTypeEnum = "DataBoxHeavy" + // JobDetailsTypeJobDetails ... + JobDetailsTypeJobDetails JobDetailsTypeEnum = "JobDetails" +) + +// PossibleJobDetailsTypeEnumValues returns an array of possible values for the JobDetailsTypeEnum const type. +func PossibleJobDetailsTypeEnumValues() []JobDetailsTypeEnum { + return []JobDetailsTypeEnum{JobDetailsTypeDataBox, JobDetailsTypeDataBoxDisk, JobDetailsTypeDataBoxHeavy, JobDetailsTypeJobDetails} +} + +// JobSecretsTypeEnum enumerates the values for job secrets type enum. +type JobSecretsTypeEnum string + +const ( + // JobSecretsTypeDataBox ... + JobSecretsTypeDataBox JobSecretsTypeEnum = "DataBox" + // JobSecretsTypeDataBoxDisk ... + JobSecretsTypeDataBoxDisk JobSecretsTypeEnum = "DataBoxDisk" + // JobSecretsTypeDataBoxHeavy ... + JobSecretsTypeDataBoxHeavy JobSecretsTypeEnum = "DataBoxHeavy" + // JobSecretsTypeJobSecrets ... + JobSecretsTypeJobSecrets JobSecretsTypeEnum = "JobSecrets" +) + +// PossibleJobSecretsTypeEnumValues returns an array of possible values for the JobSecretsTypeEnum const type. +func PossibleJobSecretsTypeEnumValues() []JobSecretsTypeEnum { + return []JobSecretsTypeEnum{JobSecretsTypeDataBox, JobSecretsTypeDataBoxDisk, JobSecretsTypeDataBoxHeavy, JobSecretsTypeJobSecrets} +} + +// NotificationStageName enumerates the values for notification stage name. +type NotificationStageName string + +const ( + // AtAzureDC Notification at device received at azure datacenter stage. + AtAzureDC NotificationStageName = "AtAzureDC" + // DataCopy Notification at data copy started stage. + DataCopy NotificationStageName = "DataCopy" + // Delivered Notification at device delivered stage. + Delivered NotificationStageName = "Delivered" + // DevicePrepared Notification at device prepared stage. + DevicePrepared NotificationStageName = "DevicePrepared" + // Dispatched Notification at device dispatched stage. + Dispatched NotificationStageName = "Dispatched" + // PickedUp Notification at device picked up from user stage. + PickedUp NotificationStageName = "PickedUp" +) + +// PossibleNotificationStageNameValues returns an array of possible values for the NotificationStageName const type. +func PossibleNotificationStageNameValues() []NotificationStageName { + return []NotificationStageName{AtAzureDC, DataCopy, Delivered, DevicePrepared, Dispatched, PickedUp} +} + +// OverallValidationStatus enumerates the values for overall validation status. +type OverallValidationStatus string + +const ( + // AllValidToProceed Every input request is valid. + AllValidToProceed OverallValidationStatus = "AllValidToProceed" + // CertainInputValidationsSkipped Certain input validations skipped. + CertainInputValidationsSkipped OverallValidationStatus = "CertainInputValidationsSkipped" + // InputsRevisitRequired Some input requests are not valid. + InputsRevisitRequired OverallValidationStatus = "InputsRevisitRequired" +) + +// PossibleOverallValidationStatusValues returns an array of possible values for the OverallValidationStatus const type. +func PossibleOverallValidationStatusValues() []OverallValidationStatus { + return []OverallValidationStatus{AllValidToProceed, CertainInputValidationsSkipped, InputsRevisitRequired} +} + +// ShareDestinationFormatType enumerates the values for share destination format type. +type ShareDestinationFormatType string + +const ( + // ShareDestinationFormatTypeAzureFile Azure storage file format. + ShareDestinationFormatTypeAzureFile ShareDestinationFormatType = "AzureFile" + // ShareDestinationFormatTypeBlockBlob Azure storage block blob format. + ShareDestinationFormatTypeBlockBlob ShareDestinationFormatType = "BlockBlob" + // ShareDestinationFormatTypeHCS Storsimple data format. + ShareDestinationFormatTypeHCS ShareDestinationFormatType = "HCS" + // ShareDestinationFormatTypeManagedDisk Azure Compute Disk. + ShareDestinationFormatTypeManagedDisk ShareDestinationFormatType = "ManagedDisk" + // ShareDestinationFormatTypePageBlob Azure storage page blob format. + ShareDestinationFormatTypePageBlob ShareDestinationFormatType = "PageBlob" + // ShareDestinationFormatTypeUnknownType Unknown format. + ShareDestinationFormatTypeUnknownType ShareDestinationFormatType = "UnknownType" +) + +// PossibleShareDestinationFormatTypeValues returns an array of possible values for the ShareDestinationFormatType const type. +func PossibleShareDestinationFormatTypeValues() []ShareDestinationFormatType { + return []ShareDestinationFormatType{ShareDestinationFormatTypeAzureFile, ShareDestinationFormatTypeBlockBlob, ShareDestinationFormatTypeHCS, ShareDestinationFormatTypeManagedDisk, ShareDestinationFormatTypePageBlob, ShareDestinationFormatTypeUnknownType} +} + +// SkuDisabledReason enumerates the values for sku disabled reason. +type SkuDisabledReason string + +const ( + // SkuDisabledReasonCountry SKU is not available in the requested country. + SkuDisabledReasonCountry SkuDisabledReason = "Country" + // SkuDisabledReasonFeature Required features are not enabled for the SKU. + SkuDisabledReasonFeature SkuDisabledReason = "Feature" + // SkuDisabledReasonNone SKU is not disabled. + SkuDisabledReasonNone SkuDisabledReason = "None" + // SkuDisabledReasonNoSubscriptionInfo Subscription has not registered to Microsoft.DataBox and Service + // does not have the subscription notification. + SkuDisabledReasonNoSubscriptionInfo SkuDisabledReason = "NoSubscriptionInfo" + // SkuDisabledReasonOfferType Subscription does not have required offer types for the SKU. + SkuDisabledReasonOfferType SkuDisabledReason = "OfferType" + // SkuDisabledReasonRegion SKU is not available to push data to the requested Azure region. + SkuDisabledReasonRegion SkuDisabledReason = "Region" +) + +// PossibleSkuDisabledReasonValues returns an array of possible values for the SkuDisabledReason const type. +func PossibleSkuDisabledReasonValues() []SkuDisabledReason { + return []SkuDisabledReason{SkuDisabledReasonCountry, SkuDisabledReasonFeature, SkuDisabledReasonNone, SkuDisabledReasonNoSubscriptionInfo, SkuDisabledReasonOfferType, SkuDisabledReasonRegion} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // DataBox Databox. + DataBox SkuName = "DataBox" + // DataBoxDisk DataboxDisk. + DataBoxDisk SkuName = "DataBoxDisk" + // DataBoxHeavy DataboxHeavy. + DataBoxHeavy SkuName = "DataBoxHeavy" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{DataBox, DataBoxDisk, DataBoxHeavy} +} + +// SkuNameBasicScheduleAvailabilityRequest enumerates the values for sku name basic schedule availability +// request. +type SkuNameBasicScheduleAvailabilityRequest string + +const ( + // SkuNameDataBox ... + SkuNameDataBox SkuNameBasicScheduleAvailabilityRequest = "DataBox" + // SkuNameDataBoxDisk ... + SkuNameDataBoxDisk SkuNameBasicScheduleAvailabilityRequest = "DataBoxDisk" + // SkuNameDataBoxHeavy ... + SkuNameDataBoxHeavy SkuNameBasicScheduleAvailabilityRequest = "DataBoxHeavy" + // SkuNameScheduleAvailabilityRequest ... + SkuNameScheduleAvailabilityRequest SkuNameBasicScheduleAvailabilityRequest = "ScheduleAvailabilityRequest" +) + +// PossibleSkuNameBasicScheduleAvailabilityRequestValues returns an array of possible values for the SkuNameBasicScheduleAvailabilityRequest const type. +func PossibleSkuNameBasicScheduleAvailabilityRequestValues() []SkuNameBasicScheduleAvailabilityRequest { + return []SkuNameBasicScheduleAvailabilityRequest{SkuNameDataBox, SkuNameDataBoxDisk, SkuNameDataBoxHeavy, SkuNameScheduleAvailabilityRequest} +} + +// StageName enumerates the values for stage name. +type StageName string + +const ( + // StageNameAborted Order has been aborted. + StageNameAborted StageName = "Aborted" + // StageNameAtAzureDC Device has been received at azure datacenter from the user. + StageNameAtAzureDC StageName = "AtAzureDC" + // StageNameCancelled Order has been cancelled. + StageNameCancelled StageName = "Cancelled" + // StageNameCompleted Order has completed. + StageNameCompleted StageName = "Completed" + // StageNameCompletedWithErrors Order has completed with errors. + StageNameCompletedWithErrors StageName = "CompletedWithErrors" + // StageNameCompletedWithWarnings Order has completed with warnings. + StageNameCompletedWithWarnings StageName = "CompletedWithWarnings" + // StageNameDataCopy Data copy from the device at azure datacenter. + StageNameDataCopy StageName = "DataCopy" + // StageNameDelivered Device has been delivered to the user of the order. + StageNameDelivered StageName = "Delivered" + // StageNameDeviceOrdered An order has been created. + StageNameDeviceOrdered StageName = "DeviceOrdered" + // StageNameDevicePrepared A device has been prepared for the order. + StageNameDevicePrepared StageName = "DevicePrepared" + // StageNameDispatched Device has been dispatched to the user of the order. + StageNameDispatched StageName = "Dispatched" + // StageNameFailedIssueDetectedAtAzureDC Order has failed due to issue detected at azure datacenter. + StageNameFailedIssueDetectedAtAzureDC StageName = "Failed_IssueDetectedAtAzureDC" + // StageNameFailedIssueReportedAtCustomer Order has failed due to issue reported by user. + StageNameFailedIssueReportedAtCustomer StageName = "Failed_IssueReportedAtCustomer" + // StageNamePickedUp Device has been picked up from user and in transit to azure datacenter. + StageNamePickedUp StageName = "PickedUp" + // StageNameReadyToDispatchFromAzureDC Device is ready to be handed to customer from Azure DC. + StageNameReadyToDispatchFromAzureDC StageName = "ReadyToDispatchFromAzureDC" + // StageNameReadyToReceiveAtAzureDC Device can be dropped off at Azure DC. + StageNameReadyToReceiveAtAzureDC StageName = "ReadyToReceiveAtAzureDC" +) + +// PossibleStageNameValues returns an array of possible values for the StageName const type. +func PossibleStageNameValues() []StageName { + return []StageName{StageNameAborted, StageNameAtAzureDC, StageNameCancelled, StageNameCompleted, StageNameCompletedWithErrors, StageNameCompletedWithWarnings, StageNameDataCopy, StageNameDelivered, StageNameDeviceOrdered, StageNameDevicePrepared, StageNameDispatched, StageNameFailedIssueDetectedAtAzureDC, StageNameFailedIssueReportedAtCustomer, StageNamePickedUp, StageNameReadyToDispatchFromAzureDC, StageNameReadyToReceiveAtAzureDC} +} + +// StageStatus enumerates the values for stage status. +type StageStatus string + +const ( + // StageStatusCancelled Stage has been cancelled. + StageStatusCancelled StageStatus = "Cancelled" + // StageStatusCancelling Stage is cancelling. + StageStatusCancelling StageStatus = "Cancelling" + // StageStatusFailed Stage has failed. + StageStatusFailed StageStatus = "Failed" + // StageStatusInProgress Stage is in progress. + StageStatusInProgress StageStatus = "InProgress" + // StageStatusNone No status available yet. + StageStatusNone StageStatus = "None" + // StageStatusSucceeded Stage has succeeded. + StageStatusSucceeded StageStatus = "Succeeded" + // StageStatusSucceededWithErrors Stage has succeeded with errors. + StageStatusSucceededWithErrors StageStatus = "SucceededWithErrors" +) + +// PossibleStageStatusValues returns an array of possible values for the StageStatus const type. +func PossibleStageStatusValues() []StageStatus { + return []StageStatus{StageStatusCancelled, StageStatusCancelling, StageStatusFailed, StageStatusInProgress, StageStatusNone, StageStatusSucceeded, StageStatusSucceededWithErrors} +} + +// TransportShipmentTypes enumerates the values for transport shipment types. +type TransportShipmentTypes string + +const ( + // CustomerManaged Shipment Logistics is handled by the customer. + CustomerManaged TransportShipmentTypes = "CustomerManaged" + // MicrosoftManaged Shipment Logistics is handled by Microsoft. + MicrosoftManaged TransportShipmentTypes = "MicrosoftManaged" +) + +// PossibleTransportShipmentTypesValues returns an array of possible values for the TransportShipmentTypes const type. +func PossibleTransportShipmentTypesValues() []TransportShipmentTypes { + return []TransportShipmentTypes{CustomerManaged, MicrosoftManaged} +} + +// ValidationCategory enumerates the values for validation category. +type ValidationCategory string + +const ( + // ValidationCategoryJobCreationValidation ... + ValidationCategoryJobCreationValidation ValidationCategory = "JobCreationValidation" + // ValidationCategoryValidationRequest ... + ValidationCategoryValidationRequest ValidationCategory = "ValidationRequest" +) + +// PossibleValidationCategoryValues returns an array of possible values for the ValidationCategory const type. +func PossibleValidationCategoryValues() []ValidationCategory { + return []ValidationCategory{ValidationCategoryJobCreationValidation, ValidationCategoryValidationRequest} +} + +// ValidationStatus enumerates the values for validation status. +type ValidationStatus string + +const ( + // ValidationStatusInvalid Validation is not successful + ValidationStatusInvalid ValidationStatus = "Invalid" + // ValidationStatusSkipped Validation is skipped + ValidationStatusSkipped ValidationStatus = "Skipped" + // ValidationStatusValid Validation is successful + ValidationStatusValid ValidationStatus = "Valid" +) + +// PossibleValidationStatusValues returns an array of possible values for the ValidationStatus const type. +func PossibleValidationStatusValues() []ValidationStatus { + return []ValidationStatus{ValidationStatusInvalid, ValidationStatusSkipped, ValidationStatusValid} +} + +// ValidationType enumerates the values for validation type. +type ValidationType string + +const ( + // ValidationTypeValidateAddress ... + ValidationTypeValidateAddress ValidationType = "ValidateAddress" + // ValidationTypeValidateCreateOrderLimit ... + ValidationTypeValidateCreateOrderLimit ValidationType = "ValidateCreateOrderLimit" + // ValidationTypeValidateDataDestinationDetails ... + ValidationTypeValidateDataDestinationDetails ValidationType = "ValidateDataDestinationDetails" + // ValidationTypeValidatePreferences ... + ValidationTypeValidatePreferences ValidationType = "ValidatePreferences" + // ValidationTypeValidateSkuAvailability ... + ValidationTypeValidateSkuAvailability ValidationType = "ValidateSkuAvailability" + // ValidationTypeValidateSubscriptionIsAllowedToCreateJob ... + ValidationTypeValidateSubscriptionIsAllowedToCreateJob ValidationType = "ValidateSubscriptionIsAllowedToCreateJob" + // ValidationTypeValidationInputRequest ... + ValidationTypeValidationInputRequest ValidationType = "ValidationInputRequest" +) + +// PossibleValidationTypeValues returns an array of possible values for the ValidationType const type. +func PossibleValidationTypeValues() []ValidationType { + return []ValidationType{ValidationTypeValidateAddress, ValidationTypeValidateCreateOrderLimit, ValidationTypeValidateDataDestinationDetails, ValidationTypeValidatePreferences, ValidationTypeValidateSkuAvailability, ValidationTypeValidateSubscriptionIsAllowedToCreateJob, ValidationTypeValidationInputRequest} +} + +// ValidationTypeBasicValidationInputResponse enumerates the values for validation type basic validation input +// response. +type ValidationTypeBasicValidationInputResponse string + +const ( + // ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress ... + ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress ValidationTypeBasicValidationInputResponse = "ValidateAddress" + // ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit ... + ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit ValidationTypeBasicValidationInputResponse = "ValidateCreateOrderLimit" + // ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails ... + ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails ValidationTypeBasicValidationInputResponse = "ValidateDataDestinationDetails" + // ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences ... + ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences ValidationTypeBasicValidationInputResponse = "ValidatePreferences" + // ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability ... + ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability ValidationTypeBasicValidationInputResponse = "ValidateSkuAvailability" + // ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob ... + ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob ValidationTypeBasicValidationInputResponse = "ValidateSubscriptionIsAllowedToCreateJob" + // ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse ... + ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse ValidationTypeBasicValidationInputResponse = "ValidationInputResponse" +) + +// PossibleValidationTypeBasicValidationInputResponseValues returns an array of possible values for the ValidationTypeBasicValidationInputResponse const type. +func PossibleValidationTypeBasicValidationInputResponseValues() []ValidationTypeBasicValidationInputResponse { + return []ValidationTypeBasicValidationInputResponse{ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress, ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit, ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails, ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences, ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability, ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob, ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse} +} + +// AccountCopyLogDetails copy log details for a storage account of a DataBox job +type AccountCopyLogDetails struct { + // AccountName - READ-ONLY; Destination account name. + AccountName *string `json:"accountName,omitempty"` + // CopyLogLink - READ-ONLY; Link for copy logs. + CopyLogLink *string `json:"copyLogLink,omitempty"` + // CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypeDataBox', 'CopyLogDetailsTypeDataBoxDisk', 'CopyLogDetailsTypeDataBoxHeavy' + CopyLogDetailsType CopyLogDetailsType `json:"copyLogDetailsType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AccountCopyLogDetails. +func (acld AccountCopyLogDetails) MarshalJSON() ([]byte, error) { + acld.CopyLogDetailsType = CopyLogDetailsTypeDataBox + objectMap := make(map[string]interface{}) + if acld.CopyLogDetailsType != "" { + objectMap["copyLogDetailsType"] = acld.CopyLogDetailsType + } + return json.Marshal(objectMap) +} + +// AsAccountCopyLogDetails is the BasicCopyLogDetails implementation for AccountCopyLogDetails. +func (acld AccountCopyLogDetails) AsAccountCopyLogDetails() (*AccountCopyLogDetails, bool) { + return &acld, true +} + +// AsDiskCopyLogDetails is the BasicCopyLogDetails implementation for AccountCopyLogDetails. +func (acld AccountCopyLogDetails) AsDiskCopyLogDetails() (*DiskCopyLogDetails, bool) { + return nil, false +} + +// AsHeavyAccountCopyLogDetails is the BasicCopyLogDetails implementation for AccountCopyLogDetails. +func (acld AccountCopyLogDetails) AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool) { + return nil, false +} + +// AsCopyLogDetails is the BasicCopyLogDetails implementation for AccountCopyLogDetails. +func (acld AccountCopyLogDetails) AsCopyLogDetails() (*CopyLogDetails, bool) { + return nil, false +} + +// AsBasicCopyLogDetails is the BasicCopyLogDetails implementation for AccountCopyLogDetails. +func (acld AccountCopyLogDetails) AsBasicCopyLogDetails() (BasicCopyLogDetails, bool) { + return &acld, true +} + +// AccountCredentialDetails credential details of the account. +type AccountCredentialDetails struct { + // AccountName - READ-ONLY; Name of the account. + AccountName *string `json:"accountName,omitempty"` + // DataDestinationType - READ-ONLY; Data Destination Type. Possible values include: 'StorageAccount', 'ManagedDisk' + DataDestinationType DataDestinationType `json:"dataDestinationType,omitempty"` + // AccountConnectionString - READ-ONLY; Connection string of the account endpoint to use the account as a storage endpoint on the device. + AccountConnectionString *string `json:"accountConnectionString,omitempty"` + // ShareCredentialDetails - READ-ONLY; Per share level unencrypted access credentials. + ShareCredentialDetails *[]ShareCredentialDetails `json:"shareCredentialDetails,omitempty"` +} + +// AddressValidationOutput output of the address validation api. +type AddressValidationOutput struct { + autorest.Response `json:"-"` + // AddressValidationProperties - READ-ONLY; The address validation properties. + *AddressValidationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AddressValidationOutput. +func (avo AddressValidationOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AddressValidationOutput struct. +func (avo *AddressValidationOutput) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var addressValidationProperties AddressValidationProperties + err = json.Unmarshal(*v, &addressValidationProperties) + if err != nil { + return err + } + avo.AddressValidationProperties = &addressValidationProperties + } + } + } + + return nil +} + +// AddressValidationProperties the address validation output. +type AddressValidationProperties struct { + // ValidationStatus - READ-ONLY; The address validation status. Possible values include: 'Valid', 'Invalid', 'Ambiguous' + ValidationStatus AddressValidationStatus `json:"validationStatus,omitempty"` + // AlternateAddresses - READ-ONLY; List of alternate addresses. + AlternateAddresses *[]ShippingAddress `json:"alternateAddresses,omitempty"` + // Error - READ-ONLY; Error code and message of validation response. + Error *Error `json:"error,omitempty"` + // ValidationType - Possible values include: 'ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails', 'ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob' + ValidationType ValidationTypeBasicValidationInputResponse `json:"validationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AddressValidationProperties. +func (avp AddressValidationProperties) MarshalJSON() ([]byte, error) { + avp.ValidationType = ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress + objectMap := make(map[string]interface{}) + if avp.ValidationType != "" { + objectMap["validationType"] = avp.ValidationType + } + return json.Marshal(objectMap) +} + +// AsAddressValidationProperties is the BasicValidationInputResponse implementation for AddressValidationProperties. +func (avp AddressValidationProperties) AsAddressValidationProperties() (*AddressValidationProperties, bool) { + return &avp, true +} + +// AsCreateOrderLimitForSubscriptionValidationResponseProperties is the BasicValidationInputResponse implementation for AddressValidationProperties. +func (avp AddressValidationProperties) AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) { + return nil, false +} + +// AsDataDestinationDetailsValidationResponseProperties is the BasicValidationInputResponse implementation for AddressValidationProperties. +func (avp AddressValidationProperties) AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) { + return nil, false +} + +// AsPreferencesValidationResponseProperties is the BasicValidationInputResponse implementation for AddressValidationProperties. +func (avp AddressValidationProperties) AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) { + return nil, false +} + +// AsSkuAvailabilityValidationResponseProperties is the BasicValidationInputResponse implementation for AddressValidationProperties. +func (avp AddressValidationProperties) AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) { + return nil, false +} + +// AsSubscriptionIsAllowedToCreateJobValidationResponseProperties is the BasicValidationInputResponse implementation for AddressValidationProperties. +func (avp AddressValidationProperties) AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) { + return nil, false +} + +// AsValidationInputResponse is the BasicValidationInputResponse implementation for AddressValidationProperties. +func (avp AddressValidationProperties) AsValidationInputResponse() (*ValidationInputResponse, bool) { + return nil, false +} + +// AsBasicValidationInputResponse is the BasicValidationInputResponse implementation for AddressValidationProperties. +func (avp AddressValidationProperties) AsBasicValidationInputResponse() (BasicValidationInputResponse, bool) { + return &avp, true +} + +// ApplianceNetworkConfiguration the Network Adapter configuration of a DataBox. +type ApplianceNetworkConfiguration struct { + // Name - READ-ONLY; Name of the network. + Name *string `json:"name,omitempty"` + // MacAddress - READ-ONLY; Mac Address. + MacAddress *string `json:"macAddress,omitempty"` +} + +// ArmBaseObject base class for all objects under resource. +type ArmBaseObject struct { + // Name - READ-ONLY; Name of the object. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; Id of the object. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; Type of the object. + Type *string `json:"type,omitempty"` +} + +// AvailableSkuRequest the filters for showing the available skus. +type AvailableSkuRequest struct { + // TransferType - Type of the transfer. + TransferType *string `json:"transferType,omitempty"` + // Country - ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + Country *string `json:"country,omitempty"` + // Location - Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + Location *string `json:"location,omitempty"` + // SkuNames - Sku Names to filter for available skus + SkuNames *[]SkuName `json:"skuNames,omitempty"` +} + +// AvailableSkusResult the available skus operation response. +type AvailableSkusResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of available skus. + Value *[]SkuInformation `json:"value,omitempty"` + // NextLink - Link for the next set of skus. + NextLink *string `json:"nextLink,omitempty"` +} + +// AvailableSkusResultIterator provides access to a complete listing of SkuInformation values. +type AvailableSkusResultIterator struct { + i int + page AvailableSkusResultPage +} + +// 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 *AvailableSkusResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailableSkusResultIterator.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 *AvailableSkusResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AvailableSkusResultIterator) 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 AvailableSkusResultIterator) Response() AvailableSkusResult { + 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 AvailableSkusResultIterator) Value() SkuInformation { + if !iter.page.NotDone() { + return SkuInformation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AvailableSkusResultIterator type. +func NewAvailableSkusResultIterator(page AvailableSkusResultPage) AvailableSkusResultIterator { + return AvailableSkusResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (asr AvailableSkusResult) IsEmpty() bool { + return asr.Value == nil || len(*asr.Value) == 0 +} + +// availableSkusResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (asr AvailableSkusResult) availableSkusResultPreparer(ctx context.Context) (*http.Request, error) { + if asr.NextLink == nil || len(to.String(asr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(asr.NextLink))) +} + +// AvailableSkusResultPage contains a page of SkuInformation values. +type AvailableSkusResultPage struct { + fn func(context.Context, AvailableSkusResult) (AvailableSkusResult, error) + asr AvailableSkusResult +} + +// 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 *AvailableSkusResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailableSkusResultPage.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.asr) + if err != nil { + return err + } + page.asr = 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 *AvailableSkusResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AvailableSkusResultPage) NotDone() bool { + return !page.asr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AvailableSkusResultPage) Response() AvailableSkusResult { + return page.asr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AvailableSkusResultPage) Values() []SkuInformation { + if page.asr.IsEmpty() { + return nil + } + return *page.asr.Value +} + +// Creates a new instance of the AvailableSkusResultPage type. +func NewAvailableSkusResultPage(getNextPage func(context.Context, AvailableSkusResult) (AvailableSkusResult, error)) AvailableSkusResultPage { + return AvailableSkusResultPage{fn: getNextPage} +} + +// CancellationReason reason for cancellation. +type CancellationReason struct { + // Reason - Reason for cancellation. + Reason *string `json:"reason,omitempty"` +} + +// CloudError the error information object. +type CloudError struct { + // Code - READ-ONLY; Error code string. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Descriptive error information. + Message *string `json:"message,omitempty"` + // Target - Error target + Target *string `json:"target,omitempty"` + // Details - More detailed error information. + Details *[]CloudError `json:"details,omitempty"` +} + +// ContactDetails contact Details. +type ContactDetails struct { + // ContactName - Contact name of the person. + ContactName *string `json:"contactName,omitempty"` + // Phone - Phone number of the contact person. + Phone *string `json:"phone,omitempty"` + // PhoneExtension - Phone extension number of the contact person. + PhoneExtension *string `json:"phoneExtension,omitempty"` + // Mobile - Mobile number of the contact person. + Mobile *string `json:"mobile,omitempty"` + // EmailList - List of Email-ids to be notified about job progress. + EmailList *[]string `json:"emailList,omitempty"` + // NotificationPreference - Notification preference for a job stage. + NotificationPreference *[]NotificationPreference `json:"notificationPreference,omitempty"` +} + +// BasicCopyLogDetails details for log generated during copy. +type BasicCopyLogDetails interface { + AsAccountCopyLogDetails() (*AccountCopyLogDetails, bool) + AsDiskCopyLogDetails() (*DiskCopyLogDetails, bool) + AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool) + AsCopyLogDetails() (*CopyLogDetails, bool) +} + +// CopyLogDetails details for log generated during copy. +type CopyLogDetails struct { + // CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypeDataBox', 'CopyLogDetailsTypeDataBoxDisk', 'CopyLogDetailsTypeDataBoxHeavy' + CopyLogDetailsType CopyLogDetailsType `json:"copyLogDetailsType,omitempty"` +} + +func unmarshalBasicCopyLogDetails(body []byte) (BasicCopyLogDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["copyLogDetailsType"] { + case string(CopyLogDetailsTypeDataBox): + var acld AccountCopyLogDetails + err := json.Unmarshal(body, &acld) + return acld, err + case string(CopyLogDetailsTypeDataBoxDisk): + var dcld DiskCopyLogDetails + err := json.Unmarshal(body, &dcld) + return dcld, err + case string(CopyLogDetailsTypeDataBoxHeavy): + var hacld HeavyAccountCopyLogDetails + err := json.Unmarshal(body, &hacld) + return hacld, err + default: + var cld CopyLogDetails + err := json.Unmarshal(body, &cld) + return cld, err + } +} +func unmarshalBasicCopyLogDetailsArray(body []byte) ([]BasicCopyLogDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cldArray := make([]BasicCopyLogDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cld, err := unmarshalBasicCopyLogDetails(*rawMessage) + if err != nil { + return nil, err + } + cldArray[index] = cld + } + return cldArray, nil +} + +// MarshalJSON is the custom marshaler for CopyLogDetails. +func (cld CopyLogDetails) MarshalJSON() ([]byte, error) { + cld.CopyLogDetailsType = CopyLogDetailsTypeCopyLogDetails + objectMap := make(map[string]interface{}) + if cld.CopyLogDetailsType != "" { + objectMap["copyLogDetailsType"] = cld.CopyLogDetailsType + } + return json.Marshal(objectMap) +} + +// AsAccountCopyLogDetails is the BasicCopyLogDetails implementation for CopyLogDetails. +func (cld CopyLogDetails) AsAccountCopyLogDetails() (*AccountCopyLogDetails, bool) { + return nil, false +} + +// AsDiskCopyLogDetails is the BasicCopyLogDetails implementation for CopyLogDetails. +func (cld CopyLogDetails) AsDiskCopyLogDetails() (*DiskCopyLogDetails, bool) { + return nil, false +} + +// AsHeavyAccountCopyLogDetails is the BasicCopyLogDetails implementation for CopyLogDetails. +func (cld CopyLogDetails) AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool) { + return nil, false +} + +// AsCopyLogDetails is the BasicCopyLogDetails implementation for CopyLogDetails. +func (cld CopyLogDetails) AsCopyLogDetails() (*CopyLogDetails, bool) { + return &cld, true +} + +// AsBasicCopyLogDetails is the BasicCopyLogDetails implementation for CopyLogDetails. +func (cld CopyLogDetails) AsBasicCopyLogDetails() (BasicCopyLogDetails, bool) { + return &cld, true +} + +// CopyProgress copy progress. +type CopyProgress struct { + // StorageAccountName - READ-ONLY; Name of the storage account where the data needs to be uploaded. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // DataDestinationType - READ-ONLY; Data Destination Type. Possible values include: 'StorageAccount', 'ManagedDisk' + DataDestinationType DataDestinationType `json:"dataDestinationType,omitempty"` + // AccountID - READ-ONLY; Id of the account where the data needs to be uploaded. + AccountID *string `json:"accountId,omitempty"` + // BytesSentToCloud - READ-ONLY; Amount of data uploaded by the job as of now. + BytesSentToCloud *int64 `json:"bytesSentToCloud,omitempty"` + // TotalBytesToProcess - READ-ONLY; Total amount of data to be processed by the job. + TotalBytesToProcess *int64 `json:"totalBytesToProcess,omitempty"` + // FilesProcessed - READ-ONLY; Number of files processed by the job as of now. + FilesProcessed *int64 `json:"filesProcessed,omitempty"` + // TotalFilesToProcess - READ-ONLY; Total number of files to be processed by the job. + TotalFilesToProcess *int64 `json:"totalFilesToProcess,omitempty"` + // InvalidFilesProcessed - READ-ONLY; Number of files not adhering to azure naming conventions which were processed by automatic renaming + InvalidFilesProcessed *int64 `json:"invalidFilesProcessed,omitempty"` + // InvalidFileBytesUploaded - READ-ONLY; Total amount of data not adhering to azure naming conventions which were processed by automatic renaming + InvalidFileBytesUploaded *int64 `json:"invalidFileBytesUploaded,omitempty"` + // RenamedContainerCount - READ-ONLY; Number of folders not adhering to azure naming conventions which were processed by automatic renaming + RenamedContainerCount *int64 `json:"renamedContainerCount,omitempty"` + // FilesErroredOut - READ-ONLY; Number of files which could not be copied + FilesErroredOut *int64 `json:"filesErroredOut,omitempty"` +} + +// CreateJobValidations it does all pre-job creation validations. +type CreateJobValidations struct { + // IndividualRequestDetails - List of request details contain validationType and its request as key and value respectively. + IndividualRequestDetails *[]BasicValidationInputRequest `json:"individualRequestDetails,omitempty"` + // ValidationCategory - Possible values include: 'ValidationCategoryValidationRequest', 'ValidationCategoryJobCreationValidation' + ValidationCategory ValidationCategory `json:"validationCategory,omitempty"` +} + +// MarshalJSON is the custom marshaler for CreateJobValidations. +func (cjv CreateJobValidations) MarshalJSON() ([]byte, error) { + cjv.ValidationCategory = ValidationCategoryJobCreationValidation + objectMap := make(map[string]interface{}) + if cjv.IndividualRequestDetails != nil { + objectMap["individualRequestDetails"] = cjv.IndividualRequestDetails + } + if cjv.ValidationCategory != "" { + objectMap["validationCategory"] = cjv.ValidationCategory + } + return json.Marshal(objectMap) +} + +// AsCreateJobValidations is the BasicValidationRequest implementation for CreateJobValidations. +func (cjv CreateJobValidations) AsCreateJobValidations() (*CreateJobValidations, bool) { + return &cjv, true +} + +// AsValidationRequest is the BasicValidationRequest implementation for CreateJobValidations. +func (cjv CreateJobValidations) AsValidationRequest() (*ValidationRequest, bool) { + return nil, false +} + +// AsBasicValidationRequest is the BasicValidationRequest implementation for CreateJobValidations. +func (cjv CreateJobValidations) AsBasicValidationRequest() (BasicValidationRequest, bool) { + return &cjv, true +} + +// UnmarshalJSON is the custom unmarshaler for CreateJobValidations struct. +func (cjv *CreateJobValidations) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "individualRequestDetails": + if v != nil { + individualRequestDetails, err := unmarshalBasicValidationInputRequestArray(*v) + if err != nil { + return err + } + cjv.IndividualRequestDetails = &individualRequestDetails + } + case "validationCategory": + if v != nil { + var validationCategory ValidationCategory + err = json.Unmarshal(*v, &validationCategory) + if err != nil { + return err + } + cjv.ValidationCategory = validationCategory + } + } + } + + return nil +} + +// CreateOrderLimitForSubscriptionValidationRequest request to validate create order limit for current +// subscription. +type CreateOrderLimitForSubscriptionValidationRequest struct { + // DeviceType - Device type to be used for the job. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' + DeviceType SkuName `json:"deviceType,omitempty"` + // ValidationType - Possible values include: 'ValidationTypeValidationInputRequest', 'ValidationTypeValidateCreateOrderLimit', 'ValidationTypeValidateDataDestinationDetails', 'ValidationTypeValidatePreferences', 'ValidationTypeValidateSkuAvailability', 'ValidationTypeValidateSubscriptionIsAllowedToCreateJob', 'ValidationTypeValidateAddress' + ValidationType ValidationType `json:"validationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for CreateOrderLimitForSubscriptionValidationRequest. +func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) MarshalJSON() ([]byte, error) { + colfsvr.ValidationType = ValidationTypeValidateCreateOrderLimit + objectMap := make(map[string]interface{}) + if colfsvr.DeviceType != "" { + objectMap["deviceType"] = colfsvr.DeviceType + } + if colfsvr.ValidationType != "" { + objectMap["validationType"] = colfsvr.ValidationType + } + return json.Marshal(objectMap) +} + +// AsCreateOrderLimitForSubscriptionValidationRequest is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest. +func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) { + return &colfsvr, true +} + +// AsDataDestinationDetailsValidationRequest is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest. +func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) { + return nil, false +} + +// AsPreferencesValidationRequest is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest. +func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) { + return nil, false +} + +// AsSkuAvailabilityValidationRequest is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest. +func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) { + return nil, false +} + +// AsSubscriptionIsAllowedToCreateJobValidationRequest is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest. +func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) { + return nil, false +} + +// AsValidateAddress is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest. +func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsValidateAddress() (*ValidateAddress, bool) { + return nil, false +} + +// AsValidationInputRequest is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest. +func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsValidationInputRequest() (*ValidationInputRequest, bool) { + return nil, false +} + +// AsBasicValidationInputRequest is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest. +func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsBasicValidationInputRequest() (BasicValidationInputRequest, bool) { + return &colfsvr, true +} + +// CreateOrderLimitForSubscriptionValidationResponseProperties properties of create order limit for +// subscription validation response. +type CreateOrderLimitForSubscriptionValidationResponseProperties struct { + // Status - READ-ONLY; Create order limit validation status. Possible values include: 'ValidationStatusValid', 'ValidationStatusInvalid', 'ValidationStatusSkipped' + Status ValidationStatus `json:"status,omitempty"` + // Error - READ-ONLY; Error code and message of validation response. + Error *Error `json:"error,omitempty"` + // ValidationType - Possible values include: 'ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails', 'ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob' + ValidationType ValidationTypeBasicValidationInputResponse `json:"validationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for CreateOrderLimitForSubscriptionValidationResponseProperties. +func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) MarshalJSON() ([]byte, error) { + colfsvrp.ValidationType = ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit + objectMap := make(map[string]interface{}) + if colfsvrp.ValidationType != "" { + objectMap["validationType"] = colfsvrp.ValidationType + } + return json.Marshal(objectMap) +} + +// AsAddressValidationProperties is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties. +func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsAddressValidationProperties() (*AddressValidationProperties, bool) { + return nil, false +} + +// AsCreateOrderLimitForSubscriptionValidationResponseProperties is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties. +func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) { + return &colfsvrp, true +} + +// AsDataDestinationDetailsValidationResponseProperties is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties. +func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) { + return nil, false +} + +// AsPreferencesValidationResponseProperties is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties. +func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) { + return nil, false +} + +// AsSkuAvailabilityValidationResponseProperties is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties. +func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) { + return nil, false +} + +// AsSubscriptionIsAllowedToCreateJobValidationResponseProperties is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties. +func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) { + return nil, false +} + +// AsValidationInputResponse is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties. +func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsValidationInputResponse() (*ValidationInputResponse, bool) { + return nil, false +} + +// AsBasicValidationInputResponse is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties. +func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsBasicValidationInputResponse() (BasicValidationInputResponse, bool) { + return &colfsvrp, true +} + +// DataDestinationDetailsValidationRequest request to validate data destination details. +type DataDestinationDetailsValidationRequest struct { + // DestinationAccountDetails - Destination account details list. + DestinationAccountDetails *[]BasicDestinationAccountDetails `json:"destinationAccountDetails,omitempty"` + // Location - Location of stamp or geo. + Location *string `json:"location,omitempty"` + // ValidationType - Possible values include: 'ValidationTypeValidationInputRequest', 'ValidationTypeValidateCreateOrderLimit', 'ValidationTypeValidateDataDestinationDetails', 'ValidationTypeValidatePreferences', 'ValidationTypeValidateSkuAvailability', 'ValidationTypeValidateSubscriptionIsAllowedToCreateJob', 'ValidationTypeValidateAddress' + ValidationType ValidationType `json:"validationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataDestinationDetailsValidationRequest. +func (dddvr DataDestinationDetailsValidationRequest) MarshalJSON() ([]byte, error) { + dddvr.ValidationType = ValidationTypeValidateDataDestinationDetails + objectMap := make(map[string]interface{}) + if dddvr.DestinationAccountDetails != nil { + objectMap["destinationAccountDetails"] = dddvr.DestinationAccountDetails + } + if dddvr.Location != nil { + objectMap["location"] = dddvr.Location + } + if dddvr.ValidationType != "" { + objectMap["validationType"] = dddvr.ValidationType + } + return json.Marshal(objectMap) +} + +// AsCreateOrderLimitForSubscriptionValidationRequest is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest. +func (dddvr DataDestinationDetailsValidationRequest) AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) { + return nil, false +} + +// AsDataDestinationDetailsValidationRequest is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest. +func (dddvr DataDestinationDetailsValidationRequest) AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) { + return &dddvr, true +} + +// AsPreferencesValidationRequest is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest. +func (dddvr DataDestinationDetailsValidationRequest) AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) { + return nil, false +} + +// AsSkuAvailabilityValidationRequest is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest. +func (dddvr DataDestinationDetailsValidationRequest) AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) { + return nil, false +} + +// AsSubscriptionIsAllowedToCreateJobValidationRequest is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest. +func (dddvr DataDestinationDetailsValidationRequest) AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) { + return nil, false +} + +// AsValidateAddress is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest. +func (dddvr DataDestinationDetailsValidationRequest) AsValidateAddress() (*ValidateAddress, bool) { + return nil, false +} + +// AsValidationInputRequest is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest. +func (dddvr DataDestinationDetailsValidationRequest) AsValidationInputRequest() (*ValidationInputRequest, bool) { + return nil, false +} + +// AsBasicValidationInputRequest is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest. +func (dddvr DataDestinationDetailsValidationRequest) AsBasicValidationInputRequest() (BasicValidationInputRequest, bool) { + return &dddvr, true +} + +// UnmarshalJSON is the custom unmarshaler for DataDestinationDetailsValidationRequest struct. +func (dddvr *DataDestinationDetailsValidationRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "destinationAccountDetails": + if v != nil { + destinationAccountDetails, err := unmarshalBasicDestinationAccountDetailsArray(*v) + if err != nil { + return err + } + dddvr.DestinationAccountDetails = &destinationAccountDetails + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dddvr.Location = &location + } + case "validationType": + if v != nil { + var validationType ValidationType + err = json.Unmarshal(*v, &validationType) + if err != nil { + return err + } + dddvr.ValidationType = validationType + } + } + } + + return nil +} + +// DataDestinationDetailsValidationResponseProperties properties of data destination details validation +// response. +type DataDestinationDetailsValidationResponseProperties struct { + // Status - READ-ONLY; Data destination details validation status. Possible values include: 'ValidationStatusValid', 'ValidationStatusInvalid', 'ValidationStatusSkipped' + Status ValidationStatus `json:"status,omitempty"` + // Error - READ-ONLY; Error code and message of validation response. + Error *Error `json:"error,omitempty"` + // ValidationType - Possible values include: 'ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails', 'ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob' + ValidationType ValidationTypeBasicValidationInputResponse `json:"validationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataDestinationDetailsValidationResponseProperties. +func (dddvrp DataDestinationDetailsValidationResponseProperties) MarshalJSON() ([]byte, error) { + dddvrp.ValidationType = ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails + objectMap := make(map[string]interface{}) + if dddvrp.ValidationType != "" { + objectMap["validationType"] = dddvrp.ValidationType + } + return json.Marshal(objectMap) +} + +// AsAddressValidationProperties is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties. +func (dddvrp DataDestinationDetailsValidationResponseProperties) AsAddressValidationProperties() (*AddressValidationProperties, bool) { + return nil, false +} + +// AsCreateOrderLimitForSubscriptionValidationResponseProperties is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties. +func (dddvrp DataDestinationDetailsValidationResponseProperties) AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) { + return nil, false +} + +// AsDataDestinationDetailsValidationResponseProperties is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties. +func (dddvrp DataDestinationDetailsValidationResponseProperties) AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) { + return &dddvrp, true +} + +// AsPreferencesValidationResponseProperties is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties. +func (dddvrp DataDestinationDetailsValidationResponseProperties) AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) { + return nil, false +} + +// AsSkuAvailabilityValidationResponseProperties is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties. +func (dddvrp DataDestinationDetailsValidationResponseProperties) AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) { + return nil, false +} + +// AsSubscriptionIsAllowedToCreateJobValidationResponseProperties is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties. +func (dddvrp DataDestinationDetailsValidationResponseProperties) AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) { + return nil, false +} + +// AsValidationInputResponse is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties. +func (dddvrp DataDestinationDetailsValidationResponseProperties) AsValidationInputResponse() (*ValidationInputResponse, bool) { + return nil, false +} + +// AsBasicValidationInputResponse is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties. +func (dddvrp DataDestinationDetailsValidationResponseProperties) AsBasicValidationInputResponse() (BasicValidationInputResponse, bool) { + return &dddvrp, true +} + +// DcAccessSecurityCode dc Access Security code for device. +type DcAccessSecurityCode struct { + // ForwardDcAccessCode - Dc Access Code for dispatching from DC. + ForwardDcAccessCode *string `json:"forwardDcAccessCode,omitempty"` + // ReverseDcAccessCode - Dc Access code for dropping off at DC. + ReverseDcAccessCode *string `json:"reverseDcAccessCode,omitempty"` +} + +// BasicDestinationAccountDetails details of the destination storage accounts. +type BasicDestinationAccountDetails interface { + AsDestinationManagedDiskDetails() (*DestinationManagedDiskDetails, bool) + AsDestinationStorageAccountDetails() (*DestinationStorageAccountDetails, bool) + AsDestinationAccountDetails() (*DestinationAccountDetails, bool) +} + +// DestinationAccountDetails details of the destination storage accounts. +type DestinationAccountDetails struct { + // AccountID - Arm Id of the destination where the data has to be moved. + AccountID *string `json:"accountId,omitempty"` + // SharePassword - Share password to be shared by all shares in SA. + SharePassword *string `json:"sharePassword,omitempty"` + // DataDestinationType - Possible values include: 'DataDestinationTypeDestinationAccountDetails', 'DataDestinationTypeManagedDisk', 'DataDestinationTypeStorageAccount' + DataDestinationType DataDestinationTypeBasicDestinationAccountDetails `json:"dataDestinationType,omitempty"` +} + +func unmarshalBasicDestinationAccountDetails(body []byte) (BasicDestinationAccountDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["dataDestinationType"] { + case string(DataDestinationTypeManagedDisk): + var dmdd DestinationManagedDiskDetails + err := json.Unmarshal(body, &dmdd) + return dmdd, err + case string(DataDestinationTypeStorageAccount): + var dsad DestinationStorageAccountDetails + err := json.Unmarshal(body, &dsad) + return dsad, err + default: + var dad DestinationAccountDetails + err := json.Unmarshal(body, &dad) + return dad, err + } +} +func unmarshalBasicDestinationAccountDetailsArray(body []byte) ([]BasicDestinationAccountDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dadArray := make([]BasicDestinationAccountDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dad, err := unmarshalBasicDestinationAccountDetails(*rawMessage) + if err != nil { + return nil, err + } + dadArray[index] = dad + } + return dadArray, nil +} + +// MarshalJSON is the custom marshaler for DestinationAccountDetails. +func (dad DestinationAccountDetails) MarshalJSON() ([]byte, error) { + dad.DataDestinationType = DataDestinationTypeDestinationAccountDetails + objectMap := make(map[string]interface{}) + if dad.AccountID != nil { + objectMap["accountId"] = dad.AccountID + } + if dad.SharePassword != nil { + objectMap["sharePassword"] = dad.SharePassword + } + if dad.DataDestinationType != "" { + objectMap["dataDestinationType"] = dad.DataDestinationType + } + return json.Marshal(objectMap) +} + +// AsDestinationManagedDiskDetails is the BasicDestinationAccountDetails implementation for DestinationAccountDetails. +func (dad DestinationAccountDetails) AsDestinationManagedDiskDetails() (*DestinationManagedDiskDetails, bool) { + return nil, false +} + +// AsDestinationStorageAccountDetails is the BasicDestinationAccountDetails implementation for DestinationAccountDetails. +func (dad DestinationAccountDetails) AsDestinationStorageAccountDetails() (*DestinationStorageAccountDetails, bool) { + return nil, false +} + +// AsDestinationAccountDetails is the BasicDestinationAccountDetails implementation for DestinationAccountDetails. +func (dad DestinationAccountDetails) AsDestinationAccountDetails() (*DestinationAccountDetails, bool) { + return &dad, true +} + +// AsBasicDestinationAccountDetails is the BasicDestinationAccountDetails implementation for DestinationAccountDetails. +func (dad DestinationAccountDetails) AsBasicDestinationAccountDetails() (BasicDestinationAccountDetails, bool) { + return &dad, true +} + +// DestinationManagedDiskDetails details for the destination compute disks. +type DestinationManagedDiskDetails struct { + // ResourceGroupID - Destination Resource Group Id where the Compute disks should be created. + ResourceGroupID *string `json:"resourceGroupId,omitempty"` + // StagingStorageAccountID - Arm Id of the storage account that can be used to copy the vhd for staging. + StagingStorageAccountID *string `json:"stagingStorageAccountId,omitempty"` + // AccountID - Arm Id of the destination where the data has to be moved. + AccountID *string `json:"accountId,omitempty"` + // SharePassword - Share password to be shared by all shares in SA. + SharePassword *string `json:"sharePassword,omitempty"` + // DataDestinationType - Possible values include: 'DataDestinationTypeDestinationAccountDetails', 'DataDestinationTypeManagedDisk', 'DataDestinationTypeStorageAccount' + DataDestinationType DataDestinationTypeBasicDestinationAccountDetails `json:"dataDestinationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DestinationManagedDiskDetails. +func (dmdd DestinationManagedDiskDetails) MarshalJSON() ([]byte, error) { + dmdd.DataDestinationType = DataDestinationTypeManagedDisk + objectMap := make(map[string]interface{}) + if dmdd.ResourceGroupID != nil { + objectMap["resourceGroupId"] = dmdd.ResourceGroupID + } + if dmdd.StagingStorageAccountID != nil { + objectMap["stagingStorageAccountId"] = dmdd.StagingStorageAccountID + } + if dmdd.AccountID != nil { + objectMap["accountId"] = dmdd.AccountID + } + if dmdd.SharePassword != nil { + objectMap["sharePassword"] = dmdd.SharePassword + } + if dmdd.DataDestinationType != "" { + objectMap["dataDestinationType"] = dmdd.DataDestinationType + } + return json.Marshal(objectMap) +} + +// AsDestinationManagedDiskDetails is the BasicDestinationAccountDetails implementation for DestinationManagedDiskDetails. +func (dmdd DestinationManagedDiskDetails) AsDestinationManagedDiskDetails() (*DestinationManagedDiskDetails, bool) { + return &dmdd, true +} + +// AsDestinationStorageAccountDetails is the BasicDestinationAccountDetails implementation for DestinationManagedDiskDetails. +func (dmdd DestinationManagedDiskDetails) AsDestinationStorageAccountDetails() (*DestinationStorageAccountDetails, bool) { + return nil, false +} + +// AsDestinationAccountDetails is the BasicDestinationAccountDetails implementation for DestinationManagedDiskDetails. +func (dmdd DestinationManagedDiskDetails) AsDestinationAccountDetails() (*DestinationAccountDetails, bool) { + return nil, false +} + +// AsBasicDestinationAccountDetails is the BasicDestinationAccountDetails implementation for DestinationManagedDiskDetails. +func (dmdd DestinationManagedDiskDetails) AsBasicDestinationAccountDetails() (BasicDestinationAccountDetails, bool) { + return &dmdd, true +} + +// DestinationStorageAccountDetails details for the destination storage account. +type DestinationStorageAccountDetails struct { + // StorageAccountID - Destination Storage Account Arm Id. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // AccountID - Arm Id of the destination where the data has to be moved. + AccountID *string `json:"accountId,omitempty"` + // SharePassword - Share password to be shared by all shares in SA. + SharePassword *string `json:"sharePassword,omitempty"` + // DataDestinationType - Possible values include: 'DataDestinationTypeDestinationAccountDetails', 'DataDestinationTypeManagedDisk', 'DataDestinationTypeStorageAccount' + DataDestinationType DataDestinationTypeBasicDestinationAccountDetails `json:"dataDestinationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DestinationStorageAccountDetails. +func (dsad DestinationStorageAccountDetails) MarshalJSON() ([]byte, error) { + dsad.DataDestinationType = DataDestinationTypeStorageAccount + objectMap := make(map[string]interface{}) + if dsad.StorageAccountID != nil { + objectMap["storageAccountId"] = dsad.StorageAccountID + } + if dsad.AccountID != nil { + objectMap["accountId"] = dsad.AccountID + } + if dsad.SharePassword != nil { + objectMap["sharePassword"] = dsad.SharePassword + } + if dsad.DataDestinationType != "" { + objectMap["dataDestinationType"] = dsad.DataDestinationType + } + return json.Marshal(objectMap) +} + +// AsDestinationManagedDiskDetails is the BasicDestinationAccountDetails implementation for DestinationStorageAccountDetails. +func (dsad DestinationStorageAccountDetails) AsDestinationManagedDiskDetails() (*DestinationManagedDiskDetails, bool) { + return nil, false +} + +// AsDestinationStorageAccountDetails is the BasicDestinationAccountDetails implementation for DestinationStorageAccountDetails. +func (dsad DestinationStorageAccountDetails) AsDestinationStorageAccountDetails() (*DestinationStorageAccountDetails, bool) { + return &dsad, true +} + +// AsDestinationAccountDetails is the BasicDestinationAccountDetails implementation for DestinationStorageAccountDetails. +func (dsad DestinationStorageAccountDetails) AsDestinationAccountDetails() (*DestinationAccountDetails, bool) { + return nil, false +} + +// AsBasicDestinationAccountDetails is the BasicDestinationAccountDetails implementation for DestinationStorageAccountDetails. +func (dsad DestinationStorageAccountDetails) AsBasicDestinationAccountDetails() (BasicDestinationAccountDetails, bool) { + return &dsad, true +} + +// DestinationToServiceLocationMap map of destination location to service location. +type DestinationToServiceLocationMap struct { + // DestinationLocation - READ-ONLY; Location of the destination. + DestinationLocation *string `json:"destinationLocation,omitempty"` + // ServiceLocation - READ-ONLY; Location of the service. + ServiceLocation *string `json:"serviceLocation,omitempty"` +} + +// DiskCopyLogDetails copy Log Details for a disk +type DiskCopyLogDetails struct { + // DiskSerialNumber - READ-ONLY; Disk Serial Number. + DiskSerialNumber *string `json:"diskSerialNumber,omitempty"` + // ErrorLogLink - READ-ONLY; Link for copy error logs. + ErrorLogLink *string `json:"errorLogLink,omitempty"` + // VerboseLogLink - READ-ONLY; Link for copy verbose logs. + VerboseLogLink *string `json:"verboseLogLink,omitempty"` + // CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypeDataBox', 'CopyLogDetailsTypeDataBoxDisk', 'CopyLogDetailsTypeDataBoxHeavy' + CopyLogDetailsType CopyLogDetailsType `json:"copyLogDetailsType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskCopyLogDetails. +func (dcld DiskCopyLogDetails) MarshalJSON() ([]byte, error) { + dcld.CopyLogDetailsType = CopyLogDetailsTypeDataBoxDisk + objectMap := make(map[string]interface{}) + if dcld.CopyLogDetailsType != "" { + objectMap["copyLogDetailsType"] = dcld.CopyLogDetailsType + } + return json.Marshal(objectMap) +} + +// AsAccountCopyLogDetails is the BasicCopyLogDetails implementation for DiskCopyLogDetails. +func (dcld DiskCopyLogDetails) AsAccountCopyLogDetails() (*AccountCopyLogDetails, bool) { + return nil, false +} + +// AsDiskCopyLogDetails is the BasicCopyLogDetails implementation for DiskCopyLogDetails. +func (dcld DiskCopyLogDetails) AsDiskCopyLogDetails() (*DiskCopyLogDetails, bool) { + return &dcld, true +} + +// AsHeavyAccountCopyLogDetails is the BasicCopyLogDetails implementation for DiskCopyLogDetails. +func (dcld DiskCopyLogDetails) AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool) { + return nil, false +} + +// AsCopyLogDetails is the BasicCopyLogDetails implementation for DiskCopyLogDetails. +func (dcld DiskCopyLogDetails) AsCopyLogDetails() (*CopyLogDetails, bool) { + return nil, false +} + +// AsBasicCopyLogDetails is the BasicCopyLogDetails implementation for DiskCopyLogDetails. +func (dcld DiskCopyLogDetails) AsBasicCopyLogDetails() (BasicCopyLogDetails, bool) { + return &dcld, true +} + +// DiskCopyProgress dataBox Disk Copy Progress +type DiskCopyProgress struct { + // SerialNumber - READ-ONLY; The serial number of the disk + SerialNumber *string `json:"serialNumber,omitempty"` + // BytesCopied - READ-ONLY; Bytes copied during the copy of disk. + BytesCopied *int64 `json:"bytesCopied,omitempty"` + // PercentComplete - READ-ONLY; Indicates the percentage completed for the copy of the disk. + PercentComplete *int32 `json:"percentComplete,omitempty"` + // Status - READ-ONLY; The Status of the copy. Possible values include: 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', 'NotReturned', 'HardwareError', 'DeviceFormatted', 'DeviceMetadataModified', 'StorageAccountNotAccessible', 'UnsupportedData' + Status CopyStatus `json:"status,omitempty"` +} + +// DiskJobDetails dataBox Disk Job Details. +type DiskJobDetails struct { + // PreferredDisks - User preference on what size disks are needed for the job. The map is from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but will be checked against an int. + PreferredDisks map[string]*int32 `json:"preferredDisks"` + // CopyProgress - READ-ONLY; Copy progress per disk. + CopyProgress *[]DiskCopyProgress `json:"copyProgress,omitempty"` + // DisksAndSizeDetails - READ-ONLY; Contains the map of disk serial number to the disk size being used for the job. Is returned only after the disks are shipped to the customer. + DisksAndSizeDetails map[string]*int32 `json:"disksAndSizeDetails"` + // Passkey - User entered passkey for DataBox Disk job. + Passkey *string `json:"passkey,omitempty"` + // ExpectedDataSizeInTerabytes - The expected size of the data, which needs to be transferred in this job, in terabytes. + ExpectedDataSizeInTerabytes *int32 `json:"expectedDataSizeInTerabytes,omitempty"` + // JobStages - READ-ONLY; List of stages that run in the job. + JobStages *[]JobStages `json:"jobStages,omitempty"` + // ContactDetails - Contact details for notification and shipping. + ContactDetails *ContactDetails `json:"contactDetails,omitempty"` + // ShippingAddress - Shipping address of the customer. + ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"` + // DeliveryPackage - READ-ONLY; Delivery package shipping details. + DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty"` + // ReturnPackage - READ-ONLY; Return package shipping details. + ReturnPackage *PackageShippingDetails `json:"returnPackage,omitempty"` + // DestinationAccountDetails - Destination account details. + DestinationAccountDetails *[]BasicDestinationAccountDetails `json:"destinationAccountDetails,omitempty"` + // ErrorDetails - READ-ONLY; Error details for failure. This is optional. + ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"` + // Preferences - Preferences for the order. + Preferences *Preferences `json:"preferences,omitempty"` + // CopyLogDetails - READ-ONLY; List of copy log details. + CopyLogDetails *[]BasicCopyLogDetails `json:"copyLogDetails,omitempty"` + // ReverseShipmentLabelSasKey - READ-ONLY; Shared access key to download the return shipment label + ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty"` + // ChainOfCustodySasKey - READ-ONLY; Shared access key to download the chain of custody logs + ChainOfCustodySasKey *string `json:"chainOfCustodySasKey,omitempty"` + // JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDataBoxDisk', 'JobDetailsTypeDataBoxHeavy', 'JobDetailsTypeDataBox' + JobDetailsType JobDetailsTypeEnum `json:"jobDetailsType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskJobDetails. +func (djd DiskJobDetails) MarshalJSON() ([]byte, error) { + djd.JobDetailsType = JobDetailsTypeDataBoxDisk + objectMap := make(map[string]interface{}) + if djd.PreferredDisks != nil { + objectMap["preferredDisks"] = djd.PreferredDisks + } + if djd.Passkey != nil { + objectMap["passkey"] = djd.Passkey + } + if djd.ExpectedDataSizeInTerabytes != nil { + objectMap["expectedDataSizeInTerabytes"] = djd.ExpectedDataSizeInTerabytes + } + if djd.ContactDetails != nil { + objectMap["contactDetails"] = djd.ContactDetails + } + if djd.ShippingAddress != nil { + objectMap["shippingAddress"] = djd.ShippingAddress + } + if djd.DestinationAccountDetails != nil { + objectMap["destinationAccountDetails"] = djd.DestinationAccountDetails + } + if djd.Preferences != nil { + objectMap["preferences"] = djd.Preferences + } + if djd.JobDetailsType != "" { + objectMap["jobDetailsType"] = djd.JobDetailsType + } + return json.Marshal(objectMap) +} + +// AsDiskJobDetails is the BasicJobDetails implementation for DiskJobDetails. +func (djd DiskJobDetails) AsDiskJobDetails() (*DiskJobDetails, bool) { + return &djd, true +} + +// AsHeavyJobDetails is the BasicJobDetails implementation for DiskJobDetails. +func (djd DiskJobDetails) AsHeavyJobDetails() (*HeavyJobDetails, bool) { + return nil, false +} + +// AsJobDetailsType is the BasicJobDetails implementation for DiskJobDetails. +func (djd DiskJobDetails) AsJobDetailsType() (*JobDetailsType, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for DiskJobDetails. +func (djd DiskJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for DiskJobDetails. +func (djd DiskJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &djd, true +} + +// UnmarshalJSON is the custom unmarshaler for DiskJobDetails struct. +func (djd *DiskJobDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "preferredDisks": + if v != nil { + var preferredDisks map[string]*int32 + err = json.Unmarshal(*v, &preferredDisks) + if err != nil { + return err + } + djd.PreferredDisks = preferredDisks + } + case "copyProgress": + if v != nil { + var copyProgress []DiskCopyProgress + err = json.Unmarshal(*v, ©Progress) + if err != nil { + return err + } + djd.CopyProgress = ©Progress + } + case "disksAndSizeDetails": + if v != nil { + var disksAndSizeDetails map[string]*int32 + err = json.Unmarshal(*v, &disksAndSizeDetails) + if err != nil { + return err + } + djd.DisksAndSizeDetails = disksAndSizeDetails + } + case "passkey": + if v != nil { + var passkey string + err = json.Unmarshal(*v, &passkey) + if err != nil { + return err + } + djd.Passkey = &passkey + } + case "expectedDataSizeInTerabytes": + if v != nil { + var expectedDataSizeInTerabytes int32 + err = json.Unmarshal(*v, &expectedDataSizeInTerabytes) + if err != nil { + return err + } + djd.ExpectedDataSizeInTerabytes = &expectedDataSizeInTerabytes + } + case "jobStages": + if v != nil { + var jobStages []JobStages + err = json.Unmarshal(*v, &jobStages) + if err != nil { + return err + } + djd.JobStages = &jobStages + } + case "contactDetails": + if v != nil { + var contactDetails ContactDetails + err = json.Unmarshal(*v, &contactDetails) + if err != nil { + return err + } + djd.ContactDetails = &contactDetails + } + case "shippingAddress": + if v != nil { + var shippingAddress ShippingAddress + err = json.Unmarshal(*v, &shippingAddress) + if err != nil { + return err + } + djd.ShippingAddress = &shippingAddress + } + case "deliveryPackage": + if v != nil { + var deliveryPackage PackageShippingDetails + err = json.Unmarshal(*v, &deliveryPackage) + if err != nil { + return err + } + djd.DeliveryPackage = &deliveryPackage + } + case "returnPackage": + if v != nil { + var returnPackage PackageShippingDetails + err = json.Unmarshal(*v, &returnPackage) + if err != nil { + return err + } + djd.ReturnPackage = &returnPackage + } + case "destinationAccountDetails": + if v != nil { + destinationAccountDetails, err := unmarshalBasicDestinationAccountDetailsArray(*v) + if err != nil { + return err + } + djd.DestinationAccountDetails = &destinationAccountDetails + } + case "errorDetails": + if v != nil { + var errorDetails []JobErrorDetails + err = json.Unmarshal(*v, &errorDetails) + if err != nil { + return err + } + djd.ErrorDetails = &errorDetails + } + case "preferences": + if v != nil { + var preferences Preferences + err = json.Unmarshal(*v, &preferences) + if err != nil { + return err + } + djd.Preferences = &preferences + } + case "copyLogDetails": + if v != nil { + copyLogDetails, err := unmarshalBasicCopyLogDetailsArray(*v) + if err != nil { + return err + } + djd.CopyLogDetails = ©LogDetails + } + case "reverseShipmentLabelSasKey": + if v != nil { + var reverseShipmentLabelSasKey string + err = json.Unmarshal(*v, &reverseShipmentLabelSasKey) + if err != nil { + return err + } + djd.ReverseShipmentLabelSasKey = &reverseShipmentLabelSasKey + } + case "chainOfCustodySasKey": + if v != nil { + var chainOfCustodySasKey string + err = json.Unmarshal(*v, &chainOfCustodySasKey) + if err != nil { + return err + } + djd.ChainOfCustodySasKey = &chainOfCustodySasKey + } + case "jobDetailsType": + if v != nil { + var jobDetailsType JobDetailsTypeEnum + err = json.Unmarshal(*v, &jobDetailsType) + if err != nil { + return err + } + djd.JobDetailsType = jobDetailsType + } + } + } + + return nil +} + +// DiskJobSecrets the secrets related to disk job. +type DiskJobSecrets struct { + // DiskSecrets - READ-ONLY; Contains the list of secrets object for that device. + DiskSecrets *[]DiskSecret `json:"diskSecrets,omitempty"` + // PassKey - READ-ONLY; PassKey for the disk Job. + PassKey *string `json:"passKey,omitempty"` + // IsPasskeyUserDefined - READ-ONLY; Whether passkey was provided by user. + IsPasskeyUserDefined *bool `json:"isPasskeyUserDefined,omitempty"` + // DcAccessSecurityCode - Dc Access Security Code for Customer Managed Shipping + DcAccessSecurityCode *DcAccessSecurityCode `json:"dcAccessSecurityCode,omitempty"` + // JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeDataBoxDisk', 'JobSecretsTypeDataBoxHeavy', 'JobSecretsTypeDataBox' + JobSecretsType JobSecretsTypeEnum `json:"jobSecretsType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskJobSecrets. +func (djs DiskJobSecrets) MarshalJSON() ([]byte, error) { + djs.JobSecretsType = JobSecretsTypeDataBoxDisk + objectMap := make(map[string]interface{}) + if djs.DcAccessSecurityCode != nil { + objectMap["dcAccessSecurityCode"] = djs.DcAccessSecurityCode + } + if djs.JobSecretsType != "" { + objectMap["jobSecretsType"] = djs.JobSecretsType + } + return json.Marshal(objectMap) +} + +// AsDiskJobSecrets is the BasicJobSecrets implementation for DiskJobSecrets. +func (djs DiskJobSecrets) AsDiskJobSecrets() (*DiskJobSecrets, bool) { + return &djs, true +} + +// AsHeavyJobSecrets is the BasicJobSecrets implementation for DiskJobSecrets. +func (djs DiskJobSecrets) AsHeavyJobSecrets() (*HeavyJobSecrets, bool) { + return nil, false +} + +// AsJobSecretsType is the BasicJobSecrets implementation for DiskJobSecrets. +func (djs DiskJobSecrets) AsJobSecretsType() (*JobSecretsType, bool) { + return nil, false +} + +// AsJobSecrets is the BasicJobSecrets implementation for DiskJobSecrets. +func (djs DiskJobSecrets) AsJobSecrets() (*JobSecrets, bool) { + return nil, false +} + +// AsBasicJobSecrets is the BasicJobSecrets implementation for DiskJobSecrets. +func (djs DiskJobSecrets) AsBasicJobSecrets() (BasicJobSecrets, bool) { + return &djs, true +} + +// DiskScheduleAvailabilityRequest request body to get the availability for scheduling disk orders. +type DiskScheduleAvailabilityRequest struct { + // ExpectedDataSizeInTerabytes - The expected size of the data, which needs to be transferred in this job, in terabytes. + ExpectedDataSizeInTerabytes *int32 `json:"expectedDataSizeInTerabytes,omitempty"` + // StorageLocation - Location for data transfer. + // For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + StorageLocation *string `json:"storageLocation,omitempty"` + // SkuName - Possible values include: 'SkuNameScheduleAvailabilityRequest', 'SkuNameDataBox', 'SkuNameDataBoxDisk', 'SkuNameDataBoxHeavy' + SkuName SkuNameBasicScheduleAvailabilityRequest `json:"skuName,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskScheduleAvailabilityRequest. +func (dsar DiskScheduleAvailabilityRequest) MarshalJSON() ([]byte, error) { + dsar.SkuName = SkuNameDataBoxDisk + objectMap := make(map[string]interface{}) + if dsar.ExpectedDataSizeInTerabytes != nil { + objectMap["expectedDataSizeInTerabytes"] = dsar.ExpectedDataSizeInTerabytes + } + if dsar.StorageLocation != nil { + objectMap["storageLocation"] = dsar.StorageLocation + } + if dsar.SkuName != "" { + objectMap["skuName"] = dsar.SkuName + } + return json.Marshal(objectMap) +} + +// AsScheduleAvailabilityRequestType is the BasicScheduleAvailabilityRequest implementation for DiskScheduleAvailabilityRequest. +func (dsar DiskScheduleAvailabilityRequest) AsScheduleAvailabilityRequestType() (*ScheduleAvailabilityRequestType, bool) { + return nil, false +} + +// AsDiskScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for DiskScheduleAvailabilityRequest. +func (dsar DiskScheduleAvailabilityRequest) AsDiskScheduleAvailabilityRequest() (*DiskScheduleAvailabilityRequest, bool) { + return &dsar, true +} + +// AsHeavyScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for DiskScheduleAvailabilityRequest. +func (dsar DiskScheduleAvailabilityRequest) AsHeavyScheduleAvailabilityRequest() (*HeavyScheduleAvailabilityRequest, bool) { + return nil, false +} + +// AsScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for DiskScheduleAvailabilityRequest. +func (dsar DiskScheduleAvailabilityRequest) AsScheduleAvailabilityRequest() (*ScheduleAvailabilityRequest, bool) { + return nil, false +} + +// AsBasicScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for DiskScheduleAvailabilityRequest. +func (dsar DiskScheduleAvailabilityRequest) AsBasicScheduleAvailabilityRequest() (BasicScheduleAvailabilityRequest, bool) { + return &dsar, true +} + +// DiskSecret contains all the secrets of a Disk. +type DiskSecret struct { + // DiskSerialNumber - READ-ONLY; Serial number of the assigned disk. + DiskSerialNumber *string `json:"diskSerialNumber,omitempty"` + // BitLockerKey - READ-ONLY; Bit Locker key of the disk which can be used to unlock the disk to copy data. + BitLockerKey *string `json:"bitLockerKey,omitempty"` +} + +// Error top level error for the job. +type Error struct { + // Code - READ-ONLY; Error code that can be used to programmatically identify the error. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Describes the error in detail and provides debugging information. + Message *string `json:"message,omitempty"` +} + +// HeavyAccountCopyLogDetails copy log details for a storage account for Databox heavy +type HeavyAccountCopyLogDetails struct { + // AccountName - READ-ONLY; Destination account name. + AccountName *string `json:"accountName,omitempty"` + // CopyLogLink - READ-ONLY; Link for copy logs. + CopyLogLink *[]string `json:"copyLogLink,omitempty"` + // CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypeDataBox', 'CopyLogDetailsTypeDataBoxDisk', 'CopyLogDetailsTypeDataBoxHeavy' + CopyLogDetailsType CopyLogDetailsType `json:"copyLogDetailsType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HeavyAccountCopyLogDetails. +func (hacld HeavyAccountCopyLogDetails) MarshalJSON() ([]byte, error) { + hacld.CopyLogDetailsType = CopyLogDetailsTypeDataBoxHeavy + objectMap := make(map[string]interface{}) + if hacld.CopyLogDetailsType != "" { + objectMap["copyLogDetailsType"] = hacld.CopyLogDetailsType + } + return json.Marshal(objectMap) +} + +// AsAccountCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails. +func (hacld HeavyAccountCopyLogDetails) AsAccountCopyLogDetails() (*AccountCopyLogDetails, bool) { + return nil, false +} + +// AsDiskCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails. +func (hacld HeavyAccountCopyLogDetails) AsDiskCopyLogDetails() (*DiskCopyLogDetails, bool) { + return nil, false +} + +// AsHeavyAccountCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails. +func (hacld HeavyAccountCopyLogDetails) AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool) { + return &hacld, true +} + +// AsCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails. +func (hacld HeavyAccountCopyLogDetails) AsCopyLogDetails() (*CopyLogDetails, bool) { + return nil, false +} + +// AsBasicCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails. +func (hacld HeavyAccountCopyLogDetails) AsBasicCopyLogDetails() (BasicCopyLogDetails, bool) { + return &hacld, true +} + +// HeavyJobDetails databox Heavy Device Job Details +type HeavyJobDetails struct { + // CopyProgress - READ-ONLY; Copy progress per account. + CopyProgress *[]CopyProgress `json:"copyProgress,omitempty"` + // DevicePassword - Set Device password for unlocking Databox Heavy + DevicePassword *string `json:"devicePassword,omitempty"` + // ExpectedDataSizeInTerabytes - The expected size of the data, which needs to be transferred in this job, in terabytes. + ExpectedDataSizeInTerabytes *int32 `json:"expectedDataSizeInTerabytes,omitempty"` + // JobStages - READ-ONLY; List of stages that run in the job. + JobStages *[]JobStages `json:"jobStages,omitempty"` + // ContactDetails - Contact details for notification and shipping. + ContactDetails *ContactDetails `json:"contactDetails,omitempty"` + // ShippingAddress - Shipping address of the customer. + ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"` + // DeliveryPackage - READ-ONLY; Delivery package shipping details. + DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty"` + // ReturnPackage - READ-ONLY; Return package shipping details. + ReturnPackage *PackageShippingDetails `json:"returnPackage,omitempty"` + // DestinationAccountDetails - Destination account details. + DestinationAccountDetails *[]BasicDestinationAccountDetails `json:"destinationAccountDetails,omitempty"` + // ErrorDetails - READ-ONLY; Error details for failure. This is optional. + ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"` + // Preferences - Preferences for the order. + Preferences *Preferences `json:"preferences,omitempty"` + // CopyLogDetails - READ-ONLY; List of copy log details. + CopyLogDetails *[]BasicCopyLogDetails `json:"copyLogDetails,omitempty"` + // ReverseShipmentLabelSasKey - READ-ONLY; Shared access key to download the return shipment label + ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty"` + // ChainOfCustodySasKey - READ-ONLY; Shared access key to download the chain of custody logs + ChainOfCustodySasKey *string `json:"chainOfCustodySasKey,omitempty"` + // JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDataBoxDisk', 'JobDetailsTypeDataBoxHeavy', 'JobDetailsTypeDataBox' + JobDetailsType JobDetailsTypeEnum `json:"jobDetailsType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HeavyJobDetails. +func (hjd HeavyJobDetails) MarshalJSON() ([]byte, error) { + hjd.JobDetailsType = JobDetailsTypeDataBoxHeavy + objectMap := make(map[string]interface{}) + if hjd.DevicePassword != nil { + objectMap["devicePassword"] = hjd.DevicePassword + } + if hjd.ExpectedDataSizeInTerabytes != nil { + objectMap["expectedDataSizeInTerabytes"] = hjd.ExpectedDataSizeInTerabytes + } + if hjd.ContactDetails != nil { + objectMap["contactDetails"] = hjd.ContactDetails + } + if hjd.ShippingAddress != nil { + objectMap["shippingAddress"] = hjd.ShippingAddress + } + if hjd.DestinationAccountDetails != nil { + objectMap["destinationAccountDetails"] = hjd.DestinationAccountDetails + } + if hjd.Preferences != nil { + objectMap["preferences"] = hjd.Preferences + } + if hjd.JobDetailsType != "" { + objectMap["jobDetailsType"] = hjd.JobDetailsType + } + return json.Marshal(objectMap) +} + +// AsDiskJobDetails is the BasicJobDetails implementation for HeavyJobDetails. +func (hjd HeavyJobDetails) AsDiskJobDetails() (*DiskJobDetails, bool) { + return nil, false +} + +// AsHeavyJobDetails is the BasicJobDetails implementation for HeavyJobDetails. +func (hjd HeavyJobDetails) AsHeavyJobDetails() (*HeavyJobDetails, bool) { + return &hjd, true +} + +// AsJobDetailsType is the BasicJobDetails implementation for HeavyJobDetails. +func (hjd HeavyJobDetails) AsJobDetailsType() (*JobDetailsType, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for HeavyJobDetails. +func (hjd HeavyJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for HeavyJobDetails. +func (hjd HeavyJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &hjd, true +} + +// UnmarshalJSON is the custom unmarshaler for HeavyJobDetails struct. +func (hjd *HeavyJobDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "copyProgress": + if v != nil { + var copyProgress []CopyProgress + err = json.Unmarshal(*v, ©Progress) + if err != nil { + return err + } + hjd.CopyProgress = ©Progress + } + case "devicePassword": + if v != nil { + var devicePassword string + err = json.Unmarshal(*v, &devicePassword) + if err != nil { + return err + } + hjd.DevicePassword = &devicePassword + } + case "expectedDataSizeInTerabytes": + if v != nil { + var expectedDataSizeInTerabytes int32 + err = json.Unmarshal(*v, &expectedDataSizeInTerabytes) + if err != nil { + return err + } + hjd.ExpectedDataSizeInTerabytes = &expectedDataSizeInTerabytes + } + case "jobStages": + if v != nil { + var jobStages []JobStages + err = json.Unmarshal(*v, &jobStages) + if err != nil { + return err + } + hjd.JobStages = &jobStages + } + case "contactDetails": + if v != nil { + var contactDetails ContactDetails + err = json.Unmarshal(*v, &contactDetails) + if err != nil { + return err + } + hjd.ContactDetails = &contactDetails + } + case "shippingAddress": + if v != nil { + var shippingAddress ShippingAddress + err = json.Unmarshal(*v, &shippingAddress) + if err != nil { + return err + } + hjd.ShippingAddress = &shippingAddress + } + case "deliveryPackage": + if v != nil { + var deliveryPackage PackageShippingDetails + err = json.Unmarshal(*v, &deliveryPackage) + if err != nil { + return err + } + hjd.DeliveryPackage = &deliveryPackage + } + case "returnPackage": + if v != nil { + var returnPackage PackageShippingDetails + err = json.Unmarshal(*v, &returnPackage) + if err != nil { + return err + } + hjd.ReturnPackage = &returnPackage + } + case "destinationAccountDetails": + if v != nil { + destinationAccountDetails, err := unmarshalBasicDestinationAccountDetailsArray(*v) + if err != nil { + return err + } + hjd.DestinationAccountDetails = &destinationAccountDetails + } + case "errorDetails": + if v != nil { + var errorDetails []JobErrorDetails + err = json.Unmarshal(*v, &errorDetails) + if err != nil { + return err + } + hjd.ErrorDetails = &errorDetails + } + case "preferences": + if v != nil { + var preferences Preferences + err = json.Unmarshal(*v, &preferences) + if err != nil { + return err + } + hjd.Preferences = &preferences + } + case "copyLogDetails": + if v != nil { + copyLogDetails, err := unmarshalBasicCopyLogDetailsArray(*v) + if err != nil { + return err + } + hjd.CopyLogDetails = ©LogDetails + } + case "reverseShipmentLabelSasKey": + if v != nil { + var reverseShipmentLabelSasKey string + err = json.Unmarshal(*v, &reverseShipmentLabelSasKey) + if err != nil { + return err + } + hjd.ReverseShipmentLabelSasKey = &reverseShipmentLabelSasKey + } + case "chainOfCustodySasKey": + if v != nil { + var chainOfCustodySasKey string + err = json.Unmarshal(*v, &chainOfCustodySasKey) + if err != nil { + return err + } + hjd.ChainOfCustodySasKey = &chainOfCustodySasKey + } + case "jobDetailsType": + if v != nil { + var jobDetailsType JobDetailsTypeEnum + err = json.Unmarshal(*v, &jobDetailsType) + if err != nil { + return err + } + hjd.JobDetailsType = jobDetailsType + } + } + } + + return nil +} + +// HeavyJobSecrets the secrets related to a databox heavy job. +type HeavyJobSecrets struct { + // CabinetPodSecrets - READ-ONLY; Contains the list of secret objects for a databox heavy job. + CabinetPodSecrets *[]HeavySecret `json:"cabinetPodSecrets,omitempty"` + // DcAccessSecurityCode - Dc Access Security Code for Customer Managed Shipping + DcAccessSecurityCode *DcAccessSecurityCode `json:"dcAccessSecurityCode,omitempty"` + // JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeDataBoxDisk', 'JobSecretsTypeDataBoxHeavy', 'JobSecretsTypeDataBox' + JobSecretsType JobSecretsTypeEnum `json:"jobSecretsType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HeavyJobSecrets. +func (hjs HeavyJobSecrets) MarshalJSON() ([]byte, error) { + hjs.JobSecretsType = JobSecretsTypeDataBoxHeavy + objectMap := make(map[string]interface{}) + if hjs.DcAccessSecurityCode != nil { + objectMap["dcAccessSecurityCode"] = hjs.DcAccessSecurityCode + } + if hjs.JobSecretsType != "" { + objectMap["jobSecretsType"] = hjs.JobSecretsType + } + return json.Marshal(objectMap) +} + +// AsDiskJobSecrets is the BasicJobSecrets implementation for HeavyJobSecrets. +func (hjs HeavyJobSecrets) AsDiskJobSecrets() (*DiskJobSecrets, bool) { + return nil, false +} + +// AsHeavyJobSecrets is the BasicJobSecrets implementation for HeavyJobSecrets. +func (hjs HeavyJobSecrets) AsHeavyJobSecrets() (*HeavyJobSecrets, bool) { + return &hjs, true +} + +// AsJobSecretsType is the BasicJobSecrets implementation for HeavyJobSecrets. +func (hjs HeavyJobSecrets) AsJobSecretsType() (*JobSecretsType, bool) { + return nil, false +} + +// AsJobSecrets is the BasicJobSecrets implementation for HeavyJobSecrets. +func (hjs HeavyJobSecrets) AsJobSecrets() (*JobSecrets, bool) { + return nil, false +} + +// AsBasicJobSecrets is the BasicJobSecrets implementation for HeavyJobSecrets. +func (hjs HeavyJobSecrets) AsBasicJobSecrets() (BasicJobSecrets, bool) { + return &hjs, true +} + +// HeavyScheduleAvailabilityRequest request body to get the availability for scheduling heavy orders. +type HeavyScheduleAvailabilityRequest struct { + // StorageLocation - Location for data transfer. + // For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + StorageLocation *string `json:"storageLocation,omitempty"` + // SkuName - Possible values include: 'SkuNameScheduleAvailabilityRequest', 'SkuNameDataBox', 'SkuNameDataBoxDisk', 'SkuNameDataBoxHeavy' + SkuName SkuNameBasicScheduleAvailabilityRequest `json:"skuName,omitempty"` +} + +// MarshalJSON is the custom marshaler for HeavyScheduleAvailabilityRequest. +func (hsar HeavyScheduleAvailabilityRequest) MarshalJSON() ([]byte, error) { + hsar.SkuName = SkuNameDataBoxHeavy + objectMap := make(map[string]interface{}) + if hsar.StorageLocation != nil { + objectMap["storageLocation"] = hsar.StorageLocation + } + if hsar.SkuName != "" { + objectMap["skuName"] = hsar.SkuName + } + return json.Marshal(objectMap) +} + +// AsScheduleAvailabilityRequestType is the BasicScheduleAvailabilityRequest implementation for HeavyScheduleAvailabilityRequest. +func (hsar HeavyScheduleAvailabilityRequest) AsScheduleAvailabilityRequestType() (*ScheduleAvailabilityRequestType, bool) { + return nil, false +} + +// AsDiskScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for HeavyScheduleAvailabilityRequest. +func (hsar HeavyScheduleAvailabilityRequest) AsDiskScheduleAvailabilityRequest() (*DiskScheduleAvailabilityRequest, bool) { + return nil, false +} + +// AsHeavyScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for HeavyScheduleAvailabilityRequest. +func (hsar HeavyScheduleAvailabilityRequest) AsHeavyScheduleAvailabilityRequest() (*HeavyScheduleAvailabilityRequest, bool) { + return &hsar, true +} + +// AsScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for HeavyScheduleAvailabilityRequest. +func (hsar HeavyScheduleAvailabilityRequest) AsScheduleAvailabilityRequest() (*ScheduleAvailabilityRequest, bool) { + return nil, false +} + +// AsBasicScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for HeavyScheduleAvailabilityRequest. +func (hsar HeavyScheduleAvailabilityRequest) AsBasicScheduleAvailabilityRequest() (BasicScheduleAvailabilityRequest, bool) { + return &hsar, true +} + +// HeavySecret the secrets related to a databox heavy. +type HeavySecret struct { + // DeviceSerialNumber - READ-ONLY; Serial number of the assigned device. + DeviceSerialNumber *string `json:"deviceSerialNumber,omitempty"` + // DevicePassword - READ-ONLY; Password for out of the box experience on device. + DevicePassword *string `json:"devicePassword,omitempty"` + // NetworkConfigurations - READ-ONLY; Network configuration of the appliance. + NetworkConfigurations *[]ApplianceNetworkConfiguration `json:"networkConfigurations,omitempty"` + // EncodedValidationCertPubKey - READ-ONLY; The base 64 encoded public key to authenticate with the device + EncodedValidationCertPubKey *string `json:"encodedValidationCertPubKey,omitempty"` + // AccountCredentialDetails - READ-ONLY; Per account level access credentials. + AccountCredentialDetails *[]AccountCredentialDetails `json:"accountCredentialDetails,omitempty"` +} + +// JobDeliveryInfo additional delivery info. +type JobDeliveryInfo struct { + // ScheduledDateTime - Scheduled date time. + ScheduledDateTime *date.Time `json:"scheduledDateTime,omitempty"` +} + +// BasicJobDetails job details. +type BasicJobDetails interface { + AsDiskJobDetails() (*DiskJobDetails, bool) + AsHeavyJobDetails() (*HeavyJobDetails, bool) + AsJobDetailsType() (*JobDetailsType, bool) + AsJobDetails() (*JobDetails, bool) +} + +// JobDetails job details. +type JobDetails struct { + // ExpectedDataSizeInTerabytes - The expected size of the data, which needs to be transferred in this job, in terabytes. + ExpectedDataSizeInTerabytes *int32 `json:"expectedDataSizeInTerabytes,omitempty"` + // JobStages - READ-ONLY; List of stages that run in the job. + JobStages *[]JobStages `json:"jobStages,omitempty"` + // ContactDetails - Contact details for notification and shipping. + ContactDetails *ContactDetails `json:"contactDetails,omitempty"` + // ShippingAddress - Shipping address of the customer. + ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"` + // DeliveryPackage - READ-ONLY; Delivery package shipping details. + DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty"` + // ReturnPackage - READ-ONLY; Return package shipping details. + ReturnPackage *PackageShippingDetails `json:"returnPackage,omitempty"` + // DestinationAccountDetails - Destination account details. + DestinationAccountDetails *[]BasicDestinationAccountDetails `json:"destinationAccountDetails,omitempty"` + // ErrorDetails - READ-ONLY; Error details for failure. This is optional. + ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"` + // Preferences - Preferences for the order. + Preferences *Preferences `json:"preferences,omitempty"` + // CopyLogDetails - READ-ONLY; List of copy log details. + CopyLogDetails *[]BasicCopyLogDetails `json:"copyLogDetails,omitempty"` + // ReverseShipmentLabelSasKey - READ-ONLY; Shared access key to download the return shipment label + ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty"` + // ChainOfCustodySasKey - READ-ONLY; Shared access key to download the chain of custody logs + ChainOfCustodySasKey *string `json:"chainOfCustodySasKey,omitempty"` + // JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDataBoxDisk', 'JobDetailsTypeDataBoxHeavy', 'JobDetailsTypeDataBox' + JobDetailsType JobDetailsTypeEnum `json:"jobDetailsType,omitempty"` +} + +func unmarshalBasicJobDetails(body []byte) (BasicJobDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["jobDetailsType"] { + case string(JobDetailsTypeDataBoxDisk): + var djd DiskJobDetails + err := json.Unmarshal(body, &djd) + return djd, err + case string(JobDetailsTypeDataBoxHeavy): + var hjd HeavyJobDetails + err := json.Unmarshal(body, &hjd) + return hjd, err + case string(JobDetailsTypeDataBox): + var jdt JobDetailsType + err := json.Unmarshal(body, &jdt) + return jdt, err + default: + var jd JobDetails + err := json.Unmarshal(body, &jd) + return jd, err + } +} +func unmarshalBasicJobDetailsArray(body []byte) ([]BasicJobDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jdArray := make([]BasicJobDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jd, err := unmarshalBasicJobDetails(*rawMessage) + if err != nil { + return nil, err + } + jdArray[index] = jd + } + return jdArray, nil +} + +// MarshalJSON is the custom marshaler for JobDetails. +func (jd JobDetails) MarshalJSON() ([]byte, error) { + jd.JobDetailsType = JobDetailsTypeJobDetails + objectMap := make(map[string]interface{}) + if jd.ExpectedDataSizeInTerabytes != nil { + objectMap["expectedDataSizeInTerabytes"] = jd.ExpectedDataSizeInTerabytes + } + if jd.ContactDetails != nil { + objectMap["contactDetails"] = jd.ContactDetails + } + if jd.ShippingAddress != nil { + objectMap["shippingAddress"] = jd.ShippingAddress + } + if jd.DestinationAccountDetails != nil { + objectMap["destinationAccountDetails"] = jd.DestinationAccountDetails + } + if jd.Preferences != nil { + objectMap["preferences"] = jd.Preferences + } + if jd.JobDetailsType != "" { + objectMap["jobDetailsType"] = jd.JobDetailsType + } + return json.Marshal(objectMap) +} + +// AsDiskJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsDiskJobDetails() (*DiskJobDetails, bool) { + return nil, false +} + +// AsHeavyJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsHeavyJobDetails() (*HeavyJobDetails, bool) { + return nil, false +} + +// AsJobDetailsType is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsJobDetailsType() (*JobDetailsType, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsJobDetails() (*JobDetails, bool) { + return &jd, true +} + +// AsBasicJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &jd, true +} + +// UnmarshalJSON is the custom unmarshaler for JobDetails struct. +func (jd *JobDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "expectedDataSizeInTerabytes": + if v != nil { + var expectedDataSizeInTerabytes int32 + err = json.Unmarshal(*v, &expectedDataSizeInTerabytes) + if err != nil { + return err + } + jd.ExpectedDataSizeInTerabytes = &expectedDataSizeInTerabytes + } + case "jobStages": + if v != nil { + var jobStages []JobStages + err = json.Unmarshal(*v, &jobStages) + if err != nil { + return err + } + jd.JobStages = &jobStages + } + case "contactDetails": + if v != nil { + var contactDetails ContactDetails + err = json.Unmarshal(*v, &contactDetails) + if err != nil { + return err + } + jd.ContactDetails = &contactDetails + } + case "shippingAddress": + if v != nil { + var shippingAddress ShippingAddress + err = json.Unmarshal(*v, &shippingAddress) + if err != nil { + return err + } + jd.ShippingAddress = &shippingAddress + } + case "deliveryPackage": + if v != nil { + var deliveryPackage PackageShippingDetails + err = json.Unmarshal(*v, &deliveryPackage) + if err != nil { + return err + } + jd.DeliveryPackage = &deliveryPackage + } + case "returnPackage": + if v != nil { + var returnPackage PackageShippingDetails + err = json.Unmarshal(*v, &returnPackage) + if err != nil { + return err + } + jd.ReturnPackage = &returnPackage + } + case "destinationAccountDetails": + if v != nil { + destinationAccountDetails, err := unmarshalBasicDestinationAccountDetailsArray(*v) + if err != nil { + return err + } + jd.DestinationAccountDetails = &destinationAccountDetails + } + case "errorDetails": + if v != nil { + var errorDetails []JobErrorDetails + err = json.Unmarshal(*v, &errorDetails) + if err != nil { + return err + } + jd.ErrorDetails = &errorDetails + } + case "preferences": + if v != nil { + var preferences Preferences + err = json.Unmarshal(*v, &preferences) + if err != nil { + return err + } + jd.Preferences = &preferences + } + case "copyLogDetails": + if v != nil { + copyLogDetails, err := unmarshalBasicCopyLogDetailsArray(*v) + if err != nil { + return err + } + jd.CopyLogDetails = ©LogDetails + } + case "reverseShipmentLabelSasKey": + if v != nil { + var reverseShipmentLabelSasKey string + err = json.Unmarshal(*v, &reverseShipmentLabelSasKey) + if err != nil { + return err + } + jd.ReverseShipmentLabelSasKey = &reverseShipmentLabelSasKey + } + case "chainOfCustodySasKey": + if v != nil { + var chainOfCustodySasKey string + err = json.Unmarshal(*v, &chainOfCustodySasKey) + if err != nil { + return err + } + jd.ChainOfCustodySasKey = &chainOfCustodySasKey + } + case "jobDetailsType": + if v != nil { + var jobDetailsType JobDetailsTypeEnum + err = json.Unmarshal(*v, &jobDetailsType) + if err != nil { + return err + } + jd.JobDetailsType = jobDetailsType + } + } + } + + return nil +} + +// JobDetailsType databox Job Details +type JobDetailsType struct { + // CopyProgress - READ-ONLY; Copy progress per storage account. + CopyProgress *[]CopyProgress `json:"copyProgress,omitempty"` + // DevicePassword - Set Device password for unlocking Databox + DevicePassword *string `json:"devicePassword,omitempty"` + // ExpectedDataSizeInTerabytes - The expected size of the data, which needs to be transferred in this job, in terabytes. + ExpectedDataSizeInTerabytes *int32 `json:"expectedDataSizeInTerabytes,omitempty"` + // JobStages - READ-ONLY; List of stages that run in the job. + JobStages *[]JobStages `json:"jobStages,omitempty"` + // ContactDetails - Contact details for notification and shipping. + ContactDetails *ContactDetails `json:"contactDetails,omitempty"` + // ShippingAddress - Shipping address of the customer. + ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"` + // DeliveryPackage - READ-ONLY; Delivery package shipping details. + DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty"` + // ReturnPackage - READ-ONLY; Return package shipping details. + ReturnPackage *PackageShippingDetails `json:"returnPackage,omitempty"` + // DestinationAccountDetails - Destination account details. + DestinationAccountDetails *[]BasicDestinationAccountDetails `json:"destinationAccountDetails,omitempty"` + // ErrorDetails - READ-ONLY; Error details for failure. This is optional. + ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"` + // Preferences - Preferences for the order. + Preferences *Preferences `json:"preferences,omitempty"` + // CopyLogDetails - READ-ONLY; List of copy log details. + CopyLogDetails *[]BasicCopyLogDetails `json:"copyLogDetails,omitempty"` + // ReverseShipmentLabelSasKey - READ-ONLY; Shared access key to download the return shipment label + ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty"` + // ChainOfCustodySasKey - READ-ONLY; Shared access key to download the chain of custody logs + ChainOfCustodySasKey *string `json:"chainOfCustodySasKey,omitempty"` + // JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDataBoxDisk', 'JobDetailsTypeDataBoxHeavy', 'JobDetailsTypeDataBox' + JobDetailsType JobDetailsTypeEnum `json:"jobDetailsType,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobDetailsType. +func (jdt JobDetailsType) MarshalJSON() ([]byte, error) { + jdt.JobDetailsType = JobDetailsTypeDataBox + objectMap := make(map[string]interface{}) + if jdt.DevicePassword != nil { + objectMap["devicePassword"] = jdt.DevicePassword + } + if jdt.ExpectedDataSizeInTerabytes != nil { + objectMap["expectedDataSizeInTerabytes"] = jdt.ExpectedDataSizeInTerabytes + } + if jdt.ContactDetails != nil { + objectMap["contactDetails"] = jdt.ContactDetails + } + if jdt.ShippingAddress != nil { + objectMap["shippingAddress"] = jdt.ShippingAddress + } + if jdt.DestinationAccountDetails != nil { + objectMap["destinationAccountDetails"] = jdt.DestinationAccountDetails + } + if jdt.Preferences != nil { + objectMap["preferences"] = jdt.Preferences + } + if jdt.JobDetailsType != "" { + objectMap["jobDetailsType"] = jdt.JobDetailsType + } + return json.Marshal(objectMap) +} + +// AsDiskJobDetails is the BasicJobDetails implementation for JobDetailsType. +func (jdt JobDetailsType) AsDiskJobDetails() (*DiskJobDetails, bool) { + return nil, false +} + +// AsHeavyJobDetails is the BasicJobDetails implementation for JobDetailsType. +func (jdt JobDetailsType) AsHeavyJobDetails() (*HeavyJobDetails, bool) { + return nil, false +} + +// AsJobDetailsType is the BasicJobDetails implementation for JobDetailsType. +func (jdt JobDetailsType) AsJobDetailsType() (*JobDetailsType, bool) { + return &jdt, true +} + +// AsJobDetails is the BasicJobDetails implementation for JobDetailsType. +func (jdt JobDetailsType) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for JobDetailsType. +func (jdt JobDetailsType) AsBasicJobDetails() (BasicJobDetails, bool) { + return &jdt, true +} + +// UnmarshalJSON is the custom unmarshaler for JobDetailsType struct. +func (jdt *JobDetailsType) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "copyProgress": + if v != nil { + var copyProgress []CopyProgress + err = json.Unmarshal(*v, ©Progress) + if err != nil { + return err + } + jdt.CopyProgress = ©Progress + } + case "devicePassword": + if v != nil { + var devicePassword string + err = json.Unmarshal(*v, &devicePassword) + if err != nil { + return err + } + jdt.DevicePassword = &devicePassword + } + case "expectedDataSizeInTerabytes": + if v != nil { + var expectedDataSizeInTerabytes int32 + err = json.Unmarshal(*v, &expectedDataSizeInTerabytes) + if err != nil { + return err + } + jdt.ExpectedDataSizeInTerabytes = &expectedDataSizeInTerabytes + } + case "jobStages": + if v != nil { + var jobStages []JobStages + err = json.Unmarshal(*v, &jobStages) + if err != nil { + return err + } + jdt.JobStages = &jobStages + } + case "contactDetails": + if v != nil { + var contactDetails ContactDetails + err = json.Unmarshal(*v, &contactDetails) + if err != nil { + return err + } + jdt.ContactDetails = &contactDetails + } + case "shippingAddress": + if v != nil { + var shippingAddress ShippingAddress + err = json.Unmarshal(*v, &shippingAddress) + if err != nil { + return err + } + jdt.ShippingAddress = &shippingAddress + } + case "deliveryPackage": + if v != nil { + var deliveryPackage PackageShippingDetails + err = json.Unmarshal(*v, &deliveryPackage) + if err != nil { + return err + } + jdt.DeliveryPackage = &deliveryPackage + } + case "returnPackage": + if v != nil { + var returnPackage PackageShippingDetails + err = json.Unmarshal(*v, &returnPackage) + if err != nil { + return err + } + jdt.ReturnPackage = &returnPackage + } + case "destinationAccountDetails": + if v != nil { + destinationAccountDetails, err := unmarshalBasicDestinationAccountDetailsArray(*v) + if err != nil { + return err + } + jdt.DestinationAccountDetails = &destinationAccountDetails + } + case "errorDetails": + if v != nil { + var errorDetails []JobErrorDetails + err = json.Unmarshal(*v, &errorDetails) + if err != nil { + return err + } + jdt.ErrorDetails = &errorDetails + } + case "preferences": + if v != nil { + var preferences Preferences + err = json.Unmarshal(*v, &preferences) + if err != nil { + return err + } + jdt.Preferences = &preferences + } + case "copyLogDetails": + if v != nil { + copyLogDetails, err := unmarshalBasicCopyLogDetailsArray(*v) + if err != nil { + return err + } + jdt.CopyLogDetails = ©LogDetails + } + case "reverseShipmentLabelSasKey": + if v != nil { + var reverseShipmentLabelSasKey string + err = json.Unmarshal(*v, &reverseShipmentLabelSasKey) + if err != nil { + return err + } + jdt.ReverseShipmentLabelSasKey = &reverseShipmentLabelSasKey + } + case "chainOfCustodySasKey": + if v != nil { + var chainOfCustodySasKey string + err = json.Unmarshal(*v, &chainOfCustodySasKey) + if err != nil { + return err + } + jdt.ChainOfCustodySasKey = &chainOfCustodySasKey + } + case "jobDetailsType": + if v != nil { + var jobDetailsType JobDetailsTypeEnum + err = json.Unmarshal(*v, &jobDetailsType) + if err != nil { + return err + } + jdt.JobDetailsType = jobDetailsType + } + } + } + + return nil +} + +// JobErrorDetails job Error Details for providing the information and recommended action. +type JobErrorDetails struct { + // ErrorMessage - READ-ONLY; Message for the error. + ErrorMessage *string `json:"errorMessage,omitempty"` + // ErrorCode - READ-ONLY; Code for the error. + ErrorCode *int32 `json:"errorCode,omitempty"` + // RecommendedAction - READ-ONLY; Recommended action for the error. + RecommendedAction *string `json:"recommendedAction,omitempty"` + // ExceptionMessage - READ-ONLY; Contains the non localized exception message + ExceptionMessage *string `json:"exceptionMessage,omitempty"` +} + +// JobProperties job Properties +type JobProperties struct { + // IsCancellable - READ-ONLY; Describes whether the job is cancellable or not. + IsCancellable *bool `json:"isCancellable,omitempty"` + // IsDeletable - READ-ONLY; Describes whether the job is deletable or not. + IsDeletable *bool `json:"isDeletable,omitempty"` + // IsShippingAddressEditable - READ-ONLY; Describes whether the shipping address is editable or not. + IsShippingAddressEditable *bool `json:"isShippingAddressEditable,omitempty"` + // Status - READ-ONLY; Name of the stage which is in progress. Possible values include: 'StageNameDeviceOrdered', 'StageNameDevicePrepared', 'StageNameDispatched', 'StageNameDelivered', 'StageNamePickedUp', 'StageNameAtAzureDC', 'StageNameDataCopy', 'StageNameCompleted', 'StageNameCompletedWithErrors', 'StageNameCancelled', 'StageNameFailedIssueReportedAtCustomer', 'StageNameFailedIssueDetectedAtAzureDC', 'StageNameAborted', 'StageNameCompletedWithWarnings', 'StageNameReadyToDispatchFromAzureDC', 'StageNameReadyToReceiveAtAzureDC' + Status StageName `json:"status,omitempty"` + // StartTime - READ-ONLY; Time at which the job was started in UTC ISO 8601 format. + StartTime *date.Time `json:"startTime,omitempty"` + // Error - READ-ONLY; Top level error for the job. + Error *Error `json:"error,omitempty"` + // Details - Details of a job run. This field will only be sent for expand details filter. + Details BasicJobDetails `json:"details,omitempty"` + // CancellationReason - READ-ONLY; Reason for cancellation. + CancellationReason *string `json:"cancellationReason,omitempty"` + // DeliveryType - Delivery type of Job. Possible values include: 'NonScheduled', 'Scheduled' + DeliveryType JobDeliveryType `json:"deliveryType,omitempty"` + // DeliveryInfo - Delivery Info of Job. + DeliveryInfo *JobDeliveryInfo `json:"deliveryInfo,omitempty"` + // IsCancellableWithoutFee - READ-ONLY; Flag to indicate cancellation of scheduled job. + IsCancellableWithoutFee *bool `json:"isCancellableWithoutFee,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for JobProperties struct. +func (jp *JobProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "isCancellable": + if v != nil { + var isCancellable bool + err = json.Unmarshal(*v, &isCancellable) + if err != nil { + return err + } + jp.IsCancellable = &isCancellable + } + case "isDeletable": + if v != nil { + var isDeletable bool + err = json.Unmarshal(*v, &isDeletable) + if err != nil { + return err + } + jp.IsDeletable = &isDeletable + } + case "isShippingAddressEditable": + if v != nil { + var isShippingAddressEditable bool + err = json.Unmarshal(*v, &isShippingAddressEditable) + if err != nil { + return err + } + jp.IsShippingAddressEditable = &isShippingAddressEditable + } + case "status": + if v != nil { + var status StageName + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + jp.Status = status + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + jp.StartTime = &startTime + } + case "error": + if v != nil { + var errorVar Error + err = json.Unmarshal(*v, &errorVar) + if err != nil { + return err + } + jp.Error = &errorVar + } + case "details": + if v != nil { + details, err := unmarshalBasicJobDetails(*v) + if err != nil { + return err + } + jp.Details = details + } + case "cancellationReason": + if v != nil { + var cancellationReason string + err = json.Unmarshal(*v, &cancellationReason) + if err != nil { + return err + } + jp.CancellationReason = &cancellationReason + } + case "deliveryType": + if v != nil { + var deliveryType JobDeliveryType + err = json.Unmarshal(*v, &deliveryType) + if err != nil { + return err + } + jp.DeliveryType = deliveryType + } + case "deliveryInfo": + if v != nil { + var deliveryInfo JobDeliveryInfo + err = json.Unmarshal(*v, &deliveryInfo) + if err != nil { + return err + } + jp.DeliveryInfo = &deliveryInfo + } + case "isCancellableWithoutFee": + if v != nil { + var isCancellableWithoutFee bool + err = json.Unmarshal(*v, &isCancellableWithoutFee) + if err != nil { + return err + } + jp.IsCancellableWithoutFee = &isCancellableWithoutFee + } + } + } + + return nil +} + +// JobResource job Resource. +type JobResource struct { + autorest.Response `json:"-"` + // JobProperties - Properties of a job. + *JobProperties `json:"properties,omitempty"` + // Name - READ-ONLY; Name of the object. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; Id of the object. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; Type of the object. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed. + Location *string `json:"location,omitempty"` + // Tags - The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). + Tags map[string]*string `json:"tags"` + // Sku - The sku type. + Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobResource. +func (jr JobResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jr.JobProperties != nil { + objectMap["properties"] = jr.JobProperties + } + if jr.Location != nil { + objectMap["location"] = jr.Location + } + if jr.Tags != nil { + objectMap["tags"] = jr.Tags + } + if jr.Sku != nil { + objectMap["sku"] = jr.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobResource struct. +func (jr *JobResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobProperties JobProperties + err = json.Unmarshal(*v, &jobProperties) + if err != nil { + return err + } + jr.JobProperties = &jobProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + jr.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + jr.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + jr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + jr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + jr.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + jr.Sku = &sku + } + } + } + + return nil +} + +// JobResourceList job Resource Collection +type JobResourceList struct { + autorest.Response `json:"-"` + // Value - List of job resources. + Value *[]JobResource `json:"value,omitempty"` + // NextLink - Link for the next set of job resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobResourceListIterator provides access to a complete listing of JobResource values. +type JobResourceListIterator struct { + i int + page JobResourceListPage +} + +// 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 *JobResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListIterator.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 *JobResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobResourceListIterator) 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 JobResourceListIterator) Response() JobResourceList { + 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 JobResourceListIterator) Value() JobResource { + if !iter.page.NotDone() { + return JobResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobResourceListIterator type. +func NewJobResourceListIterator(page JobResourceListPage) JobResourceListIterator { + return JobResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jrl JobResourceList) IsEmpty() bool { + return jrl.Value == nil || len(*jrl.Value) == 0 +} + +// jobResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jrl JobResourceList) jobResourceListPreparer(ctx context.Context) (*http.Request, error) { + if jrl.NextLink == nil || len(to.String(jrl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jrl.NextLink))) +} + +// JobResourceListPage contains a page of JobResource values. +type JobResourceListPage struct { + fn func(context.Context, JobResourceList) (JobResourceList, error) + jrl JobResourceList +} + +// 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 *JobResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListPage.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.jrl) + if err != nil { + return err + } + page.jrl = 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 *JobResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobResourceListPage) NotDone() bool { + return !page.jrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobResourceListPage) Response() JobResourceList { + return page.jrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobResourceListPage) Values() []JobResource { + if page.jrl.IsEmpty() { + return nil + } + return *page.jrl.Value +} + +// Creates a new instance of the JobResourceListPage type. +func NewJobResourceListPage(getNextPage func(context.Context, JobResourceList) (JobResourceList, error)) JobResourceListPage { + return JobResourceListPage{fn: getNextPage} +} + +// JobResourceUpdateParameter the JobResourceUpdateParameter. +type JobResourceUpdateParameter struct { + // UpdateJobProperties - Properties of a job to be updated. + *UpdateJobProperties `json:"properties,omitempty"` + // Tags - The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for JobResourceUpdateParameter. +func (jrup JobResourceUpdateParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jrup.UpdateJobProperties != nil { + objectMap["properties"] = jrup.UpdateJobProperties + } + if jrup.Tags != nil { + objectMap["tags"] = jrup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobResourceUpdateParameter struct. +func (jrup *JobResourceUpdateParameter) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var updateJobProperties UpdateJobProperties + err = json.Unmarshal(*v, &updateJobProperties) + if err != nil { + return err + } + jrup.UpdateJobProperties = &updateJobProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + jrup.Tags = tags + } + } + } + + return nil +} + +// JobsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type JobsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *JobsCreateFuture) Result(client JobsClient) (jr JobResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databox.JobsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if jr.Response.Response, err = future.GetResult(sender); err == nil && jr.Response.Response.StatusCode != http.StatusNoContent { + jr, err = client.CreateResponder(jr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsCreateFuture", "Result", jr.Response.Response, "Failure responding to request") + } + } + return +} + +// JobsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type JobsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *JobsDeleteFuture) Result(client JobsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databox.JobsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// BasicJobSecrets the base class for the secrets +type BasicJobSecrets interface { + AsDiskJobSecrets() (*DiskJobSecrets, bool) + AsHeavyJobSecrets() (*HeavyJobSecrets, bool) + AsJobSecretsType() (*JobSecretsType, bool) + AsJobSecrets() (*JobSecrets, bool) +} + +// JobSecrets the base class for the secrets +type JobSecrets struct { + // DcAccessSecurityCode - Dc Access Security Code for Customer Managed Shipping + DcAccessSecurityCode *DcAccessSecurityCode `json:"dcAccessSecurityCode,omitempty"` + // JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeDataBoxDisk', 'JobSecretsTypeDataBoxHeavy', 'JobSecretsTypeDataBox' + JobSecretsType JobSecretsTypeEnum `json:"jobSecretsType,omitempty"` +} + +func unmarshalBasicJobSecrets(body []byte) (BasicJobSecrets, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["jobSecretsType"] { + case string(JobSecretsTypeDataBoxDisk): + var djs DiskJobSecrets + err := json.Unmarshal(body, &djs) + return djs, err + case string(JobSecretsTypeDataBoxHeavy): + var hjs HeavyJobSecrets + err := json.Unmarshal(body, &hjs) + return hjs, err + case string(JobSecretsTypeDataBox): + var jst JobSecretsType + err := json.Unmarshal(body, &jst) + return jst, err + default: + var js JobSecrets + err := json.Unmarshal(body, &js) + return js, err + } +} +func unmarshalBasicJobSecretsArray(body []byte) ([]BasicJobSecrets, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jsArray := make([]BasicJobSecrets, len(rawMessages)) + + for index, rawMessage := range rawMessages { + js, err := unmarshalBasicJobSecrets(*rawMessage) + if err != nil { + return nil, err + } + jsArray[index] = js + } + return jsArray, nil +} + +// MarshalJSON is the custom marshaler for JobSecrets. +func (js JobSecrets) MarshalJSON() ([]byte, error) { + js.JobSecretsType = JobSecretsTypeJobSecrets + objectMap := make(map[string]interface{}) + if js.DcAccessSecurityCode != nil { + objectMap["dcAccessSecurityCode"] = js.DcAccessSecurityCode + } + if js.JobSecretsType != "" { + objectMap["jobSecretsType"] = js.JobSecretsType + } + return json.Marshal(objectMap) +} + +// AsDiskJobSecrets is the BasicJobSecrets implementation for JobSecrets. +func (js JobSecrets) AsDiskJobSecrets() (*DiskJobSecrets, bool) { + return nil, false +} + +// AsHeavyJobSecrets is the BasicJobSecrets implementation for JobSecrets. +func (js JobSecrets) AsHeavyJobSecrets() (*HeavyJobSecrets, bool) { + return nil, false +} + +// AsJobSecretsType is the BasicJobSecrets implementation for JobSecrets. +func (js JobSecrets) AsJobSecretsType() (*JobSecretsType, bool) { + return nil, false +} + +// AsJobSecrets is the BasicJobSecrets implementation for JobSecrets. +func (js JobSecrets) AsJobSecrets() (*JobSecrets, bool) { + return &js, true +} + +// AsBasicJobSecrets is the BasicJobSecrets implementation for JobSecrets. +func (js JobSecrets) AsBasicJobSecrets() (BasicJobSecrets, bool) { + return &js, true +} + +// JobSecretsType the secrets related to a databox job. +type JobSecretsType struct { + // PodSecrets - Contains the list of secret objects for a job. + PodSecrets *[]Secret `json:"podSecrets,omitempty"` + // DcAccessSecurityCode - Dc Access Security Code for Customer Managed Shipping + DcAccessSecurityCode *DcAccessSecurityCode `json:"dcAccessSecurityCode,omitempty"` + // JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeDataBoxDisk', 'JobSecretsTypeDataBoxHeavy', 'JobSecretsTypeDataBox' + JobSecretsType JobSecretsTypeEnum `json:"jobSecretsType,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobSecretsType. +func (jst JobSecretsType) MarshalJSON() ([]byte, error) { + jst.JobSecretsType = JobSecretsTypeDataBox + objectMap := make(map[string]interface{}) + if jst.PodSecrets != nil { + objectMap["podSecrets"] = jst.PodSecrets + } + if jst.DcAccessSecurityCode != nil { + objectMap["dcAccessSecurityCode"] = jst.DcAccessSecurityCode + } + if jst.JobSecretsType != "" { + objectMap["jobSecretsType"] = jst.JobSecretsType + } + return json.Marshal(objectMap) +} + +// AsDiskJobSecrets is the BasicJobSecrets implementation for JobSecretsType. +func (jst JobSecretsType) AsDiskJobSecrets() (*DiskJobSecrets, bool) { + return nil, false +} + +// AsHeavyJobSecrets is the BasicJobSecrets implementation for JobSecretsType. +func (jst JobSecretsType) AsHeavyJobSecrets() (*HeavyJobSecrets, bool) { + return nil, false +} + +// AsJobSecretsType is the BasicJobSecrets implementation for JobSecretsType. +func (jst JobSecretsType) AsJobSecretsType() (*JobSecretsType, bool) { + return &jst, true +} + +// AsJobSecrets is the BasicJobSecrets implementation for JobSecretsType. +func (jst JobSecretsType) AsJobSecrets() (*JobSecrets, bool) { + return nil, false +} + +// AsBasicJobSecrets is the BasicJobSecrets implementation for JobSecretsType. +func (jst JobSecretsType) AsBasicJobSecrets() (BasicJobSecrets, bool) { + return &jst, true +} + +// JobStages job stages. +type JobStages struct { + // StageName - READ-ONLY; Name of the job stage. Possible values include: 'StageNameDeviceOrdered', 'StageNameDevicePrepared', 'StageNameDispatched', 'StageNameDelivered', 'StageNamePickedUp', 'StageNameAtAzureDC', 'StageNameDataCopy', 'StageNameCompleted', 'StageNameCompletedWithErrors', 'StageNameCancelled', 'StageNameFailedIssueReportedAtCustomer', 'StageNameFailedIssueDetectedAtAzureDC', 'StageNameAborted', 'StageNameCompletedWithWarnings', 'StageNameReadyToDispatchFromAzureDC', 'StageNameReadyToReceiveAtAzureDC' + StageName StageName `json:"stageName,omitempty"` + // DisplayName - READ-ONLY; Display name of the job stage. + DisplayName *string `json:"displayName,omitempty"` + // StageStatus - READ-ONLY; Status of the job stage. Possible values include: 'StageStatusNone', 'StageStatusInProgress', 'StageStatusSucceeded', 'StageStatusFailed', 'StageStatusCancelled', 'StageStatusCancelling', 'StageStatusSucceededWithErrors' + StageStatus StageStatus `json:"stageStatus,omitempty"` + // StageTime - READ-ONLY; Time for the job stage in UTC ISO 8601 format. + StageTime *date.Time `json:"stageTime,omitempty"` + // JobStageDetails - READ-ONLY; Job Stage Details + JobStageDetails interface{} `json:"jobStageDetails,omitempty"` + // ErrorDetails - READ-ONLY; Error details for the stage. + ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"` +} + +// JobsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type JobsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *JobsUpdateFuture) Result(client JobsClient) (jr JobResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databox.JobsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if jr.Response.Response, err = future.GetResult(sender); err == nil && jr.Response.Response.StatusCode != http.StatusNoContent { + jr, err = client.UpdateResponder(jr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsUpdateFuture", "Result", jr.Response.Response, "Failure responding to request") + } + } + return +} + +// NotificationPreference notification preference for a job stage. +type NotificationPreference struct { + // StageName - Name of the stage. Possible values include: 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy' + StageName NotificationStageName `json:"stageName,omitempty"` + // SendNotification - Notification is required or not. + SendNotification *bool `json:"sendNotification,omitempty"` +} + +// Operation operation entity. +type Operation struct { + // Name - READ-ONLY; Name of the operation. Format: {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} + Name *string `json:"name,omitempty"` + // Display - READ-ONLY; Operation display values. + Display *OperationDisplay `json:"display,omitempty"` + // Properties - READ-ONLY; Operation properties. + Properties interface{} `json:"properties,omitempty"` + // Origin - READ-ONLY; Origin of the operation. Can be : user|system|user,system + Origin *string `json:"origin,omitempty"` +} + +// OperationDisplay operation display +type OperationDisplay struct { + // Provider - Provider name. + Provider *string `json:"provider,omitempty"` + // Resource - Resource name. + Resource *string `json:"resource,omitempty"` + // Operation - Localized name of the operation for display purpose. + Operation *string `json:"operation,omitempty"` + // Description - Localized description of the operation for display purpose. + Description *string `json:"description,omitempty"` +} + +// OperationList operation Collection. +type OperationList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of operations. + Value *[]Operation `json:"value,omitempty"` + // NextLink - Link for the next set of operations. + 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} +} + +// PackageShippingDetails shipping details. +type PackageShippingDetails struct { + // CarrierName - READ-ONLY; Name of the carrier. + CarrierName *string `json:"carrierName,omitempty"` + // TrackingID - READ-ONLY; Tracking Id of shipment. + TrackingID *string `json:"trackingId,omitempty"` + // TrackingURL - READ-ONLY; Url where shipment can be tracked. + TrackingURL *string `json:"trackingUrl,omitempty"` +} + +// Preferences preferences related to the order +type Preferences struct { + // PreferredDataCenterRegion - Preferred Data Center Region. + PreferredDataCenterRegion *[]string `json:"preferredDataCenterRegion,omitempty"` + // TransportPreferences - Preferences related to the shipment logistics of the sku. + TransportPreferences *TransportPreferences `json:"transportPreferences,omitempty"` +} + +// PreferencesValidationRequest request to validate preference of transport and data center. +type PreferencesValidationRequest struct { + // Preference - Preference requested with respect to transport type and data center + Preference *Preferences `json:"preference,omitempty"` + // DeviceType - Device type to be used for the job. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' + DeviceType SkuName `json:"deviceType,omitempty"` + // ValidationType - Possible values include: 'ValidationTypeValidationInputRequest', 'ValidationTypeValidateCreateOrderLimit', 'ValidationTypeValidateDataDestinationDetails', 'ValidationTypeValidatePreferences', 'ValidationTypeValidateSkuAvailability', 'ValidationTypeValidateSubscriptionIsAllowedToCreateJob', 'ValidationTypeValidateAddress' + ValidationType ValidationType `json:"validationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for PreferencesValidationRequest. +func (pvr PreferencesValidationRequest) MarshalJSON() ([]byte, error) { + pvr.ValidationType = ValidationTypeValidatePreferences + objectMap := make(map[string]interface{}) + if pvr.Preference != nil { + objectMap["preference"] = pvr.Preference + } + if pvr.DeviceType != "" { + objectMap["deviceType"] = pvr.DeviceType + } + if pvr.ValidationType != "" { + objectMap["validationType"] = pvr.ValidationType + } + return json.Marshal(objectMap) +} + +// AsCreateOrderLimitForSubscriptionValidationRequest is the BasicValidationInputRequest implementation for PreferencesValidationRequest. +func (pvr PreferencesValidationRequest) AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) { + return nil, false +} + +// AsDataDestinationDetailsValidationRequest is the BasicValidationInputRequest implementation for PreferencesValidationRequest. +func (pvr PreferencesValidationRequest) AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) { + return nil, false +} + +// AsPreferencesValidationRequest is the BasicValidationInputRequest implementation for PreferencesValidationRequest. +func (pvr PreferencesValidationRequest) AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) { + return &pvr, true +} + +// AsSkuAvailabilityValidationRequest is the BasicValidationInputRequest implementation for PreferencesValidationRequest. +func (pvr PreferencesValidationRequest) AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) { + return nil, false +} + +// AsSubscriptionIsAllowedToCreateJobValidationRequest is the BasicValidationInputRequest implementation for PreferencesValidationRequest. +func (pvr PreferencesValidationRequest) AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) { + return nil, false +} + +// AsValidateAddress is the BasicValidationInputRequest implementation for PreferencesValidationRequest. +func (pvr PreferencesValidationRequest) AsValidateAddress() (*ValidateAddress, bool) { + return nil, false +} + +// AsValidationInputRequest is the BasicValidationInputRequest implementation for PreferencesValidationRequest. +func (pvr PreferencesValidationRequest) AsValidationInputRequest() (*ValidationInputRequest, bool) { + return nil, false +} + +// AsBasicValidationInputRequest is the BasicValidationInputRequest implementation for PreferencesValidationRequest. +func (pvr PreferencesValidationRequest) AsBasicValidationInputRequest() (BasicValidationInputRequest, bool) { + return &pvr, true +} + +// PreferencesValidationResponseProperties properties of data center and transport preference validation +// response. +type PreferencesValidationResponseProperties struct { + // Status - READ-ONLY; Validation status of requested data center and transport. Possible values include: 'ValidationStatusValid', 'ValidationStatusInvalid', 'ValidationStatusSkipped' + Status ValidationStatus `json:"status,omitempty"` + // Error - READ-ONLY; Error code and message of validation response. + Error *Error `json:"error,omitempty"` + // ValidationType - Possible values include: 'ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails', 'ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob' + ValidationType ValidationTypeBasicValidationInputResponse `json:"validationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for PreferencesValidationResponseProperties. +func (pvrp PreferencesValidationResponseProperties) MarshalJSON() ([]byte, error) { + pvrp.ValidationType = ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences + objectMap := make(map[string]interface{}) + if pvrp.ValidationType != "" { + objectMap["validationType"] = pvrp.ValidationType + } + return json.Marshal(objectMap) +} + +// AsAddressValidationProperties is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties. +func (pvrp PreferencesValidationResponseProperties) AsAddressValidationProperties() (*AddressValidationProperties, bool) { + return nil, false +} + +// AsCreateOrderLimitForSubscriptionValidationResponseProperties is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties. +func (pvrp PreferencesValidationResponseProperties) AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) { + return nil, false +} + +// AsDataDestinationDetailsValidationResponseProperties is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties. +func (pvrp PreferencesValidationResponseProperties) AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) { + return nil, false +} + +// AsPreferencesValidationResponseProperties is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties. +func (pvrp PreferencesValidationResponseProperties) AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) { + return &pvrp, true +} + +// AsSkuAvailabilityValidationResponseProperties is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties. +func (pvrp PreferencesValidationResponseProperties) AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) { + return nil, false +} + +// AsSubscriptionIsAllowedToCreateJobValidationResponseProperties is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties. +func (pvrp PreferencesValidationResponseProperties) AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) { + return nil, false +} + +// AsValidationInputResponse is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties. +func (pvrp PreferencesValidationResponseProperties) AsValidationInputResponse() (*ValidationInputResponse, bool) { + return nil, false +} + +// AsBasicValidationInputResponse is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties. +func (pvrp PreferencesValidationResponseProperties) AsBasicValidationInputResponse() (BasicValidationInputResponse, bool) { + return &pvrp, true +} + +// RegionConfigurationRequest request body to get the configuration for the region. +type RegionConfigurationRequest struct { + // ScheduleAvailabilityRequest - Request body to get the availability for scheduling orders. + ScheduleAvailabilityRequest BasicScheduleAvailabilityRequest `json:"scheduleAvailabilityRequest,omitempty"` + // TransportAvailabilityRequest - Request body to get the transport availability for given sku. + TransportAvailabilityRequest *TransportAvailabilityRequest `json:"transportAvailabilityRequest,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RegionConfigurationRequest struct. +func (rcr *RegionConfigurationRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "scheduleAvailabilityRequest": + if v != nil { + scheduleAvailabilityRequest, err := unmarshalBasicScheduleAvailabilityRequest(*v) + if err != nil { + return err + } + rcr.ScheduleAvailabilityRequest = scheduleAvailabilityRequest + } + case "transportAvailabilityRequest": + if v != nil { + var transportAvailabilityRequest TransportAvailabilityRequest + err = json.Unmarshal(*v, &transportAvailabilityRequest) + if err != nil { + return err + } + rcr.TransportAvailabilityRequest = &transportAvailabilityRequest + } + } + } + + return nil +} + +// RegionConfigurationResponse configuration response specific to a region. +type RegionConfigurationResponse struct { + autorest.Response `json:"-"` + // ScheduleAvailabilityResponse - READ-ONLY; Schedule availability for given sku in a region. + ScheduleAvailabilityResponse *ScheduleAvailabilityResponse `json:"scheduleAvailabilityResponse,omitempty"` + // TransportAvailabilityResponse - READ-ONLY; Transport options available for given sku in a region. + TransportAvailabilityResponse *TransportAvailabilityResponse `json:"transportAvailabilityResponse,omitempty"` +} + +// Resource model of the Resource. +type Resource struct { + // Location - The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed. + Location *string `json:"location,omitempty"` + // Tags - The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). + Tags map[string]*string `json:"tags"` + // Sku - The sku type. + 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.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) +} + +// BasicScheduleAvailabilityRequest request body to get the availability for scheduling orders. +type BasicScheduleAvailabilityRequest interface { + AsScheduleAvailabilityRequestType() (*ScheduleAvailabilityRequestType, bool) + AsDiskScheduleAvailabilityRequest() (*DiskScheduleAvailabilityRequest, bool) + AsHeavyScheduleAvailabilityRequest() (*HeavyScheduleAvailabilityRequest, bool) + AsScheduleAvailabilityRequest() (*ScheduleAvailabilityRequest, bool) +} + +// ScheduleAvailabilityRequest request body to get the availability for scheduling orders. +type ScheduleAvailabilityRequest struct { + // StorageLocation - Location for data transfer. + // For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + StorageLocation *string `json:"storageLocation,omitempty"` + // SkuName - Possible values include: 'SkuNameScheduleAvailabilityRequest', 'SkuNameDataBox', 'SkuNameDataBoxDisk', 'SkuNameDataBoxHeavy' + SkuName SkuNameBasicScheduleAvailabilityRequest `json:"skuName,omitempty"` +} + +func unmarshalBasicScheduleAvailabilityRequest(body []byte) (BasicScheduleAvailabilityRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["skuName"] { + case string(SkuNameDataBox): + var sart ScheduleAvailabilityRequestType + err := json.Unmarshal(body, &sart) + return sart, err + case string(SkuNameDataBoxDisk): + var dsar DiskScheduleAvailabilityRequest + err := json.Unmarshal(body, &dsar) + return dsar, err + case string(SkuNameDataBoxHeavy): + var hsar HeavyScheduleAvailabilityRequest + err := json.Unmarshal(body, &hsar) + return hsar, err + default: + var sar ScheduleAvailabilityRequest + err := json.Unmarshal(body, &sar) + return sar, err + } +} +func unmarshalBasicScheduleAvailabilityRequestArray(body []byte) ([]BasicScheduleAvailabilityRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sarArray := make([]BasicScheduleAvailabilityRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sar, err := unmarshalBasicScheduleAvailabilityRequest(*rawMessage) + if err != nil { + return nil, err + } + sarArray[index] = sar + } + return sarArray, nil +} + +// MarshalJSON is the custom marshaler for ScheduleAvailabilityRequest. +func (sar ScheduleAvailabilityRequest) MarshalJSON() ([]byte, error) { + sar.SkuName = SkuNameScheduleAvailabilityRequest + objectMap := make(map[string]interface{}) + if sar.StorageLocation != nil { + objectMap["storageLocation"] = sar.StorageLocation + } + if sar.SkuName != "" { + objectMap["skuName"] = sar.SkuName + } + return json.Marshal(objectMap) +} + +// AsScheduleAvailabilityRequestType is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequest. +func (sar ScheduleAvailabilityRequest) AsScheduleAvailabilityRequestType() (*ScheduleAvailabilityRequestType, bool) { + return nil, false +} + +// AsDiskScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequest. +func (sar ScheduleAvailabilityRequest) AsDiskScheduleAvailabilityRequest() (*DiskScheduleAvailabilityRequest, bool) { + return nil, false +} + +// AsHeavyScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequest. +func (sar ScheduleAvailabilityRequest) AsHeavyScheduleAvailabilityRequest() (*HeavyScheduleAvailabilityRequest, bool) { + return nil, false +} + +// AsScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequest. +func (sar ScheduleAvailabilityRequest) AsScheduleAvailabilityRequest() (*ScheduleAvailabilityRequest, bool) { + return &sar, true +} + +// AsBasicScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequest. +func (sar ScheduleAvailabilityRequest) AsBasicScheduleAvailabilityRequest() (BasicScheduleAvailabilityRequest, bool) { + return &sar, true +} + +// ScheduleAvailabilityRequestType request body to get the availability for scheduling data box orders +// orders. +type ScheduleAvailabilityRequestType struct { + // StorageLocation - Location for data transfer. + // For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + StorageLocation *string `json:"storageLocation,omitempty"` + // SkuName - Possible values include: 'SkuNameScheduleAvailabilityRequest', 'SkuNameDataBox', 'SkuNameDataBoxDisk', 'SkuNameDataBoxHeavy' + SkuName SkuNameBasicScheduleAvailabilityRequest `json:"skuName,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduleAvailabilityRequestType. +func (sart ScheduleAvailabilityRequestType) MarshalJSON() ([]byte, error) { + sart.SkuName = SkuNameDataBox + objectMap := make(map[string]interface{}) + if sart.StorageLocation != nil { + objectMap["storageLocation"] = sart.StorageLocation + } + if sart.SkuName != "" { + objectMap["skuName"] = sart.SkuName + } + return json.Marshal(objectMap) +} + +// AsScheduleAvailabilityRequestType is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequestType. +func (sart ScheduleAvailabilityRequestType) AsScheduleAvailabilityRequestType() (*ScheduleAvailabilityRequestType, bool) { + return &sart, true +} + +// AsDiskScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequestType. +func (sart ScheduleAvailabilityRequestType) AsDiskScheduleAvailabilityRequest() (*DiskScheduleAvailabilityRequest, bool) { + return nil, false +} + +// AsHeavyScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequestType. +func (sart ScheduleAvailabilityRequestType) AsHeavyScheduleAvailabilityRequest() (*HeavyScheduleAvailabilityRequest, bool) { + return nil, false +} + +// AsScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequestType. +func (sart ScheduleAvailabilityRequestType) AsScheduleAvailabilityRequest() (*ScheduleAvailabilityRequest, bool) { + return nil, false +} + +// AsBasicScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequestType. +func (sart ScheduleAvailabilityRequestType) AsBasicScheduleAvailabilityRequest() (BasicScheduleAvailabilityRequest, bool) { + return &sart, true +} + +// ScheduleAvailabilityResponse schedule availability response for given sku in a region. +type ScheduleAvailabilityResponse struct { + // AvailableDates - READ-ONLY; List of dates available to schedule + AvailableDates *[]date.Time `json:"availableDates,omitempty"` +} + +// Secret the secrets related to a DataBox. +type Secret struct { + // DeviceSerialNumber - READ-ONLY; Serial number of the assigned device. + DeviceSerialNumber *string `json:"deviceSerialNumber,omitempty"` + // DevicePassword - READ-ONLY; Password for out of the box experience on device. + DevicePassword *string `json:"devicePassword,omitempty"` + // NetworkConfigurations - READ-ONLY; Network configuration of the appliance. + NetworkConfigurations *[]ApplianceNetworkConfiguration `json:"networkConfigurations,omitempty"` + // EncodedValidationCertPubKey - READ-ONLY; The base 64 encoded public key to authenticate with the device + EncodedValidationCertPubKey *string `json:"encodedValidationCertPubKey,omitempty"` + // AccountCredentialDetails - READ-ONLY; Per account level access credentials. + AccountCredentialDetails *[]AccountCredentialDetails `json:"accountCredentialDetails,omitempty"` +} + +// ShareCredentialDetails credential details of the shares in account. +type ShareCredentialDetails struct { + // ShareName - READ-ONLY; Name of the share. + ShareName *string `json:"shareName,omitempty"` + // ShareType - READ-ONLY; Type of the share. Possible values include: 'ShareDestinationFormatTypeUnknownType', 'ShareDestinationFormatTypeHCS', 'ShareDestinationFormatTypeBlockBlob', 'ShareDestinationFormatTypePageBlob', 'ShareDestinationFormatTypeAzureFile', 'ShareDestinationFormatTypeManagedDisk' + ShareType ShareDestinationFormatType `json:"shareType,omitempty"` + // UserName - READ-ONLY; User name for the share. + UserName *string `json:"userName,omitempty"` + // Password - READ-ONLY; Password for the share. + Password *string `json:"password,omitempty"` + // SupportedAccessProtocols - READ-ONLY; Access protocols supported on the device. + SupportedAccessProtocols *[]AccessProtocol `json:"supportedAccessProtocols,omitempty"` +} + +// ShipmentPickUpRequest shipment pick up request details. +type ShipmentPickUpRequest struct { + // StartTime - Minimum date after which the pick up should commence, this must be in local time of pick up area. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Maximum date before which the pick up should commence, this must be in local time of pick up area. + EndTime *date.Time `json:"endTime,omitempty"` + // ShipmentLocation - Shipment Location in the pickup place. Eg.front desk + ShipmentLocation *string `json:"shipmentLocation,omitempty"` +} + +// ShipmentPickUpResponse shipment pick up response. +type ShipmentPickUpResponse struct { + autorest.Response `json:"-"` + // ConfirmationNumber - READ-ONLY; Confirmation number for the pick up request. + ConfirmationNumber *string `json:"confirmationNumber,omitempty"` + // ReadyByTime - READ-ONLY; Time by which shipment should be ready for pick up, this is in local time of pick up area. + ReadyByTime *date.Time `json:"readyByTime,omitempty"` +} + +// ShippingAddress shipping address where customer wishes to receive the device. +type ShippingAddress struct { + // StreetAddress1 - Street Address line 1. + StreetAddress1 *string `json:"streetAddress1,omitempty"` + // StreetAddress2 - Street Address line 2. + StreetAddress2 *string `json:"streetAddress2,omitempty"` + // StreetAddress3 - Street Address line 3. + StreetAddress3 *string `json:"streetAddress3,omitempty"` + // City - Name of the City. + City *string `json:"city,omitempty"` + // StateOrProvince - Name of the State or Province. + StateOrProvince *string `json:"stateOrProvince,omitempty"` + // Country - Name of the Country. + Country *string `json:"country,omitempty"` + // PostalCode - Postal code. + PostalCode *string `json:"postalCode,omitempty"` + // ZipExtendedCode - Extended Zip Code. + ZipExtendedCode *string `json:"zipExtendedCode,omitempty"` + // CompanyName - Name of the company. + CompanyName *string `json:"companyName,omitempty"` + // AddressType - Type of address. Possible values include: 'None', 'Residential', 'Commercial' + AddressType AddressType `json:"addressType,omitempty"` +} + +// Sku the Sku. +type Sku struct { + // Name - The sku name. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' + Name SkuName `json:"name,omitempty"` + // DisplayName - The display name of the sku. + DisplayName *string `json:"displayName,omitempty"` + // Family - The sku family. + Family *string `json:"family,omitempty"` +} + +// SkuAvailabilityValidationRequest request to validate sku availability. +type SkuAvailabilityValidationRequest struct { + // DeviceType - Device type to be used for the job. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' + DeviceType SkuName `json:"deviceType,omitempty"` + // TransferType - Type of the transfer. + TransferType *string `json:"transferType,omitempty"` + // Country - ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + Country *string `json:"country,omitempty"` + // Location - Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + Location *string `json:"location,omitempty"` + // ValidationType - Possible values include: 'ValidationTypeValidationInputRequest', 'ValidationTypeValidateCreateOrderLimit', 'ValidationTypeValidateDataDestinationDetails', 'ValidationTypeValidatePreferences', 'ValidationTypeValidateSkuAvailability', 'ValidationTypeValidateSubscriptionIsAllowedToCreateJob', 'ValidationTypeValidateAddress' + ValidationType ValidationType `json:"validationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SkuAvailabilityValidationRequest. +func (savr SkuAvailabilityValidationRequest) MarshalJSON() ([]byte, error) { + savr.ValidationType = ValidationTypeValidateSkuAvailability + objectMap := make(map[string]interface{}) + if savr.DeviceType != "" { + objectMap["deviceType"] = savr.DeviceType + } + if savr.TransferType != nil { + objectMap["transferType"] = savr.TransferType + } + if savr.Country != nil { + objectMap["country"] = savr.Country + } + if savr.Location != nil { + objectMap["location"] = savr.Location + } + if savr.ValidationType != "" { + objectMap["validationType"] = savr.ValidationType + } + return json.Marshal(objectMap) +} + +// AsCreateOrderLimitForSubscriptionValidationRequest is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest. +func (savr SkuAvailabilityValidationRequest) AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) { + return nil, false +} + +// AsDataDestinationDetailsValidationRequest is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest. +func (savr SkuAvailabilityValidationRequest) AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) { + return nil, false +} + +// AsPreferencesValidationRequest is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest. +func (savr SkuAvailabilityValidationRequest) AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) { + return nil, false +} + +// AsSkuAvailabilityValidationRequest is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest. +func (savr SkuAvailabilityValidationRequest) AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) { + return &savr, true +} + +// AsSubscriptionIsAllowedToCreateJobValidationRequest is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest. +func (savr SkuAvailabilityValidationRequest) AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) { + return nil, false +} + +// AsValidateAddress is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest. +func (savr SkuAvailabilityValidationRequest) AsValidateAddress() (*ValidateAddress, bool) { + return nil, false +} + +// AsValidationInputRequest is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest. +func (savr SkuAvailabilityValidationRequest) AsValidationInputRequest() (*ValidationInputRequest, bool) { + return nil, false +} + +// AsBasicValidationInputRequest is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest. +func (savr SkuAvailabilityValidationRequest) AsBasicValidationInputRequest() (BasicValidationInputRequest, bool) { + return &savr, true +} + +// SkuAvailabilityValidationResponseProperties properties of sku availability validation response. +type SkuAvailabilityValidationResponseProperties struct { + // Status - READ-ONLY; Sku availability validation status. Possible values include: 'ValidationStatusValid', 'ValidationStatusInvalid', 'ValidationStatusSkipped' + Status ValidationStatus `json:"status,omitempty"` + // Error - READ-ONLY; Error code and message of validation response. + Error *Error `json:"error,omitempty"` + // ValidationType - Possible values include: 'ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails', 'ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob' + ValidationType ValidationTypeBasicValidationInputResponse `json:"validationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SkuAvailabilityValidationResponseProperties. +func (savrp SkuAvailabilityValidationResponseProperties) MarshalJSON() ([]byte, error) { + savrp.ValidationType = ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability + objectMap := make(map[string]interface{}) + if savrp.ValidationType != "" { + objectMap["validationType"] = savrp.ValidationType + } + return json.Marshal(objectMap) +} + +// AsAddressValidationProperties is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties. +func (savrp SkuAvailabilityValidationResponseProperties) AsAddressValidationProperties() (*AddressValidationProperties, bool) { + return nil, false +} + +// AsCreateOrderLimitForSubscriptionValidationResponseProperties is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties. +func (savrp SkuAvailabilityValidationResponseProperties) AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) { + return nil, false +} + +// AsDataDestinationDetailsValidationResponseProperties is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties. +func (savrp SkuAvailabilityValidationResponseProperties) AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) { + return nil, false +} + +// AsPreferencesValidationResponseProperties is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties. +func (savrp SkuAvailabilityValidationResponseProperties) AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) { + return nil, false +} + +// AsSkuAvailabilityValidationResponseProperties is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties. +func (savrp SkuAvailabilityValidationResponseProperties) AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) { + return &savrp, true +} + +// AsSubscriptionIsAllowedToCreateJobValidationResponseProperties is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties. +func (savrp SkuAvailabilityValidationResponseProperties) AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) { + return nil, false +} + +// AsValidationInputResponse is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties. +func (savrp SkuAvailabilityValidationResponseProperties) AsValidationInputResponse() (*ValidationInputResponse, bool) { + return nil, false +} + +// AsBasicValidationInputResponse is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties. +func (savrp SkuAvailabilityValidationResponseProperties) AsBasicValidationInputResponse() (BasicValidationInputResponse, bool) { + return &savrp, true +} + +// SkuCapacity capacity of the sku. +type SkuCapacity struct { + // Usable - READ-ONLY; Usable capacity in TB. + Usable *string `json:"usable,omitempty"` + // Maximum - READ-ONLY; Maximum capacity in TB. + Maximum *string `json:"maximum,omitempty"` +} + +// SkuCost describes metadata for retrieving price info. +type SkuCost struct { + // MeterID - READ-ONLY; Meter id of the Sku. + MeterID *string `json:"meterId,omitempty"` + // MeterType - READ-ONLY; The type of the meter. + MeterType *string `json:"meterType,omitempty"` +} + +// SkuInformation information of the sku. +type SkuInformation struct { + // Sku - READ-ONLY; The Sku. + Sku *Sku `json:"sku,omitempty"` + // Enabled - READ-ONLY; The sku is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + // SkuProperties - READ-ONLY; Properties of the sku. + *SkuProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SkuInformation. +func (si SkuInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SkuInformation struct. +func (si *SkuInformation) UnmarshalJSON(body []byte) error { + 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 + } + si.Sku = &sku + } + case "enabled": + if v != nil { + var enabled bool + err = json.Unmarshal(*v, &enabled) + if err != nil { + return err + } + si.Enabled = &enabled + } + case "properties": + if v != nil { + var skuProperties SkuProperties + err = json.Unmarshal(*v, &skuProperties) + if err != nil { + return err + } + si.SkuProperties = &skuProperties + } + } + } + + return nil +} + +// SkuProperties properties of the sku. +type SkuProperties struct { + // DestinationToServiceLocationMap - READ-ONLY; The map of destination location to service location. + DestinationToServiceLocationMap *[]DestinationToServiceLocationMap `json:"destinationToServiceLocationMap,omitempty"` + // Capacity - READ-ONLY; Capacity of the Sku. + Capacity *SkuCapacity `json:"capacity,omitempty"` + // Costs - READ-ONLY; Cost of the Sku. + Costs *[]SkuCost `json:"costs,omitempty"` + // APIVersions - READ-ONLY; Api versions that support this Sku. + APIVersions *[]string `json:"apiVersions,omitempty"` + // DisabledReason - READ-ONLY; Reason why the Sku is disabled. Possible values include: 'SkuDisabledReasonNone', 'SkuDisabledReasonCountry', 'SkuDisabledReasonRegion', 'SkuDisabledReasonFeature', 'SkuDisabledReasonOfferType', 'SkuDisabledReasonNoSubscriptionInfo' + DisabledReason SkuDisabledReason `json:"disabledReason,omitempty"` + // DisabledReasonMessage - READ-ONLY; Message for why the Sku is disabled. + DisabledReasonMessage *string `json:"disabledReasonMessage,omitempty"` + // RequiredFeature - READ-ONLY; Required feature to access the sku. + RequiredFeature *string `json:"requiredFeature,omitempty"` +} + +// SubscriptionIsAllowedToCreateJobValidationRequest request to validate subscription permission to create +// jobs. +type SubscriptionIsAllowedToCreateJobValidationRequest struct { + // ValidationType - Possible values include: 'ValidationTypeValidationInputRequest', 'ValidationTypeValidateCreateOrderLimit', 'ValidationTypeValidateDataDestinationDetails', 'ValidationTypeValidatePreferences', 'ValidationTypeValidateSkuAvailability', 'ValidationTypeValidateSubscriptionIsAllowedToCreateJob', 'ValidationTypeValidateAddress' + ValidationType ValidationType `json:"validationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubscriptionIsAllowedToCreateJobValidationRequest. +func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) MarshalJSON() ([]byte, error) { + siatcjvr.ValidationType = ValidationTypeValidateSubscriptionIsAllowedToCreateJob + objectMap := make(map[string]interface{}) + if siatcjvr.ValidationType != "" { + objectMap["validationType"] = siatcjvr.ValidationType + } + return json.Marshal(objectMap) +} + +// AsCreateOrderLimitForSubscriptionValidationRequest is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest. +func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) { + return nil, false +} + +// AsDataDestinationDetailsValidationRequest is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest. +func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) { + return nil, false +} + +// AsPreferencesValidationRequest is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest. +func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) { + return nil, false +} + +// AsSkuAvailabilityValidationRequest is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest. +func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) { + return nil, false +} + +// AsSubscriptionIsAllowedToCreateJobValidationRequest is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest. +func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) { + return &siatcjvr, true +} + +// AsValidateAddress is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest. +func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsValidateAddress() (*ValidateAddress, bool) { + return nil, false +} + +// AsValidationInputRequest is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest. +func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsValidationInputRequest() (*ValidationInputRequest, bool) { + return nil, false +} + +// AsBasicValidationInputRequest is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest. +func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsBasicValidationInputRequest() (BasicValidationInputRequest, bool) { + return &siatcjvr, true +} + +// SubscriptionIsAllowedToCreateJobValidationResponseProperties properties of subscription permission to +// create job validation response. +type SubscriptionIsAllowedToCreateJobValidationResponseProperties struct { + // Status - READ-ONLY; Validation status of subscription permission to create job. Possible values include: 'ValidationStatusValid', 'ValidationStatusInvalid', 'ValidationStatusSkipped' + Status ValidationStatus `json:"status,omitempty"` + // Error - READ-ONLY; Error code and message of validation response. + Error *Error `json:"error,omitempty"` + // ValidationType - Possible values include: 'ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails', 'ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob' + ValidationType ValidationTypeBasicValidationInputResponse `json:"validationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubscriptionIsAllowedToCreateJobValidationResponseProperties. +func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) MarshalJSON() ([]byte, error) { + siatcjvrp.ValidationType = ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob + objectMap := make(map[string]interface{}) + if siatcjvrp.ValidationType != "" { + objectMap["validationType"] = siatcjvrp.ValidationType + } + return json.Marshal(objectMap) +} + +// AsAddressValidationProperties is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties. +func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsAddressValidationProperties() (*AddressValidationProperties, bool) { + return nil, false +} + +// AsCreateOrderLimitForSubscriptionValidationResponseProperties is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties. +func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) { + return nil, false +} + +// AsDataDestinationDetailsValidationResponseProperties is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties. +func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) { + return nil, false +} + +// AsPreferencesValidationResponseProperties is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties. +func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) { + return nil, false +} + +// AsSkuAvailabilityValidationResponseProperties is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties. +func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) { + return nil, false +} + +// AsSubscriptionIsAllowedToCreateJobValidationResponseProperties is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties. +func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) { + return &siatcjvrp, true +} + +// AsValidationInputResponse is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties. +func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsValidationInputResponse() (*ValidationInputResponse, bool) { + return nil, false +} + +// AsBasicValidationInputResponse is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties. +func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsBasicValidationInputResponse() (BasicValidationInputResponse, bool) { + return &siatcjvrp, true +} + +// TransportAvailabilityDetails transport options availability details for given region. +type TransportAvailabilityDetails struct { + // ShipmentType - READ-ONLY; Transport Shipment Type supported for given region. Possible values include: 'CustomerManaged', 'MicrosoftManaged' + ShipmentType TransportShipmentTypes `json:"shipmentType,omitempty"` +} + +// TransportAvailabilityRequest request body to get the transport availability for given sku. +type TransportAvailabilityRequest struct { + // SkuName - Type of the device. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' + SkuName SkuName `json:"skuName,omitempty"` +} + +// TransportAvailabilityResponse transport options available for given sku in a region. +type TransportAvailabilityResponse struct { + // TransportAvailabilityDetails - READ-ONLY; List of transport availability details for given region + TransportAvailabilityDetails *[]TransportAvailabilityDetails `json:"transportAvailabilityDetails,omitempty"` +} + +// TransportPreferences preferences related to the shipment logistics of the sku +type TransportPreferences struct { + // PreferredShipmentType - Indicates Shipment Logistics type that the customer preferred. Possible values include: 'CustomerManaged', 'MicrosoftManaged' + PreferredShipmentType TransportShipmentTypes `json:"preferredShipmentType,omitempty"` +} + +// UnencryptedCredentials unencrypted credentials for accessing device. +type UnencryptedCredentials struct { + // JobName - READ-ONLY; Name of the job. + JobName *string `json:"jobName,omitempty"` + // JobSecrets - READ-ONLY; Secrets related to this job. + JobSecrets BasicJobSecrets `json:"jobSecrets,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UnencryptedCredentials struct. +func (uc *UnencryptedCredentials) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "jobName": + if v != nil { + var jobName string + err = json.Unmarshal(*v, &jobName) + if err != nil { + return err + } + uc.JobName = &jobName + } + case "jobSecrets": + if v != nil { + jobSecrets, err := unmarshalBasicJobSecrets(*v) + if err != nil { + return err + } + uc.JobSecrets = jobSecrets + } + } + } + + return nil +} + +// UnencryptedCredentialsList list of unencrypted credentials for accessing device. +type UnencryptedCredentialsList struct { + autorest.Response `json:"-"` + // Value - List of unencrypted credentials. + Value *[]UnencryptedCredentials `json:"value,omitempty"` + // NextLink - Link for the next set of unencrypted credentials. + NextLink *string `json:"nextLink,omitempty"` +} + +// UpdateJobDetails job details for update. +type UpdateJobDetails struct { + // ContactDetails - Contact details for notification and shipping. + ContactDetails *ContactDetails `json:"contactDetails,omitempty"` + // ShippingAddress - Shipping address of the customer. + ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"` +} + +// UpdateJobProperties job Properties for update +type UpdateJobProperties struct { + // Details - Details of a job to be updated. + Details *UpdateJobDetails `json:"details,omitempty"` + // DestinationAccountDetails - Destination account details. + DestinationAccountDetails *[]BasicDestinationAccountDetails `json:"destinationAccountDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UpdateJobProperties struct. +func (ujp *UpdateJobProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "details": + if v != nil { + var details UpdateJobDetails + err = json.Unmarshal(*v, &details) + if err != nil { + return err + } + ujp.Details = &details + } + case "destinationAccountDetails": + if v != nil { + destinationAccountDetails, err := unmarshalBasicDestinationAccountDetailsArray(*v) + if err != nil { + return err + } + ujp.DestinationAccountDetails = &destinationAccountDetails + } + } + } + + return nil +} + +// ValidateAddress the requirements to validate customer address where the device needs to be shipped. +type ValidateAddress struct { + // ShippingAddress - Shipping address of the customer. + ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"` + // DeviceType - Device type to be used for the job. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' + DeviceType SkuName `json:"deviceType,omitempty"` + // TransportPreferences - Preferences related to the shipment logistics of the sku. + TransportPreferences *TransportPreferences `json:"transportPreferences,omitempty"` + // ValidationType - Possible values include: 'ValidationTypeValidationInputRequest', 'ValidationTypeValidateCreateOrderLimit', 'ValidationTypeValidateDataDestinationDetails', 'ValidationTypeValidatePreferences', 'ValidationTypeValidateSkuAvailability', 'ValidationTypeValidateSubscriptionIsAllowedToCreateJob', 'ValidationTypeValidateAddress' + ValidationType ValidationType `json:"validationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ValidateAddress. +func (va ValidateAddress) MarshalJSON() ([]byte, error) { + va.ValidationType = ValidationTypeValidateAddress + objectMap := make(map[string]interface{}) + if va.ShippingAddress != nil { + objectMap["shippingAddress"] = va.ShippingAddress + } + if va.DeviceType != "" { + objectMap["deviceType"] = va.DeviceType + } + if va.TransportPreferences != nil { + objectMap["transportPreferences"] = va.TransportPreferences + } + if va.ValidationType != "" { + objectMap["validationType"] = va.ValidationType + } + return json.Marshal(objectMap) +} + +// AsCreateOrderLimitForSubscriptionValidationRequest is the BasicValidationInputRequest implementation for ValidateAddress. +func (va ValidateAddress) AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) { + return nil, false +} + +// AsDataDestinationDetailsValidationRequest is the BasicValidationInputRequest implementation for ValidateAddress. +func (va ValidateAddress) AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) { + return nil, false +} + +// AsPreferencesValidationRequest is the BasicValidationInputRequest implementation for ValidateAddress. +func (va ValidateAddress) AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) { + return nil, false +} + +// AsSkuAvailabilityValidationRequest is the BasicValidationInputRequest implementation for ValidateAddress. +func (va ValidateAddress) AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) { + return nil, false +} + +// AsSubscriptionIsAllowedToCreateJobValidationRequest is the BasicValidationInputRequest implementation for ValidateAddress. +func (va ValidateAddress) AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) { + return nil, false +} + +// AsValidateAddress is the BasicValidationInputRequest implementation for ValidateAddress. +func (va ValidateAddress) AsValidateAddress() (*ValidateAddress, bool) { + return &va, true +} + +// AsValidationInputRequest is the BasicValidationInputRequest implementation for ValidateAddress. +func (va ValidateAddress) AsValidationInputRequest() (*ValidationInputRequest, bool) { + return nil, false +} + +// AsBasicValidationInputRequest is the BasicValidationInputRequest implementation for ValidateAddress. +func (va ValidateAddress) AsBasicValidationInputRequest() (BasicValidationInputRequest, bool) { + return &va, true +} + +// BasicValidationInputRequest minimum fields that must be present in any type of validation request. +type BasicValidationInputRequest interface { + AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) + AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) + AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) + AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) + AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) + AsValidateAddress() (*ValidateAddress, bool) + AsValidationInputRequest() (*ValidationInputRequest, bool) +} + +// ValidationInputRequest minimum fields that must be present in any type of validation request. +type ValidationInputRequest struct { + // ValidationType - Possible values include: 'ValidationTypeValidationInputRequest', 'ValidationTypeValidateCreateOrderLimit', 'ValidationTypeValidateDataDestinationDetails', 'ValidationTypeValidatePreferences', 'ValidationTypeValidateSkuAvailability', 'ValidationTypeValidateSubscriptionIsAllowedToCreateJob', 'ValidationTypeValidateAddress' + ValidationType ValidationType `json:"validationType,omitempty"` +} + +func unmarshalBasicValidationInputRequest(body []byte) (BasicValidationInputRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["validationType"] { + case string(ValidationTypeValidateCreateOrderLimit): + var colfsvr CreateOrderLimitForSubscriptionValidationRequest + err := json.Unmarshal(body, &colfsvr) + return colfsvr, err + case string(ValidationTypeValidateDataDestinationDetails): + var dddvr DataDestinationDetailsValidationRequest + err := json.Unmarshal(body, &dddvr) + return dddvr, err + case string(ValidationTypeValidatePreferences): + var pvr PreferencesValidationRequest + err := json.Unmarshal(body, &pvr) + return pvr, err + case string(ValidationTypeValidateSkuAvailability): + var savr SkuAvailabilityValidationRequest + err := json.Unmarshal(body, &savr) + return savr, err + case string(ValidationTypeValidateSubscriptionIsAllowedToCreateJob): + var siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest + err := json.Unmarshal(body, &siatcjvr) + return siatcjvr, err + case string(ValidationTypeValidateAddress): + var va ValidateAddress + err := json.Unmarshal(body, &va) + return va, err + default: + var vir ValidationInputRequest + err := json.Unmarshal(body, &vir) + return vir, err + } +} +func unmarshalBasicValidationInputRequestArray(body []byte) ([]BasicValidationInputRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + virArray := make([]BasicValidationInputRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + vir, err := unmarshalBasicValidationInputRequest(*rawMessage) + if err != nil { + return nil, err + } + virArray[index] = vir + } + return virArray, nil +} + +// MarshalJSON is the custom marshaler for ValidationInputRequest. +func (vir ValidationInputRequest) MarshalJSON() ([]byte, error) { + vir.ValidationType = ValidationTypeValidationInputRequest + objectMap := make(map[string]interface{}) + if vir.ValidationType != "" { + objectMap["validationType"] = vir.ValidationType + } + return json.Marshal(objectMap) +} + +// AsCreateOrderLimitForSubscriptionValidationRequest is the BasicValidationInputRequest implementation for ValidationInputRequest. +func (vir ValidationInputRequest) AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) { + return nil, false +} + +// AsDataDestinationDetailsValidationRequest is the BasicValidationInputRequest implementation for ValidationInputRequest. +func (vir ValidationInputRequest) AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) { + return nil, false +} + +// AsPreferencesValidationRequest is the BasicValidationInputRequest implementation for ValidationInputRequest. +func (vir ValidationInputRequest) AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) { + return nil, false +} + +// AsSkuAvailabilityValidationRequest is the BasicValidationInputRequest implementation for ValidationInputRequest. +func (vir ValidationInputRequest) AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) { + return nil, false +} + +// AsSubscriptionIsAllowedToCreateJobValidationRequest is the BasicValidationInputRequest implementation for ValidationInputRequest. +func (vir ValidationInputRequest) AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) { + return nil, false +} + +// AsValidateAddress is the BasicValidationInputRequest implementation for ValidationInputRequest. +func (vir ValidationInputRequest) AsValidateAddress() (*ValidateAddress, bool) { + return nil, false +} + +// AsValidationInputRequest is the BasicValidationInputRequest implementation for ValidationInputRequest. +func (vir ValidationInputRequest) AsValidationInputRequest() (*ValidationInputRequest, bool) { + return &vir, true +} + +// AsBasicValidationInputRequest is the BasicValidationInputRequest implementation for ValidationInputRequest. +func (vir ValidationInputRequest) AsBasicValidationInputRequest() (BasicValidationInputRequest, bool) { + return &vir, true +} + +// BasicValidationInputResponse minimum properties that should be present in each individual validation response. +type BasicValidationInputResponse interface { + AsAddressValidationProperties() (*AddressValidationProperties, bool) + AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) + AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) + AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) + AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) + AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) + AsValidationInputResponse() (*ValidationInputResponse, bool) +} + +// ValidationInputResponse minimum properties that should be present in each individual validation response. +type ValidationInputResponse struct { + // Error - READ-ONLY; Error code and message of validation response. + Error *Error `json:"error,omitempty"` + // ValidationType - Possible values include: 'ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails', 'ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob' + ValidationType ValidationTypeBasicValidationInputResponse `json:"validationType,omitempty"` +} + +func unmarshalBasicValidationInputResponse(body []byte) (BasicValidationInputResponse, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["validationType"] { + case string(ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress): + var avp AddressValidationProperties + err := json.Unmarshal(body, &avp) + return avp, err + case string(ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit): + var colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties + err := json.Unmarshal(body, &colfsvrp) + return colfsvrp, err + case string(ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails): + var dddvrp DataDestinationDetailsValidationResponseProperties + err := json.Unmarshal(body, &dddvrp) + return dddvrp, err + case string(ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences): + var pvrp PreferencesValidationResponseProperties + err := json.Unmarshal(body, &pvrp) + return pvrp, err + case string(ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability): + var savrp SkuAvailabilityValidationResponseProperties + err := json.Unmarshal(body, &savrp) + return savrp, err + case string(ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob): + var siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties + err := json.Unmarshal(body, &siatcjvrp) + return siatcjvrp, err + default: + var vir ValidationInputResponse + err := json.Unmarshal(body, &vir) + return vir, err + } +} +func unmarshalBasicValidationInputResponseArray(body []byte) ([]BasicValidationInputResponse, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + virArray := make([]BasicValidationInputResponse, len(rawMessages)) + + for index, rawMessage := range rawMessages { + vir, err := unmarshalBasicValidationInputResponse(*rawMessage) + if err != nil { + return nil, err + } + virArray[index] = vir + } + return virArray, nil +} + +// MarshalJSON is the custom marshaler for ValidationInputResponse. +func (vir ValidationInputResponse) MarshalJSON() ([]byte, error) { + vir.ValidationType = ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse + objectMap := make(map[string]interface{}) + if vir.ValidationType != "" { + objectMap["validationType"] = vir.ValidationType + } + return json.Marshal(objectMap) +} + +// AsAddressValidationProperties is the BasicValidationInputResponse implementation for ValidationInputResponse. +func (vir ValidationInputResponse) AsAddressValidationProperties() (*AddressValidationProperties, bool) { + return nil, false +} + +// AsCreateOrderLimitForSubscriptionValidationResponseProperties is the BasicValidationInputResponse implementation for ValidationInputResponse. +func (vir ValidationInputResponse) AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) { + return nil, false +} + +// AsDataDestinationDetailsValidationResponseProperties is the BasicValidationInputResponse implementation for ValidationInputResponse. +func (vir ValidationInputResponse) AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) { + return nil, false +} + +// AsPreferencesValidationResponseProperties is the BasicValidationInputResponse implementation for ValidationInputResponse. +func (vir ValidationInputResponse) AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) { + return nil, false +} + +// AsSkuAvailabilityValidationResponseProperties is the BasicValidationInputResponse implementation for ValidationInputResponse. +func (vir ValidationInputResponse) AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) { + return nil, false +} + +// AsSubscriptionIsAllowedToCreateJobValidationResponseProperties is the BasicValidationInputResponse implementation for ValidationInputResponse. +func (vir ValidationInputResponse) AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) { + return nil, false +} + +// AsValidationInputResponse is the BasicValidationInputResponse implementation for ValidationInputResponse. +func (vir ValidationInputResponse) AsValidationInputResponse() (*ValidationInputResponse, bool) { + return &vir, true +} + +// AsBasicValidationInputResponse is the BasicValidationInputResponse implementation for ValidationInputResponse. +func (vir ValidationInputResponse) AsBasicValidationInputResponse() (BasicValidationInputResponse, bool) { + return &vir, true +} + +// BasicValidationRequest input request for all pre job creation validation. +type BasicValidationRequest interface { + AsCreateJobValidations() (*CreateJobValidations, bool) + AsValidationRequest() (*ValidationRequest, bool) +} + +// ValidationRequest input request for all pre job creation validation. +type ValidationRequest struct { + // IndividualRequestDetails - List of request details contain validationType and its request as key and value respectively. + IndividualRequestDetails *[]BasicValidationInputRequest `json:"individualRequestDetails,omitempty"` + // ValidationCategory - Possible values include: 'ValidationCategoryValidationRequest', 'ValidationCategoryJobCreationValidation' + ValidationCategory ValidationCategory `json:"validationCategory,omitempty"` +} + +func unmarshalBasicValidationRequest(body []byte) (BasicValidationRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["validationCategory"] { + case string(ValidationCategoryJobCreationValidation): + var cjv CreateJobValidations + err := json.Unmarshal(body, &cjv) + return cjv, err + default: + var vr ValidationRequest + err := json.Unmarshal(body, &vr) + return vr, err + } +} +func unmarshalBasicValidationRequestArray(body []byte) ([]BasicValidationRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + vrArray := make([]BasicValidationRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + vr, err := unmarshalBasicValidationRequest(*rawMessage) + if err != nil { + return nil, err + } + vrArray[index] = vr + } + return vrArray, nil +} + +// MarshalJSON is the custom marshaler for ValidationRequest. +func (vr ValidationRequest) MarshalJSON() ([]byte, error) { + vr.ValidationCategory = ValidationCategoryValidationRequest + objectMap := make(map[string]interface{}) + if vr.IndividualRequestDetails != nil { + objectMap["individualRequestDetails"] = vr.IndividualRequestDetails + } + if vr.ValidationCategory != "" { + objectMap["validationCategory"] = vr.ValidationCategory + } + return json.Marshal(objectMap) +} + +// AsCreateJobValidations is the BasicValidationRequest implementation for ValidationRequest. +func (vr ValidationRequest) AsCreateJobValidations() (*CreateJobValidations, bool) { + return nil, false +} + +// AsValidationRequest is the BasicValidationRequest implementation for ValidationRequest. +func (vr ValidationRequest) AsValidationRequest() (*ValidationRequest, bool) { + return &vr, true +} + +// AsBasicValidationRequest is the BasicValidationRequest implementation for ValidationRequest. +func (vr ValidationRequest) AsBasicValidationRequest() (BasicValidationRequest, bool) { + return &vr, true +} + +// UnmarshalJSON is the custom unmarshaler for ValidationRequest struct. +func (vr *ValidationRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "individualRequestDetails": + if v != nil { + individualRequestDetails, err := unmarshalBasicValidationInputRequestArray(*v) + if err != nil { + return err + } + vr.IndividualRequestDetails = &individualRequestDetails + } + case "validationCategory": + if v != nil { + var validationCategory ValidationCategory + err = json.Unmarshal(*v, &validationCategory) + if err != nil { + return err + } + vr.ValidationCategory = validationCategory + } + } + } + + return nil +} + +// ValidationResponse response of pre job creation validations. +type ValidationResponse struct { + autorest.Response `json:"-"` + // ValidationResponseProperties - READ-ONLY; Properties of pre job creation validation response. + *ValidationResponseProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ValidationResponse. +func (vr ValidationResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ValidationResponse struct. +func (vr *ValidationResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var validationResponseProperties ValidationResponseProperties + err = json.Unmarshal(*v, &validationResponseProperties) + if err != nil { + return err + } + vr.ValidationResponseProperties = &validationResponseProperties + } + } + } + + return nil +} + +// ValidationResponseProperties properties of pre job creation validation response. +type ValidationResponseProperties struct { + // Status - READ-ONLY; Overall validation status. Possible values include: 'AllValidToProceed', 'InputsRevisitRequired', 'CertainInputValidationsSkipped' + Status OverallValidationStatus `json:"status,omitempty"` + // IndividualResponseDetails - READ-ONLY; List of response details contain validationType and its response as key and value respectively. + IndividualResponseDetails *[]BasicValidationInputResponse `json:"individualResponseDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ValidationResponseProperties struct. +func (vrp *ValidationResponseProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "status": + if v != nil { + var status OverallValidationStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + vrp.Status = status + } + case "individualResponseDetails": + if v != nil { + individualResponseDetails, err := unmarshalBasicValidationInputResponseArray(*v) + if err != nil { + return err + } + vrp.IndividualResponseDetails = &individualResponseDetails + } + } + } + + return nil +} diff --git a/services/preview/portal/mgmt/2015-11-01-preview/portal/operations.go b/services/databox/mgmt/2019-09-01/databox/operations.go similarity index 69% rename from services/preview/portal/mgmt/2015-11-01-preview/portal/operations.go rename to services/databox/mgmt/2019-09-01/databox/operations.go index d813511a7e03..59771136ee8b 100644 --- a/services/preview/portal/mgmt/2015-11-01-preview/portal/operations.go +++ b/services/databox/mgmt/2019-09-01/databox/operations.go @@ -1,4 +1,4 @@ -package portal +package databox // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,7 +25,7 @@ import ( "net/http" ) -// OperationsClient is the allows creation and deletion of Azure Shared Dashboards. +// OperationsClient is the client for the Operations methods of the Databox service. type OperationsClient struct { BaseClient } @@ -40,14 +40,14 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List the Microsoft Portal operations API. -func (client OperationsClient) List(ctx context.Context) (result ResourceProviderOperationListPage, err error) { +// List this method gets all the operations. +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.rpol.Response.Response != nil { - sc = result.rpol.Response.Response.StatusCode + if result.ol.Response.Response != nil { + sc = result.ol.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -55,20 +55,20 @@ func (client OperationsClient) List(ctx context.Context) (result ResourceProvide result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "portal.OperationsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databox.OperationsClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { - result.rpol.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "portal.OperationsClient", "List", resp, "Failure sending request") + result.ol.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databox.OperationsClient", "List", resp, "Failure sending request") return } - result.rpol, err = client.ListResponder(resp) + result.ol, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "portal.OperationsClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databox.OperationsClient", "List", resp, "Failure responding to request") } return @@ -76,7 +76,7 @@ func (client OperationsClient) List(ctx context.Context) (result ResourceProvide // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2015-11-01-preview" + const APIVersion = "2019-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -84,7 +84,7 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Portal/operations"), + autorest.WithPath("/providers/Microsoft.DataBox/operations"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -92,13 +92,13 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, // 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 autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) } // 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) { +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationList, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -110,10 +110,10 @@ func (client OperationsClient) ListResponder(resp *http.Response) (result Resour } // listNextResults retrieves the next set of results, if any. -func (client OperationsClient) listNextResults(ctx context.Context, lastResults ResourceProviderOperationList) (result ResourceProviderOperationList, err error) { - req, err := lastResults.resourceProviderOperationListPreparer(ctx) +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, "portal.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "databox.OperationsClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -121,17 +121,17 @@ func (client OperationsClient) listNextResults(ctx context.Context, lastResults resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "portal.OperationsClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "databox.OperationsClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "portal.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "databox.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 ResourceProviderOperationListIterator, err error) { +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { diff --git a/services/databox/mgmt/2019-09-01/databox/service.go b/services/databox/mgmt/2019-09-01/databox/service.go new file mode 100644 index 000000000000..c588c0b52613 --- /dev/null +++ b/services/databox/mgmt/2019-09-01/databox/service.go @@ -0,0 +1,637 @@ +package databox + +// 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" +) + +// ServiceClient is the client for the Service methods of the Databox service. +type ServiceClient struct { + BaseClient +} + +// NewServiceClient creates an instance of the ServiceClient client. +func NewServiceClient(subscriptionID string) ServiceClient { + return NewServiceClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServiceClientWithBaseURI creates an instance of the ServiceClient client. +func NewServiceClientWithBaseURI(baseURI string, subscriptionID string) ServiceClient { + return ServiceClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListAvailableSkus this method provides the list of available skus for the given subscription and location. +// Parameters: +// location - the location of the resource +// availableSkuRequest - filters for showing the available skus. +func (client ServiceClient) ListAvailableSkus(ctx context.Context, location string, availableSkuRequest AvailableSkuRequest) (result AvailableSkusResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.ListAvailableSkus") + defer func() { + sc := -1 + if result.asr.Response.Response != nil { + sc = result.asr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: availableSkuRequest, + Constraints: []validation.Constraint{{Target: "availableSkuRequest.TransferType", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "availableSkuRequest.Country", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "availableSkuRequest.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("databox.ServiceClient", "ListAvailableSkus", err.Error()) + } + + result.fn = client.listAvailableSkusNextResults + req, err := client.ListAvailableSkusPreparer(ctx, location, availableSkuRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ListAvailableSkus", nil, "Failure preparing request") + return + } + + resp, err := client.ListAvailableSkusSender(req) + if err != nil { + result.asr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ListAvailableSkus", resp, "Failure sending request") + return + } + + result.asr, err = client.ListAvailableSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ListAvailableSkus", resp, "Failure responding to request") + } + + return +} + +// ListAvailableSkusPreparer prepares the ListAvailableSkus request. +func (client ServiceClient) ListAvailableSkusPreparer(ctx context.Context, location string, availableSkuRequest AvailableSkuRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus", pathParameters), + autorest.WithJSON(availableSkuRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAvailableSkusSender sends the ListAvailableSkus request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) ListAvailableSkusSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListAvailableSkusResponder handles the response to the ListAvailableSkus request. The method always +// closes the http.Response Body. +func (client ServiceClient) ListAvailableSkusResponder(resp *http.Response) (result AvailableSkusResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAvailableSkusNextResults retrieves the next set of results, if any. +func (client ServiceClient) listAvailableSkusNextResults(ctx context.Context, lastResults AvailableSkusResult) (result AvailableSkusResult, err error) { + req, err := lastResults.availableSkusResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databox.ServiceClient", "listAvailableSkusNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAvailableSkusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databox.ServiceClient", "listAvailableSkusNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAvailableSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "listAvailableSkusNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAvailableSkusComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServiceClient) ListAvailableSkusComplete(ctx context.Context, location string, availableSkuRequest AvailableSkuRequest) (result AvailableSkusResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.ListAvailableSkus") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListAvailableSkus(ctx, location, availableSkuRequest) + return +} + +// ListAvailableSkusByResourceGroup this method provides the list of available skus for the given subscription, +// resource group and location. +// Parameters: +// resourceGroupName - the Resource Group Name +// location - the location of the resource +// availableSkuRequest - filters for showing the available skus. +func (client ServiceClient) ListAvailableSkusByResourceGroup(ctx context.Context, resourceGroupName string, location string, availableSkuRequest AvailableSkuRequest) (result AvailableSkusResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.ListAvailableSkusByResourceGroup") + defer func() { + sc := -1 + if result.asr.Response.Response != nil { + sc = result.asr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: availableSkuRequest, + Constraints: []validation.Constraint{{Target: "availableSkuRequest.TransferType", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "availableSkuRequest.Country", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "availableSkuRequest.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("databox.ServiceClient", "ListAvailableSkusByResourceGroup", err.Error()) + } + + result.fn = client.listAvailableSkusByResourceGroupNextResults + req, err := client.ListAvailableSkusByResourceGroupPreparer(ctx, resourceGroupName, location, availableSkuRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ListAvailableSkusByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListAvailableSkusByResourceGroupSender(req) + if err != nil { + result.asr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ListAvailableSkusByResourceGroup", resp, "Failure sending request") + return + } + + result.asr, err = client.ListAvailableSkusByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ListAvailableSkusByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListAvailableSkusByResourceGroupPreparer prepares the ListAvailableSkusByResourceGroup request. +func (client ServiceClient) ListAvailableSkusByResourceGroupPreparer(ctx context.Context, resourceGroupName string, location string, availableSkuRequest AvailableSkuRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus", pathParameters), + autorest.WithJSON(availableSkuRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAvailableSkusByResourceGroupSender sends the ListAvailableSkusByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) ListAvailableSkusByResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListAvailableSkusByResourceGroupResponder handles the response to the ListAvailableSkusByResourceGroup request. The method always +// closes the http.Response Body. +func (client ServiceClient) ListAvailableSkusByResourceGroupResponder(resp *http.Response) (result AvailableSkusResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAvailableSkusByResourceGroupNextResults retrieves the next set of results, if any. +func (client ServiceClient) listAvailableSkusByResourceGroupNextResults(ctx context.Context, lastResults AvailableSkusResult) (result AvailableSkusResult, err error) { + req, err := lastResults.availableSkusResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databox.ServiceClient", "listAvailableSkusByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAvailableSkusByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databox.ServiceClient", "listAvailableSkusByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAvailableSkusByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "listAvailableSkusByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAvailableSkusByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServiceClient) ListAvailableSkusByResourceGroupComplete(ctx context.Context, resourceGroupName string, location string, availableSkuRequest AvailableSkuRequest) (result AvailableSkusResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.ListAvailableSkusByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListAvailableSkusByResourceGroup(ctx, resourceGroupName, location, availableSkuRequest) + return +} + +// RegionConfiguration this API provides configuration details specific to given region/location. +// Parameters: +// location - the location of the resource +// regionConfigurationRequest - request body to get the configuration for the region. +func (client ServiceClient) RegionConfiguration(ctx context.Context, location string, regionConfigurationRequest RegionConfigurationRequest) (result RegionConfigurationResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.RegionConfiguration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: regionConfigurationRequest, + Constraints: []validation.Constraint{{Target: "regionConfigurationRequest.ScheduleAvailabilityRequest", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "regionConfigurationRequest.ScheduleAvailabilityRequest.StorageLocation", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("databox.ServiceClient", "RegionConfiguration", err.Error()) + } + + req, err := client.RegionConfigurationPreparer(ctx, location, regionConfigurationRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "RegionConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.RegionConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "RegionConfiguration", resp, "Failure sending request") + return + } + + result, err = client.RegionConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "RegionConfiguration", resp, "Failure responding to request") + } + + return +} + +// RegionConfigurationPreparer prepares the RegionConfiguration request. +func (client ServiceClient) RegionConfigurationPreparer(ctx context.Context, location string, regionConfigurationRequest RegionConfigurationRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration", pathParameters), + autorest.WithJSON(regionConfigurationRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegionConfigurationSender sends the RegionConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) RegionConfigurationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// RegionConfigurationResponder handles the response to the RegionConfiguration request. The method always +// closes the http.Response Body. +func (client ServiceClient) RegionConfigurationResponder(resp *http.Response) (result RegionConfigurationResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ValidateAddressMethod [DEPRECATED NOTICE: This operation will soon be removed] This method validates the customer +// shipping address and provide alternate addresses if any. +// Parameters: +// location - the location of the resource +// validateAddress - shipping address of the customer. +func (client ServiceClient) ValidateAddressMethod(ctx context.Context, location string, validateAddress ValidateAddress) (result AddressValidationOutput, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.ValidateAddressMethod") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: validateAddress, + Constraints: []validation.Constraint{{Target: "validateAddress.ShippingAddress", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "validateAddress.ShippingAddress.StreetAddress1", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "validateAddress.ShippingAddress.Country", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "validateAddress.ShippingAddress.PostalCode", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("databox.ServiceClient", "ValidateAddressMethod", err.Error()) + } + + req, err := client.ValidateAddressMethodPreparer(ctx, location, validateAddress) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ValidateAddressMethod", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateAddressMethodSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ValidateAddressMethod", resp, "Failure sending request") + return + } + + result, err = client.ValidateAddressMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ValidateAddressMethod", resp, "Failure responding to request") + } + + return +} + +// ValidateAddressMethodPreparer prepares the ValidateAddressMethod request. +func (client ServiceClient) ValidateAddressMethodPreparer(ctx context.Context, location string, validateAddress ValidateAddress) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress", pathParameters), + autorest.WithJSON(validateAddress), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateAddressMethodSender sends the ValidateAddressMethod request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) ValidateAddressMethodSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ValidateAddressMethodResponder handles the response to the ValidateAddressMethod request. The method always +// closes the http.Response Body. +func (client ServiceClient) ValidateAddressMethodResponder(resp *http.Response) (result AddressValidationOutput, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ValidateInputs this method does all necessary pre-job creation validation under subscription. +// Parameters: +// location - the location of the resource +// validationRequest - inputs of the customer. +func (client ServiceClient) ValidateInputs(ctx context.Context, location string, validationRequest BasicValidationRequest) (result ValidationResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.ValidateInputs") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: validationRequest, + Constraints: []validation.Constraint{{Target: "validationRequest.IndividualRequestDetails", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("databox.ServiceClient", "ValidateInputs", err.Error()) + } + + req, err := client.ValidateInputsPreparer(ctx, location, validationRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ValidateInputs", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateInputsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ValidateInputs", resp, "Failure sending request") + return + } + + result, err = client.ValidateInputsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ValidateInputs", resp, "Failure responding to request") + } + + return +} + +// ValidateInputsPreparer prepares the ValidateInputs request. +func (client ServiceClient) ValidateInputsPreparer(ctx context.Context, location string, validationRequest BasicValidationRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs", pathParameters), + autorest.WithJSON(validationRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateInputsSender sends the ValidateInputs request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) ValidateInputsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ValidateInputsResponder handles the response to the ValidateInputs request. The method always +// closes the http.Response Body. +func (client ServiceClient) ValidateInputsResponder(resp *http.Response) (result ValidationResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ValidateInputsByResourceGroup this method does all necessary pre-job creation validation under resource group. +// Parameters: +// resourceGroupName - the Resource Group Name +// location - the location of the resource +// validationRequest - inputs of the customer. +func (client ServiceClient) ValidateInputsByResourceGroup(ctx context.Context, resourceGroupName string, location string, validationRequest BasicValidationRequest) (result ValidationResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.ValidateInputsByResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: validationRequest, + Constraints: []validation.Constraint{{Target: "validationRequest.IndividualRequestDetails", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("databox.ServiceClient", "ValidateInputsByResourceGroup", err.Error()) + } + + req, err := client.ValidateInputsByResourceGroupPreparer(ctx, resourceGroupName, location, validationRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ValidateInputsByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateInputsByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ValidateInputsByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ValidateInputsByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.ServiceClient", "ValidateInputsByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ValidateInputsByResourceGroupPreparer prepares the ValidateInputsByResourceGroup request. +func (client ServiceClient) ValidateInputsByResourceGroupPreparer(ctx context.Context, resourceGroupName string, location string, validationRequest BasicValidationRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs", pathParameters), + autorest.WithJSON(validationRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateInputsByResourceGroupSender sends the ValidateInputsByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) ValidateInputsByResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ValidateInputsByResourceGroupResponder handles the response to the ValidateInputsByResourceGroup request. The method always +// closes the http.Response Body. +func (client ServiceClient) ValidateInputsByResourceGroupResponder(resp *http.Response) (result ValidationResponse, 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/batch/2016-02-01.3.0/batch/version.go b/services/databox/mgmt/2019-09-01/databox/version.go similarity index 92% rename from services/batch/2016-02-01.3.0/batch/version.go rename to services/databox/mgmt/2019-09-01/databox/version.go index 5acaa3accc99..521bc0b7a5bc 100644 --- a/services/batch/2016-02-01.3.0/batch/version.go +++ b/services/databox/mgmt/2019-09-01/databox/version.go @@ -1,4 +1,4 @@ -package batch +package databox import "github.com/Azure/azure-sdk-for-go/version" @@ -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.Number + " batch/2016-02-01.3.0" + return "Azure-SDK-For-Go/" + version.Number + " databox/2019-09-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/alerts.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/alerts.go similarity index 92% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/alerts.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/alerts.go index dc202149b308..60ac781dddaf 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/alerts.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/alerts.go @@ -1,4 +1,4 @@ -package edgegateway +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,7 +25,7 @@ import ( "net/http" ) -// AlertsClient is the client for the Alerts methods of the Edgegateway service. +// AlertsClient is the client for the Alerts methods of the Databoxedge service. type AlertsClient struct { BaseClient } @@ -58,20 +58,20 @@ func (client AlertsClient) Get(ctx context.Context, deviceName string, name stri } req, err := client.GetPreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.AlertsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.AlertsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.AlertsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "Get", resp, "Failure responding to request") } return @@ -137,20 +137,20 @@ func (client AlertsClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceNa result.fn = client.listByDataBoxEdgeDeviceNextResults req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.AlertsClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") return } resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.al.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.AlertsClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") return } result.al, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.AlertsClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") } return @@ -201,7 +201,7 @@ func (client AlertsClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) func (client AlertsClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults AlertList) (result AlertList, err error) { req, err := lastResults.alertListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "edgegateway.AlertsClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -209,11 +209,11 @@ func (client AlertsClient) listByDataBoxEdgeDeviceNextResults(ctx context.Contex resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "edgegateway.AlertsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") } result, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.AlertsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") } return } diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/bandwidthschedules.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/bandwidthschedules.go similarity index 94% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/bandwidthschedules.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/bandwidthschedules.go index a2be80d29d12..405205caa0d3 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/bandwidthschedules.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/bandwidthschedules.go @@ -1,4 +1,4 @@ -package edgegateway +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -26,7 +26,7 @@ import ( "net/http" ) -// BandwidthSchedulesClient is the client for the BandwidthSchedules methods of the Edgegateway service. +// BandwidthSchedulesClient is the client for the BandwidthSchedules methods of the Databoxedge service. type BandwidthSchedulesClient struct { BaseClient } @@ -66,18 +66,18 @@ func (client BandwidthSchedulesClient) CreateOrUpdate(ctx context.Context, devic {Target: "parameters.BandwidthScheduleProperties.RateInMbps", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.BandwidthScheduleProperties.Days", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewError("edgegateway.BandwidthSchedulesClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("databoxedge.BandwidthSchedulesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, parameters, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -152,13 +152,13 @@ func (client BandwidthSchedulesClient) Delete(ctx context.Context, deviceName st } req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Delete", result.Response(), "Failure sending request") return } @@ -230,20 +230,20 @@ func (client BandwidthSchedulesClient) Get(ctx context.Context, deviceName strin } req, err := client.GetPreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Get", resp, "Failure responding to request") } return @@ -309,20 +309,20 @@ func (client BandwidthSchedulesClient) ListByDataBoxEdgeDevice(ctx context.Conte result.fn = client.listByDataBoxEdgeDeviceNextResults req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") return } resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.bsl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") return } result.bsl, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") } return @@ -373,7 +373,7 @@ func (client BandwidthSchedulesClient) ListByDataBoxEdgeDeviceResponder(resp *ht func (client BandwidthSchedulesClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults BandwidthSchedulesList) (result BandwidthSchedulesList, err error) { req, err := lastResults.bandwidthSchedulesListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -381,11 +381,11 @@ func (client BandwidthSchedulesClient) listByDataBoxEdgeDeviceNextResults(ctx co resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") } result, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") } return } diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/client.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/client.go similarity index 87% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/client.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/client.go index 0ab0aafdcf66..d47519ebaf3e 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/client.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/client.go @@ -1,7 +1,7 @@ -// Package edgegateway implements the Azure ARM Edgegateway service API version 2019-03-01. +// Package databoxedge implements the Azure ARM Databoxedge service API version 2019-03-01. // // -package edgegateway +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,11 +25,11 @@ import ( ) const ( - // DefaultBaseURI is the default URI used for the service Edgegateway + // DefaultBaseURI is the default URI used for the service Databoxedge DefaultBaseURI = "https://management.azure.com" ) -// BaseClient is the base client for Edgegateway. +// BaseClient is the base client for Databoxedge. type BaseClient struct { autorest.Client BaseURI string diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/edgegatewayapi/interfaces.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/databoxedgeapi/interfaces.go similarity index 55% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/edgegatewayapi/interfaces.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/databoxedgeapi/interfaces.go index 397ab3840cb0..605c9c9e6904 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/edgegatewayapi/interfaces.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/databoxedgeapi/interfaces.go @@ -1,4 +1,4 @@ -package edgegatewayapi +package databoxedgeapi // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -19,125 +19,125 @@ package edgegatewayapi import ( "context" - "github.com/Azure/azure-sdk-for-go/services/edgegateway/mgmt/2019-03-01/edgegateway" + "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-03-01/databoxedge" ) // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { - List(ctx context.Context) (result edgegateway.OperationsListPage, err error) + List(ctx context.Context) (result databoxedge.OperationsListPage, err error) } -var _ OperationsClientAPI = (*edgegateway.OperationsClient)(nil) +var _ OperationsClientAPI = (*databoxedge.OperationsClient)(nil) // DevicesClientAPI contains the set of methods on the DevicesClient type. type DevicesClientAPI interface { - CreateOrUpdate(ctx context.Context, deviceName string, dataBoxEdgeDevice edgegateway.DataBoxEdgeDevice, resourceGroupName string) (result edgegateway.DevicesCreateOrUpdateFuture, err error) - CreateOrUpdateSecuritySettings(ctx context.Context, deviceName string, securitySettings edgegateway.SecuritySettings, resourceGroupName string) (result edgegateway.DevicesCreateOrUpdateSecuritySettingsFuture, err error) - Delete(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.DevicesDeleteFuture, err error) - DownloadUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.DevicesDownloadUpdatesFuture, err error) - Get(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.DataBoxEdgeDevice, err error) - GetExtendedInformation(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.DataBoxEdgeDeviceExtendedInfo, err error) - GetNetworkSettings(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.NetworkSettings, err error) - GetUpdateSummary(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.UpdateSummary, err error) - InstallUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.DevicesInstallUpdatesFuture, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string, expand string) (result edgegateway.DataBoxEdgeDeviceListPage, err error) - ListBySubscription(ctx context.Context, expand string) (result edgegateway.DataBoxEdgeDeviceListPage, err error) - ScanForUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.DevicesScanForUpdatesFuture, err error) - Update(ctx context.Context, deviceName string, parameters edgegateway.DataBoxEdgeDevicePatch, resourceGroupName string) (result edgegateway.DataBoxEdgeDevice, err error) - UploadCertificate(ctx context.Context, deviceName string, parameters edgegateway.UploadCertificateRequest, resourceGroupName string) (result edgegateway.UploadCertificateResponse, err error) + CreateOrUpdate(ctx context.Context, deviceName string, dataBoxEdgeDevice databoxedge.Device, resourceGroupName string) (result databoxedge.DevicesCreateOrUpdateFuture, err error) + CreateOrUpdateSecuritySettings(ctx context.Context, deviceName string, securitySettings databoxedge.SecuritySettings, resourceGroupName string) (result databoxedge.DevicesCreateOrUpdateSecuritySettingsFuture, err error) + Delete(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DevicesDeleteFuture, err error) + DownloadUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DevicesDownloadUpdatesFuture, err error) + Get(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.Device, err error) + GetExtendedInformation(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DeviceExtendedInfo, err error) + GetNetworkSettings(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.NetworkSettings, err error) + GetUpdateSummary(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.UpdateSummary, err error) + InstallUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DevicesInstallUpdatesFuture, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, expand string) (result databoxedge.DeviceListPage, err error) + ListBySubscription(ctx context.Context, expand string) (result databoxedge.DeviceListPage, err error) + ScanForUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DevicesScanForUpdatesFuture, err error) + Update(ctx context.Context, deviceName string, parameters databoxedge.DevicePatch, resourceGroupName string) (result databoxedge.Device, err error) + UploadCertificate(ctx context.Context, deviceName string, parameters databoxedge.UploadCertificateRequest, resourceGroupName string) (result databoxedge.UploadCertificateResponse, err error) } -var _ DevicesClientAPI = (*edgegateway.DevicesClient)(nil) +var _ DevicesClientAPI = (*databoxedge.DevicesClient)(nil) // AlertsClientAPI contains the set of methods on the AlertsClient type. type AlertsClientAPI interface { - Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.Alert, err error) - ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.AlertListPage, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.Alert, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.AlertListPage, err error) } -var _ AlertsClientAPI = (*edgegateway.AlertsClient)(nil) +var _ AlertsClientAPI = (*databoxedge.AlertsClient)(nil) // BandwidthSchedulesClientAPI contains the set of methods on the BandwidthSchedulesClient type. type BandwidthSchedulesClientAPI interface { - CreateOrUpdate(ctx context.Context, deviceName string, name string, parameters edgegateway.BandwidthSchedule, resourceGroupName string) (result edgegateway.BandwidthSchedulesCreateOrUpdateFuture, err error) - Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.BandwidthSchedulesDeleteFuture, err error) - Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.BandwidthSchedule, err error) - ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.BandwidthSchedulesListPage, err error) + CreateOrUpdate(ctx context.Context, deviceName string, name string, parameters databoxedge.BandwidthSchedule, resourceGroupName string) (result databoxedge.BandwidthSchedulesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.BandwidthSchedulesDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.BandwidthSchedule, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.BandwidthSchedulesListPage, err error) } -var _ BandwidthSchedulesClientAPI = (*edgegateway.BandwidthSchedulesClient)(nil) +var _ BandwidthSchedulesClientAPI = (*databoxedge.BandwidthSchedulesClient)(nil) // JobsClientAPI contains the set of methods on the JobsClient type. type JobsClientAPI interface { - Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.Job, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.Job, err error) } -var _ JobsClientAPI = (*edgegateway.JobsClient)(nil) +var _ JobsClientAPI = (*databoxedge.JobsClient)(nil) // OperationsStatusClientAPI contains the set of methods on the OperationsStatusClient type. type OperationsStatusClientAPI interface { - Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.Job, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.Job, err error) } -var _ OperationsStatusClientAPI = (*edgegateway.OperationsStatusClient)(nil) +var _ OperationsStatusClientAPI = (*databoxedge.OperationsStatusClient)(nil) // OrdersClientAPI contains the set of methods on the OrdersClient type. type OrdersClientAPI interface { - CreateOrUpdate(ctx context.Context, deviceName string, order edgegateway.Order, resourceGroupName string) (result edgegateway.OrdersCreateOrUpdateFuture, err error) - Delete(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.OrdersDeleteFuture, err error) - Get(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.Order, err error) - ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.OrderListPage, err error) + CreateOrUpdate(ctx context.Context, deviceName string, order databoxedge.Order, resourceGroupName string) (result databoxedge.OrdersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.OrdersDeleteFuture, err error) + Get(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.Order, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.OrderListPage, err error) } -var _ OrdersClientAPI = (*edgegateway.OrdersClient)(nil) +var _ OrdersClientAPI = (*databoxedge.OrdersClient)(nil) // RolesClientAPI contains the set of methods on the RolesClient type. type RolesClientAPI interface { - CreateOrUpdate(ctx context.Context, deviceName string, name string, role edgegateway.BasicRole, resourceGroupName string) (result edgegateway.RolesCreateOrUpdateFuture, err error) - Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.RolesDeleteFuture, err error) - Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.RoleModel, err error) - ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.RoleListPage, err error) + CreateOrUpdate(ctx context.Context, deviceName string, name string, role databoxedge.BasicRole, resourceGroupName string) (result databoxedge.RolesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.RolesDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.RoleModel, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.RoleListPage, err error) } -var _ RolesClientAPI = (*edgegateway.RolesClient)(nil) +var _ RolesClientAPI = (*databoxedge.RolesClient)(nil) // SharesClientAPI contains the set of methods on the SharesClient type. type SharesClientAPI interface { - CreateOrUpdate(ctx context.Context, deviceName string, name string, share edgegateway.Share, resourceGroupName string) (result edgegateway.SharesCreateOrUpdateFuture, err error) - Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.SharesDeleteFuture, err error) - Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.Share, err error) - ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.ShareListPage, err error) - Refresh(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.SharesRefreshFuture, err error) + CreateOrUpdate(ctx context.Context, deviceName string, name string, share databoxedge.Share, resourceGroupName string) (result databoxedge.SharesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.SharesDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.Share, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.ShareListPage, err error) + Refresh(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.SharesRefreshFuture, err error) } -var _ SharesClientAPI = (*edgegateway.SharesClient)(nil) +var _ SharesClientAPI = (*databoxedge.SharesClient)(nil) // StorageAccountCredentialsClientAPI contains the set of methods on the StorageAccountCredentialsClient type. type StorageAccountCredentialsClientAPI interface { - CreateOrUpdate(ctx context.Context, deviceName string, name string, storageAccountCredential edgegateway.StorageAccountCredential, resourceGroupName string) (result edgegateway.StorageAccountCredentialsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.StorageAccountCredentialsDeleteFuture, err error) - Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.StorageAccountCredential, err error) - ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.StorageAccountCredentialListPage, err error) + CreateOrUpdate(ctx context.Context, deviceName string, name string, storageAccountCredential databoxedge.StorageAccountCredential, resourceGroupName string) (result databoxedge.StorageAccountCredentialsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.StorageAccountCredentialsDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.StorageAccountCredential, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.StorageAccountCredentialListPage, err error) } -var _ StorageAccountCredentialsClientAPI = (*edgegateway.StorageAccountCredentialsClient)(nil) +var _ StorageAccountCredentialsClientAPI = (*databoxedge.StorageAccountCredentialsClient)(nil) // TriggersClientAPI contains the set of methods on the TriggersClient type. type TriggersClientAPI interface { - CreateOrUpdate(ctx context.Context, deviceName string, name string, trigger edgegateway.BasicTrigger, resourceGroupName string) (result edgegateway.TriggersCreateOrUpdateFuture, err error) - Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.TriggersDeleteFuture, err error) - Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.TriggerModel, err error) - ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string, expand string) (result edgegateway.TriggerListPage, err error) + CreateOrUpdate(ctx context.Context, deviceName string, name string, trigger databoxedge.BasicTrigger, resourceGroupName string) (result databoxedge.TriggersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.TriggersDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.TriggerModel, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string, expand string) (result databoxedge.TriggerListPage, err error) } -var _ TriggersClientAPI = (*edgegateway.TriggersClient)(nil) +var _ TriggersClientAPI = (*databoxedge.TriggersClient)(nil) // UsersClientAPI contains the set of methods on the UsersClient type. type UsersClientAPI interface { - CreateOrUpdate(ctx context.Context, deviceName string, name string, userParameter edgegateway.User, resourceGroupName string) (result edgegateway.UsersCreateOrUpdateFuture, err error) - Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.UsersDeleteFuture, err error) - Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result edgegateway.User, err error) - ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result edgegateway.UserListPage, err error) + CreateOrUpdate(ctx context.Context, deviceName string, name string, userParameter databoxedge.User, resourceGroupName string) (result databoxedge.UsersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.UsersDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.User, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.UserListPage, err error) } -var _ UsersClientAPI = (*edgegateway.UsersClient)(nil) +var _ UsersClientAPI = (*databoxedge.UsersClient)(nil) diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/devices.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/devices.go similarity index 89% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/devices.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/devices.go index 8090235b1dec..3e688657b1d1 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/devices.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/devices.go @@ -1,4 +1,4 @@ -package edgegateway +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -26,7 +26,7 @@ import ( "net/http" ) -// DevicesClient is the client for the Devices methods of the Edgegateway service. +// DevicesClient is the client for the Devices methods of the Databoxedge service. type DevicesClient struct { BaseClient } @@ -46,7 +46,7 @@ func NewDevicesClientWithBaseURI(baseURI string, subscriptionID string) DevicesC // deviceName - the device name. // dataBoxEdgeDevice - the resource object. // resourceGroupName - the resource group name. -func (client DevicesClient) CreateOrUpdate(ctx context.Context, deviceName string, dataBoxEdgeDevice DataBoxEdgeDevice, resourceGroupName string) (result DevicesCreateOrUpdateFuture, err error) { +func (client DevicesClient) CreateOrUpdate(ctx context.Context, deviceName string, dataBoxEdgeDevice Device, resourceGroupName string) (result DevicesCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.CreateOrUpdate") defer func() { @@ -60,18 +60,18 @@ func (client DevicesClient) CreateOrUpdate(ctx context.Context, deviceName strin if err := validation.Validate([]validation.Validation{ {TargetValue: dataBoxEdgeDevice, Constraints: []validation.Constraint{{Target: "dataBoxEdgeDevice.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("edgegateway.DevicesClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("databoxedge.DevicesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, deviceName, dataBoxEdgeDevice, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -79,7 +79,7 @@ func (client DevicesClient) CreateOrUpdate(ctx context.Context, deviceName strin } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DevicesClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, dataBoxEdgeDevice DataBoxEdgeDevice, resourceGroupName string) (*http.Request, error) { +func (client DevicesClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, dataBoxEdgeDevice Device, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "deviceName": autorest.Encode("path", deviceName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -116,7 +116,7 @@ func (client DevicesClient) CreateOrUpdateSender(req *http.Request) (future Devi // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client DevicesClient) CreateOrUpdateResponder(resp *http.Response) (result DataBoxEdgeDevice, err error) { +func (client DevicesClient) CreateOrUpdateResponder(resp *http.Response) (result Device, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -149,18 +149,18 @@ func (client DevicesClient) CreateOrUpdateSecuritySettings(ctx context.Context, Chain: []validation.Constraint{{Target: "securitySettings.SecuritySettingsProperties.DeviceAdminPassword", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "securitySettings.SecuritySettingsProperties.DeviceAdminPassword.Value", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewError("edgegateway.DevicesClient", "CreateOrUpdateSecuritySettings", err.Error()) + return result, validation.NewError("databoxedge.DevicesClient", "CreateOrUpdateSecuritySettings", err.Error()) } req, err := client.CreateOrUpdateSecuritySettingsPreparer(ctx, deviceName, securitySettings, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "CreateOrUpdateSecuritySettings", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "CreateOrUpdateSecuritySettings", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSecuritySettingsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "CreateOrUpdateSecuritySettings", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "CreateOrUpdateSecuritySettings", result.Response(), "Failure sending request") return } @@ -232,13 +232,13 @@ func (client DevicesClient) Delete(ctx context.Context, deviceName string, resou } req, err := client.DeletePreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Delete", result.Response(), "Failure sending request") return } @@ -308,13 +308,13 @@ func (client DevicesClient) DownloadUpdates(ctx context.Context, deviceName stri } req, err := client.DownloadUpdatesPreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "DownloadUpdates", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "DownloadUpdates", nil, "Failure preparing request") return } result, err = client.DownloadUpdatesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "DownloadUpdates", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "DownloadUpdates", result.Response(), "Failure sending request") return } @@ -371,7 +371,7 @@ func (client DevicesClient) DownloadUpdatesResponder(resp *http.Response) (resul // Parameters: // deviceName - the device name. // resourceGroupName - the resource group name. -func (client DevicesClient) Get(ctx context.Context, deviceName string, resourceGroupName string) (result DataBoxEdgeDevice, err error) { +func (client DevicesClient) Get(ctx context.Context, deviceName string, resourceGroupName string) (result Device, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.Get") defer func() { @@ -384,20 +384,20 @@ func (client DevicesClient) Get(ctx context.Context, deviceName string, resource } req, err := client.GetPreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Get", resp, "Failure responding to request") } return @@ -433,7 +433,7 @@ func (client DevicesClient) GetSender(req *http.Request) (*http.Response, error) // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client DevicesClient) GetResponder(resp *http.Response) (result DataBoxEdgeDevice, err error) { +func (client DevicesClient) GetResponder(resp *http.Response) (result Device, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -448,7 +448,7 @@ func (client DevicesClient) GetResponder(resp *http.Response) (result DataBoxEdg // Parameters: // deviceName - the device name. // resourceGroupName - the resource group name. -func (client DevicesClient) GetExtendedInformation(ctx context.Context, deviceName string, resourceGroupName string) (result DataBoxEdgeDeviceExtendedInfo, err error) { +func (client DevicesClient) GetExtendedInformation(ctx context.Context, deviceName string, resourceGroupName string) (result DeviceExtendedInfo, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.GetExtendedInformation") defer func() { @@ -461,20 +461,20 @@ func (client DevicesClient) GetExtendedInformation(ctx context.Context, deviceNa } req, err := client.GetExtendedInformationPreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "GetExtendedInformation", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetExtendedInformation", nil, "Failure preparing request") return } resp, err := client.GetExtendedInformationSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "GetExtendedInformation", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetExtendedInformation", resp, "Failure sending request") return } result, err = client.GetExtendedInformationResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "GetExtendedInformation", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetExtendedInformation", resp, "Failure responding to request") } return @@ -510,7 +510,7 @@ func (client DevicesClient) GetExtendedInformationSender(req *http.Request) (*ht // GetExtendedInformationResponder handles the response to the GetExtendedInformation request. The method always // closes the http.Response Body. -func (client DevicesClient) GetExtendedInformationResponder(resp *http.Response) (result DataBoxEdgeDeviceExtendedInfo, err error) { +func (client DevicesClient) GetExtendedInformationResponder(resp *http.Response) (result DeviceExtendedInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -538,20 +538,20 @@ func (client DevicesClient) GetNetworkSettings(ctx context.Context, deviceName s } req, err := client.GetNetworkSettingsPreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "GetNetworkSettings", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetNetworkSettings", nil, "Failure preparing request") return } resp, err := client.GetNetworkSettingsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "GetNetworkSettings", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetNetworkSettings", resp, "Failure sending request") return } result, err = client.GetNetworkSettingsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "GetNetworkSettings", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetNetworkSettings", resp, "Failure responding to request") } return @@ -615,20 +615,20 @@ func (client DevicesClient) GetUpdateSummary(ctx context.Context, deviceName str } req, err := client.GetUpdateSummaryPreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "GetUpdateSummary", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetUpdateSummary", nil, "Failure preparing request") return } resp, err := client.GetUpdateSummarySender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "GetUpdateSummary", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetUpdateSummary", resp, "Failure sending request") return } result, err = client.GetUpdateSummaryResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "GetUpdateSummary", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetUpdateSummary", resp, "Failure responding to request") } return @@ -692,13 +692,13 @@ func (client DevicesClient) InstallUpdates(ctx context.Context, deviceName strin } req, err := client.InstallUpdatesPreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "InstallUpdates", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "InstallUpdates", nil, "Failure preparing request") return } result, err = client.InstallUpdatesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "InstallUpdates", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "InstallUpdates", result.Response(), "Failure sending request") return } @@ -756,13 +756,13 @@ func (client DevicesClient) InstallUpdatesResponder(resp *http.Response) (result // resourceGroupName - the resource group name. // expand - specify $expand=details to populate additional fields related to the resource or Specify // $skipToken= to populate the next page in the list. -func (client DevicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, expand string) (result DataBoxEdgeDeviceListPage, err error) { +func (client DevicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, expand string) (result DeviceListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.ListByResourceGroup") defer func() { sc := -1 - if result.dbedl.Response.Response != nil { - sc = result.dbedl.Response.Response.StatusCode + if result.dl.Response.Response != nil { + sc = result.dl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -770,20 +770,20 @@ func (client DevicesClient) ListByResourceGroup(ctx context.Context, resourceGro result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, expand) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "ListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListByResourceGroup", nil, "Failure preparing request") return } resp, err := client.ListByResourceGroupSender(req) if err != nil { - result.dbedl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "ListByResourceGroup", resp, "Failure sending request") + result.dl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListByResourceGroup", resp, "Failure sending request") return } - result.dbedl, err = client.ListByResourceGroupResponder(resp) + result.dl, err = client.ListByResourceGroupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "ListByResourceGroup", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListByResourceGroup", resp, "Failure responding to request") } return @@ -821,7 +821,7 @@ func (client DevicesClient) ListByResourceGroupSender(req *http.Request) (*http. // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always // closes the http.Response Body. -func (client DevicesClient) ListByResourceGroupResponder(resp *http.Response) (result DataBoxEdgeDeviceList, err error) { +func (client DevicesClient) ListByResourceGroupResponder(resp *http.Response) (result DeviceList, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -833,10 +833,10 @@ func (client DevicesClient) ListByResourceGroupResponder(resp *http.Response) (r } // listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DevicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults DataBoxEdgeDeviceList) (result DataBoxEdgeDeviceList, err error) { - req, err := lastResults.dataBoxEdgeDeviceListPreparer(ctx) +func (client DevicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults DeviceList) (result DeviceList, err error) { + req, err := lastResults.deviceListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -844,17 +844,17 @@ func (client DevicesClient) listByResourceGroupNextResults(ctx context.Context, resp, err := client.ListByResourceGroupSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") } result, err = client.ListByResourceGroupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") } return } // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DevicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, expand string) (result DataBoxEdgeDeviceListIterator, err error) { +func (client DevicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, expand string) (result DeviceListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.ListByResourceGroup") defer func() { @@ -873,13 +873,13 @@ func (client DevicesClient) ListByResourceGroupComplete(ctx context.Context, res // Parameters: // expand - specify $expand=details to populate additional fields related to the resource or Specify // $skipToken= to populate the next page in the list. -func (client DevicesClient) ListBySubscription(ctx context.Context, expand string) (result DataBoxEdgeDeviceListPage, err error) { +func (client DevicesClient) ListBySubscription(ctx context.Context, expand string) (result DeviceListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.ListBySubscription") defer func() { sc := -1 - if result.dbedl.Response.Response != nil { - sc = result.dbedl.Response.Response.StatusCode + if result.dl.Response.Response != nil { + sc = result.dl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -887,20 +887,20 @@ func (client DevicesClient) ListBySubscription(ctx context.Context, expand strin result.fn = client.listBySubscriptionNextResults req, err := client.ListBySubscriptionPreparer(ctx, expand) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "ListBySubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListBySubscription", nil, "Failure preparing request") return } resp, err := client.ListBySubscriptionSender(req) if err != nil { - result.dbedl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "ListBySubscription", resp, "Failure sending request") + result.dl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListBySubscription", resp, "Failure sending request") return } - result.dbedl, err = client.ListBySubscriptionResponder(resp) + result.dl, err = client.ListBySubscriptionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "ListBySubscription", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListBySubscription", resp, "Failure responding to request") } return @@ -937,7 +937,7 @@ func (client DevicesClient) ListBySubscriptionSender(req *http.Request) (*http.R // ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always // closes the http.Response Body. -func (client DevicesClient) ListBySubscriptionResponder(resp *http.Response) (result DataBoxEdgeDeviceList, err error) { +func (client DevicesClient) ListBySubscriptionResponder(resp *http.Response) (result DeviceList, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -949,10 +949,10 @@ func (client DevicesClient) ListBySubscriptionResponder(resp *http.Response) (re } // listBySubscriptionNextResults retrieves the next set of results, if any. -func (client DevicesClient) listBySubscriptionNextResults(ctx context.Context, lastResults DataBoxEdgeDeviceList) (result DataBoxEdgeDeviceList, err error) { - req, err := lastResults.dataBoxEdgeDeviceListPreparer(ctx) +func (client DevicesClient) listBySubscriptionNextResults(ctx context.Context, lastResults DeviceList) (result DeviceList, err error) { + req, err := lastResults.deviceListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -960,17 +960,17 @@ func (client DevicesClient) listBySubscriptionNextResults(ctx context.Context, l resp, err := client.ListBySubscriptionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") } result, err = client.ListBySubscriptionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") } return } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client DevicesClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result DataBoxEdgeDeviceListIterator, err error) { +func (client DevicesClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result DeviceListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.ListBySubscription") defer func() { @@ -1002,13 +1002,13 @@ func (client DevicesClient) ScanForUpdates(ctx context.Context, deviceName strin } req, err := client.ScanForUpdatesPreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "ScanForUpdates", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ScanForUpdates", nil, "Failure preparing request") return } result, err = client.ScanForUpdatesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "ScanForUpdates", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ScanForUpdates", result.Response(), "Failure sending request") return } @@ -1066,7 +1066,7 @@ func (client DevicesClient) ScanForUpdatesResponder(resp *http.Response) (result // deviceName - the device name. // parameters - the resource parameters. // resourceGroupName - the resource group name. -func (client DevicesClient) Update(ctx context.Context, deviceName string, parameters DataBoxEdgeDevicePatch, resourceGroupName string) (result DataBoxEdgeDevice, err error) { +func (client DevicesClient) Update(ctx context.Context, deviceName string, parameters DevicePatch, resourceGroupName string) (result Device, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.Update") defer func() { @@ -1079,27 +1079,27 @@ func (client DevicesClient) Update(ctx context.Context, deviceName string, param } req, err := client.UpdatePreparer(ctx, deviceName, parameters, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "Update", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Update", nil, "Failure preparing request") return } resp, err := client.UpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "Update", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Update", resp, "Failure sending request") return } result, err = client.UpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "Update", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Update", resp, "Failure responding to request") } return } // UpdatePreparer prepares the Update request. -func (client DevicesClient) UpdatePreparer(ctx context.Context, deviceName string, parameters DataBoxEdgeDevicePatch, resourceGroupName string) (*http.Request, error) { +func (client DevicesClient) UpdatePreparer(ctx context.Context, deviceName string, parameters DevicePatch, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "deviceName": autorest.Encode("path", deviceName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -1130,7 +1130,7 @@ func (client DevicesClient) UpdateSender(req *http.Request) (*http.Response, err // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client DevicesClient) UpdateResponder(resp *http.Response) (result DataBoxEdgeDevice, err error) { +func (client DevicesClient) UpdateResponder(resp *http.Response) (result Device, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -1161,25 +1161,25 @@ func (client DevicesClient) UploadCertificate(ctx context.Context, deviceName st {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.RawCertificateData", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.RawCertificateData.Certificate", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("edgegateway.DevicesClient", "UploadCertificate", err.Error()) + return result, validation.NewError("databoxedge.DevicesClient", "UploadCertificate", err.Error()) } req, err := client.UploadCertificatePreparer(ctx, deviceName, parameters, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "UploadCertificate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "UploadCertificate", nil, "Failure preparing request") return } resp, err := client.UploadCertificateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "UploadCertificate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "UploadCertificate", resp, "Failure sending request") return } result, err = client.UploadCertificateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesClient", "UploadCertificate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "UploadCertificate", resp, "Failure responding to request") } return diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/jobs.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/jobs.go similarity index 93% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/jobs.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/jobs.go index 4980344b2df1..793689c273b0 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/jobs.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/jobs.go @@ -1,4 +1,4 @@ -package edgegateway +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,7 +25,7 @@ import ( "net/http" ) -// JobsClient is the client for the Jobs methods of the Edgegateway service. +// JobsClient is the client for the Jobs methods of the Databoxedge service. type JobsClient struct { BaseClient } @@ -58,20 +58,20 @@ func (client JobsClient) Get(ctx context.Context, deviceName string, name string } req, err := client.GetPreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.JobsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.JobsClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.JobsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.JobsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.JobsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.JobsClient", "Get", resp, "Failure responding to request") } return diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/models.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/models.go similarity index 94% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/models.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/models.go index 3529b63e152a..91483cbbc9c1 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/models.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/models.go @@ -1,4 +1,4 @@ -package edgegateway +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -29,7 +29,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/edgegateway/mgmt/2019-03-01/edgegateway" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-03-01/databoxedge" // AccountType enumerates the values for account type. type AccountType string @@ -112,29 +112,6 @@ func PossibleClientPermissionTypeValues() []ClientPermissionType { return []ClientPermissionType{NoAccess, ReadOnly, ReadWrite} } -// DataBoxEdgeDeviceStatus enumerates the values for data box edge device status. -type DataBoxEdgeDeviceStatus string - -const ( - // Disconnected ... - Disconnected DataBoxEdgeDeviceStatus = "Disconnected" - // NeedsAttention ... - NeedsAttention DataBoxEdgeDeviceStatus = "NeedsAttention" - // Offline ... - Offline DataBoxEdgeDeviceStatus = "Offline" - // Online ... - Online DataBoxEdgeDeviceStatus = "Online" - // PartiallyDisconnected ... - PartiallyDisconnected DataBoxEdgeDeviceStatus = "PartiallyDisconnected" - // ReadyToSetup ... - ReadyToSetup DataBoxEdgeDeviceStatus = "ReadyToSetup" -) - -// PossibleDataBoxEdgeDeviceStatusValues returns an array of possible values for the DataBoxEdgeDeviceStatus const type. -func PossibleDataBoxEdgeDeviceStatusValues() []DataBoxEdgeDeviceStatus { - return []DataBoxEdgeDeviceStatus{Disconnected, NeedsAttention, Offline, Online, PartiallyDisconnected, ReadyToSetup} -} - // DataPolicy enumerates the values for data policy. type DataPolicy string @@ -175,17 +152,40 @@ func PossibleDayOfWeekValues() []DayOfWeek { return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} } +// DeviceStatus enumerates the values for device status. +type DeviceStatus string + +const ( + // Disconnected ... + Disconnected DeviceStatus = "Disconnected" + // NeedsAttention ... + NeedsAttention DeviceStatus = "NeedsAttention" + // Offline ... + Offline DeviceStatus = "Offline" + // Online ... + Online DeviceStatus = "Online" + // PartiallyDisconnected ... + PartiallyDisconnected DeviceStatus = "PartiallyDisconnected" + // ReadyToSetup ... + ReadyToSetup DeviceStatus = "ReadyToSetup" +) + +// PossibleDeviceStatusValues returns an array of possible values for the DeviceStatus const type. +func PossibleDeviceStatusValues() []DeviceStatus { + return []DeviceStatus{Disconnected, NeedsAttention, Offline, Online, PartiallyDisconnected, ReadyToSetup} +} + // DeviceType enumerates the values for device type. type DeviceType string const ( - // DeviceTypeDataBoxEdgeDevice ... - DeviceTypeDataBoxEdgeDevice DeviceType = "DataBoxEdgeDevice" + // DataBoxEdgeDevice ... + DataBoxEdgeDevice DeviceType = "DataBoxEdgeDevice" ) // PossibleDeviceTypeValues returns an array of possible values for the DeviceType const type. func PossibleDeviceTypeValues() []DeviceType { - return []DeviceType{DeviceTypeDataBoxEdgeDevice} + return []DeviceType{DataBoxEdgeDevice} } // DownloadPhase enumerates the values for download phase. @@ -1133,18 +1133,18 @@ func (future *BandwidthSchedulesCreateOrUpdateFuture) Result(client BandwidthSch var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.BandwidthSchedulesCreateOrUpdateFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.BandwidthSchedulesCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if bs.Response.Response, err = future.GetResult(sender); err == nil && bs.Response.Response.StatusCode != http.StatusNoContent { bs, err = client.CreateOrUpdateResponder(bs.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesCreateOrUpdateFuture", "Result", bs.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesCreateOrUpdateFuture", "Result", bs.Response.Response, "Failure responding to request") } } return @@ -1162,11 +1162,11 @@ func (future *BandwidthSchedulesDeleteFuture) Result(client BandwidthSchedulesCl var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.BandwidthSchedulesDeleteFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.BandwidthSchedulesDeleteFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.BandwidthSchedulesDeleteFuture") return } ar.Response = future.Response() @@ -1356,8 +1356,8 @@ type ContactDetails struct { EmailList *[]string `json:"emailList,omitempty"` } -// DataBoxEdgeDevice the Data Box Edge/Gateway device. -type DataBoxEdgeDevice struct { +// Device the Data Box Edge/Gateway device. +type Device struct { autorest.Response `json:"-"` // Location - The location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed. Location *string `json:"location,omitempty"` @@ -1367,8 +1367,8 @@ type DataBoxEdgeDevice struct { Sku *Sku `json:"sku,omitempty"` // Etag - The etag for the devices. Etag *string `json:"etag,omitempty"` - // DataBoxEdgeDeviceProperties - The properties of the Data Box Edge/Gateway device. - *DataBoxEdgeDeviceProperties `json:"properties,omitempty"` + // DeviceProperties - The properties of the Data Box Edge/Gateway device. + *DeviceProperties `json:"properties,omitempty"` // ID - READ-ONLY; The path ID that uniquely identifies the object. ID *string `json:"id,omitempty"` // Name - READ-ONLY; The object name. @@ -1377,29 +1377,29 @@ type DataBoxEdgeDevice struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for DataBoxEdgeDevice. -func (dbed DataBoxEdgeDevice) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for Device. +func (d Device) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dbed.Location != nil { - objectMap["location"] = dbed.Location + if d.Location != nil { + objectMap["location"] = d.Location } - if dbed.Tags != nil { - objectMap["tags"] = dbed.Tags + if d.Tags != nil { + objectMap["tags"] = d.Tags } - if dbed.Sku != nil { - objectMap["sku"] = dbed.Sku + if d.Sku != nil { + objectMap["sku"] = d.Sku } - if dbed.Etag != nil { - objectMap["etag"] = dbed.Etag + if d.Etag != nil { + objectMap["etag"] = d.Etag } - if dbed.DataBoxEdgeDeviceProperties != nil { - objectMap["properties"] = dbed.DataBoxEdgeDeviceProperties + if d.DeviceProperties != nil { + objectMap["properties"] = d.DeviceProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DataBoxEdgeDevice struct. -func (dbed *DataBoxEdgeDevice) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for Device struct. +func (d *Device) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1414,7 +1414,7 @@ func (dbed *DataBoxEdgeDevice) UnmarshalJSON(body []byte) error { if err != nil { return err } - dbed.Location = &location + d.Location = &location } case "tags": if v != nil { @@ -1423,7 +1423,7 @@ func (dbed *DataBoxEdgeDevice) UnmarshalJSON(body []byte) error { if err != nil { return err } - dbed.Tags = tags + d.Tags = tags } case "sku": if v != nil { @@ -1432,7 +1432,7 @@ func (dbed *DataBoxEdgeDevice) UnmarshalJSON(body []byte) error { if err != nil { return err } - dbed.Sku = &sku + d.Sku = &sku } case "etag": if v != nil { @@ -1441,16 +1441,16 @@ func (dbed *DataBoxEdgeDevice) UnmarshalJSON(body []byte) error { if err != nil { return err } - dbed.Etag = &etag + d.Etag = &etag } case "properties": if v != nil { - var dataBoxEdgeDeviceProperties DataBoxEdgeDeviceProperties - err = json.Unmarshal(*v, &dataBoxEdgeDeviceProperties) + var deviceProperties DeviceProperties + err = json.Unmarshal(*v, &deviceProperties) if err != nil { return err } - dbed.DataBoxEdgeDeviceProperties = &dataBoxEdgeDeviceProperties + d.DeviceProperties = &deviceProperties } case "id": if v != nil { @@ -1459,7 +1459,7 @@ func (dbed *DataBoxEdgeDevice) UnmarshalJSON(body []byte) error { if err != nil { return err } - dbed.ID = &ID + d.ID = &ID } case "name": if v != nil { @@ -1468,7 +1468,7 @@ func (dbed *DataBoxEdgeDevice) UnmarshalJSON(body []byte) error { if err != nil { return err } - dbed.Name = &name + d.Name = &name } case "type": if v != nil { @@ -1477,7 +1477,7 @@ func (dbed *DataBoxEdgeDevice) UnmarshalJSON(body []byte) error { if err != nil { return err } - dbed.Type = &typeVar + d.Type = &typeVar } } } @@ -1485,11 +1485,11 @@ func (dbed *DataBoxEdgeDevice) UnmarshalJSON(body []byte) error { return nil } -// DataBoxEdgeDeviceExtendedInfo the extended Info of the Data Box Edge/Gateway device. -type DataBoxEdgeDeviceExtendedInfo struct { +// DeviceExtendedInfo the extended Info of the Data Box Edge/Gateway device. +type DeviceExtendedInfo struct { autorest.Response `json:"-"` - // DataBoxEdgeDeviceExtendedInfoProperties - The extended info properties. - *DataBoxEdgeDeviceExtendedInfoProperties `json:"properties,omitempty"` + // DeviceExtendedInfoProperties - The extended info properties. + *DeviceExtendedInfoProperties `json:"properties,omitempty"` // ID - READ-ONLY; The path ID that uniquely identifies the object. ID *string `json:"id,omitempty"` // Name - READ-ONLY; The object name. @@ -1498,17 +1498,17 @@ type DataBoxEdgeDeviceExtendedInfo struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for DataBoxEdgeDeviceExtendedInfo. -func (dbedei DataBoxEdgeDeviceExtendedInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DeviceExtendedInfo. +func (dei DeviceExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dbedei.DataBoxEdgeDeviceExtendedInfoProperties != nil { - objectMap["properties"] = dbedei.DataBoxEdgeDeviceExtendedInfoProperties + if dei.DeviceExtendedInfoProperties != nil { + objectMap["properties"] = dei.DeviceExtendedInfoProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DataBoxEdgeDeviceExtendedInfo struct. -func (dbedei *DataBoxEdgeDeviceExtendedInfo) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for DeviceExtendedInfo struct. +func (dei *DeviceExtendedInfo) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1518,12 +1518,12 @@ func (dbedei *DataBoxEdgeDeviceExtendedInfo) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var dataBoxEdgeDeviceExtendedInfoProperties DataBoxEdgeDeviceExtendedInfoProperties - err = json.Unmarshal(*v, &dataBoxEdgeDeviceExtendedInfoProperties) + var deviceExtendedInfoProperties DeviceExtendedInfoProperties + err = json.Unmarshal(*v, &deviceExtendedInfoProperties) if err != nil { return err } - dbedei.DataBoxEdgeDeviceExtendedInfoProperties = &dataBoxEdgeDeviceExtendedInfoProperties + dei.DeviceExtendedInfoProperties = &deviceExtendedInfoProperties } case "id": if v != nil { @@ -1532,7 +1532,7 @@ func (dbedei *DataBoxEdgeDeviceExtendedInfo) UnmarshalJSON(body []byte) error { if err != nil { return err } - dbedei.ID = &ID + dei.ID = &ID } case "name": if v != nil { @@ -1541,7 +1541,7 @@ func (dbedei *DataBoxEdgeDeviceExtendedInfo) UnmarshalJSON(body []byte) error { if err != nil { return err } - dbedei.Name = &name + dei.Name = &name } case "type": if v != nil { @@ -1550,7 +1550,7 @@ func (dbedei *DataBoxEdgeDeviceExtendedInfo) UnmarshalJSON(body []byte) error { if err != nil { return err } - dbedei.Type = &typeVar + dei.Type = &typeVar } } } @@ -1558,9 +1558,8 @@ func (dbedei *DataBoxEdgeDeviceExtendedInfo) UnmarshalJSON(body []byte) error { return nil } -// DataBoxEdgeDeviceExtendedInfoProperties the properties of the Data Box Edge/Gateway device extended -// info. -type DataBoxEdgeDeviceExtendedInfoProperties struct { +// DeviceExtendedInfoProperties the properties of the Data Box Edge/Gateway device extended info. +type DeviceExtendedInfoProperties struct { // EncryptionKeyThumbprint - The digital signature of encrypted certificate. EncryptionKeyThumbprint *string `json:"encryptionKeyThumbprint,omitempty"` // EncryptionKey - The public part of the encryption certificate. Client uses this to encrypt any secret. @@ -1569,26 +1568,26 @@ type DataBoxEdgeDeviceExtendedInfoProperties struct { ResourceKey *string `json:"resourceKey,omitempty"` } -// DataBoxEdgeDeviceList the collection of Data Box Edge/Gateway devices. -type DataBoxEdgeDeviceList struct { +// DeviceList the collection of Data Box Edge/Gateway devices. +type DeviceList struct { autorest.Response `json:"-"` // Value - READ-ONLY; The list of Data Box Edge/Gateway devices. - Value *[]DataBoxEdgeDevice `json:"value,omitempty"` + Value *[]Device `json:"value,omitempty"` // NextLink - READ-ONLY; Link to the next set of results. NextLink *string `json:"nextLink,omitempty"` } -// DataBoxEdgeDeviceListIterator provides access to a complete listing of DataBoxEdgeDevice values. -type DataBoxEdgeDeviceListIterator struct { +// DeviceListIterator provides access to a complete listing of Device values. +type DeviceListIterator struct { i int - page DataBoxEdgeDeviceListPage + page DeviceListPage } // 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 *DataBoxEdgeDeviceListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *DeviceListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DataBoxEdgeDeviceListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -1613,62 +1612,62 @@ func (iter *DataBoxEdgeDeviceListIterator) NextWithContext(ctx context.Context) // 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 *DataBoxEdgeDeviceListIterator) Next() error { +func (iter *DeviceListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DataBoxEdgeDeviceListIterator) NotDone() bool { +func (iter DeviceListIterator) 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 DataBoxEdgeDeviceListIterator) Response() DataBoxEdgeDeviceList { +func (iter DeviceListIterator) Response() DeviceList { 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 DataBoxEdgeDeviceListIterator) Value() DataBoxEdgeDevice { +func (iter DeviceListIterator) Value() Device { if !iter.page.NotDone() { - return DataBoxEdgeDevice{} + return Device{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the DataBoxEdgeDeviceListIterator type. -func NewDataBoxEdgeDeviceListIterator(page DataBoxEdgeDeviceListPage) DataBoxEdgeDeviceListIterator { - return DataBoxEdgeDeviceListIterator{page: page} +// Creates a new instance of the DeviceListIterator type. +func NewDeviceListIterator(page DeviceListPage) DeviceListIterator { + return DeviceListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (dbedl DataBoxEdgeDeviceList) IsEmpty() bool { - return dbedl.Value == nil || len(*dbedl.Value) == 0 +func (dl DeviceList) IsEmpty() bool { + return dl.Value == nil || len(*dl.Value) == 0 } -// dataBoxEdgeDeviceListPreparer prepares a request to retrieve the next set of results. +// deviceListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (dbedl DataBoxEdgeDeviceList) dataBoxEdgeDeviceListPreparer(ctx context.Context) (*http.Request, error) { - if dbedl.NextLink == nil || len(to.String(dbedl.NextLink)) < 1 { +func (dl DeviceList) deviceListPreparer(ctx context.Context) (*http.Request, error) { + if dl.NextLink == nil || len(to.String(dl.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(dbedl.NextLink))) + autorest.WithBaseURL(to.String(dl.NextLink))) } -// DataBoxEdgeDeviceListPage contains a page of DataBoxEdgeDevice values. -type DataBoxEdgeDeviceListPage struct { - fn func(context.Context, DataBoxEdgeDeviceList) (DataBoxEdgeDeviceList, error) - dbedl DataBoxEdgeDeviceList +// DeviceListPage contains a page of Device values. +type DeviceListPage struct { + fn func(context.Context, DeviceList) (DeviceList, error) + dl DeviceList } // 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 *DataBoxEdgeDeviceListPage) NextWithContext(ctx context.Context) (err error) { +func (page *DeviceListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DataBoxEdgeDeviceListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -1677,70 +1676,70 @@ func (page *DataBoxEdgeDeviceListPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dbedl) + next, err := page.fn(ctx, page.dl) if err != nil { return err } - page.dbedl = next + page.dl = 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 *DataBoxEdgeDeviceListPage) Next() error { +func (page *DeviceListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DataBoxEdgeDeviceListPage) NotDone() bool { - return !page.dbedl.IsEmpty() +func (page DeviceListPage) NotDone() bool { + return !page.dl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page DataBoxEdgeDeviceListPage) Response() DataBoxEdgeDeviceList { - return page.dbedl +func (page DeviceListPage) Response() DeviceList { + return page.dl } // Values returns the slice of values for the current page or nil if there are no values. -func (page DataBoxEdgeDeviceListPage) Values() []DataBoxEdgeDevice { - if page.dbedl.IsEmpty() { +func (page DeviceListPage) Values() []Device { + if page.dl.IsEmpty() { return nil } - return *page.dbedl.Value + return *page.dl.Value } -// Creates a new instance of the DataBoxEdgeDeviceListPage type. -func NewDataBoxEdgeDeviceListPage(getNextPage func(context.Context, DataBoxEdgeDeviceList) (DataBoxEdgeDeviceList, error)) DataBoxEdgeDeviceListPage { - return DataBoxEdgeDeviceListPage{fn: getNextPage} +// Creates a new instance of the DeviceListPage type. +func NewDeviceListPage(getNextPage func(context.Context, DeviceList) (DeviceList, error)) DeviceListPage { + return DeviceListPage{fn: getNextPage} } -// DataBoxEdgeDevicePatch the Data Box Edge/Gateway device patch. -type DataBoxEdgeDevicePatch struct { +// DevicePatch the Data Box Edge/Gateway device patch. +type DevicePatch struct { // Tags - The tags attached to the Data Box Edge/Gateway resource. Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for DataBoxEdgeDevicePatch. -func (dbedp DataBoxEdgeDevicePatch) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DevicePatch. +func (dp DevicePatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dbedp.Tags != nil { - objectMap["tags"] = dbedp.Tags + if dp.Tags != nil { + objectMap["tags"] = dp.Tags } return json.Marshal(objectMap) } -// DataBoxEdgeDeviceProperties the properties of the Data Box Edge/Gateway device. -type DataBoxEdgeDeviceProperties struct { +// DeviceProperties the properties of the Data Box Edge/Gateway device. +type DeviceProperties struct { // DataBoxEdgeDeviceStatus - The status of the Data Box Edge/Gateway device. Possible values include: 'ReadyToSetup', 'Online', 'Offline', 'NeedsAttention', 'Disconnected', 'PartiallyDisconnected' - DataBoxEdgeDeviceStatus DataBoxEdgeDeviceStatus `json:"dataBoxEdgeDeviceStatus,omitempty"` + DataBoxEdgeDeviceStatus DeviceStatus `json:"dataBoxEdgeDeviceStatus,omitempty"` // SerialNumber - READ-ONLY; The Serial Number of Data Box Edge/Gateway device. SerialNumber *string `json:"serialNumber,omitempty"` // Description - The Description of the Data Box Edge/Gateway device. Description *string `json:"description,omitempty"` // ModelDescription - The description of the Data Box Edge/Gateway device model. ModelDescription *string `json:"modelDescription,omitempty"` - // DeviceType - READ-ONLY; The type of the Data Box Edge/Gateway device. Possible values include: 'DeviceTypeDataBoxEdgeDevice' + // DeviceType - READ-ONLY; The type of the Data Box Edge/Gateway device. Possible values include: 'DataBoxEdgeDevice' DeviceType DeviceType `json:"deviceType,omitempty"` // FriendlyName - The Data Box Edge/Gateway device name. FriendlyName *string `json:"friendlyName,omitempty"` @@ -1768,22 +1767,22 @@ type DevicesCreateOrUpdateFuture struct { // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *DevicesCreateOrUpdateFuture) Result(client DevicesClient) (dbed DataBoxEdgeDevice, err error) { +func (future *DevicesCreateOrUpdateFuture) Result(client DevicesClient) (d Device, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.DevicesCreateOrUpdateFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dbed.Response.Response, err = future.GetResult(sender); err == nil && dbed.Response.Response.StatusCode != http.StatusNoContent { - dbed, err = client.CreateOrUpdateResponder(dbed.Response.Response) + if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { + d, err = client.CreateOrUpdateResponder(d.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesCreateOrUpdateFuture", "Result", dbed.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") } } return @@ -1801,11 +1800,11 @@ func (future *DevicesCreateOrUpdateSecuritySettingsFuture) Result(client Devices var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesCreateOrUpdateSecuritySettingsFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesCreateOrUpdateSecuritySettingsFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.DevicesCreateOrUpdateSecuritySettingsFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesCreateOrUpdateSecuritySettingsFuture") return } ar.Response = future.Response() @@ -1824,11 +1823,11 @@ func (future *DevicesDeleteFuture) Result(client DevicesClient) (ar autorest.Res var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesDeleteFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.DevicesDeleteFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesDeleteFuture") return } ar.Response = future.Response() @@ -1847,11 +1846,11 @@ func (future *DevicesDownloadUpdatesFuture) Result(client DevicesClient) (ar aut var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesDownloadUpdatesFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesDownloadUpdatesFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.DevicesDownloadUpdatesFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesDownloadUpdatesFuture") return } ar.Response = future.Response() @@ -1870,11 +1869,11 @@ func (future *DevicesInstallUpdatesFuture) Result(client DevicesClient) (ar auto var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesInstallUpdatesFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesInstallUpdatesFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.DevicesInstallUpdatesFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesInstallUpdatesFuture") return } ar.Response = future.Response() @@ -1893,11 +1892,11 @@ func (future *DevicesScanForUpdatesFuture) Result(client DevicesClient) (ar auto var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.DevicesScanForUpdatesFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.DevicesScanForUpdatesFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.DevicesScanForUpdatesFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesScanForUpdatesFuture") return } ar.Response = future.Response() @@ -2998,18 +2997,18 @@ func (future *OrdersCreateOrUpdateFuture) Result(client OrdersClient) (o Order, var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OrdersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.OrdersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.OrdersCreateOrUpdateFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.OrdersCreateOrUpdateFuture") 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.CreateOrUpdateResponder(o.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OrdersCreateOrUpdateFuture", "Result", o.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.OrdersCreateOrUpdateFuture", "Result", o.Response.Response, "Failure responding to request") } } return @@ -3026,11 +3025,11 @@ func (future *OrdersDeleteFuture) Result(client OrdersClient) (ar autorest.Respo var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OrdersDeleteFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.OrdersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.OrdersDeleteFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.OrdersDeleteFuture") return } ar.Response = future.Response() @@ -3482,18 +3481,18 @@ func (future *RolesCreateOrUpdateFuture) Result(client RolesClient) (rm RoleMode var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.RolesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.RolesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.RolesCreateOrUpdateFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.RolesCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if rm.Response.Response, err = future.GetResult(sender); err == nil && rm.Response.Response.StatusCode != http.StatusNoContent { rm, err = client.CreateOrUpdateResponder(rm.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.RolesCreateOrUpdateFuture", "Result", rm.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.RolesCreateOrUpdateFuture", "Result", rm.Response.Response, "Failure responding to request") } } return @@ -3510,11 +3509,11 @@ func (future *RolesDeleteFuture) Result(client RolesClient) (ar autorest.Respons var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.RolesDeleteFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.RolesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.RolesDeleteFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.RolesDeleteFuture") return } ar.Response = future.Response() @@ -3875,18 +3874,18 @@ func (future *SharesCreateOrUpdateFuture) Result(client SharesClient) (s Share, var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.SharesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.SharesCreateOrUpdateFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.SharesCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { s, err = client.CreateOrUpdateResponder(s.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.SharesCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") } } return @@ -3903,11 +3902,11 @@ func (future *SharesDeleteFuture) Result(client SharesClient) (ar autorest.Respo var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesDeleteFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.SharesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.SharesDeleteFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.SharesDeleteFuture") return } ar.Response = future.Response() @@ -3926,11 +3925,11 @@ func (future *SharesRefreshFuture) Result(client SharesClient) (ar autorest.Resp var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesRefreshFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.SharesRefreshFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.SharesRefreshFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.SharesRefreshFuture") return } ar.Response = future.Response() @@ -4195,18 +4194,18 @@ func (future *StorageAccountCredentialsCreateOrUpdateFuture) Result(client Stora var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.StorageAccountCredentialsCreateOrUpdateFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.StorageAccountCredentialsCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if sac.Response.Response, err = future.GetResult(sender); err == nil && sac.Response.Response.StatusCode != http.StatusNoContent { sac, err = client.CreateOrUpdateResponder(sac.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsCreateOrUpdateFuture", "Result", sac.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsCreateOrUpdateFuture", "Result", sac.Response.Response, "Failure responding to request") } } return @@ -4224,11 +4223,11 @@ func (future *StorageAccountCredentialsDeleteFuture) Result(client StorageAccoun var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsDeleteFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.StorageAccountCredentialsDeleteFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.StorageAccountCredentialsDeleteFuture") return } ar.Response = future.Response() @@ -4551,18 +4550,18 @@ func (future *TriggersCreateOrUpdateFuture) Result(client TriggersClient) (tm Tr var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.TriggersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.TriggersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.TriggersCreateOrUpdateFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.TriggersCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if tm.Response.Response, err = future.GetResult(sender); err == nil && tm.Response.Response.StatusCode != http.StatusNoContent { tm, err = client.CreateOrUpdateResponder(tm.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.TriggersCreateOrUpdateFuture", "Result", tm.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.TriggersCreateOrUpdateFuture", "Result", tm.Response.Response, "Failure responding to request") } } return @@ -4580,11 +4579,11 @@ func (future *TriggersDeleteFuture) Result(client TriggersClient) (ar autorest.R var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.TriggersDeleteFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.TriggersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.TriggersDeleteFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.TriggersDeleteFuture") return } ar.Response = future.Response() @@ -5033,18 +5032,18 @@ func (future *UsersCreateOrUpdateFuture) Result(client UsersClient) (u User, err var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.UsersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.UsersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.UsersCreateOrUpdateFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.UsersCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if u.Response.Response, err = future.GetResult(sender); err == nil && u.Response.Response.StatusCode != http.StatusNoContent { u, err = client.CreateOrUpdateResponder(u.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.UsersCreateOrUpdateFuture", "Result", u.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.UsersCreateOrUpdateFuture", "Result", u.Response.Response, "Failure responding to request") } } return @@ -5061,11 +5060,11 @@ func (future *UsersDeleteFuture) Result(client UsersClient) (ar autorest.Respons var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.UsersDeleteFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "databoxedge.UsersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("edgegateway.UsersDeleteFuture") + err = azure.NewAsyncOpIncompleteError("databoxedge.UsersDeleteFuture") return } ar.Response = future.Response() diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/operations.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/operations.go similarity index 92% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/operations.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/operations.go index 4d3b2ca8d3d1..47a0db9e1e81 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/operations.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/operations.go @@ -1,4 +1,4 @@ -package edgegateway +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,7 +25,7 @@ import ( "net/http" ) -// OperationsClient is the client for the Operations methods of the Edgegateway service. +// OperationsClient is the client for the Operations methods of the Databoxedge service. type OperationsClient struct { BaseClient } @@ -55,20 +55,20 @@ func (client OperationsClient) List(ctx context.Context) (result OperationsListP result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OperationsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.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, "edgegateway.OperationsClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.OperationsClient", "List", resp, "Failure sending request") return } result.ol, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OperationsClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.OperationsClient", "List", resp, "Failure responding to request") } return @@ -113,7 +113,7 @@ func (client OperationsClient) ListResponder(resp *http.Response) (result Operat func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationsList) (result OperationsList, err error) { req, err := lastResults.operationsListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "edgegateway.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.OperationsClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -121,11 +121,11 @@ func (client OperationsClient) listNextResults(ctx context.Context, lastResults resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "edgegateway.OperationsClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.OperationsClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "databoxedge.OperationsClient", "listNextResults", resp, "Failure responding to next results request") } return } diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/operationsstatus.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/operationsstatus.go similarity index 94% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/operationsstatus.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/operationsstatus.go index 17756abdbc54..e08a6177b3cc 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/operationsstatus.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/operationsstatus.go @@ -1,4 +1,4 @@ -package edgegateway +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,7 +25,7 @@ import ( "net/http" ) -// OperationsStatusClient is the client for the OperationsStatus methods of the Edgegateway service. +// OperationsStatusClient is the client for the OperationsStatus methods of the Databoxedge service. type OperationsStatusClient struct { BaseClient } @@ -58,20 +58,20 @@ func (client OperationsStatusClient) Get(ctx context.Context, deviceName string, } req, err := client.GetPreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OperationsStatusClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.OperationsStatusClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.OperationsStatusClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.OperationsStatusClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OperationsStatusClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.OperationsStatusClient", "Get", resp, "Failure responding to request") } return diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/orders.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/orders.go similarity index 94% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/orders.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/orders.go index 173333eb4a5c..5b989ab89c2c 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/orders.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/orders.go @@ -1,4 +1,4 @@ -package edgegateway +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -26,7 +26,7 @@ import ( "net/http" ) -// OrdersClient is the client for the Orders methods of the Edgegateway service. +// OrdersClient is the client for the Orders methods of the Databoxedge service. type OrdersClient struct { BaseClient } @@ -74,18 +74,18 @@ func (client OrdersClient) CreateOrUpdate(ctx context.Context, deviceName string {Target: "order.OrderProperties.ShippingAddress.Country", Name: validation.Null, Rule: true, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewError("edgegateway.OrdersClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("databoxedge.OrdersClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, deviceName, order, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OrdersClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OrdersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -158,13 +158,13 @@ func (client OrdersClient) Delete(ctx context.Context, deviceName string, resour } req, err := client.DeletePreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OrdersClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OrdersClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Delete", result.Response(), "Failure sending request") return } @@ -234,20 +234,20 @@ func (client OrdersClient) Get(ctx context.Context, deviceName string, resourceG } req, err := client.GetPreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OrdersClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.OrdersClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OrdersClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Get", resp, "Failure responding to request") } return @@ -312,20 +312,20 @@ func (client OrdersClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceNa result.fn = client.listByDataBoxEdgeDeviceNextResults req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OrdersClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") return } resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.ol.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.OrdersClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") return } result.ol, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OrdersClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") } return @@ -376,7 +376,7 @@ func (client OrdersClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) func (client OrdersClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults OrderList) (result OrderList, err error) { req, err := lastResults.orderListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "edgegateway.OrdersClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -384,11 +384,11 @@ func (client OrdersClient) listByDataBoxEdgeDeviceNextResults(ctx context.Contex resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "edgegateway.OrdersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") } result, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.OrdersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") } return } diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/roles.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/roles.go similarity index 94% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/roles.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/roles.go index e6ed68296867..5324a10c4a75 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/roles.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/roles.go @@ -1,4 +1,4 @@ -package edgegateway +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,7 +25,7 @@ import ( "net/http" ) -// RolesClient is the client for the Roles methods of the Edgegateway service. +// RolesClient is the client for the Roles methods of the Databoxedge service. type RolesClient struct { BaseClient } @@ -59,13 +59,13 @@ func (client RolesClient) CreateOrUpdate(ctx context.Context, deviceName string, } req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, role, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.RolesClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.RolesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -140,13 +140,13 @@ func (client RolesClient) Delete(ctx context.Context, deviceName string, name st } req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.RolesClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.RolesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Delete", result.Response(), "Failure sending request") return } @@ -218,20 +218,20 @@ func (client RolesClient) Get(ctx context.Context, deviceName string, name strin } req, err := client.GetPreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.RolesClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.RolesClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.RolesClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Get", resp, "Failure responding to request") } return @@ -297,20 +297,20 @@ func (client RolesClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceNam result.fn = client.listByDataBoxEdgeDeviceNextResults req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.RolesClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") return } resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.rl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.RolesClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") return } result.rl, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.RolesClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") } return @@ -361,7 +361,7 @@ func (client RolesClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) func (client RolesClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults RoleList) (result RoleList, err error) { req, err := lastResults.roleListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "edgegateway.RolesClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.RolesClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -369,11 +369,11 @@ func (client RolesClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "edgegateway.RolesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.RolesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") } result, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.RolesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") } return } diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/shares.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/shares.go similarity index 94% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/shares.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/shares.go index 77d253b7072f..04dc7f8e4157 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/shares.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/shares.go @@ -1,4 +1,4 @@ -package edgegateway +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -26,7 +26,7 @@ import ( "net/http" ) -// SharesClient is the client for the Shares methods of the Edgegateway service. +// SharesClient is the client for the Shares methods of the Databoxedge service. type SharesClient struct { BaseClient } @@ -66,18 +66,18 @@ func (client SharesClient) CreateOrUpdate(ctx context.Context, deviceName string {Target: "share.ShareProperties.AzureContainerInfo.ContainerName", Name: validation.Null, Rule: true, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewError("edgegateway.SharesClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("databoxedge.SharesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, share, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -152,13 +152,13 @@ func (client SharesClient) Delete(ctx context.Context, deviceName string, name s } req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Delete", result.Response(), "Failure sending request") return } @@ -230,20 +230,20 @@ func (client SharesClient) Get(ctx context.Context, deviceName string, name stri } req, err := client.GetPreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.SharesClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Get", resp, "Failure responding to request") } return @@ -309,20 +309,20 @@ func (client SharesClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceNa result.fn = client.listByDataBoxEdgeDeviceNextResults req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") return } resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.sl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.SharesClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") return } result.sl, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") } return @@ -373,7 +373,7 @@ func (client SharesClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) func (client SharesClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults ShareList) (result ShareList, err error) { req, err := lastResults.shareListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "edgegateway.SharesClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.SharesClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -381,11 +381,11 @@ func (client SharesClient) listByDataBoxEdgeDeviceNextResults(ctx context.Contex resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "edgegateway.SharesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.SharesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") } result, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") } return } @@ -424,13 +424,13 @@ func (client SharesClient) Refresh(ctx context.Context, deviceName string, name } req, err := client.RefreshPreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesClient", "Refresh", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Refresh", nil, "Failure preparing request") return } result, err = client.RefreshSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.SharesClient", "Refresh", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Refresh", result.Response(), "Failure sending request") return } diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/storageaccountcredentials.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/storageaccountcredentials.go similarity index 94% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/storageaccountcredentials.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/storageaccountcredentials.go index a0795c0d522b..4eb785135af9 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/storageaccountcredentials.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/storageaccountcredentials.go @@ -1,4 +1,4 @@ -package edgegateway +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -26,7 +26,7 @@ import ( "net/http" ) -// StorageAccountCredentialsClient is the client for the StorageAccountCredentials methods of the Edgegateway service. +// StorageAccountCredentialsClient is the client for the StorageAccountCredentials methods of the Databoxedge service. type StorageAccountCredentialsClient struct { BaseClient } @@ -65,18 +65,18 @@ func (client StorageAccountCredentialsClient) CreateOrUpdate(ctx context.Context {Target: "storageAccountCredential.StorageAccountCredentialProperties.AccountKey", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "storageAccountCredential.StorageAccountCredentialProperties.AccountKey.Value", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewError("edgegateway.StorageAccountCredentialsClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("databoxedge.StorageAccountCredentialsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, storageAccountCredential, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -151,13 +151,13 @@ func (client StorageAccountCredentialsClient) Delete(ctx context.Context, device } req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Delete", result.Response(), "Failure sending request") return } @@ -229,20 +229,20 @@ func (client StorageAccountCredentialsClient) Get(ctx context.Context, deviceNam } req, err := client.GetPreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Get", resp, "Failure responding to request") } return @@ -308,20 +308,20 @@ func (client StorageAccountCredentialsClient) ListByDataBoxEdgeDevice(ctx contex result.fn = client.listByDataBoxEdgeDeviceNextResults req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") return } resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.sacl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") return } result.sacl, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") } return @@ -372,7 +372,7 @@ func (client StorageAccountCredentialsClient) ListByDataBoxEdgeDeviceResponder(r func (client StorageAccountCredentialsClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults StorageAccountCredentialList) (result StorageAccountCredentialList, err error) { req, err := lastResults.storageAccountCredentialListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -380,11 +380,11 @@ func (client StorageAccountCredentialsClient) listByDataBoxEdgeDeviceNextResults resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") } result, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.StorageAccountCredentialsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") } return } diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/triggers.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/triggers.go similarity index 94% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/triggers.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/triggers.go index dd1db1e80166..47ab4172d287 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/triggers.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/triggers.go @@ -1,4 +1,4 @@ -package edgegateway +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,7 +25,7 @@ import ( "net/http" ) -// TriggersClient is the client for the Triggers methods of the Edgegateway service. +// TriggersClient is the client for the Triggers methods of the Databoxedge service. type TriggersClient struct { BaseClient } @@ -59,13 +59,13 @@ func (client TriggersClient) CreateOrUpdate(ctx context.Context, deviceName stri } req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, trigger, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.TriggersClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.TriggersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -140,13 +140,13 @@ func (client TriggersClient) Delete(ctx context.Context, deviceName string, name } req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.TriggersClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.TriggersClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Delete", result.Response(), "Failure sending request") return } @@ -218,20 +218,20 @@ func (client TriggersClient) Get(ctx context.Context, deviceName string, name st } req, err := client.GetPreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.TriggersClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.TriggersClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.TriggersClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Get", resp, "Failure responding to request") } return @@ -298,20 +298,20 @@ func (client TriggersClient) ListByDataBoxEdgeDevice(ctx context.Context, device result.fn = client.listByDataBoxEdgeDeviceNextResults req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName, expand) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.TriggersClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") return } resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.tl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.TriggersClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") return } result.tl, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.TriggersClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") } return @@ -365,7 +365,7 @@ func (client TriggersClient) ListByDataBoxEdgeDeviceResponder(resp *http.Respons func (client TriggersClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults TriggerList) (result TriggerList, err error) { req, err := lastResults.triggerListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "edgegateway.TriggersClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -373,11 +373,11 @@ func (client TriggersClient) listByDataBoxEdgeDeviceNextResults(ctx context.Cont resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "edgegateway.TriggersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") } result, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.TriggersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") } return } diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/users.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/users.go similarity index 93% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/users.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/users.go index 16c4acc13078..7fba6cb567c2 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/users.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/users.go @@ -1,4 +1,4 @@ -package edgegateway +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -26,7 +26,7 @@ import ( "net/http" ) -// UsersClient is the client for the Users methods of the Edgegateway service. +// UsersClient is the client for the Users methods of the Databoxedge service. type UsersClient struct { BaseClient } @@ -64,18 +64,18 @@ func (client UsersClient) CreateOrUpdate(ctx context.Context, deviceName string, Chain: []validation.Constraint{{Target: "userParameter.UserProperties.EncryptedPassword", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "userParameter.UserProperties.EncryptedPassword.Value", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewError("edgegateway.UsersClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("databoxedge.UsersClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, userParameter, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.UsersClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.UsersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -150,13 +150,13 @@ func (client UsersClient) Delete(ctx context.Context, deviceName string, name st } req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.UsersClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.UsersClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Delete", result.Response(), "Failure sending request") return } @@ -228,20 +228,20 @@ func (client UsersClient) Get(ctx context.Context, deviceName string, name strin } req, err := client.GetPreparer(ctx, deviceName, name, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.UsersClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.UsersClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.UsersClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Get", resp, "Failure responding to request") } return @@ -307,20 +307,20 @@ func (client UsersClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceNam result.fn = client.listByDataBoxEdgeDeviceNextResults req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.UsersClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") return } resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.ul.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "edgegateway.UsersClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") return } result.ul, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.UsersClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") } return @@ -371,7 +371,7 @@ func (client UsersClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) func (client UsersClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults UserList) (result UserList, err error) { req, err := lastResults.userListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "edgegateway.UsersClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.UsersClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -379,11 +379,11 @@ func (client UsersClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context resp, err := client.ListByDataBoxEdgeDeviceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "edgegateway.UsersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "databoxedge.UsersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") } result, err = client.ListByDataBoxEdgeDeviceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "edgegateway.UsersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") } return } diff --git a/services/edgegateway/mgmt/2019-03-01/edgegateway/version.go b/services/databoxedge/mgmt/2019-03-01/databoxedge/version.go similarity index 92% rename from services/edgegateway/mgmt/2019-03-01/edgegateway/version.go rename to services/databoxedge/mgmt/2019-03-01/databoxedge/version.go index fbcb4e3dff98..b390cf60a53e 100644 --- a/services/edgegateway/mgmt/2019-03-01/edgegateway/version.go +++ b/services/databoxedge/mgmt/2019-03-01/databoxedge/version.go @@ -1,4 +1,4 @@ -package edgegateway +package databoxedge import "github.com/Azure/azure-sdk-for-go/version" @@ -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.Number + " edgegateway/2019-03-01" + return "Azure-SDK-For-Go/" + version.Number + " databoxedge/2019-03-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/services/databoxedge/mgmt/2019-07-01/databoxedge/alerts.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/alerts.go new file mode 100644 index 000000000000..942ea572ba27 --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/alerts.go @@ -0,0 +1,235 @@ +package databoxedge + +// 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" +) + +// AlertsClient is the client for the Alerts methods of the Databoxedge service. +type AlertsClient struct { + BaseClient +} + +// NewAlertsClient creates an instance of the AlertsClient client. +func NewAlertsClient(subscriptionID string) AlertsClient { + return NewAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAlertsClientWithBaseURI creates an instance of the AlertsClient client. +func NewAlertsClientWithBaseURI(baseURI string, subscriptionID string) AlertsClient { + return AlertsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get sends the get request. +// Parameters: +// deviceName - the device name. +// name - the alert name. +// resourceGroupName - the resource group name. +func (client AlertsClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AlertsClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AlertsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AlertsClient) GetResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice gets all the alerts for a Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client AlertsClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result AlertListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.al, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client AlertsClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client AlertsClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client AlertsClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result AlertList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client AlertsClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults AlertList) (result AlertList, err error) { + req, err := lastResults.alertListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client AlertsClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string) (result AlertListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName) + return +} diff --git a/services/databoxedge/mgmt/2019-07-01/databoxedge/bandwidthschedules.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/bandwidthschedules.go new file mode 100644 index 000000000000..8224612fd704 --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/bandwidthschedules.go @@ -0,0 +1,407 @@ +package databoxedge + +// 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" +) + +// BandwidthSchedulesClient is the client for the BandwidthSchedules methods of the Databoxedge service. +type BandwidthSchedulesClient struct { + BaseClient +} + +// NewBandwidthSchedulesClient creates an instance of the BandwidthSchedulesClient client. +func NewBandwidthSchedulesClient(subscriptionID string) BandwidthSchedulesClient { + return NewBandwidthSchedulesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewBandwidthSchedulesClientWithBaseURI creates an instance of the BandwidthSchedulesClient client. +func NewBandwidthSchedulesClientWithBaseURI(baseURI string, subscriptionID string) BandwidthSchedulesClient { + return BandwidthSchedulesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a bandwidth schedule. +// Parameters: +// deviceName - the device name. +// name - the bandwidth schedule name which needs to be added/updated. +// parameters - the bandwidth schedule to be added or updated. +// resourceGroupName - the resource group name. +func (client BandwidthSchedulesClient) CreateOrUpdate(ctx context.Context, deviceName string, name string, parameters BandwidthSchedule, resourceGroupName string) (result BandwidthSchedulesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesClient.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.BandwidthScheduleProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.BandwidthScheduleProperties.Start", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.BandwidthScheduleProperties.Stop", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.BandwidthScheduleProperties.RateInMbps", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.BandwidthScheduleProperties.Days", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("databoxedge.BandwidthSchedulesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, parameters, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client BandwidthSchedulesClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, name string, parameters BandwidthSchedule, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", 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 BandwidthSchedulesClient) CreateOrUpdateSender(req *http.Request) (future BandwidthSchedulesCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 BandwidthSchedulesClient) CreateOrUpdateResponder(resp *http.Response) (result BandwidthSchedule, 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 +} + +// Delete deletes the specified bandwidth schedule. +// Parameters: +// deviceName - the device name. +// name - the bandwidth schedule name. +// resourceGroupName - the resource group name. +func (client BandwidthSchedulesClient) Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result BandwidthSchedulesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client BandwidthSchedulesClient) DeletePreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client BandwidthSchedulesClient) DeleteSender(req *http.Request) (future BandwidthSchedulesDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 BandwidthSchedulesClient) 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 bandwidth schedule. +// Parameters: +// deviceName - the device name. +// name - the bandwidth schedule name. +// resourceGroupName - the resource group name. +func (client BandwidthSchedulesClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result BandwidthSchedule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client BandwidthSchedulesClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client BandwidthSchedulesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client BandwidthSchedulesClient) GetResponder(resp *http.Response) (result BandwidthSchedule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client BandwidthSchedulesClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result BandwidthSchedulesListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.bsl.Response.Response != nil { + sc = result.bsl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.bsl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.bsl, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client BandwidthSchedulesClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client BandwidthSchedulesClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client BandwidthSchedulesClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result BandwidthSchedulesList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client BandwidthSchedulesClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults BandwidthSchedulesList) (result BandwidthSchedulesList, err error) { + req, err := lastResults.bandwidthSchedulesListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client BandwidthSchedulesClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string) (result BandwidthSchedulesListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName) + return +} diff --git a/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/client.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/client.go similarity index 84% rename from services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/client.go rename to services/databoxedge/mgmt/2019-07-01/databoxedge/client.go index 12d2550d5b65..36593d1fec80 100644 --- a/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/client.go +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/client.go @@ -1,7 +1,7 @@ -// Package devspaces implements the Azure ARM Devspaces service API version 2019-01-01-preview. +// Package databoxedge implements the Azure ARM Databoxedge service API version 2019-07-01. // -// Dev Spaces Client -package devspaces +// +package databoxedge // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,11 +25,11 @@ import ( ) const ( - // DefaultBaseURI is the default URI used for the service Devspaces + // DefaultBaseURI is the default URI used for the service Databoxedge DefaultBaseURI = "https://management.azure.com" ) -// BaseClient is the base client for Devspaces. +// BaseClient is the base client for Databoxedge. type BaseClient struct { autorest.Client BaseURI string diff --git a/services/databoxedge/mgmt/2019-07-01/databoxedge/databoxedgeapi/interfaces.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/databoxedgeapi/interfaces.go new file mode 100644 index 000000000000..545baab9a791 --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/databoxedgeapi/interfaces.go @@ -0,0 +1,150 @@ +package databoxedgeapi + +// 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/databoxedge/mgmt/2019-07-01/databoxedge" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result databoxedge.OperationsListPage, err error) +} + +var _ OperationsClientAPI = (*databoxedge.OperationsClient)(nil) + +// DevicesClientAPI contains the set of methods on the DevicesClient type. +type DevicesClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, dataBoxEdgeDevice databoxedge.Device, resourceGroupName string) (result databoxedge.DevicesCreateOrUpdateFuture, err error) + CreateOrUpdateSecuritySettings(ctx context.Context, deviceName string, securitySettings databoxedge.SecuritySettings, resourceGroupName string) (result databoxedge.DevicesCreateOrUpdateSecuritySettingsFuture, err error) + Delete(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DevicesDeleteFuture, err error) + DownloadUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DevicesDownloadUpdatesFuture, err error) + Get(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.Device, err error) + GetExtendedInformation(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DeviceExtendedInfo, err error) + GetNetworkSettings(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.NetworkSettings, err error) + GetUpdateSummary(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.UpdateSummary, err error) + InstallUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DevicesInstallUpdatesFuture, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, expand string) (result databoxedge.DeviceListPage, err error) + ListBySubscription(ctx context.Context, expand string) (result databoxedge.DeviceListPage, err error) + ScanForUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DevicesScanForUpdatesFuture, err error) + Update(ctx context.Context, deviceName string, parameters databoxedge.DevicePatch, resourceGroupName string) (result databoxedge.Device, err error) + UploadCertificate(ctx context.Context, deviceName string, parameters databoxedge.UploadCertificateRequest, resourceGroupName string) (result databoxedge.UploadCertificateResponse, err error) +} + +var _ DevicesClientAPI = (*databoxedge.DevicesClient)(nil) + +// AlertsClientAPI contains the set of methods on the AlertsClient type. +type AlertsClientAPI interface { + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.Alert, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.AlertListPage, err error) +} + +var _ AlertsClientAPI = (*databoxedge.AlertsClient)(nil) + +// BandwidthSchedulesClientAPI contains the set of methods on the BandwidthSchedulesClient type. +type BandwidthSchedulesClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, name string, parameters databoxedge.BandwidthSchedule, resourceGroupName string) (result databoxedge.BandwidthSchedulesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.BandwidthSchedulesDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.BandwidthSchedule, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.BandwidthSchedulesListPage, err error) +} + +var _ BandwidthSchedulesClientAPI = (*databoxedge.BandwidthSchedulesClient)(nil) + +// JobsClientAPI contains the set of methods on the JobsClient type. +type JobsClientAPI interface { + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.Job, err error) +} + +var _ JobsClientAPI = (*databoxedge.JobsClient)(nil) + +// NodesClientAPI contains the set of methods on the NodesClient type. +type NodesClientAPI interface { + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.NodeList, err error) +} + +var _ NodesClientAPI = (*databoxedge.NodesClient)(nil) + +// OperationsStatusClientAPI contains the set of methods on the OperationsStatusClient type. +type OperationsStatusClientAPI interface { + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.Job, err error) +} + +var _ OperationsStatusClientAPI = (*databoxedge.OperationsStatusClient)(nil) + +// OrdersClientAPI contains the set of methods on the OrdersClient type. +type OrdersClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, order databoxedge.Order, resourceGroupName string) (result databoxedge.OrdersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.OrdersDeleteFuture, err error) + Get(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.Order, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.OrderListPage, err error) +} + +var _ OrdersClientAPI = (*databoxedge.OrdersClient)(nil) + +// RolesClientAPI contains the set of methods on the RolesClient type. +type RolesClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, name string, role databoxedge.BasicRole, resourceGroupName string) (result databoxedge.RolesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.RolesDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.RoleModel, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.RoleListPage, err error) +} + +var _ RolesClientAPI = (*databoxedge.RolesClient)(nil) + +// SharesClientAPI contains the set of methods on the SharesClient type. +type SharesClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, name string, share databoxedge.Share, resourceGroupName string) (result databoxedge.SharesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.SharesDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.Share, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.ShareListPage, err error) + Refresh(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.SharesRefreshFuture, err error) +} + +var _ SharesClientAPI = (*databoxedge.SharesClient)(nil) + +// StorageAccountCredentialsClientAPI contains the set of methods on the StorageAccountCredentialsClient type. +type StorageAccountCredentialsClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, name string, storageAccountCredential databoxedge.StorageAccountCredential, resourceGroupName string) (result databoxedge.StorageAccountCredentialsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.StorageAccountCredentialsDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.StorageAccountCredential, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.StorageAccountCredentialListPage, err error) +} + +var _ StorageAccountCredentialsClientAPI = (*databoxedge.StorageAccountCredentialsClient)(nil) + +// TriggersClientAPI contains the set of methods on the TriggersClient type. +type TriggersClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, name string, trigger databoxedge.BasicTrigger, resourceGroupName string) (result databoxedge.TriggersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.TriggersDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.TriggerModel, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string, expand string) (result databoxedge.TriggerListPage, err error) +} + +var _ TriggersClientAPI = (*databoxedge.TriggersClient)(nil) + +// UsersClientAPI contains the set of methods on the UsersClient type. +type UsersClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, name string, userParameter databoxedge.User, resourceGroupName string) (result databoxedge.UsersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.UsersDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.User, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.UserListPage, err error) +} + +var _ UsersClientAPI = (*databoxedge.UsersClient)(nil) diff --git a/services/databoxedge/mgmt/2019-07-01/databoxedge/devices.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/devices.go new file mode 100644 index 000000000000..3ba730cbaca4 --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/devices.go @@ -0,0 +1,1229 @@ +package databoxedge + +// 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" +) + +// DevicesClient is the client for the Devices methods of the Databoxedge service. +type DevicesClient struct { + BaseClient +} + +// NewDevicesClient creates an instance of the DevicesClient client. +func NewDevicesClient(subscriptionID string) DevicesClient { + return NewDevicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDevicesClientWithBaseURI creates an instance of the DevicesClient client. +func NewDevicesClientWithBaseURI(baseURI string, subscriptionID string) DevicesClient { + return DevicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a Data Box Edge/Data Box Gateway resource. +// Parameters: +// deviceName - the device name. +// dataBoxEdgeDevice - the resource object. +// resourceGroupName - the resource group name. +func (client DevicesClient) CreateOrUpdate(ctx context.Context, deviceName string, dataBoxEdgeDevice Device, resourceGroupName string) (result DevicesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.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: dataBoxEdgeDevice, + Constraints: []validation.Constraint{{Target: "dataBoxEdgeDevice.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("databoxedge.DevicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, dataBoxEdgeDevice, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DevicesClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, dataBoxEdgeDevice Device, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", pathParameters), + autorest.WithJSON(dataBoxEdgeDevice), + 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 DevicesClient) CreateOrUpdateSender(req *http.Request) (future DevicesCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 DevicesClient) CreateOrUpdateResponder(resp *http.Response) (result Device, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateSecuritySettings updates the security settings on a Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// securitySettings - the security settings. +// resourceGroupName - the resource group name. +func (client DevicesClient) CreateOrUpdateSecuritySettings(ctx context.Context, deviceName string, securitySettings SecuritySettings, resourceGroupName string) (result DevicesCreateOrUpdateSecuritySettingsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.CreateOrUpdateSecuritySettings") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: securitySettings, + Constraints: []validation.Constraint{{Target: "securitySettings.SecuritySettingsProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "securitySettings.SecuritySettingsProperties.DeviceAdminPassword", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "securitySettings.SecuritySettingsProperties.DeviceAdminPassword.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("databoxedge.DevicesClient", "CreateOrUpdateSecuritySettings", err.Error()) + } + + req, err := client.CreateOrUpdateSecuritySettingsPreparer(ctx, deviceName, securitySettings, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "CreateOrUpdateSecuritySettings", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSecuritySettingsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "CreateOrUpdateSecuritySettings", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdateSecuritySettingsPreparer prepares the CreateOrUpdateSecuritySettings request. +func (client DevicesClient) CreateOrUpdateSecuritySettingsPreparer(ctx context.Context, deviceName string, securitySettings SecuritySettings, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update", pathParameters), + autorest.WithJSON(securitySettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSecuritySettingsSender sends the CreateOrUpdateSecuritySettings request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) CreateOrUpdateSecuritySettingsSender(req *http.Request) (future DevicesCreateOrUpdateSecuritySettingsFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateSecuritySettingsResponder handles the response to the CreateOrUpdateSecuritySettings request. The method always +// closes the http.Response Body. +func (client DevicesClient) CreateOrUpdateSecuritySettingsResponder(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 +} + +// Delete deletes the Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) Delete(ctx context.Context, deviceName string, resourceGroupName string) (result DevicesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DevicesClient) DeletePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", 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 DevicesClient) DeleteSender(req *http.Request) (future DevicesDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 DevicesClient) 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 +} + +// DownloadUpdates sends the download updates request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) DownloadUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result DevicesDownloadUpdatesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.DownloadUpdates") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DownloadUpdatesPreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "DownloadUpdates", nil, "Failure preparing request") + return + } + + result, err = client.DownloadUpdatesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "DownloadUpdates", result.Response(), "Failure sending request") + return + } + + return +} + +// DownloadUpdatesPreparer prepares the DownloadUpdates request. +func (client DevicesClient) DownloadUpdatesPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DownloadUpdatesSender sends the DownloadUpdates request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) DownloadUpdatesSender(req *http.Request) (future DevicesDownloadUpdatesFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DownloadUpdatesResponder handles the response to the DownloadUpdates request. The method always +// closes the http.Response Body. +func (client DevicesClient) DownloadUpdatesResponder(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 the properties of the Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) Get(ctx context.Context, deviceName string, resourceGroupName string) (result Device, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.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, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DevicesClient) GetPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", 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 DevicesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DevicesClient) GetResponder(resp *http.Response) (result Device, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetExtendedInformation gets additional information for the specified Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) GetExtendedInformation(ctx context.Context, deviceName string, resourceGroupName string) (result DeviceExtendedInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.GetExtendedInformation") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetExtendedInformationPreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetExtendedInformation", nil, "Failure preparing request") + return + } + + resp, err := client.GetExtendedInformationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetExtendedInformation", resp, "Failure sending request") + return + } + + result, err = client.GetExtendedInformationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetExtendedInformation", resp, "Failure responding to request") + } + + return +} + +// GetExtendedInformationPreparer prepares the GetExtendedInformation request. +func (client DevicesClient) GetExtendedInformationPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetExtendedInformationSender sends the GetExtendedInformation request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) GetExtendedInformationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetExtendedInformationResponder handles the response to the GetExtendedInformation request. The method always +// closes the http.Response Body. +func (client DevicesClient) GetExtendedInformationResponder(resp *http.Response) (result DeviceExtendedInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetNetworkSettings gets the network settings of the specified Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) GetNetworkSettings(ctx context.Context, deviceName string, resourceGroupName string) (result NetworkSettings, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.GetNetworkSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetNetworkSettingsPreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetNetworkSettings", nil, "Failure preparing request") + return + } + + resp, err := client.GetNetworkSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetNetworkSettings", resp, "Failure sending request") + return + } + + result, err = client.GetNetworkSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetNetworkSettings", resp, "Failure responding to request") + } + + return +} + +// GetNetworkSettingsPreparer prepares the GetNetworkSettings request. +func (client DevicesClient) GetNetworkSettingsPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetNetworkSettingsSender sends the GetNetworkSettings request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) GetNetworkSettingsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetNetworkSettingsResponder handles the response to the GetNetworkSettings request. The method always +// closes the http.Response Body. +func (client DevicesClient) GetNetworkSettingsResponder(resp *http.Response) (result NetworkSettings, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetUpdateSummary sends the get update summary request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) GetUpdateSummary(ctx context.Context, deviceName string, resourceGroupName string) (result UpdateSummary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.GetUpdateSummary") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetUpdateSummaryPreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetUpdateSummary", nil, "Failure preparing request") + return + } + + resp, err := client.GetUpdateSummarySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetUpdateSummary", resp, "Failure sending request") + return + } + + result, err = client.GetUpdateSummaryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetUpdateSummary", resp, "Failure responding to request") + } + + return +} + +// GetUpdateSummaryPreparer prepares the GetUpdateSummary request. +func (client DevicesClient) GetUpdateSummaryPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUpdateSummarySender sends the GetUpdateSummary request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) GetUpdateSummarySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetUpdateSummaryResponder handles the response to the GetUpdateSummary request. The method always +// closes the http.Response Body. +func (client DevicesClient) GetUpdateSummaryResponder(resp *http.Response) (result UpdateSummary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// InstallUpdates sends the install updates request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) InstallUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result DevicesInstallUpdatesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.InstallUpdates") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.InstallUpdatesPreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "InstallUpdates", nil, "Failure preparing request") + return + } + + result, err = client.InstallUpdatesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "InstallUpdates", result.Response(), "Failure sending request") + return + } + + return +} + +// InstallUpdatesPreparer prepares the InstallUpdates request. +func (client DevicesClient) InstallUpdatesPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// InstallUpdatesSender sends the InstallUpdates request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) InstallUpdatesSender(req *http.Request) (future DevicesInstallUpdatesFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// InstallUpdatesResponder handles the response to the InstallUpdates request. The method always +// closes the http.Response Body. +func (client DevicesClient) InstallUpdatesResponder(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 +} + +// ListByResourceGroup gets all the Data Box Edge/Data Box Gateway devices in a resource group. +// Parameters: +// resourceGroupName - the resource group name. +// expand - specify $expand=details to populate additional fields related to the resource or Specify +// $skipToken= to populate the next page in the list. +func (client DevicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, expand string) (result DeviceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.dl.Response.Response != nil { + sc = result.dl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.dl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.dl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client DevicesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-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.DataBoxEdge/dataBoxEdgeDevices", 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 DevicesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client DevicesClient) ListByResourceGroupResponder(resp *http.Response) (result DeviceList, 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 DevicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults DeviceList) (result DeviceList, err error) { + req, err := lastResults.deviceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "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, "databoxedge.DevicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client DevicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, expand string) (result DeviceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.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, expand) + return +} + +// ListBySubscription gets all the Data Box Edge/Data Box Gateway devices in a subscription. +// Parameters: +// expand - specify $expand=details to populate additional fields related to the resource or Specify +// $skipToken= to populate the next page in the list. +func (client DevicesClient) ListBySubscription(ctx context.Context, expand string) (result DeviceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.ListBySubscription") + defer func() { + sc := -1 + if result.dl.Response.Response != nil { + sc = result.dl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.dl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.dl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client DevicesClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-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}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices", 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 DevicesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client DevicesClient) ListBySubscriptionResponder(resp *http.Response) (result DeviceList, 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 DevicesClient) listBySubscriptionNextResults(ctx context.Context, lastResults DeviceList) (result DeviceList, err error) { + req, err := lastResults.deviceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "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, "databoxedge.DevicesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client DevicesClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result DeviceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.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, expand) + return +} + +// ScanForUpdates sends the scan for updates request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) ScanForUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result DevicesScanForUpdatesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.ScanForUpdates") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ScanForUpdatesPreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ScanForUpdates", nil, "Failure preparing request") + return + } + + result, err = client.ScanForUpdatesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ScanForUpdates", result.Response(), "Failure sending request") + return + } + + return +} + +// ScanForUpdatesPreparer prepares the ScanForUpdates request. +func (client DevicesClient) ScanForUpdatesPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ScanForUpdatesSender sends the ScanForUpdates request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) ScanForUpdatesSender(req *http.Request) (future DevicesScanForUpdatesFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ScanForUpdatesResponder handles the response to the ScanForUpdates request. The method always +// closes the http.Response Body. +func (client DevicesClient) ScanForUpdatesResponder(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 +} + +// Update modifies a Data Box Edge/Data Box Gateway resource. +// Parameters: +// deviceName - the device name. +// parameters - the resource parameters. +// resourceGroupName - the resource group name. +func (client DevicesClient) Update(ctx context.Context, deviceName string, parameters DevicePatch, resourceGroupName string) (result Device, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.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, deviceName, parameters, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DevicesClient) UpdatePreparer(ctx context.Context, deviceName string, parameters DevicePatch, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", 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 DevicesClient) UpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DevicesClient) UpdateResponder(resp *http.Response) (result Device, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UploadCertificate uploads registration certificate for the device. +// Parameters: +// deviceName - the device name. +// parameters - the upload certificate request. +// resourceGroupName - the resource group name. +func (client DevicesClient) UploadCertificate(ctx context.Context, deviceName string, parameters UploadCertificateRequest, resourceGroupName string) (result UploadCertificateResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.UploadCertificate") + defer func() { + 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.RawCertificateData", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.RawCertificateData.Certificate", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("databoxedge.DevicesClient", "UploadCertificate", err.Error()) + } + + req, err := client.UploadCertificatePreparer(ctx, deviceName, parameters, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "UploadCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.UploadCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "UploadCertificate", resp, "Failure sending request") + return + } + + result, err = client.UploadCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "UploadCertificate", resp, "Failure responding to request") + } + + return +} + +// UploadCertificatePreparer prepares the UploadCertificate request. +func (client DevicesClient) UploadCertificatePreparer(ctx context.Context, deviceName string, parameters UploadCertificateRequest, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UploadCertificateSender sends the UploadCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) UploadCertificateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// UploadCertificateResponder handles the response to the UploadCertificate request. The method always +// closes the http.Response Body. +func (client DevicesClient) UploadCertificateResponder(resp *http.Response) (result UploadCertificateResponse, 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/databoxedge/mgmt/2019-07-01/databoxedge/jobs.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/jobs.go new file mode 100644 index 000000000000..cb77c8a60081 --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/jobs.go @@ -0,0 +1,120 @@ +package databoxedge + +// 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" +) + +// JobsClient is the client for the Jobs methods of the Databoxedge service. +type JobsClient struct { + BaseClient +} + +// NewJobsClient creates an instance of the JobsClient client. +func NewJobsClient(subscriptionID string) JobsClient { + return NewJobsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewJobsClientWithBaseURI creates an instance of the JobsClient client. +func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient { + return JobsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get sends the get request. +// Parameters: +// deviceName - the device name. +// name - the job name. +// resourceGroupName - the resource group name. +func (client JobsClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.JobsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.JobsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.JobsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client JobsClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client JobsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client JobsClient) GetResponder(resp *http.Response) (result Job, 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/databoxedge/mgmt/2019-07-01/databoxedge/models.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/models.go new file mode 100644 index 000000000000..0b13b5c4be4e --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/models.go @@ -0,0 +1,5203 @@ +package databoxedge + +// 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/databoxedge/mgmt/2019-07-01/databoxedge" + +// AccountType enumerates the values for account type. +type AccountType string + +const ( + // BlobStorage ... + BlobStorage AccountType = "BlobStorage" + // GeneralPurposeStorage ... + GeneralPurposeStorage AccountType = "GeneralPurposeStorage" +) + +// PossibleAccountTypeValues returns an array of possible values for the AccountType const type. +func PossibleAccountTypeValues() []AccountType { + return []AccountType{BlobStorage, GeneralPurposeStorage} +} + +// AlertSeverity enumerates the values for alert severity. +type AlertSeverity string + +const ( + // Critical ... + Critical AlertSeverity = "Critical" + // Informational ... + Informational AlertSeverity = "Informational" + // Warning ... + Warning AlertSeverity = "Warning" +) + +// PossibleAlertSeverityValues returns an array of possible values for the AlertSeverity const type. +func PossibleAlertSeverityValues() []AlertSeverity { + return []AlertSeverity{Critical, Informational, Warning} +} + +// AuthenticationType enumerates the values for authentication type. +type AuthenticationType string + +const ( + // AzureActiveDirectory ... + AzureActiveDirectory AuthenticationType = "AzureActiveDirectory" + // Invalid ... + Invalid AuthenticationType = "Invalid" +) + +// PossibleAuthenticationTypeValues returns an array of possible values for the AuthenticationType const type. +func PossibleAuthenticationTypeValues() []AuthenticationType { + return []AuthenticationType{AzureActiveDirectory, Invalid} +} + +// AzureContainerDataFormat enumerates the values for azure container data format. +type AzureContainerDataFormat string + +const ( + // AzureFile ... + AzureFile AzureContainerDataFormat = "AzureFile" + // BlockBlob ... + BlockBlob AzureContainerDataFormat = "BlockBlob" + // PageBlob ... + PageBlob AzureContainerDataFormat = "PageBlob" +) + +// PossibleAzureContainerDataFormatValues returns an array of possible values for the AzureContainerDataFormat const type. +func PossibleAzureContainerDataFormatValues() []AzureContainerDataFormat { + return []AzureContainerDataFormat{AzureFile, BlockBlob, PageBlob} +} + +// ClientPermissionType enumerates the values for client permission type. +type ClientPermissionType string + +const ( + // NoAccess ... + NoAccess ClientPermissionType = "NoAccess" + // ReadOnly ... + ReadOnly ClientPermissionType = "ReadOnly" + // ReadWrite ... + ReadWrite ClientPermissionType = "ReadWrite" +) + +// PossibleClientPermissionTypeValues returns an array of possible values for the ClientPermissionType const type. +func PossibleClientPermissionTypeValues() []ClientPermissionType { + return []ClientPermissionType{NoAccess, ReadOnly, ReadWrite} +} + +// DataPolicy enumerates the values for data policy. +type DataPolicy string + +const ( + // Cloud ... + Cloud DataPolicy = "Cloud" + // Local ... + Local DataPolicy = "Local" +) + +// PossibleDataPolicyValues returns an array of possible values for the DataPolicy const type. +func PossibleDataPolicyValues() []DataPolicy { + return []DataPolicy{Cloud, Local} +} + +// DayOfWeek enumerates the values for day of week. +type DayOfWeek string + +const ( + // Friday ... + Friday DayOfWeek = "Friday" + // Monday ... + Monday DayOfWeek = "Monday" + // Saturday ... + Saturday DayOfWeek = "Saturday" + // Sunday ... + Sunday DayOfWeek = "Sunday" + // Thursday ... + Thursday DayOfWeek = "Thursday" + // Tuesday ... + Tuesday DayOfWeek = "Tuesday" + // Wednesday ... + Wednesday DayOfWeek = "Wednesday" +) + +// PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type. +func PossibleDayOfWeekValues() []DayOfWeek { + return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} +} + +// DeviceStatus enumerates the values for device status. +type DeviceStatus string + +const ( + // Disconnected ... + Disconnected DeviceStatus = "Disconnected" + // Maintenance ... + Maintenance DeviceStatus = "Maintenance" + // NeedsAttention ... + NeedsAttention DeviceStatus = "NeedsAttention" + // Offline ... + Offline DeviceStatus = "Offline" + // Online ... + Online DeviceStatus = "Online" + // PartiallyDisconnected ... + PartiallyDisconnected DeviceStatus = "PartiallyDisconnected" + // ReadyToSetup ... + ReadyToSetup DeviceStatus = "ReadyToSetup" +) + +// PossibleDeviceStatusValues returns an array of possible values for the DeviceStatus const type. +func PossibleDeviceStatusValues() []DeviceStatus { + return []DeviceStatus{Disconnected, Maintenance, NeedsAttention, Offline, Online, PartiallyDisconnected, ReadyToSetup} +} + +// DeviceType enumerates the values for device type. +type DeviceType string + +const ( + // DataBoxEdgeDevice ... + DataBoxEdgeDevice DeviceType = "DataBoxEdgeDevice" +) + +// PossibleDeviceTypeValues returns an array of possible values for the DeviceType const type. +func PossibleDeviceTypeValues() []DeviceType { + return []DeviceType{DataBoxEdgeDevice} +} + +// DownloadPhase enumerates the values for download phase. +type DownloadPhase string + +const ( + // Downloading ... + Downloading DownloadPhase = "Downloading" + // Initializing ... + Initializing DownloadPhase = "Initializing" + // Unknown ... + Unknown DownloadPhase = "Unknown" + // Verifying ... + Verifying DownloadPhase = "Verifying" +) + +// PossibleDownloadPhaseValues returns an array of possible values for the DownloadPhase const type. +func PossibleDownloadPhaseValues() []DownloadPhase { + return []DownloadPhase{Downloading, Initializing, Unknown, Verifying} +} + +// EncryptionAlgorithm enumerates the values for encryption algorithm. +type EncryptionAlgorithm string + +const ( + // AES256 ... + AES256 EncryptionAlgorithm = "AES256" + // None ... + None EncryptionAlgorithm = "None" + // RSAESPKCS1V15 ... + RSAESPKCS1V15 EncryptionAlgorithm = "RSAES_PKCS1_v_1_5" +) + +// PossibleEncryptionAlgorithmValues returns an array of possible values for the EncryptionAlgorithm const type. +func PossibleEncryptionAlgorithmValues() []EncryptionAlgorithm { + return []EncryptionAlgorithm{AES256, None, RSAESPKCS1V15} +} + +// InstallRebootBehavior enumerates the values for install reboot behavior. +type InstallRebootBehavior string + +const ( + // NeverReboots ... + NeverReboots InstallRebootBehavior = "NeverReboots" + // RequestReboot ... + RequestReboot InstallRebootBehavior = "RequestReboot" + // RequiresReboot ... + RequiresReboot InstallRebootBehavior = "RequiresReboot" +) + +// PossibleInstallRebootBehaviorValues returns an array of possible values for the InstallRebootBehavior const type. +func PossibleInstallRebootBehaviorValues() []InstallRebootBehavior { + return []InstallRebootBehavior{NeverReboots, RequestReboot, RequiresReboot} +} + +// JobStatus enumerates the values for job status. +type JobStatus string + +const ( + // JobStatusCanceled ... + JobStatusCanceled JobStatus = "Canceled" + // JobStatusFailed ... + JobStatusFailed JobStatus = "Failed" + // JobStatusInvalid ... + JobStatusInvalid JobStatus = "Invalid" + // JobStatusPaused ... + JobStatusPaused JobStatus = "Paused" + // JobStatusRunning ... + JobStatusRunning JobStatus = "Running" + // JobStatusScheduled ... + JobStatusScheduled JobStatus = "Scheduled" + // JobStatusSucceeded ... + JobStatusSucceeded JobStatus = "Succeeded" +) + +// PossibleJobStatusValues returns an array of possible values for the JobStatus const type. +func PossibleJobStatusValues() []JobStatus { + return []JobStatus{JobStatusCanceled, JobStatusFailed, JobStatusInvalid, JobStatusPaused, JobStatusRunning, JobStatusScheduled, JobStatusSucceeded} +} + +// JobType enumerates the values for job type. +type JobType string + +const ( + // JobTypeDownloadUpdates ... + JobTypeDownloadUpdates JobType = "DownloadUpdates" + // JobTypeInstallUpdates ... + JobTypeInstallUpdates JobType = "InstallUpdates" + // JobTypeInvalid ... + JobTypeInvalid JobType = "Invalid" + // JobTypeRefreshShare ... + JobTypeRefreshShare JobType = "RefreshShare" + // JobTypeScanForUpdates ... + JobTypeScanForUpdates JobType = "ScanForUpdates" +) + +// PossibleJobTypeValues returns an array of possible values for the JobType const type. +func PossibleJobTypeValues() []JobType { + return []JobType{JobTypeDownloadUpdates, JobTypeInstallUpdates, JobTypeInvalid, JobTypeRefreshShare, JobTypeScanForUpdates} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindIOT ... + KindIOT Kind = "IOT" + // KindRole ... + KindRole Kind = "Role" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindIOT, KindRole} +} + +// KindBasicTrigger enumerates the values for kind basic trigger. +type KindBasicTrigger string + +const ( + // KindFileEvent ... + KindFileEvent KindBasicTrigger = "FileEvent" + // KindPeriodicTimerEvent ... + KindPeriodicTimerEvent KindBasicTrigger = "PeriodicTimerEvent" + // KindTrigger ... + KindTrigger KindBasicTrigger = "Trigger" +) + +// PossibleKindBasicTriggerValues returns an array of possible values for the KindBasicTrigger const type. +func PossibleKindBasicTriggerValues() []KindBasicTrigger { + return []KindBasicTrigger{KindFileEvent, KindPeriodicTimerEvent, KindTrigger} +} + +// MetricAggregationType enumerates the values for metric aggregation type. +type MetricAggregationType string + +const ( + // MetricAggregationTypeAverage ... + MetricAggregationTypeAverage MetricAggregationType = "Average" + // MetricAggregationTypeCount ... + MetricAggregationTypeCount MetricAggregationType = "Count" + // MetricAggregationTypeMaximum ... + MetricAggregationTypeMaximum MetricAggregationType = "Maximum" + // MetricAggregationTypeMinimum ... + MetricAggregationTypeMinimum MetricAggregationType = "Minimum" + // MetricAggregationTypeNone ... + MetricAggregationTypeNone MetricAggregationType = "None" + // MetricAggregationTypeNotSpecified ... + MetricAggregationTypeNotSpecified MetricAggregationType = "NotSpecified" + // MetricAggregationTypeTotal ... + MetricAggregationTypeTotal MetricAggregationType = "Total" +) + +// PossibleMetricAggregationTypeValues returns an array of possible values for the MetricAggregationType const type. +func PossibleMetricAggregationTypeValues() []MetricAggregationType { + return []MetricAggregationType{MetricAggregationTypeAverage, MetricAggregationTypeCount, MetricAggregationTypeMaximum, MetricAggregationTypeMinimum, MetricAggregationTypeNone, MetricAggregationTypeNotSpecified, MetricAggregationTypeTotal} +} + +// MetricCategory enumerates the values for metric category. +type MetricCategory string + +const ( + // Capacity ... + Capacity MetricCategory = "Capacity" + // Transaction ... + Transaction MetricCategory = "Transaction" +) + +// PossibleMetricCategoryValues returns an array of possible values for the MetricCategory const type. +func PossibleMetricCategoryValues() []MetricCategory { + return []MetricCategory{Capacity, Transaction} +} + +// MetricUnit enumerates the values for metric unit. +type MetricUnit string + +const ( + // Bytes ... + Bytes MetricUnit = "Bytes" + // BytesPerSecond ... + BytesPerSecond MetricUnit = "BytesPerSecond" + // Count ... + Count MetricUnit = "Count" + // CountPerSecond ... + CountPerSecond MetricUnit = "CountPerSecond" + // Milliseconds ... + Milliseconds MetricUnit = "Milliseconds" + // NotSpecified ... + NotSpecified MetricUnit = "NotSpecified" + // Percent ... + Percent MetricUnit = "Percent" + // Seconds ... + Seconds MetricUnit = "Seconds" +) + +// PossibleMetricUnitValues returns an array of possible values for the MetricUnit const type. +func PossibleMetricUnitValues() []MetricUnit { + return []MetricUnit{Bytes, BytesPerSecond, Count, CountPerSecond, Milliseconds, NotSpecified, Percent, Seconds} +} + +// MonitoringStatus enumerates the values for monitoring status. +type MonitoringStatus string + +const ( + // Disabled ... + Disabled MonitoringStatus = "Disabled" + // Enabled ... + Enabled MonitoringStatus = "Enabled" +) + +// PossibleMonitoringStatusValues returns an array of possible values for the MonitoringStatus const type. +func PossibleMonitoringStatusValues() []MonitoringStatus { + return []MonitoringStatus{Disabled, Enabled} +} + +// NetworkAdapterDHCPStatus enumerates the values for network adapter dhcp status. +type NetworkAdapterDHCPStatus string + +const ( + // NetworkAdapterDHCPStatusDisabled ... + NetworkAdapterDHCPStatusDisabled NetworkAdapterDHCPStatus = "Disabled" + // NetworkAdapterDHCPStatusEnabled ... + NetworkAdapterDHCPStatusEnabled NetworkAdapterDHCPStatus = "Enabled" +) + +// PossibleNetworkAdapterDHCPStatusValues returns an array of possible values for the NetworkAdapterDHCPStatus const type. +func PossibleNetworkAdapterDHCPStatusValues() []NetworkAdapterDHCPStatus { + return []NetworkAdapterDHCPStatus{NetworkAdapterDHCPStatusDisabled, NetworkAdapterDHCPStatusEnabled} +} + +// NetworkAdapterRDMAStatus enumerates the values for network adapter rdma status. +type NetworkAdapterRDMAStatus string + +const ( + // Capable ... + Capable NetworkAdapterRDMAStatus = "Capable" + // Incapable ... + Incapable NetworkAdapterRDMAStatus = "Incapable" +) + +// PossibleNetworkAdapterRDMAStatusValues returns an array of possible values for the NetworkAdapterRDMAStatus const type. +func PossibleNetworkAdapterRDMAStatusValues() []NetworkAdapterRDMAStatus { + return []NetworkAdapterRDMAStatus{Capable, Incapable} +} + +// NetworkAdapterStatus enumerates the values for network adapter status. +type NetworkAdapterStatus string + +const ( + // Active ... + Active NetworkAdapterStatus = "Active" + // Inactive ... + Inactive NetworkAdapterStatus = "Inactive" +) + +// PossibleNetworkAdapterStatusValues returns an array of possible values for the NetworkAdapterStatus const type. +func PossibleNetworkAdapterStatusValues() []NetworkAdapterStatus { + return []NetworkAdapterStatus{Active, Inactive} +} + +// NetworkGroup enumerates the values for network group. +type NetworkGroup string + +const ( + // NetworkGroupNone ... + NetworkGroupNone NetworkGroup = "None" + // NetworkGroupNonRDMA ... + NetworkGroupNonRDMA NetworkGroup = "NonRDMA" + // NetworkGroupRDMA ... + NetworkGroupRDMA NetworkGroup = "RDMA" +) + +// PossibleNetworkGroupValues returns an array of possible values for the NetworkGroup const type. +func PossibleNetworkGroupValues() []NetworkGroup { + return []NetworkGroup{NetworkGroupNone, NetworkGroupNonRDMA, NetworkGroupRDMA} +} + +// NodeStatus enumerates the values for node status. +type NodeStatus string + +const ( + // NodeStatusDown ... + NodeStatusDown NodeStatus = "Down" + // NodeStatusRebooting ... + NodeStatusRebooting NodeStatus = "Rebooting" + // NodeStatusShuttingDown ... + NodeStatusShuttingDown NodeStatus = "ShuttingDown" + // NodeStatusUnknown ... + NodeStatusUnknown NodeStatus = "Unknown" + // NodeStatusUp ... + NodeStatusUp NodeStatus = "Up" +) + +// PossibleNodeStatusValues returns an array of possible values for the NodeStatus const type. +func PossibleNodeStatusValues() []NodeStatus { + return []NodeStatus{NodeStatusDown, NodeStatusRebooting, NodeStatusShuttingDown, NodeStatusUnknown, NodeStatusUp} +} + +// OrderState enumerates the values for order state. +type OrderState string + +const ( + // Arriving ... + Arriving OrderState = "Arriving" + // AwaitingFulfilment ... + AwaitingFulfilment OrderState = "AwaitingFulfilment" + // AwaitingPreparation ... + AwaitingPreparation OrderState = "AwaitingPreparation" + // AwaitingReturnShipment ... + AwaitingReturnShipment OrderState = "AwaitingReturnShipment" + // AwaitingShipment ... + AwaitingShipment OrderState = "AwaitingShipment" + // CollectedAtMicrosoft ... + CollectedAtMicrosoft OrderState = "CollectedAtMicrosoft" + // Declined ... + Declined OrderState = "Declined" + // Delivered ... + Delivered OrderState = "Delivered" + // LostDevice ... + LostDevice OrderState = "LostDevice" + // ReplacementRequested ... + ReplacementRequested OrderState = "ReplacementRequested" + // ReturnInitiated ... + ReturnInitiated OrderState = "ReturnInitiated" + // Shipped ... + Shipped OrderState = "Shipped" + // ShippedBack ... + ShippedBack OrderState = "ShippedBack" + // Untracked ... + Untracked OrderState = "Untracked" +) + +// PossibleOrderStateValues returns an array of possible values for the OrderState const type. +func PossibleOrderStateValues() []OrderState { + return []OrderState{Arriving, AwaitingFulfilment, AwaitingPreparation, AwaitingReturnShipment, AwaitingShipment, CollectedAtMicrosoft, Declined, Delivered, LostDevice, ReplacementRequested, ReturnInitiated, Shipped, ShippedBack, Untracked} +} + +// PlatformType enumerates the values for platform type. +type PlatformType string + +const ( + // Linux ... + Linux PlatformType = "Linux" + // Windows ... + Windows PlatformType = "Windows" +) + +// PossiblePlatformTypeValues returns an array of possible values for the PlatformType const type. +func PossiblePlatformTypeValues() []PlatformType { + return []PlatformType{Linux, Windows} +} + +// RoleStatus enumerates the values for role status. +type RoleStatus string + +const ( + // RoleStatusDisabled ... + RoleStatusDisabled RoleStatus = "Disabled" + // RoleStatusEnabled ... + RoleStatusEnabled RoleStatus = "Enabled" +) + +// PossibleRoleStatusValues returns an array of possible values for the RoleStatus const type. +func PossibleRoleStatusValues() []RoleStatus { + return []RoleStatus{RoleStatusDisabled, RoleStatusEnabled} +} + +// RoleTypes enumerates the values for role types. +type RoleTypes string + +const ( + // ASA ... + ASA RoleTypes = "ASA" + // Cognitive ... + Cognitive RoleTypes = "Cognitive" + // Functions ... + Functions RoleTypes = "Functions" + // IOT ... + IOT RoleTypes = "IOT" +) + +// PossibleRoleTypesValues returns an array of possible values for the RoleTypes const type. +func PossibleRoleTypesValues() []RoleTypes { + return []RoleTypes{ASA, Cognitive, Functions, IOT} +} + +// ShareAccessProtocol enumerates the values for share access protocol. +type ShareAccessProtocol string + +const ( + // NFS ... + NFS ShareAccessProtocol = "NFS" + // SMB ... + SMB ShareAccessProtocol = "SMB" +) + +// PossibleShareAccessProtocolValues returns an array of possible values for the ShareAccessProtocol const type. +func PossibleShareAccessProtocolValues() []ShareAccessProtocol { + return []ShareAccessProtocol{NFS, SMB} +} + +// ShareAccessType enumerates the values for share access type. +type ShareAccessType string + +const ( + // Change ... + Change ShareAccessType = "Change" + // Custom ... + Custom ShareAccessType = "Custom" + // Read ... + Read ShareAccessType = "Read" +) + +// PossibleShareAccessTypeValues returns an array of possible values for the ShareAccessType const type. +func PossibleShareAccessTypeValues() []ShareAccessType { + return []ShareAccessType{Change, Custom, Read} +} + +// ShareStatus enumerates the values for share status. +type ShareStatus string + +const ( + // ShareStatusNeedsAttention ... + ShareStatusNeedsAttention ShareStatus = "NeedsAttention" + // ShareStatusOffline ... + ShareStatusOffline ShareStatus = "Offline" + // ShareStatusOK ... + ShareStatusOK ShareStatus = "OK" + // ShareStatusUnknown ... + ShareStatusUnknown ShareStatus = "Unknown" + // ShareStatusUpdating ... + ShareStatusUpdating ShareStatus = "Updating" +) + +// PossibleShareStatusValues returns an array of possible values for the ShareStatus const type. +func PossibleShareStatusValues() []ShareStatus { + return []ShareStatus{ShareStatusNeedsAttention, ShareStatusOffline, ShareStatusOK, ShareStatusUnknown, ShareStatusUpdating} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // Edge ... + Edge SkuName = "Edge" + // Gateway ... + Gateway SkuName = "Gateway" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{Edge, Gateway} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // Standard ... + Standard SkuTier = "Standard" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{Standard} +} + +// SSLStatus enumerates the values for ssl status. +type SSLStatus string + +const ( + // SSLStatusDisabled ... + SSLStatusDisabled SSLStatus = "Disabled" + // SSLStatusEnabled ... + SSLStatusEnabled SSLStatus = "Enabled" +) + +// PossibleSSLStatusValues returns an array of possible values for the SSLStatus const type. +func PossibleSSLStatusValues() []SSLStatus { + return []SSLStatus{SSLStatusDisabled, SSLStatusEnabled} +} + +// TimeGrain enumerates the values for time grain. +type TimeGrain string + +const ( + // PT12H ... + PT12H TimeGrain = "PT12H" + // PT15M ... + PT15M TimeGrain = "PT15M" + // PT1D ... + PT1D TimeGrain = "PT1D" + // PT1H ... + PT1H TimeGrain = "PT1H" + // PT1M ... + PT1M TimeGrain = "PT1M" + // PT30M ... + PT30M TimeGrain = "PT30M" + // PT5M ... + PT5M TimeGrain = "PT5M" + // PT6H ... + PT6H TimeGrain = "PT6H" +) + +// PossibleTimeGrainValues returns an array of possible values for the TimeGrain const type. +func PossibleTimeGrainValues() []TimeGrain { + return []TimeGrain{PT12H, PT15M, PT1D, PT1H, PT1M, PT30M, PT5M, PT6H} +} + +// UpdateOperation enumerates the values for update operation. +type UpdateOperation string + +const ( + // UpdateOperationDownload ... + UpdateOperationDownload UpdateOperation = "Download" + // UpdateOperationInstall ... + UpdateOperationInstall UpdateOperation = "Install" + // UpdateOperationNone ... + UpdateOperationNone UpdateOperation = "None" + // UpdateOperationScan ... + UpdateOperationScan UpdateOperation = "Scan" +) + +// PossibleUpdateOperationValues returns an array of possible values for the UpdateOperation const type. +func PossibleUpdateOperationValues() []UpdateOperation { + return []UpdateOperation{UpdateOperationDownload, UpdateOperationInstall, UpdateOperationNone, UpdateOperationScan} +} + +// UpdateOperationStage enumerates the values for update operation stage. +type UpdateOperationStage string + +const ( + // UpdateOperationStageDownloadComplete ... + UpdateOperationStageDownloadComplete UpdateOperationStage = "DownloadComplete" + // UpdateOperationStageDownloadFailed ... + UpdateOperationStageDownloadFailed UpdateOperationStage = "DownloadFailed" + // UpdateOperationStageDownloadStarted ... + UpdateOperationStageDownloadStarted UpdateOperationStage = "DownloadStarted" + // UpdateOperationStageFailure ... + UpdateOperationStageFailure UpdateOperationStage = "Failure" + // UpdateOperationStageInitial ... + UpdateOperationStageInitial UpdateOperationStage = "Initial" + // UpdateOperationStageInstallComplete ... + UpdateOperationStageInstallComplete UpdateOperationStage = "InstallComplete" + // UpdateOperationStageInstallFailed ... + UpdateOperationStageInstallFailed UpdateOperationStage = "InstallFailed" + // UpdateOperationStageInstallStarted ... + UpdateOperationStageInstallStarted UpdateOperationStage = "InstallStarted" + // UpdateOperationStageRebootInitiated ... + UpdateOperationStageRebootInitiated UpdateOperationStage = "RebootInitiated" + // UpdateOperationStageRescanComplete ... + UpdateOperationStageRescanComplete UpdateOperationStage = "RescanComplete" + // UpdateOperationStageRescanFailed ... + UpdateOperationStageRescanFailed UpdateOperationStage = "RescanFailed" + // UpdateOperationStageRescanStarted ... + UpdateOperationStageRescanStarted UpdateOperationStage = "RescanStarted" + // UpdateOperationStageScanComplete ... + UpdateOperationStageScanComplete UpdateOperationStage = "ScanComplete" + // UpdateOperationStageScanFailed ... + UpdateOperationStageScanFailed UpdateOperationStage = "ScanFailed" + // UpdateOperationStageScanStarted ... + UpdateOperationStageScanStarted UpdateOperationStage = "ScanStarted" + // UpdateOperationStageSuccess ... + UpdateOperationStageSuccess UpdateOperationStage = "Success" + // UpdateOperationStageUnknown ... + UpdateOperationStageUnknown UpdateOperationStage = "Unknown" +) + +// PossibleUpdateOperationStageValues returns an array of possible values for the UpdateOperationStage const type. +func PossibleUpdateOperationStageValues() []UpdateOperationStage { + return []UpdateOperationStage{UpdateOperationStageDownloadComplete, UpdateOperationStageDownloadFailed, UpdateOperationStageDownloadStarted, UpdateOperationStageFailure, UpdateOperationStageInitial, UpdateOperationStageInstallComplete, UpdateOperationStageInstallFailed, UpdateOperationStageInstallStarted, UpdateOperationStageRebootInitiated, UpdateOperationStageRescanComplete, UpdateOperationStageRescanFailed, UpdateOperationStageRescanStarted, UpdateOperationStageScanComplete, UpdateOperationStageScanFailed, UpdateOperationStageScanStarted, UpdateOperationStageSuccess, UpdateOperationStageUnknown} +} + +// Address the shipping address of the customer. +type Address struct { + // AddressLine1 - The address line1. + AddressLine1 *string `json:"addressLine1,omitempty"` + // AddressLine2 - The address line2. + AddressLine2 *string `json:"addressLine2,omitempty"` + // AddressLine3 - The address line3. + AddressLine3 *string `json:"addressLine3,omitempty"` + // PostalCode - The postal code. + PostalCode *string `json:"postalCode,omitempty"` + // City - The city name. + City *string `json:"city,omitempty"` + // State - The state name. + State *string `json:"state,omitempty"` + // Country - The country name. + Country *string `json:"country,omitempty"` +} + +// Alert alert on the data box edge/gateway device. +type Alert struct { + autorest.Response `json:"-"` + // AlertProperties - READ-ONLY; Properties of alert. + *AlertProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Alert. +func (a Alert) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Alert struct. +func (a *Alert) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var alertProperties AlertProperties + err = json.Unmarshal(*v, &alertProperties) + if err != nil { + return err + } + a.AlertProperties = &alertProperties + } + 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 +} + +// AlertErrorDetails error details for the alert. +type AlertErrorDetails struct { + // ErrorCode - READ-ONLY; Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; Error Message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Occurrences - READ-ONLY; Number of occurrences. + Occurrences *int32 `json:"occurrences,omitempty"` +} + +// AlertList collection of alerts. +type AlertList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The value. + Value *[]Alert `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// AlertListIterator provides access to a complete listing of Alert values. +type AlertListIterator struct { + i int + page AlertListPage +} + +// 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 *AlertListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertListIterator.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 *AlertListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AlertListIterator) 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 AlertListIterator) Response() AlertList { + 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 AlertListIterator) Value() Alert { + if !iter.page.NotDone() { + return Alert{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AlertListIterator type. +func NewAlertListIterator(page AlertListPage) AlertListIterator { + return AlertListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (al AlertList) IsEmpty() bool { + return al.Value == nil || len(*al.Value) == 0 +} + +// alertListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (al AlertList) alertListPreparer(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))) +} + +// AlertListPage contains a page of Alert values. +type AlertListPage struct { + fn func(context.Context, AlertList) (AlertList, error) + al AlertList +} + +// 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 *AlertListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertListPage.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 *AlertListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AlertListPage) NotDone() bool { + return !page.al.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AlertListPage) Response() AlertList { + return page.al +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AlertListPage) Values() []Alert { + if page.al.IsEmpty() { + return nil + } + return *page.al.Value +} + +// Creates a new instance of the AlertListPage type. +func NewAlertListPage(getNextPage func(context.Context, AlertList) (AlertList, error)) AlertListPage { + return AlertListPage{fn: getNextPage} +} + +// AlertProperties properties of alert. +type AlertProperties struct { + // Title - READ-ONLY; Alert title. + Title *string `json:"title,omitempty"` + // AlertType - READ-ONLY; Alert type. + AlertType *string `json:"alertType,omitempty"` + // AppearedAtDateTime - READ-ONLY; UTC time when the alert appeared. + AppearedAtDateTime *date.Time `json:"appearedAtDateTime,omitempty"` + // Recommendation - READ-ONLY; Alert recommendation. + Recommendation *string `json:"recommendation,omitempty"` + // Severity - READ-ONLY; Severity of the alert. Possible values include: 'Informational', 'Warning', 'Critical' + Severity AlertSeverity `json:"severity,omitempty"` + // ErrorDetails - READ-ONLY; Error details of the alert. + ErrorDetails *AlertErrorDetails `json:"errorDetails,omitempty"` + // DetailedInformation - READ-ONLY; Alert details. + DetailedInformation map[string]*string `json:"detailedInformation"` +} + +// MarshalJSON is the custom marshaler for AlertProperties. +func (ap AlertProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ARMBaseModel represents the base class for all object models. +type ARMBaseModel struct { + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// AsymmetricEncryptedSecret represent the secrets intended for encryption with asymmetric key pair. +type AsymmetricEncryptedSecret struct { + // Value - The value of the secret. + Value *string `json:"value,omitempty"` + // EncryptionCertThumbprint - Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + EncryptionCertThumbprint *string `json:"encryptionCertThumbprint,omitempty"` + // EncryptionAlgorithm - The algorithm used to encrypt "Value". Possible values include: 'None', 'AES256', 'RSAESPKCS1V15' + EncryptionAlgorithm EncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"` +} + +// Authentication authentication mechanism for IoT devices. +type Authentication struct { + // SymmetricKey - Symmetric key for authentication. + SymmetricKey *SymmetricKey `json:"symmetricKey,omitempty"` +} + +// AzureContainerInfo azure container mapping of the endpoint. +type AzureContainerInfo struct { + // StorageAccountCredentialID - ID of the storage account credential used to access storage. + StorageAccountCredentialID *string `json:"storageAccountCredentialId,omitempty"` + // ContainerName - Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + ContainerName *string `json:"containerName,omitempty"` + // DataFormat - Storage format used for the file represented by the share. Possible values include: 'BlockBlob', 'PageBlob', 'AzureFile' + DataFormat AzureContainerDataFormat `json:"dataFormat,omitempty"` +} + +// BandwidthSchedule the bandwidth schedule details. +type BandwidthSchedule struct { + autorest.Response `json:"-"` + // BandwidthScheduleProperties - The properties of the bandwidth schedule. + *BandwidthScheduleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BandwidthSchedule. +func (bs BandwidthSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bs.BandwidthScheduleProperties != nil { + objectMap["properties"] = bs.BandwidthScheduleProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BandwidthSchedule struct. +func (bs *BandwidthSchedule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var bandwidthScheduleProperties BandwidthScheduleProperties + err = json.Unmarshal(*v, &bandwidthScheduleProperties) + if err != nil { + return err + } + bs.BandwidthScheduleProperties = &bandwidthScheduleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bs.Type = &typeVar + } + } + } + + return nil +} + +// BandwidthScheduleProperties the properties of the bandwidth schedule. +type BandwidthScheduleProperties struct { + // Start - The start time of the schedule in UTC. + Start *string `json:"start,omitempty"` + // Stop - The stop time of the schedule in UTC. + Stop *string `json:"stop,omitempty"` + // RateInMbps - The bandwidth rate in Mbps. + RateInMbps *int32 `json:"rateInMbps,omitempty"` + // Days - The days of the week when this schedule is applicable. + Days *[]DayOfWeek `json:"days,omitempty"` +} + +// BandwidthSchedulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type BandwidthSchedulesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *BandwidthSchedulesCreateOrUpdateFuture) Result(client BandwidthSchedulesClient) (bs BandwidthSchedule, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.BandwidthSchedulesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if bs.Response.Response, err = future.GetResult(sender); err == nil && bs.Response.Response.StatusCode != http.StatusNoContent { + bs, err = client.CreateOrUpdateResponder(bs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesCreateOrUpdateFuture", "Result", bs.Response.Response, "Failure responding to request") + } + } + return +} + +// BandwidthSchedulesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type BandwidthSchedulesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *BandwidthSchedulesDeleteFuture) Result(client BandwidthSchedulesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.BandwidthSchedulesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// BandwidthSchedulesList the collection of bandwidth schedules. +type BandwidthSchedulesList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of bandwidth schedules. + Value *[]BandwidthSchedule `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// BandwidthSchedulesListIterator provides access to a complete listing of BandwidthSchedule values. +type BandwidthSchedulesListIterator struct { + i int + page BandwidthSchedulesListPage +} + +// 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 *BandwidthSchedulesListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesListIterator.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 *BandwidthSchedulesListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter BandwidthSchedulesListIterator) 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 BandwidthSchedulesListIterator) Response() BandwidthSchedulesList { + 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 BandwidthSchedulesListIterator) Value() BandwidthSchedule { + if !iter.page.NotDone() { + return BandwidthSchedule{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the BandwidthSchedulesListIterator type. +func NewBandwidthSchedulesListIterator(page BandwidthSchedulesListPage) BandwidthSchedulesListIterator { + return BandwidthSchedulesListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (bsl BandwidthSchedulesList) IsEmpty() bool { + return bsl.Value == nil || len(*bsl.Value) == 0 +} + +// bandwidthSchedulesListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (bsl BandwidthSchedulesList) bandwidthSchedulesListPreparer(ctx context.Context) (*http.Request, error) { + if bsl.NextLink == nil || len(to.String(bsl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(bsl.NextLink))) +} + +// BandwidthSchedulesListPage contains a page of BandwidthSchedule values. +type BandwidthSchedulesListPage struct { + fn func(context.Context, BandwidthSchedulesList) (BandwidthSchedulesList, error) + bsl BandwidthSchedulesList +} + +// 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 *BandwidthSchedulesListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesListPage.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.bsl) + if err != nil { + return err + } + page.bsl = 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 *BandwidthSchedulesListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page BandwidthSchedulesListPage) NotDone() bool { + return !page.bsl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page BandwidthSchedulesListPage) Response() BandwidthSchedulesList { + return page.bsl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page BandwidthSchedulesListPage) Values() []BandwidthSchedule { + if page.bsl.IsEmpty() { + return nil + } + return *page.bsl.Value +} + +// Creates a new instance of the BandwidthSchedulesListPage type. +func NewBandwidthSchedulesListPage(getNextPage func(context.Context, BandwidthSchedulesList) (BandwidthSchedulesList, error)) BandwidthSchedulesListPage { + return BandwidthSchedulesListPage{fn: getNextPage} +} + +// ClientAccessRight the mapping between a particular client IP and the type of access client has on the +// NFS share. +type ClientAccessRight struct { + // Client - IP of the client. + Client *string `json:"client,omitempty"` + // AccessPermission - Type of access to be allowed for the client. Possible values include: 'NoAccess', 'ReadOnly', 'ReadWrite' + AccessPermission ClientPermissionType `json:"accessPermission,omitempty"` +} + +// CloudError an error response from the service. +type CloudError struct { + // Error - The error details. + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the 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"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` +} + +// ContactDetails contains all the contact details of the customer. +type ContactDetails struct { + // ContactPerson - The contact person name. + ContactPerson *string `json:"contactPerson,omitempty"` + // CompanyName - The name of the company. + CompanyName *string `json:"companyName,omitempty"` + // Phone - The phone number. + Phone *string `json:"phone,omitempty"` + // EmailList - The email list. + EmailList *[]string `json:"emailList,omitempty"` +} + +// Device the Data Box Edge/Gateway device. +type Device struct { + autorest.Response `json:"-"` + // Location - The location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed. + Location *string `json:"location,omitempty"` + // Tags - The list of tags that describe the device. These tags can be used to view and group this device (across resource groups). + Tags map[string]*string `json:"tags"` + // Sku - The SKU type. + Sku *Sku `json:"sku,omitempty"` + // Etag - The etag for the devices. + Etag *string `json:"etag,omitempty"` + // DeviceProperties - The properties of the Data Box Edge/Gateway device. + *DeviceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Device. +func (d Device) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.Location != nil { + objectMap["location"] = d.Location + } + if d.Tags != nil { + objectMap["tags"] = d.Tags + } + if d.Sku != nil { + objectMap["sku"] = d.Sku + } + if d.Etag != nil { + objectMap["etag"] = d.Etag + } + if d.DeviceProperties != nil { + objectMap["properties"] = d.DeviceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Device struct. +func (d *Device) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + d.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + d.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + d.Sku = &sku + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + d.Etag = &etag + } + case "properties": + if v != nil { + var deviceProperties DeviceProperties + err = json.Unmarshal(*v, &deviceProperties) + if err != nil { + return err + } + d.DeviceProperties = &deviceProperties + } + 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 +} + +// DeviceExtendedInfo the extended Info of the Data Box Edge/Gateway device. +type DeviceExtendedInfo struct { + autorest.Response `json:"-"` + // DeviceExtendedInfoProperties - The extended info properties. + *DeviceExtendedInfoProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeviceExtendedInfo. +func (dei DeviceExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dei.DeviceExtendedInfoProperties != nil { + objectMap["properties"] = dei.DeviceExtendedInfoProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DeviceExtendedInfo struct. +func (dei *DeviceExtendedInfo) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var deviceExtendedInfoProperties DeviceExtendedInfoProperties + err = json.Unmarshal(*v, &deviceExtendedInfoProperties) + if err != nil { + return err + } + dei.DeviceExtendedInfoProperties = &deviceExtendedInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dei.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dei.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dei.Type = &typeVar + } + } + } + + return nil +} + +// DeviceExtendedInfoProperties the properties of the Data Box Edge/Gateway device extended info. +type DeviceExtendedInfoProperties struct { + // EncryptionKeyThumbprint - The digital signature of encrypted certificate. + EncryptionKeyThumbprint *string `json:"encryptionKeyThumbprint,omitempty"` + // EncryptionKey - The public part of the encryption certificate. Client uses this to encrypt any secret. + EncryptionKey *string `json:"encryptionKey,omitempty"` + // ResourceKey - READ-ONLY; The Resource ID of the Resource. + ResourceKey *string `json:"resourceKey,omitempty"` +} + +// DeviceList the collection of Data Box Edge/Gateway devices. +type DeviceList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of Data Box Edge/Gateway devices. + Value *[]Device `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// DeviceListIterator provides access to a complete listing of Device values. +type DeviceListIterator struct { + i int + page DeviceListPage +} + +// 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 *DeviceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceListIterator.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 *DeviceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DeviceListIterator) 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 DeviceListIterator) Response() DeviceList { + 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 DeviceListIterator) Value() Device { + if !iter.page.NotDone() { + return Device{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DeviceListIterator type. +func NewDeviceListIterator(page DeviceListPage) DeviceListIterator { + return DeviceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dl DeviceList) IsEmpty() bool { + return dl.Value == nil || len(*dl.Value) == 0 +} + +// deviceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dl DeviceList) deviceListPreparer(ctx context.Context) (*http.Request, error) { + if dl.NextLink == nil || len(to.String(dl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dl.NextLink))) +} + +// DeviceListPage contains a page of Device values. +type DeviceListPage struct { + fn func(context.Context, DeviceList) (DeviceList, error) + dl DeviceList +} + +// 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 *DeviceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceListPage.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.dl) + if err != nil { + return err + } + page.dl = 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 *DeviceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DeviceListPage) NotDone() bool { + return !page.dl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DeviceListPage) Response() DeviceList { + return page.dl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DeviceListPage) Values() []Device { + if page.dl.IsEmpty() { + return nil + } + return *page.dl.Value +} + +// Creates a new instance of the DeviceListPage type. +func NewDeviceListPage(getNextPage func(context.Context, DeviceList) (DeviceList, error)) DeviceListPage { + return DeviceListPage{fn: getNextPage} +} + +// DevicePatch the Data Box Edge/Gateway device patch. +type DevicePatch struct { + // Tags - The tags attached to the Data Box Edge/Gateway resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DevicePatch. +func (dp DevicePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dp.Tags != nil { + objectMap["tags"] = dp.Tags + } + return json.Marshal(objectMap) +} + +// DeviceProperties the properties of the Data Box Edge/Gateway device. +type DeviceProperties struct { + // DataBoxEdgeDeviceStatus - The status of the Data Box Edge/Gateway device. Possible values include: 'ReadyToSetup', 'Online', 'Offline', 'NeedsAttention', 'Disconnected', 'PartiallyDisconnected', 'Maintenance' + DataBoxEdgeDeviceStatus DeviceStatus `json:"dataBoxEdgeDeviceStatus,omitempty"` + // SerialNumber - READ-ONLY; The Serial Number of Data Box Edge/Gateway device. + SerialNumber *string `json:"serialNumber,omitempty"` + // Description - The Description of the Data Box Edge/Gateway device. + Description *string `json:"description,omitempty"` + // ModelDescription - The description of the Data Box Edge/Gateway device model. + ModelDescription *string `json:"modelDescription,omitempty"` + // DeviceType - READ-ONLY; The type of the Data Box Edge/Gateway device. Possible values include: 'DataBoxEdgeDevice' + DeviceType DeviceType `json:"deviceType,omitempty"` + // FriendlyName - The Data Box Edge/Gateway device name. + FriendlyName *string `json:"friendlyName,omitempty"` + // Culture - READ-ONLY; The Data Box Edge/Gateway device culture. + Culture *string `json:"culture,omitempty"` + // DeviceModel - READ-ONLY; The Data Box Edge/Gateway device model. + DeviceModel *string `json:"deviceModel,omitempty"` + // DeviceSoftwareVersion - READ-ONLY; The Data Box Edge/Gateway device software version. + DeviceSoftwareVersion *string `json:"deviceSoftwareVersion,omitempty"` + // DeviceLocalCapacity - READ-ONLY; The Data Box Edge/Gateway device local capacity in MB. + DeviceLocalCapacity *int64 `json:"deviceLocalCapacity,omitempty"` + // TimeZone - READ-ONLY; The Data Box Edge/Gateway device timezone. + TimeZone *string `json:"timeZone,omitempty"` + // DeviceHcsVersion - READ-ONLY; The device software version number of the device (eg: 1.2.18105.6). + DeviceHcsVersion *string `json:"deviceHcsVersion,omitempty"` + // ConfiguredRoleTypes - READ-ONLY; Type of compute roles configured. + ConfiguredRoleTypes *[]RoleTypes `json:"configuredRoleTypes,omitempty"` + // NodeCount - READ-ONLY; The number of nodes in the cluster. + NodeCount *int32 `json:"nodeCount,omitempty"` +} + +// DevicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DevicesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DevicesCreateOrUpdateFuture) Result(client DevicesClient) (d Device, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { + d, err = client.CreateOrUpdateResponder(d.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") + } + } + return +} + +// DevicesCreateOrUpdateSecuritySettingsFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type DevicesCreateOrUpdateSecuritySettingsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DevicesCreateOrUpdateSecuritySettingsFuture) Result(client DevicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesCreateOrUpdateSecuritySettingsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesCreateOrUpdateSecuritySettingsFuture") + return + } + ar.Response = future.Response() + return +} + +// DevicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DevicesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DevicesDeleteFuture) Result(client DevicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DevicesDownloadUpdatesFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DevicesDownloadUpdatesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DevicesDownloadUpdatesFuture) Result(client DevicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesDownloadUpdatesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesDownloadUpdatesFuture") + return + } + ar.Response = future.Response() + return +} + +// DevicesInstallUpdatesFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DevicesInstallUpdatesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DevicesInstallUpdatesFuture) Result(client DevicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesInstallUpdatesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesInstallUpdatesFuture") + return + } + ar.Response = future.Response() + return +} + +// DevicesScanForUpdatesFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DevicesScanForUpdatesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DevicesScanForUpdatesFuture) Result(client DevicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesScanForUpdatesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesScanForUpdatesFuture") + return + } + ar.Response = future.Response() + return +} + +// FileEventTrigger trigger details. +type FileEventTrigger struct { + // FileTriggerProperties - File trigger properties. + *FileTriggerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindTrigger', 'KindFileEvent', 'KindPeriodicTimerEvent' + Kind KindBasicTrigger `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for FileEventTrigger. +func (fet FileEventTrigger) MarshalJSON() ([]byte, error) { + fet.Kind = KindFileEvent + objectMap := make(map[string]interface{}) + if fet.FileTriggerProperties != nil { + objectMap["properties"] = fet.FileTriggerProperties + } + if fet.Kind != "" { + objectMap["kind"] = fet.Kind + } + return json.Marshal(objectMap) +} + +// AsFileEventTrigger is the BasicTrigger implementation for FileEventTrigger. +func (fet FileEventTrigger) AsFileEventTrigger() (*FileEventTrigger, bool) { + return &fet, true +} + +// AsPeriodicTimerEventTrigger is the BasicTrigger implementation for FileEventTrigger. +func (fet FileEventTrigger) AsPeriodicTimerEventTrigger() (*PeriodicTimerEventTrigger, bool) { + return nil, false +} + +// AsTrigger is the BasicTrigger implementation for FileEventTrigger. +func (fet FileEventTrigger) AsTrigger() (*Trigger, bool) { + return nil, false +} + +// AsBasicTrigger is the BasicTrigger implementation for FileEventTrigger. +func (fet FileEventTrigger) AsBasicTrigger() (BasicTrigger, bool) { + return &fet, true +} + +// UnmarshalJSON is the custom unmarshaler for FileEventTrigger struct. +func (fet *FileEventTrigger) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var fileTriggerProperties FileTriggerProperties + err = json.Unmarshal(*v, &fileTriggerProperties) + if err != nil { + return err + } + fet.FileTriggerProperties = &fileTriggerProperties + } + case "kind": + if v != nil { + var kind KindBasicTrigger + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + fet.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fet.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fet.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fet.Type = &typeVar + } + } + } + + return nil +} + +// FileSourceInfo file source details. +type FileSourceInfo struct { + // ShareID - File share ID. + ShareID *string `json:"shareId,omitempty"` +} + +// FileTriggerProperties file trigger properties. +type FileTriggerProperties struct { + // SourceInfo - File event source details. + SourceInfo *FileSourceInfo `json:"sourceInfo,omitempty"` + // SinkInfo - Role sink info. + SinkInfo *RoleSinkInfo `json:"sinkInfo,omitempty"` + // CustomContextTag - A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + CustomContextTag *string `json:"customContextTag,omitempty"` +} + +// IoTDeviceInfo metadata of IoT device/IoT Edge device to be configured. +type IoTDeviceInfo struct { + // DeviceID - ID of the IoT device/edge device. + DeviceID *string `json:"deviceId,omitempty"` + // IoTHostHub - Host name for the IoT hub associated to the device. + IoTHostHub *string `json:"ioTHostHub,omitempty"` + // IoTHostHubID - Id of the IoT hub associated to the device. + IoTHostHubID *string `json:"ioTHostHubId,omitempty"` + // Authentication - IoT device authentication info. + Authentication *Authentication `json:"authentication,omitempty"` +} + +// IoTRole compute role. +type IoTRole struct { + // IoTRoleProperties - Properties specific to IoT role. + *IoTRoleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindRole', 'KindIOT' + Kind Kind `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for IoTRole. +func (itr IoTRole) MarshalJSON() ([]byte, error) { + itr.Kind = KindIOT + objectMap := make(map[string]interface{}) + if itr.IoTRoleProperties != nil { + objectMap["properties"] = itr.IoTRoleProperties + } + if itr.Kind != "" { + objectMap["kind"] = itr.Kind + } + return json.Marshal(objectMap) +} + +// AsIoTRole is the BasicRole implementation for IoTRole. +func (itr IoTRole) AsIoTRole() (*IoTRole, bool) { + return &itr, true +} + +// AsRole is the BasicRole implementation for IoTRole. +func (itr IoTRole) AsRole() (*Role, bool) { + return nil, false +} + +// AsBasicRole is the BasicRole implementation for IoTRole. +func (itr IoTRole) AsBasicRole() (BasicRole, bool) { + return &itr, true +} + +// UnmarshalJSON is the custom unmarshaler for IoTRole struct. +func (itr *IoTRole) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var ioTRoleProperties IoTRoleProperties + err = json.Unmarshal(*v, &ioTRoleProperties) + if err != nil { + return err + } + itr.IoTRoleProperties = &ioTRoleProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + itr.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + itr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + itr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + itr.Type = &typeVar + } + } + } + + return nil +} + +// IoTRoleProperties ioT role properties. +type IoTRoleProperties struct { + // HostPlatform - Host OS supported by the IoT role. Possible values include: 'Windows', 'Linux' + HostPlatform PlatformType `json:"hostPlatform,omitempty"` + // IoTDeviceDetails - IoT device metadata to which data box edge device needs to be connected. + IoTDeviceDetails *IoTDeviceInfo `json:"ioTDeviceDetails,omitempty"` + // IoTEdgeDeviceDetails - IoT edge device to which the IoT role needs to be configured. + IoTEdgeDeviceDetails *IoTDeviceInfo `json:"ioTEdgeDeviceDetails,omitempty"` + // ShareMappings - Mount points of shares in role(s). + ShareMappings *[]MountPointMap `json:"shareMappings,omitempty"` + // RoleStatus - Role status. Possible values include: 'RoleStatusEnabled', 'RoleStatusDisabled' + RoleStatus RoleStatus `json:"roleStatus,omitempty"` +} + +// Ipv4Config details related to the IPv4 address configuration. +type Ipv4Config struct { + // IPAddress - READ-ONLY; The IPv4 address of the network adapter. + IPAddress *string `json:"ipAddress,omitempty"` + // Subnet - READ-ONLY; The IPv4 subnet of the network adapter. + Subnet *string `json:"subnet,omitempty"` + // Gateway - READ-ONLY; The IPv4 gateway of the network adapter. + Gateway *string `json:"gateway,omitempty"` +} + +// Ipv6Config details related to the IPv6 address configuration. +type Ipv6Config struct { + // IPAddress - READ-ONLY; The IPv6 address of the network adapter. + IPAddress *string `json:"ipAddress,omitempty"` + // PrefixLength - READ-ONLY; The IPv6 prefix of the network adapter. + PrefixLength *int32 `json:"prefixLength,omitempty"` + // Gateway - READ-ONLY; The IPv6 gateway of the network adapter. + Gateway *string `json:"gateway,omitempty"` +} + +// Job a device job. +type Job struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the object. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` + // Status - READ-ONLY; The current status of the job. Possible values include: 'JobStatusInvalid', 'JobStatusRunning', 'JobStatusSucceeded', 'JobStatusFailed', 'JobStatusCanceled', 'JobStatusPaused', 'JobStatusScheduled' + Status JobStatus `json:"status,omitempty"` + // StartTime - READ-ONLY; The UTC date and time at which the job started. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The UTC date and time at which the job completed. + EndTime *date.Time `json:"endTime,omitempty"` + // PercentComplete - READ-ONLY; The percentage of the job that is complete. + PercentComplete *int32 `json:"percentComplete,omitempty"` + // Error - READ-ONLY; The error details. + Error *JobErrorDetails `json:"error,omitempty"` + // JobProperties - READ-ONLY; The properties of the job. + *JobProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Job struct. +func (j *Job) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + j.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + j.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + j.Type = &typeVar + } + case "status": + if v != nil { + var status JobStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + j.Status = status + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + j.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + j.EndTime = &endTime + } + case "percentComplete": + if v != nil { + var percentComplete int32 + err = json.Unmarshal(*v, &percentComplete) + if err != nil { + return err + } + j.PercentComplete = &percentComplete + } + case "error": + if v != nil { + var errorVar JobErrorDetails + err = json.Unmarshal(*v, &errorVar) + if err != nil { + return err + } + j.Error = &errorVar + } + case "properties": + if v != nil { + var jobProperties JobProperties + err = json.Unmarshal(*v, &jobProperties) + if err != nil { + return err + } + j.JobProperties = &jobProperties + } + } + } + + return nil +} + +// JobErrorDetails the job error information containing the list of job errors. +type JobErrorDetails struct { + // ErrorDetails - READ-ONLY; The error details. + ErrorDetails *[]JobErrorItem `json:"errorDetails,omitempty"` + // Code - READ-ONLY; The code intended for programmatic access. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The message that describes the error in detail. + Message *string `json:"message,omitempty"` +} + +// JobErrorItem the job error items. +type JobErrorItem struct { + // Recommendations - READ-ONLY; The recommended actions. + Recommendations *[]string `json:"recommendations,omitempty"` + // Code - READ-ONLY; The code intended for programmatic access. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The message that describes the error in detail. + Message *string `json:"message,omitempty"` +} + +// JobProperties the properties for the job. +type JobProperties struct { + // JobType - READ-ONLY; The type of the job. Possible values include: 'JobTypeInvalid', 'JobTypeScanForUpdates', 'JobTypeDownloadUpdates', 'JobTypeInstallUpdates', 'JobTypeRefreshShare' + JobType JobType `json:"jobType,omitempty"` + // CurrentStage - READ-ONLY; Current stage of the update operation. Possible values include: 'UpdateOperationStageUnknown', 'UpdateOperationStageInitial', 'UpdateOperationStageScanStarted', 'UpdateOperationStageScanComplete', 'UpdateOperationStageScanFailed', 'UpdateOperationStageDownloadStarted', 'UpdateOperationStageDownloadComplete', 'UpdateOperationStageDownloadFailed', 'UpdateOperationStageInstallStarted', 'UpdateOperationStageInstallComplete', 'UpdateOperationStageInstallFailed', 'UpdateOperationStageRebootInitiated', 'UpdateOperationStageSuccess', 'UpdateOperationStageFailure', 'UpdateOperationStageRescanStarted', 'UpdateOperationStageRescanComplete', 'UpdateOperationStageRescanFailed' + CurrentStage UpdateOperationStage `json:"currentStage,omitempty"` + // DownloadProgress - READ-ONLY; The download progress. + DownloadProgress *UpdateDownloadProgress `json:"downloadProgress,omitempty"` + // InstallProgress - READ-ONLY; The install progress. + InstallProgress *UpdateInstallProgress `json:"installProgress,omitempty"` + // TotalRefreshErrors - READ-ONLY; Total number of errors encountered during the refresh process. + TotalRefreshErrors *int32 `json:"totalRefreshErrors,omitempty"` + // ErrorManifestFile - READ-ONLY; Local share/remote container relative path to the error manifest file of the refresh. + ErrorManifestFile *string `json:"errorManifestFile,omitempty"` + // ShareID - READ-ONLY; ARM ID of the share that was refreshed. + ShareID *string `json:"shareId,omitempty"` + // Folder - If only subfolders need to be refreshed, then the subfolder path inside the share. (The path is empty if there are no subfolders.) + Folder *string `json:"folder,omitempty"` +} + +// MetricDimensionV1 metric Dimension v1. +type MetricDimensionV1 struct { + // Name - Name of the metrics dimension. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of the metrics dimension. + DisplayName *string `json:"displayName,omitempty"` + // ToBeExportedForShoebox - To be exported to shoe box. + ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` +} + +// MetricSpecificationV1 metric specification version 1. +type MetricSpecificationV1 struct { + // Name - Name of the metric. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of the metric. + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - Description of the metric to be displayed. + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - Metric units. Possible values include: 'NotSpecified', 'Percent', 'Count', 'Seconds', 'Milliseconds', 'Bytes', 'BytesPerSecond', 'CountPerSecond' + Unit MetricUnit `json:"unit,omitempty"` + // AggregationType - Metric aggregation type. Possible values include: 'MetricAggregationTypeNotSpecified', 'MetricAggregationTypeNone', 'MetricAggregationTypeAverage', 'MetricAggregationTypeMinimum', 'MetricAggregationTypeMaximum', 'MetricAggregationTypeTotal', 'MetricAggregationTypeCount' + AggregationType MetricAggregationType `json:"aggregationType,omitempty"` + // Dimensions - Metric dimensions, other than default dimension which is resource. + Dimensions *[]MetricDimensionV1 `json:"dimensions,omitempty"` + // FillGapWithZero - Set true to fill the gaps with zero. + FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + // Category - Metric category. Possible values include: 'Capacity', 'Transaction' + Category MetricCategory `json:"category,omitempty"` + // ResourceIDDimensionNameOverride - Resource name override. + ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` + // SupportedTimeGrainTypes - Support granularity of metrics. + SupportedTimeGrainTypes *[]TimeGrain `json:"supportedTimeGrainTypes,omitempty"` + // SupportedAggregationTypes - Support metric aggregation type. + SupportedAggregationTypes *[]MetricAggregationType `json:"supportedAggregationTypes,omitempty"` +} + +// MountPointMap the share mount point. +type MountPointMap struct { + // ShareID - ID of the share mounted to the role VM. + ShareID *string `json:"shareId,omitempty"` + // RoleID - READ-ONLY; ID of the role to which share is mounted. + RoleID *string `json:"roleId,omitempty"` + // MountPoint - READ-ONLY; Mount point for the share. + MountPoint *string `json:"mountPoint,omitempty"` + // RoleType - READ-ONLY; Role type. Possible values include: 'IOT', 'ASA', 'Functions', 'Cognitive' + RoleType RoleTypes `json:"roleType,omitempty"` +} + +// NetworkAdapter represents the networkAdapter on a device. +type NetworkAdapter struct { + // AdapterID - READ-ONLY; Instance ID of network adapter. + AdapterID *string `json:"adapterId,omitempty"` + // AdapterPosition - READ-ONLY; Hardware position of network adapter. + AdapterPosition *NetworkAdapterPosition `json:"adapterPosition,omitempty"` + // Index - READ-ONLY; Logical index of the adapter. + Index *int32 `json:"index,omitempty"` + // NodeID - READ-ONLY; Node ID of the network adapter. + NodeID *string `json:"nodeId,omitempty"` + // NetworkAdapterName - READ-ONLY; Network adapter name. + NetworkAdapterName *string `json:"networkAdapterName,omitempty"` + // Label - READ-ONLY; Hardware label for the adapter. + Label *string `json:"label,omitempty"` + // MacAddress - READ-ONLY; MAC address. + MacAddress *string `json:"macAddress,omitempty"` + // LinkSpeed - READ-ONLY; Link speed. + LinkSpeed *int64 `json:"linkSpeed,omitempty"` + // Status - READ-ONLY; Value indicating whether this adapter is valid. Possible values include: 'Inactive', 'Active' + Status NetworkAdapterStatus `json:"status,omitempty"` + // RdmaStatus - Value indicating whether this adapter is RDMA capable. Possible values include: 'Incapable', 'Capable' + RdmaStatus NetworkAdapterRDMAStatus `json:"rdmaStatus,omitempty"` + // DhcpStatus - Value indicating whether this adapter has DHCP enabled. Possible values include: 'NetworkAdapterDHCPStatusDisabled', 'NetworkAdapterDHCPStatusEnabled' + DhcpStatus NetworkAdapterDHCPStatus `json:"dhcpStatus,omitempty"` + // Ipv4Configuration - READ-ONLY; The IPv4 configuration of the network adapter. + Ipv4Configuration *Ipv4Config `json:"ipv4Configuration,omitempty"` + // Ipv6Configuration - READ-ONLY; The IPv6 configuration of the network adapter. + Ipv6Configuration *Ipv6Config `json:"ipv6Configuration,omitempty"` + // Ipv6LinkLocalAddress - READ-ONLY; The IPv6 local address. + Ipv6LinkLocalAddress *string `json:"ipv6LinkLocalAddress,omitempty"` + // DNSServers - READ-ONLY; The list of DNS Servers of the device. + DNSServers *[]string `json:"dnsServers,omitempty"` +} + +// NetworkAdapterPosition the network adapter position. +type NetworkAdapterPosition struct { + // NetworkGroup - READ-ONLY; The network group. Possible values include: 'NetworkGroupNone', 'NetworkGroupNonRDMA', 'NetworkGroupRDMA' + NetworkGroup NetworkGroup `json:"networkGroup,omitempty"` + // Port - READ-ONLY; The port. + Port *int32 `json:"port,omitempty"` +} + +// NetworkSettings the network settings of a device. +type NetworkSettings struct { + autorest.Response `json:"-"` + // NetworkSettingsProperties - READ-ONLY; The properties of network settings of a device. + *NetworkSettingsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkSettings. +func (ns NetworkSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for NetworkSettings struct. +func (ns *NetworkSettings) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var networkSettingsProperties NetworkSettingsProperties + err = json.Unmarshal(*v, &networkSettingsProperties) + if err != nil { + return err + } + ns.NetworkSettingsProperties = &networkSettingsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ns.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ns.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ns.Type = &typeVar + } + } + } + + return nil +} + +// NetworkSettingsProperties the properties of network settings. +type NetworkSettingsProperties struct { + // NetworkAdapters - READ-ONLY; The network adapter list on the device. + NetworkAdapters *[]NetworkAdapter `json:"networkAdapters,omitempty"` +} + +// Node represents a single node in a Data box Edge/Gateway device +// Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 node +// Multi-node Edge devices will have more than 1 nodes +type Node struct { + // NodeProperties - READ-ONLY; The properties of the node + *NodeProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Node. +func (n Node) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Node struct. +func (n *Node) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var nodeProperties NodeProperties + err = json.Unmarshal(*v, &nodeProperties) + if err != nil { + return err + } + n.NodeProperties = &nodeProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + n.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + n.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + n.Type = &typeVar + } + } + } + + return nil +} + +// NodeList collection of Nodes. +type NodeList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of Nodes. + Value *[]Node `json:"value,omitempty"` +} + +// NodeProperties this class represents the nodes in a highly available cluster +type NodeProperties struct { + // NodeStatus - READ-ONLY; The current status of the individual node. Possible values include: 'NodeStatusUnknown', 'NodeStatusUp', 'NodeStatusDown', 'NodeStatusRebooting', 'NodeStatusShuttingDown' + NodeStatus NodeStatus `json:"nodeStatus,omitempty"` + // NodeChassisSerialNumber - READ-ONLY; Serial number of the Chassis + NodeChassisSerialNumber *string `json:"nodeChassisSerialNumber,omitempty"` + // NodeSerialNumber - READ-ONLY; Serial number of the individual node + NodeSerialNumber *string `json:"nodeSerialNumber,omitempty"` + // NodeDisplayName - READ-ONLY; Display Name of the individual node + NodeDisplayName *string `json:"nodeDisplayName,omitempty"` + // NodeFriendlySoftwareVersion - READ-ONLY; Friendly software version name that is currently installed on the node + NodeFriendlySoftwareVersion *string `json:"nodeFriendlySoftwareVersion,omitempty"` + // NodeHcsVersion - READ-ONLY; HCS version that is currently installed on the node + NodeHcsVersion *string `json:"nodeHcsVersion,omitempty"` + // NodeInstanceID - READ-ONLY; Guid instance id of the node + NodeInstanceID *string `json:"nodeInstanceId,omitempty"` +} + +// Operation operations. +type Operation struct { + // Name - Name of the operation. + Name *string `json:"name,omitempty"` + // Display - Properties displayed for the operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - Origin of the operation. + Origin *string `json:"origin,omitempty"` + // OperationProperties - Operation properties. + *OperationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Name != nil { + objectMap["name"] = o.Name + } + if o.Display != nil { + objectMap["display"] = o.Display + } + if o.Origin != nil { + objectMap["origin"] = o.Origin + } + if o.OperationProperties != nil { + objectMap["properties"] = o.OperationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Operation struct. +func (o *Operation) UnmarshalJSON(body []byte) error { + 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 + } + o.Name = &name + } + case "display": + if v != nil { + var display OperationDisplay + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + o.Display = &display + } + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + o.Origin = &origin + } + case "properties": + if v != nil { + var operationProperties OperationProperties + err = json.Unmarshal(*v, &operationProperties) + if err != nil { + return err + } + o.OperationProperties = &operationProperties + } + } + } + + return nil +} + +// OperationDisplay operation display properties. +type OperationDisplay struct { + // Provider - Provider name. + Provider *string `json:"provider,omitempty"` + // Resource - The type of resource in which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - Operation to be performed on the resource. + Operation *string `json:"operation,omitempty"` + // Description - Description of the operation to be performed. + Description *string `json:"description,omitempty"` +} + +// OperationProperties operation properties. +type OperationProperties struct { + // ServiceSpecification - Service specification. + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// OperationsList the list of operations used for the discovery of available provider operations. +type OperationsList struct { + autorest.Response `json:"-"` + // Value - The value. + Value *[]Operation `json:"value,omitempty"` + // NextLink - Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationsListIterator provides access to a complete listing of Operation values. +type OperationsListIterator struct { + i int + page OperationsListPage +} + +// 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 *OperationsListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListIterator.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 *OperationsListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationsListIterator) 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 OperationsListIterator) Response() OperationsList { + 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 OperationsListIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationsListIterator type. +func NewOperationsListIterator(page OperationsListPage) OperationsListIterator { + return OperationsListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ol OperationsList) IsEmpty() bool { + return ol.Value == nil || len(*ol.Value) == 0 +} + +// operationsListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ol OperationsList) operationsListPreparer(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))) +} + +// OperationsListPage contains a page of Operation values. +type OperationsListPage struct { + fn func(context.Context, OperationsList) (OperationsList, error) + ol OperationsList +} + +// 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 *OperationsListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListPage.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 *OperationsListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationsListPage) NotDone() bool { + return !page.ol.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationsListPage) Response() OperationsList { + return page.ol +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationsListPage) Values() []Operation { + if page.ol.IsEmpty() { + return nil + } + return *page.ol.Value +} + +// Creates a new instance of the OperationsListPage type. +func NewOperationsListPage(getNextPage func(context.Context, OperationsList) (OperationsList, error)) OperationsListPage { + return OperationsListPage{fn: getNextPage} +} + +// Order the order details. +type Order struct { + autorest.Response `json:"-"` + // OrderProperties - The order properties. + *OrderProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Order. +func (o Order) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.OrderProperties != nil { + objectMap["properties"] = o.OrderProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Order struct. +func (o *Order) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var orderProperties OrderProperties + err = json.Unmarshal(*v, &orderProperties) + if err != nil { + return err + } + o.OrderProperties = &orderProperties + } + 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 +} + +// OrderList list of order entities. +type OrderList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of orders. + Value *[]Order `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// OrderListIterator provides access to a complete listing of Order values. +type OrderListIterator struct { + i int + page OrderListPage +} + +// 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 *OrderListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OrderListIterator.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 *OrderListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OrderListIterator) 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 OrderListIterator) Response() OrderList { + 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 OrderListIterator) Value() Order { + if !iter.page.NotDone() { + return Order{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OrderListIterator type. +func NewOrderListIterator(page OrderListPage) OrderListIterator { + return OrderListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ol OrderList) IsEmpty() bool { + return ol.Value == nil || len(*ol.Value) == 0 +} + +// orderListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ol OrderList) orderListPreparer(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))) +} + +// OrderListPage contains a page of Order values. +type OrderListPage struct { + fn func(context.Context, OrderList) (OrderList, error) + ol OrderList +} + +// 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 *OrderListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OrderListPage.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 *OrderListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OrderListPage) NotDone() bool { + return !page.ol.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OrderListPage) Response() OrderList { + return page.ol +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OrderListPage) Values() []Order { + if page.ol.IsEmpty() { + return nil + } + return *page.ol.Value +} + +// Creates a new instance of the OrderListPage type. +func NewOrderListPage(getNextPage func(context.Context, OrderList) (OrderList, error)) OrderListPage { + return OrderListPage{fn: getNextPage} +} + +// OrderProperties order properties. +type OrderProperties struct { + // ContactInformation - The contact details. + ContactInformation *ContactDetails `json:"contactInformation,omitempty"` + // ShippingAddress - The shipping address. + ShippingAddress *Address `json:"shippingAddress,omitempty"` + // CurrentStatus - Current status of the order. + CurrentStatus *OrderStatus `json:"currentStatus,omitempty"` + // OrderHistory - READ-ONLY; List of status changes in the order. + OrderHistory *[]OrderStatus `json:"orderHistory,omitempty"` + // SerialNumber - READ-ONLY; Serial number of the device. + SerialNumber *string `json:"serialNumber,omitempty"` + // DeliveryTrackingInfo - READ-ONLY; Tracking information for the package delivered to the customer whether it has an original or a replacement device. + DeliveryTrackingInfo *[]TrackingInfo `json:"deliveryTrackingInfo,omitempty"` + // ReturnTrackingInfo - READ-ONLY; Tracking information for the package returned from the customer whether it has an original or a replacement device. + ReturnTrackingInfo *[]TrackingInfo `json:"returnTrackingInfo,omitempty"` +} + +// OrdersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type OrdersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OrdersCreateOrUpdateFuture) Result(client OrdersClient) (o Order, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.OrdersCreateOrUpdateFuture") + 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.CreateOrUpdateResponder(o.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersCreateOrUpdateFuture", "Result", o.Response.Response, "Failure responding to request") + } + } + return +} + +// OrdersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type OrdersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OrdersDeleteFuture) Result(client OrdersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.OrdersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// OrderStatus represents a single status change. +type OrderStatus struct { + // Status - Status of the order as per the allowed status types. Possible values include: 'Untracked', 'AwaitingFulfilment', 'AwaitingPreparation', 'AwaitingShipment', 'Shipped', 'Arriving', 'Delivered', 'ReplacementRequested', 'LostDevice', 'Declined', 'ReturnInitiated', 'AwaitingReturnShipment', 'ShippedBack', 'CollectedAtMicrosoft' + Status OrderState `json:"status,omitempty"` + // UpdateDateTime - READ-ONLY; Time of status update. + UpdateDateTime *date.Time `json:"updateDateTime,omitempty"` + // Comments - Comments related to this status change. + Comments *string `json:"comments,omitempty"` +} + +// PeriodicTimerEventTrigger trigger details. +type PeriodicTimerEventTrigger struct { + // PeriodicTimerProperties - Periodic timer trigger properties. + *PeriodicTimerProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindTrigger', 'KindFileEvent', 'KindPeriodicTimerEvent' + Kind KindBasicTrigger `json:"kind,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PeriodicTimerEventTrigger. +func (ptet PeriodicTimerEventTrigger) MarshalJSON() ([]byte, error) { + ptet.Kind = KindPeriodicTimerEvent + objectMap := make(map[string]interface{}) + if ptet.PeriodicTimerProperties != nil { + objectMap["properties"] = ptet.PeriodicTimerProperties + } + if ptet.Kind != "" { + objectMap["kind"] = ptet.Kind + } + return json.Marshal(objectMap) +} + +// AsFileEventTrigger is the BasicTrigger implementation for PeriodicTimerEventTrigger. +func (ptet PeriodicTimerEventTrigger) AsFileEventTrigger() (*FileEventTrigger, bool) { + return nil, false +} + +// AsPeriodicTimerEventTrigger is the BasicTrigger implementation for PeriodicTimerEventTrigger. +func (ptet PeriodicTimerEventTrigger) AsPeriodicTimerEventTrigger() (*PeriodicTimerEventTrigger, bool) { + return &ptet, true +} + +// AsTrigger is the BasicTrigger implementation for PeriodicTimerEventTrigger. +func (ptet PeriodicTimerEventTrigger) AsTrigger() (*Trigger, bool) { + return nil, false +} + +// AsBasicTrigger is the BasicTrigger implementation for PeriodicTimerEventTrigger. +func (ptet PeriodicTimerEventTrigger) AsBasicTrigger() (BasicTrigger, bool) { + return &ptet, true +} + +// UnmarshalJSON is the custom unmarshaler for PeriodicTimerEventTrigger struct. +func (ptet *PeriodicTimerEventTrigger) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var periodicTimerProperties PeriodicTimerProperties + err = json.Unmarshal(*v, &periodicTimerProperties) + if err != nil { + return err + } + ptet.PeriodicTimerProperties = &periodicTimerProperties + } + case "kind": + if v != nil { + var kind KindBasicTrigger + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ptet.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ptet.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ptet.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ptet.Type = &typeVar + } + } + } + + return nil +} + +// PeriodicTimerProperties periodic timer trigger properties. +type PeriodicTimerProperties struct { + // SourceInfo - Periodic timer details. + SourceInfo *PeriodicTimerSourceInfo `json:"sourceInfo,omitempty"` + // SinkInfo - Role Sink information. + SinkInfo *RoleSinkInfo `json:"sinkInfo,omitempty"` + // CustomContextTag - A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + CustomContextTag *string `json:"customContextTag,omitempty"` +} + +// PeriodicTimerSourceInfo periodic timer event source. +type PeriodicTimerSourceInfo struct { + // StartTime - The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC time. + StartTime *date.Time `json:"startTime,omitempty"` + // Schedule - Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. + Schedule *string `json:"schedule,omitempty"` + // Topic - Topic where periodic events are published to IoT device. + Topic *string `json:"topic,omitempty"` +} + +// RawCertificateData raw Certificate Data. +type RawCertificateData struct { + // AuthenticationType - The authentication type. Possible values include: 'Invalid', 'AzureActiveDirectory' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` + // Certificate - The base64 encoded certificate raw data. + Certificate *string `json:"certificate,omitempty"` +} + +// RefreshDetails fields for tracking refresh job on the share. +type RefreshDetails struct { + // InProgressRefreshJobID - If a refresh share job is currently in progress on this share, this field indicates the ARM resource ID of that job. The field is empty if no job is in progress. + InProgressRefreshJobID *string `json:"inProgressRefreshJobId,omitempty"` + // LastCompletedRefreshJobTimeInUTC - Indicates the completed time for the last refresh job on this particular share, if any.This could be a failed job or a successful job. + LastCompletedRefreshJobTimeInUTC *date.Time `json:"lastCompletedRefreshJobTimeInUTC,omitempty"` + // ErrorManifestFile - Indicates the relative path of the error xml for the last refresh job on this particular share, if any. This could be a failed job or a successful job. + ErrorManifestFile *string `json:"errorManifestFile,omitempty"` + // LastJob - Indicates the id of the last refresh job on this particular share,if any. This could be a failed job or a successful job. + LastJob *string `json:"lastJob,omitempty"` +} + +// BasicRole compute role. +type BasicRole interface { + AsIoTRole() (*IoTRole, bool) + AsRole() (*Role, bool) +} + +// Role compute role. +type Role struct { + autorest.Response `json:"-"` + // Kind - Possible values include: 'KindRole', 'KindIOT' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +func unmarshalBasicRole(body []byte) (BasicRole, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindIOT): + var itr IoTRole + err := json.Unmarshal(body, &itr) + return itr, err + default: + var r Role + err := json.Unmarshal(body, &r) + return r, err + } +} +func unmarshalBasicRoleArray(body []byte) ([]BasicRole, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rArray := make([]BasicRole, len(rawMessages)) + + for index, rawMessage := range rawMessages { + r, err := unmarshalBasicRole(*rawMessage) + if err != nil { + return nil, err + } + rArray[index] = r + } + return rArray, nil +} + +// MarshalJSON is the custom marshaler for Role. +func (r Role) MarshalJSON() ([]byte, error) { + r.Kind = KindRole + objectMap := make(map[string]interface{}) + if r.Kind != "" { + objectMap["kind"] = r.Kind + } + return json.Marshal(objectMap) +} + +// AsIoTRole is the BasicRole implementation for Role. +func (r Role) AsIoTRole() (*IoTRole, bool) { + return nil, false +} + +// AsRole is the BasicRole implementation for Role. +func (r Role) AsRole() (*Role, bool) { + return &r, true +} + +// AsBasicRole is the BasicRole implementation for Role. +func (r Role) AsBasicRole() (BasicRole, bool) { + return &r, true +} + +// RoleList collection of all the roles on the Data Box Edge device. +type RoleList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The Value. + Value *[]BasicRole `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RoleList struct. +func (rl *RoleList) UnmarshalJSON(body []byte) error { + 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 := unmarshalBasicRoleArray(*v) + if err != nil { + return err + } + rl.Value = &value + } + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + rl.NextLink = &nextLink + } + } + } + + return nil +} + +// RoleListIterator provides access to a complete listing of Role values. +type RoleListIterator struct { + i int + page RoleListPage +} + +// 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 *RoleListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleListIterator.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 *RoleListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RoleListIterator) 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 RoleListIterator) Response() RoleList { + 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 RoleListIterator) Value() BasicRole { + if !iter.page.NotDone() { + return Role{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RoleListIterator type. +func NewRoleListIterator(page RoleListPage) RoleListIterator { + return RoleListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rl RoleList) IsEmpty() bool { + return rl.Value == nil || len(*rl.Value) == 0 +} + +// roleListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rl RoleList) roleListPreparer(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))) +} + +// RoleListPage contains a page of BasicRole values. +type RoleListPage struct { + fn func(context.Context, RoleList) (RoleList, error) + rl RoleList +} + +// 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 *RoleListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleListPage.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 *RoleListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RoleListPage) NotDone() bool { + return !page.rl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RoleListPage) Response() RoleList { + return page.rl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RoleListPage) Values() []BasicRole { + if page.rl.IsEmpty() { + return nil + } + return *page.rl.Value +} + +// Creates a new instance of the RoleListPage type. +func NewRoleListPage(getNextPage func(context.Context, RoleList) (RoleList, error)) RoleListPage { + return RoleListPage{fn: getNextPage} +} + +// RoleModel ... +type RoleModel struct { + autorest.Response `json:"-"` + Value BasicRole `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RoleModel struct. +func (rm *RoleModel) UnmarshalJSON(body []byte) error { + r, err := unmarshalBasicRole(body) + if err != nil { + return err + } + rm.Value = r + + return nil +} + +// RolesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RolesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RolesCreateOrUpdateFuture) Result(client RolesClient) (rm RoleModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.RolesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rm.Response.Response, err = future.GetResult(sender); err == nil && rm.Response.Response.StatusCode != http.StatusNoContent { + rm, err = client.CreateOrUpdateResponder(rm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesCreateOrUpdateFuture", "Result", rm.Response.Response, "Failure responding to request") + } + } + return +} + +// RolesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type RolesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RolesDeleteFuture) Result(client RolesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.RolesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// RoleSinkInfo compute role against which events will be raised. +type RoleSinkInfo struct { + // RoleID - Compute role ID. + RoleID *string `json:"roleId,omitempty"` +} + +// SecuritySettings the security settings of a device. +type SecuritySettings struct { + // SecuritySettingsProperties - Properties of the security settings. + *SecuritySettingsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecuritySettings. +func (ss SecuritySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.SecuritySettingsProperties != nil { + objectMap["properties"] = ss.SecuritySettingsProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecuritySettings struct. +func (ss *SecuritySettings) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var securitySettingsProperties SecuritySettingsProperties + err = json.Unmarshal(*v, &securitySettingsProperties) + if err != nil { + return err + } + ss.SecuritySettingsProperties = &securitySettingsProperties + } + 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 +} + +// SecuritySettingsProperties the properties of security settings. +type SecuritySettingsProperties struct { + // DeviceAdminPassword - Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual password should have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. + DeviceAdminPassword *AsymmetricEncryptedSecret `json:"deviceAdminPassword,omitempty"` +} + +// ServiceSpecification service specification. +type ServiceSpecification struct { + // MetricSpecifications - Metric specification as defined by shoebox. + MetricSpecifications *[]MetricSpecificationV1 `json:"metricSpecifications,omitempty"` +} + +// Share represents a share on the Data Box Edge/Gateway device. +type Share struct { + autorest.Response `json:"-"` + // ShareProperties - The share properties. + *ShareProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Share. +func (s Share) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.ShareProperties != nil { + objectMap["properties"] = s.ShareProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Share struct. +func (s *Share) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var shareProperties ShareProperties + err = json.Unmarshal(*v, &shareProperties) + if err != nil { + return err + } + s.ShareProperties = &shareProperties + } + 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 +} + +// ShareAccessRight specifies the mapping between this particular user and the type of access he has on +// shares on this device. +type ShareAccessRight struct { + // ShareID - The share ID. + ShareID *string `json:"shareId,omitempty"` + // AccessType - Type of access to be allowed on the share for this user. Possible values include: 'Change', 'Read', 'Custom' + AccessType ShareAccessType `json:"accessType,omitempty"` +} + +// ShareList collection of all the shares on the Data Box Edge/Gateway device. +type ShareList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of shares. + Value *[]Share `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ShareListIterator provides access to a complete listing of Share values. +type ShareListIterator struct { + i int + page ShareListPage +} + +// 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 *ShareListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareListIterator.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 *ShareListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ShareListIterator) 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 ShareListIterator) Response() ShareList { + 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 ShareListIterator) Value() Share { + if !iter.page.NotDone() { + return Share{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ShareListIterator type. +func NewShareListIterator(page ShareListPage) ShareListIterator { + return ShareListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sl ShareList) IsEmpty() bool { + return sl.Value == nil || len(*sl.Value) == 0 +} + +// shareListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sl ShareList) shareListPreparer(ctx context.Context) (*http.Request, error) { + if sl.NextLink == nil || len(to.String(sl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sl.NextLink))) +} + +// ShareListPage contains a page of Share values. +type ShareListPage struct { + fn func(context.Context, ShareList) (ShareList, error) + sl ShareList +} + +// 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 *ShareListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareListPage.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.sl) + if err != nil { + return err + } + page.sl = 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 *ShareListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ShareListPage) NotDone() bool { + return !page.sl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ShareListPage) Response() ShareList { + return page.sl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ShareListPage) Values() []Share { + if page.sl.IsEmpty() { + return nil + } + return *page.sl.Value +} + +// Creates a new instance of the ShareListPage type. +func NewShareListPage(getNextPage func(context.Context, ShareList) (ShareList, error)) ShareListPage { + return ShareListPage{fn: getNextPage} +} + +// ShareProperties the share properties. +type ShareProperties struct { + // Description - Description for the share. + Description *string `json:"description,omitempty"` + // ShareStatus - Current status of the share. Possible values include: 'ShareStatusOffline', 'ShareStatusUnknown', 'ShareStatusOK', 'ShareStatusUpdating', 'ShareStatusNeedsAttention' + ShareStatus ShareStatus `json:"shareStatus,omitempty"` + // MonitoringStatus - Current monitoring status of the share. Possible values include: 'Enabled', 'Disabled' + MonitoringStatus MonitoringStatus `json:"monitoringStatus,omitempty"` + // AzureContainerInfo - Azure container mapping for the share. + AzureContainerInfo *AzureContainerInfo `json:"azureContainerInfo,omitempty"` + // AccessProtocol - Access protocol to be used by the share. Possible values include: 'SMB', 'NFS' + AccessProtocol ShareAccessProtocol `json:"accessProtocol,omitempty"` + // UserAccessRights - Mapping of users and corresponding access rights on the share (required for SMB protocol). + UserAccessRights *[]UserAccessRight `json:"userAccessRights,omitempty"` + // ClientAccessRights - List of IP addresses and corresponding access rights on the share(required for NFS protocol). + ClientAccessRights *[]ClientAccessRight `json:"clientAccessRights,omitempty"` + // RefreshDetails - Details of the refresh job on this share. + RefreshDetails *RefreshDetails `json:"refreshDetails,omitempty"` + // ShareMappings - READ-ONLY; Share mount point to the role. + ShareMappings *[]MountPointMap `json:"shareMappings,omitempty"` + // DataPolicy - Data policy of the share. Possible values include: 'Cloud', 'Local' + DataPolicy DataPolicy `json:"dataPolicy,omitempty"` +} + +// SharesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SharesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SharesCreateOrUpdateFuture) Result(client SharesClient) (s Share, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.SharesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.CreateOrUpdateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// SharesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type SharesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SharesDeleteFuture) Result(client SharesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.SharesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// SharesRefreshFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SharesRefreshFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SharesRefreshFuture) Result(client SharesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesRefreshFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.SharesRefreshFuture") + return + } + ar.Response = future.Response() + return +} + +// Sku the SKU type. +type Sku struct { + // Name - SKU name. Possible values include: 'Gateway', 'Edge' + Name SkuName `json:"name,omitempty"` + // Tier - The SKU tier. This is based on the SKU name. Possible values include: 'Standard' + Tier SkuTier `json:"tier,omitempty"` +} + +// StorageAccountCredential the storage account credential. +type StorageAccountCredential struct { + autorest.Response `json:"-"` + // StorageAccountCredentialProperties - The storage account credential properties. + *StorageAccountCredentialProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageAccountCredential. +func (sac StorageAccountCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sac.StorageAccountCredentialProperties != nil { + objectMap["properties"] = sac.StorageAccountCredentialProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StorageAccountCredential struct. +func (sac *StorageAccountCredential) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var storageAccountCredentialProperties StorageAccountCredentialProperties + err = json.Unmarshal(*v, &storageAccountCredentialProperties) + if err != nil { + return err + } + sac.StorageAccountCredentialProperties = &storageAccountCredentialProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sac.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sac.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sac.Type = &typeVar + } + } + } + + return nil +} + +// StorageAccountCredentialList the collection of storage account credentials. +type StorageAccountCredentialList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The value. + Value *[]StorageAccountCredential `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageAccountCredentialListIterator provides access to a complete listing of StorageAccountCredential +// values. +type StorageAccountCredentialListIterator struct { + i int + page StorageAccountCredentialListPage +} + +// 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 *StorageAccountCredentialListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialListIterator.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 *StorageAccountCredentialListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageAccountCredentialListIterator) 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 StorageAccountCredentialListIterator) Response() StorageAccountCredentialList { + 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 StorageAccountCredentialListIterator) Value() StorageAccountCredential { + if !iter.page.NotDone() { + return StorageAccountCredential{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageAccountCredentialListIterator type. +func NewStorageAccountCredentialListIterator(page StorageAccountCredentialListPage) StorageAccountCredentialListIterator { + return StorageAccountCredentialListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sacl StorageAccountCredentialList) IsEmpty() bool { + return sacl.Value == nil || len(*sacl.Value) == 0 +} + +// storageAccountCredentialListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sacl StorageAccountCredentialList) storageAccountCredentialListPreparer(ctx context.Context) (*http.Request, error) { + if sacl.NextLink == nil || len(to.String(sacl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sacl.NextLink))) +} + +// StorageAccountCredentialListPage contains a page of StorageAccountCredential values. +type StorageAccountCredentialListPage struct { + fn func(context.Context, StorageAccountCredentialList) (StorageAccountCredentialList, error) + sacl StorageAccountCredentialList +} + +// 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 *StorageAccountCredentialListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialListPage.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.sacl) + if err != nil { + return err + } + page.sacl = 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 *StorageAccountCredentialListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageAccountCredentialListPage) NotDone() bool { + return !page.sacl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageAccountCredentialListPage) Response() StorageAccountCredentialList { + return page.sacl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageAccountCredentialListPage) Values() []StorageAccountCredential { + if page.sacl.IsEmpty() { + return nil + } + return *page.sacl.Value +} + +// Creates a new instance of the StorageAccountCredentialListPage type. +func NewStorageAccountCredentialListPage(getNextPage func(context.Context, StorageAccountCredentialList) (StorageAccountCredentialList, error)) StorageAccountCredentialListPage { + return StorageAccountCredentialListPage{fn: getNextPage} +} + +// StorageAccountCredentialProperties the storage account credential properties. +type StorageAccountCredentialProperties struct { + // Alias - Alias for the storage account. + Alias *string `json:"alias,omitempty"` + // UserName - Username for the storage account. + UserName *string `json:"userName,omitempty"` + // AccountKey - Encrypted storage key. + AccountKey *AsymmetricEncryptedSecret `json:"accountKey,omitempty"` + // ConnectionString - Connection string for the storage account. Use this string if username and account key are not specified. + ConnectionString *string `json:"connectionString,omitempty"` + // SslStatus - Signifies whether SSL needs to be enabled or not. Possible values include: 'SSLStatusEnabled', 'SSLStatusDisabled' + SslStatus SSLStatus `json:"sslStatus,omitempty"` + // BlobDomainName - Blob end point for private clouds. + BlobDomainName *string `json:"blobDomainName,omitempty"` + // AccountType - Type of storage accessed on the storage account. Possible values include: 'GeneralPurposeStorage', 'BlobStorage' + AccountType AccountType `json:"accountType,omitempty"` + // StorageAccountID - Id of the storage account. + StorageAccountID *string `json:"storageAccountId,omitempty"` +} + +// StorageAccountCredentialsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type StorageAccountCredentialsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *StorageAccountCredentialsCreateOrUpdateFuture) Result(client StorageAccountCredentialsClient) (sac StorageAccountCredential, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.StorageAccountCredentialsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sac.Response.Response, err = future.GetResult(sender); err == nil && sac.Response.Response.StatusCode != http.StatusNoContent { + sac, err = client.CreateOrUpdateResponder(sac.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsCreateOrUpdateFuture", "Result", sac.Response.Response, "Failure responding to request") + } + } + return +} + +// StorageAccountCredentialsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type StorageAccountCredentialsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *StorageAccountCredentialsDeleteFuture) Result(client StorageAccountCredentialsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.StorageAccountCredentialsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// SymmetricKey symmetric key for authentication. +type SymmetricKey struct { + // ConnectionString - Connection string based on the symmetric key. + ConnectionString *AsymmetricEncryptedSecret `json:"connectionString,omitempty"` +} + +// TrackingInfo tracking courier information. +type TrackingInfo struct { + // SerialNumber - Serial number of the device being tracked. + SerialNumber *string `json:"serialNumber,omitempty"` + // CarrierName - Name of the carrier used in the delivery. + CarrierName *string `json:"carrierName,omitempty"` + // TrackingID - Tracking ID of the shipment. + TrackingID *string `json:"trackingId,omitempty"` + // TrackingURL - Tracking URL of the shipment. + TrackingURL *string `json:"trackingUrl,omitempty"` +} + +// BasicTrigger trigger details. +type BasicTrigger interface { + AsFileEventTrigger() (*FileEventTrigger, bool) + AsPeriodicTimerEventTrigger() (*PeriodicTimerEventTrigger, bool) + AsTrigger() (*Trigger, bool) +} + +// Trigger trigger details. +type Trigger struct { + autorest.Response `json:"-"` + // Kind - Possible values include: 'KindTrigger', 'KindFileEvent', 'KindPeriodicTimerEvent' + Kind KindBasicTrigger `json:"kind,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +func unmarshalBasicTrigger(body []byte) (BasicTrigger, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindFileEvent): + var fet FileEventTrigger + err := json.Unmarshal(body, &fet) + return fet, err + case string(KindPeriodicTimerEvent): + var ptet PeriodicTimerEventTrigger + err := json.Unmarshal(body, &ptet) + return ptet, err + default: + var t Trigger + err := json.Unmarshal(body, &t) + return t, err + } +} +func unmarshalBasicTriggerArray(body []byte) ([]BasicTrigger, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tArray := make([]BasicTrigger, len(rawMessages)) + + for index, rawMessage := range rawMessages { + t, err := unmarshalBasicTrigger(*rawMessage) + if err != nil { + return nil, err + } + tArray[index] = t + } + return tArray, nil +} + +// MarshalJSON is the custom marshaler for Trigger. +func (t Trigger) MarshalJSON() ([]byte, error) { + t.Kind = KindTrigger + objectMap := make(map[string]interface{}) + if t.Kind != "" { + objectMap["kind"] = t.Kind + } + return json.Marshal(objectMap) +} + +// AsFileEventTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsFileEventTrigger() (*FileEventTrigger, bool) { + return nil, false +} + +// AsPeriodicTimerEventTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsPeriodicTimerEventTrigger() (*PeriodicTimerEventTrigger, bool) { + return nil, false +} + +// AsTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsTrigger() (*Trigger, bool) { + return &t, true +} + +// AsBasicTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsBasicTrigger() (BasicTrigger, bool) { + return &t, true +} + +// TriggerList collection of all trigger on the data box edge device. +type TriggerList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of triggers. + Value *[]BasicTrigger `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TriggerList struct. +func (tl *TriggerList) UnmarshalJSON(body []byte) error { + 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 := unmarshalBasicTriggerArray(*v) + if err != nil { + return err + } + tl.Value = &value + } + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + tl.NextLink = &nextLink + } + } + } + + return nil +} + +// TriggerListIterator provides access to a complete listing of Trigger values. +type TriggerListIterator struct { + i int + page TriggerListPage +} + +// 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 *TriggerListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggerListIterator.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 *TriggerListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TriggerListIterator) 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 TriggerListIterator) Response() TriggerList { + 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 TriggerListIterator) Value() BasicTrigger { + if !iter.page.NotDone() { + return Trigger{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TriggerListIterator type. +func NewTriggerListIterator(page TriggerListPage) TriggerListIterator { + return TriggerListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tl TriggerList) IsEmpty() bool { + return tl.Value == nil || len(*tl.Value) == 0 +} + +// triggerListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tl TriggerList) triggerListPreparer(ctx context.Context) (*http.Request, error) { + if tl.NextLink == nil || len(to.String(tl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tl.NextLink))) +} + +// TriggerListPage contains a page of BasicTrigger values. +type TriggerListPage struct { + fn func(context.Context, TriggerList) (TriggerList, error) + tl TriggerList +} + +// 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 *TriggerListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggerListPage.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.tl) + if err != nil { + return err + } + page.tl = 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 *TriggerListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TriggerListPage) NotDone() bool { + return !page.tl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TriggerListPage) Response() TriggerList { + return page.tl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TriggerListPage) Values() []BasicTrigger { + if page.tl.IsEmpty() { + return nil + } + return *page.tl.Value +} + +// Creates a new instance of the TriggerListPage type. +func NewTriggerListPage(getNextPage func(context.Context, TriggerList) (TriggerList, error)) TriggerListPage { + return TriggerListPage{fn: getNextPage} +} + +// TriggerModel ... +type TriggerModel struct { + autorest.Response `json:"-"` + Value BasicTrigger `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TriggerModel struct. +func (tm *TriggerModel) UnmarshalJSON(body []byte) error { + t, err := unmarshalBasicTrigger(body) + if err != nil { + return err + } + tm.Value = t + + return nil +} + +// TriggersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type TriggersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TriggersCreateOrUpdateFuture) Result(client TriggersClient) (tm TriggerModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.TriggersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tm.Response.Response, err = future.GetResult(sender); err == nil && tm.Response.Response.StatusCode != http.StatusNoContent { + tm, err = client.CreateOrUpdateResponder(tm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersCreateOrUpdateFuture", "Result", tm.Response.Response, "Failure responding to request") + } + } + return +} + +// TriggersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type TriggersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TriggersDeleteFuture) Result(client TriggersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.TriggersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// UpdateDownloadProgress details about the download progress of update. +type UpdateDownloadProgress struct { + // DownloadPhase - READ-ONLY; The download phase. Possible values include: 'Unknown', 'Initializing', 'Downloading', 'Verifying' + DownloadPhase DownloadPhase `json:"downloadPhase,omitempty"` + // PercentComplete - READ-ONLY; Percentage of completion. + PercentComplete *int32 `json:"percentComplete,omitempty"` + // TotalBytesToDownload - READ-ONLY; Total bytes to download. + TotalBytesToDownload *float64 `json:"totalBytesToDownload,omitempty"` + // TotalBytesDownloaded - READ-ONLY; Total bytes downloaded. + TotalBytesDownloaded *float64 `json:"totalBytesDownloaded,omitempty"` + // NumberOfUpdatesToDownload - READ-ONLY; Number of updates to download. + NumberOfUpdatesToDownload *int32 `json:"numberOfUpdatesToDownload,omitempty"` + // NumberOfUpdatesDownloaded - READ-ONLY; Number of updates downloaded. + NumberOfUpdatesDownloaded *int32 `json:"numberOfUpdatesDownloaded,omitempty"` +} + +// UpdateInstallProgress progress details during installation of updates. +type UpdateInstallProgress struct { + // PercentComplete - READ-ONLY; Percentage completed. + PercentComplete *int32 `json:"percentComplete,omitempty"` + // NumberOfUpdatesToInstall - READ-ONLY; Number of updates to install. + NumberOfUpdatesToInstall *int32 `json:"numberOfUpdatesToInstall,omitempty"` + // NumberOfUpdatesInstalled - READ-ONLY; Number of updates installed. + NumberOfUpdatesInstalled *int32 `json:"numberOfUpdatesInstalled,omitempty"` +} + +// UpdateSummary details about ongoing updates and availability of updates on the device. +type UpdateSummary struct { + autorest.Response `json:"-"` + // UpdateSummaryProperties - The device update information summary. + *UpdateSummaryProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for UpdateSummary. +func (us UpdateSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if us.UpdateSummaryProperties != nil { + objectMap["properties"] = us.UpdateSummaryProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UpdateSummary struct. +func (us *UpdateSummary) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var updateSummaryProperties UpdateSummaryProperties + err = json.Unmarshal(*v, &updateSummaryProperties) + if err != nil { + return err + } + us.UpdateSummaryProperties = &updateSummaryProperties + } + 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 +} + +// UpdateSummaryProperties the device update information summary. +type UpdateSummaryProperties struct { + // DeviceVersionNumber - The current version of the device in format: 1.2.17312.13.", + DeviceVersionNumber *string `json:"deviceVersionNumber,omitempty"` + // FriendlyDeviceVersionName - The current version of the device in text format. + FriendlyDeviceVersionName *string `json:"friendlyDeviceVersionName,omitempty"` + // DeviceLastScannedDateTime - The last time when a scan was done on the device. + DeviceLastScannedDateTime *date.Time `json:"deviceLastScannedDateTime,omitempty"` + // LastCompletedScanJobDateTime - The time when the last scan job was completed (success/cancelled/failed) on the appliance. + LastCompletedScanJobDateTime *date.Time `json:"lastCompletedScanJobDateTime,omitempty"` + // LastCompletedDownloadJobDateTime - READ-ONLY; The time when the last Download job was completed (success/cancelled/failed) on the appliance. + LastCompletedDownloadJobDateTime *date.Time `json:"lastCompletedDownloadJobDateTime,omitempty"` + // LastCompletedInstallJobDateTime - READ-ONLY; The time when the last Install job was completed (success/cancelled/failed) on the appliance. + LastCompletedInstallJobDateTime *date.Time `json:"lastCompletedInstallJobDateTime,omitempty"` + // TotalNumberOfUpdatesAvailable - READ-ONLY; The number of updates available for the current device version as per the last device scan. + TotalNumberOfUpdatesAvailable *int32 `json:"totalNumberOfUpdatesAvailable,omitempty"` + // TotalNumberOfUpdatesPendingDownload - READ-ONLY; The total number of items pending download. + TotalNumberOfUpdatesPendingDownload *int32 `json:"totalNumberOfUpdatesPendingDownload,omitempty"` + // TotalNumberOfUpdatesPendingInstall - READ-ONLY; The total number of items pending install. + TotalNumberOfUpdatesPendingInstall *int32 `json:"totalNumberOfUpdatesPendingInstall,omitempty"` + // RebootBehavior - READ-ONLY; Indicates if updates are available and at least one of the updates needs a reboot. Possible values include: 'NeverReboots', 'RequiresReboot', 'RequestReboot' + RebootBehavior InstallRebootBehavior `json:"rebootBehavior,omitempty"` + // OngoingUpdateOperation - READ-ONLY; The current update operation. Possible values include: 'UpdateOperationNone', 'UpdateOperationScan', 'UpdateOperationDownload', 'UpdateOperationInstall' + OngoingUpdateOperation UpdateOperation `json:"ongoingUpdateOperation,omitempty"` + // InProgressDownloadJobID - READ-ONLY; The job ID of the download job in progress. + InProgressDownloadJobID *string `json:"inProgressDownloadJobId,omitempty"` + // InProgressInstallJobID - READ-ONLY; The job ID of the install job in progress. + InProgressInstallJobID *string `json:"inProgressInstallJobId,omitempty"` + // InProgressDownloadJobStartedDateTime - READ-ONLY; The time when the currently running download (if any) started. + InProgressDownloadJobStartedDateTime *date.Time `json:"inProgressDownloadJobStartedDateTime,omitempty"` + // InProgressInstallJobStartedDateTime - READ-ONLY; The time when the currently running install (if any) started. + InProgressInstallJobStartedDateTime *date.Time `json:"inProgressInstallJobStartedDateTime,omitempty"` + // UpdateTitles - READ-ONLY; The list of updates available for install. + UpdateTitles *[]string `json:"updateTitles,omitempty"` + // TotalUpdateSizeInBytes - READ-ONLY; The total size of updates available for download in bytes. + TotalUpdateSizeInBytes *float64 `json:"totalUpdateSizeInBytes,omitempty"` +} + +// UploadCertificateRequest the upload certificate request. +type UploadCertificateRequest struct { + // RawCertificateData - The Base 64 encoded certificate raw data. + *RawCertificateData `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for UploadCertificateRequest. +func (ucr UploadCertificateRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ucr.RawCertificateData != nil { + objectMap["properties"] = ucr.RawCertificateData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UploadCertificateRequest struct. +func (ucr *UploadCertificateRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var rawCertificateData RawCertificateData + err = json.Unmarshal(*v, &rawCertificateData) + if err != nil { + return err + } + ucr.RawCertificateData = &rawCertificateData + } + } + } + + return nil +} + +// UploadCertificateResponse the upload registration certificate response. +type UploadCertificateResponse struct { + autorest.Response `json:"-"` + // AuthType - Specifies authentication type. Possible values include: 'Invalid', 'AzureActiveDirectory' + AuthType AuthenticationType `json:"authType,omitempty"` + // ResourceID - The resource ID of the Data Box Edge/Gateway device. + ResourceID *string `json:"resourceId,omitempty"` + // AadAuthority - Azure Active Directory tenant authority. + AadAuthority *string `json:"aadAuthority,omitempty"` + // AadTenantID - Azure Active Directory tenant ID. + AadTenantID *string `json:"aadTenantId,omitempty"` + // ServicePrincipalClientID - Azure Active Directory service principal client ID. + ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"` + // ServicePrincipalObjectID - Azure Active Directory service principal object ID. + ServicePrincipalObjectID *string `json:"servicePrincipalObjectId,omitempty"` + // AzureManagementEndpointAudience - The azure management endpoint audience. + AzureManagementEndpointAudience *string `json:"azureManagementEndpointAudience,omitempty"` +} + +// User represents a user who has access to one or more shares on the Data Box Edge/Gateway device. +type User struct { + autorest.Response `json:"-"` + // UserProperties - The storage account credential properties. + *UserProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for User. +func (u User) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if u.UserProperties != nil { + objectMap["properties"] = u.UserProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for User struct. +func (u *User) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var userProperties UserProperties + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + u.UserProperties = &userProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + u.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + u.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + u.Type = &typeVar + } + } + } + + return nil +} + +// UserAccessRight the mapping between a particular user and the access type on the SMB share. +type UserAccessRight struct { + // UserID - User ID (already existing in the device). + UserID *string `json:"userId,omitempty"` + // AccessType - Type of access to be allowed for the user. Possible values include: 'Change', 'Read', 'Custom' + AccessType ShareAccessType `json:"accessType,omitempty"` +} + +// UserList collection of users. +type UserList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of users. + Value *[]User `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// UserListIterator provides access to a complete listing of User values. +type UserListIterator struct { + i int + page UserListPage +} + +// 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 *UserListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserListIterator.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 *UserListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter UserListIterator) 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 UserListIterator) Response() UserList { + 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 UserListIterator) Value() User { + if !iter.page.NotDone() { + return User{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the UserListIterator type. +func NewUserListIterator(page UserListPage) UserListIterator { + return UserListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ul UserList) IsEmpty() bool { + return ul.Value == nil || len(*ul.Value) == 0 +} + +// userListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ul UserList) userListPreparer(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))) +} + +// UserListPage contains a page of User values. +type UserListPage struct { + fn func(context.Context, UserList) (UserList, error) + ul UserList +} + +// 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 *UserListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserListPage.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 *UserListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page UserListPage) NotDone() bool { + return !page.ul.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page UserListPage) Response() UserList { + return page.ul +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page UserListPage) Values() []User { + if page.ul.IsEmpty() { + return nil + } + return *page.ul.Value +} + +// Creates a new instance of the UserListPage type. +func NewUserListPage(getNextPage func(context.Context, UserList) (UserList, error)) UserListPage { + return UserListPage{fn: getNextPage} +} + +// UserProperties the user properties. +type UserProperties struct { + // EncryptedPassword - The password details. + EncryptedPassword *AsymmetricEncryptedSecret `json:"encryptedPassword,omitempty"` + // ShareAccessRights - List of shares that the user has rights on. This field should not be specified during user creation. + ShareAccessRights *[]ShareAccessRight `json:"shareAccessRights,omitempty"` +} + +// UsersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type UsersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *UsersCreateOrUpdateFuture) Result(client UsersClient) (u User, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.UsersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if u.Response.Response, err = future.GetResult(sender); err == nil && u.Response.Response.StatusCode != http.StatusNoContent { + u, err = client.CreateOrUpdateResponder(u.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersCreateOrUpdateFuture", "Result", u.Response.Response, "Failure responding to request") + } + } + return +} + +// UsersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type UsersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *UsersDeleteFuture) Result(client UsersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.UsersDeleteFuture") + return + } + ar.Response = future.Response() + return +} diff --git a/services/databoxedge/mgmt/2019-07-01/databoxedge/nodes.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/nodes.go new file mode 100644 index 000000000000..86b9766a31ca --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/nodes.go @@ -0,0 +1,118 @@ +package databoxedge + +// 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" +) + +// NodesClient is the client for the Nodes methods of the Databoxedge service. +type NodesClient struct { + BaseClient +} + +// NewNodesClient creates an instance of the NodesClient client. +func NewNodesClient(subscriptionID string) NodesClient { + return NewNodesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNodesClientWithBaseURI creates an instance of the NodesClient client. +func NewNodesClientWithBaseURI(baseURI string, subscriptionID string) NodesClient { + return NodesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByDataBoxEdgeDevice gets all the nodes currently configured under this Data Box Edge device +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client NodesClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result NodeList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NodesClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.NodesClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.NodesClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.NodesClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client NodesClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client NodesClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client NodesClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result NodeList, 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/databoxedge/mgmt/2019-07-01/databoxedge/operations.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/operations.go new file mode 100644 index 000000000000..bcb8d20176f9 --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/operations.go @@ -0,0 +1,147 @@ +package databoxedge + +// 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 Databoxedge 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. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List sends the list request. +func (client OperationsClient) List(ctx context.Context) (result OperationsListPage, 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, "databoxedge.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, "databoxedge.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.ol, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.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-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.DataBoxEdge/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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationsList, 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 OperationsList) (result OperationsList, err error) { + req, err := lastResults.operationsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.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, "databoxedge.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.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 OperationsListIterator, 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/databoxedge/mgmt/2019-07-01/databoxedge/operationsstatus.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/operationsstatus.go new file mode 100644 index 000000000000..2e00a4ab98b1 --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/operationsstatus.go @@ -0,0 +1,120 @@ +package databoxedge + +// 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" +) + +// OperationsStatusClient is the client for the OperationsStatus methods of the Databoxedge service. +type OperationsStatusClient struct { + BaseClient +} + +// NewOperationsStatusClient creates an instance of the OperationsStatusClient client. +func NewOperationsStatusClient(subscriptionID string) OperationsStatusClient { + return NewOperationsStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsStatusClientWithBaseURI creates an instance of the OperationsStatusClient client. +func NewOperationsStatusClientWithBaseURI(baseURI string, subscriptionID string) OperationsStatusClient { + return OperationsStatusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get sends the get request. +// Parameters: +// deviceName - the device name. +// name - the job name. +// resourceGroupName - the resource group name. +func (client OperationsStatusClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsStatusClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OperationsStatusClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.OperationsStatusClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OperationsStatusClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OperationsStatusClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsStatusClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client OperationsStatusClient) GetResponder(resp *http.Response) (result Job, 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/databoxedge/mgmt/2019-07-01/databoxedge/orders.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/orders.go new file mode 100644 index 000000000000..380f0452d415 --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/orders.go @@ -0,0 +1,410 @@ +package databoxedge + +// 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" +) + +// OrdersClient is the client for the Orders methods of the Databoxedge service. +type OrdersClient struct { + BaseClient +} + +// NewOrdersClient creates an instance of the OrdersClient client. +func NewOrdersClient(subscriptionID string) OrdersClient { + return NewOrdersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOrdersClientWithBaseURI creates an instance of the OrdersClient client. +func NewOrdersClientWithBaseURI(baseURI string, subscriptionID string) OrdersClient { + return OrdersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// deviceName - the device name. +// order - the order to be created or updated. +// resourceGroupName - the resource group name. +func (client OrdersClient) CreateOrUpdate(ctx context.Context, deviceName string, order Order, resourceGroupName string) (result OrdersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OrdersClient.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: order, + Constraints: []validation.Constraint{{Target: "order.OrderProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "order.OrderProperties.ContactInformation", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "order.OrderProperties.ContactInformation.ContactPerson", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "order.OrderProperties.ContactInformation.CompanyName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "order.OrderProperties.ContactInformation.Phone", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "order.OrderProperties.ContactInformation.EmailList", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "order.OrderProperties.ShippingAddress", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "order.OrderProperties.ShippingAddress.AddressLine1", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "order.OrderProperties.ShippingAddress.PostalCode", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "order.OrderProperties.ShippingAddress.City", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "order.OrderProperties.ShippingAddress.State", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "order.OrderProperties.ShippingAddress.Country", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("databoxedge.OrdersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, order, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client OrdersClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, order Order, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", pathParameters), + autorest.WithJSON(order), + 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 OrdersClient) CreateOrUpdateSender(req *http.Request) (future OrdersCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 OrdersClient) CreateOrUpdateResponder(resp *http.Response) (result Order, 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 +} + +// Delete sends the delete request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client OrdersClient) Delete(ctx context.Context, deviceName string, resourceGroupName string) (result OrdersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OrdersClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client OrdersClient) DeletePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", 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 OrdersClient) DeleteSender(req *http.Request) (future OrdersDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 OrdersClient) 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: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client OrdersClient) Get(ctx context.Context, deviceName string, resourceGroupName string) (result Order, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OrdersClient.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, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OrdersClient) GetPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/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 OrdersClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client OrdersClient) GetResponder(resp *http.Response) (result Order, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice sends the list by data box edge device request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client OrdersClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result OrderListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OrdersClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.ol.Response.Response != nil { + sc = result.ol.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.ol.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.ol, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client OrdersClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client OrdersClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client OrdersClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result OrderList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client OrdersClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults OrderList) (result OrderList, err error) { + req, err := lastResults.orderListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client OrdersClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string) (result OrderListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OrdersClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName) + return +} diff --git a/services/databoxedge/mgmt/2019-07-01/databoxedge/roles.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/roles.go new file mode 100644 index 000000000000..a59b590769ab --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/roles.go @@ -0,0 +1,395 @@ +package databoxedge + +// 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" +) + +// RolesClient is the client for the Roles methods of the Databoxedge service. +type RolesClient struct { + BaseClient +} + +// NewRolesClient creates an instance of the RolesClient client. +func NewRolesClient(subscriptionID string) RolesClient { + return NewRolesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRolesClientWithBaseURI creates an instance of the RolesClient client. +func NewRolesClientWithBaseURI(baseURI string, subscriptionID string) RolesClient { + return RolesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a role. +// Parameters: +// deviceName - the device name. +// name - the role name. +// role - the role properties. +// resourceGroupName - the resource group name. +func (client RolesClient) CreateOrUpdate(ctx context.Context, deviceName string, name string, role BasicRole, resourceGroupName string) (result RolesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RolesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, role, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RolesClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, name string, role BasicRole, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", pathParameters), + autorest.WithJSON(role), + 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 RolesClient) CreateOrUpdateSender(req *http.Request) (future RolesCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 RolesClient) CreateOrUpdateResponder(resp *http.Response) (result RoleModel, 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 +} + +// Delete deletes the role on the device. +// Parameters: +// deviceName - the device name. +// name - the role name. +// resourceGroupName - the resource group name. +func (client RolesClient) Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result RolesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RolesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RolesClient) DeletePreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client RolesClient) DeleteSender(req *http.Request) (future RolesDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 RolesClient) 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 specific role by name. +// Parameters: +// deviceName - the device name. +// name - the role name. +// resourceGroupName - the resource group name. +func (client RolesClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result RoleModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RolesClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RolesClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RolesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RolesClient) GetResponder(resp *http.Response) (result RoleModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice lists all the roles configured in a Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client RolesClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result RoleListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RolesClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.rl.Response.Response != nil { + sc = result.rl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.rl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.rl, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client RolesClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client RolesClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client RolesClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result RoleList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client RolesClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults RoleList) (result RoleList, err error) { + req, err := lastResults.roleListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.RolesClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.RolesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client RolesClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string) (result RoleListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RolesClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName) + return +} diff --git a/services/databoxedge/mgmt/2019-07-01/databoxedge/shares.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/shares.go new file mode 100644 index 000000000000..9990a6891be4 --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/shares.go @@ -0,0 +1,485 @@ +package databoxedge + +// 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" +) + +// SharesClient is the client for the Shares methods of the Databoxedge service. +type SharesClient struct { + BaseClient +} + +// NewSharesClient creates an instance of the SharesClient client. +func NewSharesClient(subscriptionID string) SharesClient { + return NewSharesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSharesClientWithBaseURI creates an instance of the SharesClient client. +func NewSharesClientWithBaseURI(baseURI string, subscriptionID string) SharesClient { + return SharesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// deviceName - the device name. +// name - the share name. +// share - the share properties. +// resourceGroupName - the resource group name. +func (client SharesClient) CreateOrUpdate(ctx context.Context, deviceName string, name string, share Share, resourceGroupName string) (result SharesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.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: share, + Constraints: []validation.Constraint{{Target: "share.ShareProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "share.ShareProperties.AzureContainerInfo", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "share.ShareProperties.AzureContainerInfo.StorageAccountCredentialID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "share.ShareProperties.AzureContainerInfo.ContainerName", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("databoxedge.SharesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, share, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SharesClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, name string, share Share, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", pathParameters), + autorest.WithJSON(share), + 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 SharesClient) CreateOrUpdateSender(req *http.Request) (future SharesCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 SharesClient) CreateOrUpdateResponder(resp *http.Response) (result Share, 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 +} + +// Delete deletes the share on the Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// name - the share name. +// resourceGroupName - the resource group name. +func (client SharesClient) Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result SharesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SharesClient) DeletePreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SharesClient) DeleteSender(req *http.Request) (future SharesDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 SharesClient) 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: +// deviceName - the device name. +// name - the share name. +// resourceGroupName - the resource group name. +func (client SharesClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result Share, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SharesClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SharesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SharesClient) GetResponder(resp *http.Response) (result Share, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice sends the list by data box edge device request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client SharesClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result ShareListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.sl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.sl, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client SharesClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client SharesClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client SharesClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result ShareList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client SharesClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults ShareList) (result ShareList, err error) { + req, err := lastResults.shareListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.SharesClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.SharesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client SharesClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string) (result ShareListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName) + return +} + +// Refresh sends the refresh request. +// Parameters: +// deviceName - the device name. +// name - the share name. +// resourceGroupName - the resource group name. +func (client SharesClient) Refresh(ctx context.Context, deviceName string, name string, resourceGroupName string) (result SharesRefreshFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.Refresh") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshPreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Refresh", nil, "Failure preparing request") + return + } + + result, err = client.RefreshSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Refresh", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshPreparer prepares the Refresh request. +func (client SharesClient) RefreshPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshSender sends the Refresh request. The method will close the +// http.Response Body if it receives an error. +func (client SharesClient) RefreshSender(req *http.Request) (future SharesRefreshFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// RefreshResponder handles the response to the Refresh request. The method always +// closes the http.Response Body. +func (client SharesClient) RefreshResponder(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/databoxedge/mgmt/2019-07-01/databoxedge/storageaccountcredentials.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/storageaccountcredentials.go new file mode 100644 index 000000000000..4bc7578180fe --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/storageaccountcredentials.go @@ -0,0 +1,406 @@ +package databoxedge + +// 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" +) + +// StorageAccountCredentialsClient is the client for the StorageAccountCredentials methods of the Databoxedge service. +type StorageAccountCredentialsClient struct { + BaseClient +} + +// NewStorageAccountCredentialsClient creates an instance of the StorageAccountCredentialsClient client. +func NewStorageAccountCredentialsClient(subscriptionID string) StorageAccountCredentialsClient { + return NewStorageAccountCredentialsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStorageAccountCredentialsClientWithBaseURI creates an instance of the StorageAccountCredentialsClient client. +func NewStorageAccountCredentialsClientWithBaseURI(baseURI string, subscriptionID string) StorageAccountCredentialsClient { + return StorageAccountCredentialsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates the storage account credential. +// Parameters: +// deviceName - the device name. +// name - the storage account credential name. +// storageAccountCredential - the storage account credential. +// resourceGroupName - the resource group name. +func (client StorageAccountCredentialsClient) CreateOrUpdate(ctx context.Context, deviceName string, name string, storageAccountCredential StorageAccountCredential, resourceGroupName string) (result StorageAccountCredentialsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialsClient.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: storageAccountCredential, + Constraints: []validation.Constraint{{Target: "storageAccountCredential.StorageAccountCredentialProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "storageAccountCredential.StorageAccountCredentialProperties.Alias", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "storageAccountCredential.StorageAccountCredentialProperties.AccountKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "storageAccountCredential.StorageAccountCredentialProperties.AccountKey.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("databoxedge.StorageAccountCredentialsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, storageAccountCredential, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client StorageAccountCredentialsClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, name string, storageAccountCredential StorageAccountCredential, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", pathParameters), + autorest.WithJSON(storageAccountCredential), + 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 StorageAccountCredentialsClient) CreateOrUpdateSender(req *http.Request) (future StorageAccountCredentialsCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 StorageAccountCredentialsClient) CreateOrUpdateResponder(resp *http.Response) (result StorageAccountCredential, 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 +} + +// Delete deletes the storage account credential. +// Parameters: +// deviceName - the device name. +// name - the storage account credential name. +// resourceGroupName - the resource group name. +func (client StorageAccountCredentialsClient) Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result StorageAccountCredentialsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client StorageAccountCredentialsClient) DeletePreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client StorageAccountCredentialsClient) DeleteSender(req *http.Request) (future StorageAccountCredentialsDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 StorageAccountCredentialsClient) 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 storage account credential. +// Parameters: +// deviceName - the device name. +// name - the storage account credential name. +// resourceGroupName - the resource group name. +func (client StorageAccountCredentialsClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result StorageAccountCredential, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialsClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client StorageAccountCredentialsClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client StorageAccountCredentialsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client StorageAccountCredentialsClient) GetResponder(resp *http.Response) (result StorageAccountCredential, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice sends the list by data box edge device request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client StorageAccountCredentialsClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result StorageAccountCredentialListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialsClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.sacl.Response.Response != nil { + sc = result.sacl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.sacl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.sacl, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client StorageAccountCredentialsClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client StorageAccountCredentialsClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client StorageAccountCredentialsClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result StorageAccountCredentialList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client StorageAccountCredentialsClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults StorageAccountCredentialList) (result StorageAccountCredentialList, err error) { + req, err := lastResults.storageAccountCredentialListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client StorageAccountCredentialsClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string) (result StorageAccountCredentialListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialsClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName) + return +} diff --git a/services/databoxedge/mgmt/2019-07-01/databoxedge/triggers.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/triggers.go new file mode 100644 index 000000000000..0d669df50718 --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/triggers.go @@ -0,0 +1,399 @@ +package databoxedge + +// 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" +) + +// TriggersClient is the client for the Triggers methods of the Databoxedge service. +type TriggersClient struct { + BaseClient +} + +// NewTriggersClient creates an instance of the TriggersClient client. +func NewTriggersClient(subscriptionID string) TriggersClient { + return NewTriggersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTriggersClientWithBaseURI creates an instance of the TriggersClient client. +func NewTriggersClientWithBaseURI(baseURI string, subscriptionID string) TriggersClient { + return TriggersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a trigger. +// Parameters: +// deviceName - creates or updates a trigger +// name - the trigger name. +// trigger - the trigger. +// resourceGroupName - the resource group name. +func (client TriggersClient) CreateOrUpdate(ctx context.Context, deviceName string, name string, trigger BasicTrigger, resourceGroupName string) (result TriggersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, trigger, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client TriggersClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, name string, trigger BasicTrigger, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", pathParameters), + autorest.WithJSON(trigger), + 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 TriggersClient) CreateOrUpdateSender(req *http.Request) (future TriggersCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 TriggersClient) CreateOrUpdateResponder(resp *http.Response) (result TriggerModel, 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 +} + +// Delete deletes the trigger on the gateway device. +// Parameters: +// deviceName - the device name. +// name - the trigger name. +// resourceGroupName - the resource group name. +func (client TriggersClient) Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result TriggersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client TriggersClient) DeletePreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client TriggersClient) DeleteSender(req *http.Request) (future TriggersDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 TriggersClient) 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 a specific trigger by name. +// Parameters: +// deviceName - the device name. +// name - the trigger name. +// resourceGroupName - the resource group name. +func (client TriggersClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result TriggerModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TriggersClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TriggersClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TriggersClient) GetResponder(resp *http.Response) (result TriggerModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice lists all the triggers configured in the device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +// expand - specify $filter='CustomContextTag eq ' to filter on custom context tag property +func (client TriggersClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string, expand string) (result TriggerListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.tl.Response.Response != nil { + sc = result.tl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.tl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.tl, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client TriggersClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client TriggersClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client TriggersClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result TriggerList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client TriggersClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults TriggerList) (result TriggerList, err error) { + req, err := lastResults.triggerListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client TriggersClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string, expand string) (result TriggerListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName, expand) + return +} diff --git a/services/databoxedge/mgmt/2019-07-01/databoxedge/users.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/users.go new file mode 100644 index 000000000000..eeca2f8a653d --- /dev/null +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/users.go @@ -0,0 +1,406 @@ +package databoxedge + +// 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" +) + +// UsersClient is the client for the Users methods of the Databoxedge service. +type UsersClient struct { + BaseClient +} + +// NewUsersClient creates an instance of the UsersClient client. +func NewUsersClient(subscriptionID string) UsersClient { + return NewUsersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUsersClientWithBaseURI creates an instance of the UsersClient client. +func NewUsersClientWithBaseURI(baseURI string, subscriptionID string) UsersClient { + return UsersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway +// device. +// Parameters: +// deviceName - the device name. +// name - the user name. +// userParameter - the user details. +// resourceGroupName - the resource group name. +func (client UsersClient) CreateOrUpdate(ctx context.Context, deviceName string, name string, userParameter User, resourceGroupName string) (result UsersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.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: userParameter, + Constraints: []validation.Constraint{{Target: "userParameter.UserProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "userParameter.UserProperties.EncryptedPassword", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "userParameter.UserProperties.EncryptedPassword.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("databoxedge.UsersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, userParameter, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client UsersClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, name string, userParameter User, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", pathParameters), + autorest.WithJSON(userParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client UsersClient) CreateOrUpdateSender(req *http.Request) (future UsersCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 UsersClient) CreateOrUpdateResponder(resp *http.Response) (result User, 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 +} + +// Delete deletes the user on a databox edge/gateway device. +// Parameters: +// deviceName - the device name. +// name - the user name. +// resourceGroupName - the resource group name. +func (client UsersClient) Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result UsersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client UsersClient) DeletePreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client UsersClient) DeleteSender(req *http.Request) (future UsersDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 UsersClient) 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 user. +// Parameters: +// deviceName - the device name. +// name - the user name. +// resourceGroupName - the resource group name. +func (client UsersClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result User, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client UsersClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client UsersClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client UsersClient) GetResponder(resp *http.Response) (result User, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice gets all the users registered on a Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client UsersClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result UserListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.ul.Response.Response != nil { + sc = result.ul.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.ul.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.ul, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client UsersClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client UsersClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client UsersClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result UserList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client UsersClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults UserList) (result UserList, err error) { + req, err := lastResults.userListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.UsersClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.UsersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsersClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string) (result UserListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName) + return +} diff --git a/services/batch/2015-12-01.2.2/batch/version.go b/services/databoxedge/mgmt/2019-07-01/databoxedge/version.go similarity index 91% rename from services/batch/2015-12-01.2.2/batch/version.go rename to services/databoxedge/mgmt/2019-07-01/databoxedge/version.go index 84ce24450b69..a71041140df9 100644 --- a/services/batch/2015-12-01.2.2/batch/version.go +++ b/services/databoxedge/mgmt/2019-07-01/databoxedge/version.go @@ -1,4 +1,4 @@ -package batch +package databoxedge import "github.com/Azure/azure-sdk-for-go/version" @@ -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.Number + " batch/2015-12-01.2.2" + return "Azure-SDK-For-Go/" + version.Number + " databoxedge/2019-07-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/datafactoryapi/interfaces.go b/services/datafactory/mgmt/2018-06-01/datafactory/datafactoryapi/interfaces.go index 547619423f12..cf9ac665bd95 100644 --- a/services/datafactory/mgmt/2018-06-01/datafactory/datafactoryapi/interfaces.go +++ b/services/datafactory/mgmt/2018-06-01/datafactory/datafactoryapi/interfaces.go @@ -173,3 +173,24 @@ type RerunTriggersClientAPI interface { } var _ RerunTriggersClientAPI = (*datafactory.RerunTriggersClient)(nil) + +// DataFlowsClientAPI contains the set of methods on the DataFlowsClient type. +type DataFlowsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, factoryName string, dataFlowName string, dataFlow datafactory.DataFlowResource, ifMatch string) (result datafactory.DataFlowResource, err error) + Delete(ctx context.Context, resourceGroupName string, factoryName string, dataFlowName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, factoryName string, dataFlowName string, ifNoneMatch string) (result datafactory.DataFlowResource, err error) + ListByFactory(ctx context.Context, resourceGroupName string, factoryName string) (result datafactory.DataFlowListResponsePage, err error) +} + +var _ DataFlowsClientAPI = (*datafactory.DataFlowsClient)(nil) + +// DataFlowDebugSessionClientAPI contains the set of methods on the DataFlowDebugSessionClient type. +type DataFlowDebugSessionClientAPI interface { + AddDataFlow(ctx context.Context, resourceGroupName string, factoryName string, request datafactory.DataFlowDebugPackage) (result datafactory.AddDataFlowToDebugSessionResponse, err error) + Create(ctx context.Context, resourceGroupName string, factoryName string, request datafactory.CreateDataFlowDebugSessionRequest) (result datafactory.DataFlowDebugSessionCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, factoryName string, request datafactory.DeleteDataFlowDebugSessionRequest) (result autorest.Response, err error) + ExecuteCommand(ctx context.Context, resourceGroupName string, factoryName string, request datafactory.DataFlowDebugCommandRequest) (result datafactory.DataFlowDebugSessionExecuteCommandFuture, err error) + QueryByFactory(ctx context.Context, resourceGroupName string, factoryName string) (result datafactory.QueryDataFlowDebugSessionsResponsePage, err error) +} + +var _ DataFlowDebugSessionClientAPI = (*datafactory.DataFlowDebugSessionClient)(nil) diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/dataflowdebugsession.go b/services/datafactory/mgmt/2018-06-01/datafactory/dataflowdebugsession.go new file mode 100644 index 000000000000..91bab8cfe2e1 --- /dev/null +++ b/services/datafactory/mgmt/2018-06-01/datafactory/dataflowdebugsession.go @@ -0,0 +1,552 @@ +package datafactory + +// 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" +) + +// DataFlowDebugSessionClient is the the Azure Data Factory V2 management API provides a RESTful set of web services +// that interact with Azure Data Factory V2 services. +type DataFlowDebugSessionClient struct { + BaseClient +} + +// NewDataFlowDebugSessionClient creates an instance of the DataFlowDebugSessionClient client. +func NewDataFlowDebugSessionClient(subscriptionID string) DataFlowDebugSessionClient { + return NewDataFlowDebugSessionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDataFlowDebugSessionClientWithBaseURI creates an instance of the DataFlowDebugSessionClient client. +func NewDataFlowDebugSessionClientWithBaseURI(baseURI string, subscriptionID string) DataFlowDebugSessionClient { + return DataFlowDebugSessionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// AddDataFlow add a data flow into debug session. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// request - data flow debug session definition with debug content. +func (client DataFlowDebugSessionClient) AddDataFlow(ctx context.Context, resourceGroupName string, factoryName string, request DataFlowDebugPackage) (result AddDataFlowToDebugSessionResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataFlowDebugSessionClient.AddDataFlow") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.DataFlow", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.DataFlow.Properties", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "request.Staging", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.Staging.LinkedService", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.Staging.LinkedService.Type", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.Staging.LinkedService.ReferenceName", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("datafactory.DataFlowDebugSessionClient", "AddDataFlow", err.Error()) + } + + req, err := client.AddDataFlowPreparer(ctx, resourceGroupName, factoryName, request) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "AddDataFlow", nil, "Failure preparing request") + return + } + + resp, err := client.AddDataFlowSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "AddDataFlow", resp, "Failure sending request") + return + } + + result, err = client.AddDataFlowResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "AddDataFlow", resp, "Failure responding to request") + } + + return +} + +// AddDataFlowPreparer prepares the AddDataFlow request. +func (client DataFlowDebugSessionClient) AddDataFlowPreparer(ctx context.Context, resourceGroupName string, factoryName string, request DataFlowDebugPackage) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-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.DataFactory/factories/{factoryName}/addDataFlowToDebugSession", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddDataFlowSender sends the AddDataFlow request. The method will close the +// http.Response Body if it receives an error. +func (client DataFlowDebugSessionClient) AddDataFlowSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// AddDataFlowResponder handles the response to the AddDataFlow request. The method always +// closes the http.Response Body. +func (client DataFlowDebugSessionClient) AddDataFlowResponder(resp *http.Response) (result AddDataFlowToDebugSessionResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create creates a data flow debug session. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// request - data flow debug session definition +func (client DataFlowDebugSessionClient) Create(ctx context.Context, resourceGroupName string, factoryName string, request CreateDataFlowDebugSessionRequest) (result DataFlowDebugSessionCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataFlowDebugSessionClient.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: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.IntegrationRuntime", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.IntegrationRuntime.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("datafactory.DataFlowDebugSessionClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, factoryName, request) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client DataFlowDebugSessionClient) CreatePreparer(ctx context.Context, resourceGroupName string, factoryName string, request CreateDataFlowDebugSessionRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-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.DataFactory/factories/{factoryName}/createDataFlowDebugSession", pathParameters), + autorest.WithJSON(request), + 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 DataFlowDebugSessionClient) CreateSender(req *http.Request) (future DataFlowDebugSessionCreateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 DataFlowDebugSessionClient) CreateResponder(resp *http.Response) (result CreateDataFlowDebugSessionResponse, 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 +} + +// Delete deletes a data flow debug session. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// request - data flow debug session definition for deletion +func (client DataFlowDebugSessionClient) Delete(ctx context.Context, resourceGroupName string, factoryName string, request DeleteDataFlowDebugSessionRequest) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataFlowDebugSessionClient.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: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.DataFlowDebugSessionClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, factoryName, request) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DataFlowDebugSessionClient) DeletePreparer(ctx context.Context, resourceGroupName string, factoryName string, request DeleteDataFlowDebugSessionRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-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.DataFactory/factories/{factoryName}/deleteDataFlowDebugSession", pathParameters), + autorest.WithJSON(request), + 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 DataFlowDebugSessionClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DataFlowDebugSessionClient) 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 +} + +// ExecuteCommand execute a data flow debug command. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// request - data flow debug command definition. +func (client DataFlowDebugSessionClient) ExecuteCommand(ctx context.Context, resourceGroupName string, factoryName string, request DataFlowDebugCommandRequest) (result DataFlowDebugSessionExecuteCommandFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataFlowDebugSessionClient.ExecuteCommand") + 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: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.CommandPayload", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.CommandPayload.StreamName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("datafactory.DataFlowDebugSessionClient", "ExecuteCommand", err.Error()) + } + + req, err := client.ExecuteCommandPreparer(ctx, resourceGroupName, factoryName, request) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "ExecuteCommand", nil, "Failure preparing request") + return + } + + result, err = client.ExecuteCommandSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "ExecuteCommand", result.Response(), "Failure sending request") + return + } + + return +} + +// ExecuteCommandPreparer prepares the ExecuteCommand request. +func (client DataFlowDebugSessionClient) ExecuteCommandPreparer(ctx context.Context, resourceGroupName string, factoryName string, request DataFlowDebugCommandRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-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.DataFactory/factories/{factoryName}/executeDataFlowDebugCommand", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExecuteCommandSender sends the ExecuteCommand request. The method will close the +// http.Response Body if it receives an error. +func (client DataFlowDebugSessionClient) ExecuteCommandSender(req *http.Request) (future DataFlowDebugSessionExecuteCommandFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ExecuteCommandResponder handles the response to the ExecuteCommand request. The method always +// closes the http.Response Body. +func (client DataFlowDebugSessionClient) ExecuteCommandResponder(resp *http.Response) (result DataFlowDebugCommandResponse, 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 +} + +// QueryByFactory query all active data flow debug sessions. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +func (client DataFlowDebugSessionClient) QueryByFactory(ctx context.Context, resourceGroupName string, factoryName string) (result QueryDataFlowDebugSessionsResponsePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataFlowDebugSessionClient.QueryByFactory") + defer func() { + sc := -1 + if result.qdfdsr.Response.Response != nil { + sc = result.qdfdsr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.DataFlowDebugSessionClient", "QueryByFactory", err.Error()) + } + + result.fn = client.queryByFactoryNextResults + req, err := client.QueryByFactoryPreparer(ctx, resourceGroupName, factoryName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "QueryByFactory", nil, "Failure preparing request") + return + } + + resp, err := client.QueryByFactorySender(req) + if err != nil { + result.qdfdsr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "QueryByFactory", resp, "Failure sending request") + return + } + + result.qdfdsr, err = client.QueryByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "QueryByFactory", resp, "Failure responding to request") + } + + return +} + +// QueryByFactoryPreparer prepares the QueryByFactory request. +func (client DataFlowDebugSessionClient) QueryByFactoryPreparer(ctx context.Context, resourceGroupName string, factoryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-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.DataFactory/factories/{factoryName}/queryDataFlowDebugSessions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// QueryByFactorySender sends the QueryByFactory request. The method will close the +// http.Response Body if it receives an error. +func (client DataFlowDebugSessionClient) QueryByFactorySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// QueryByFactoryResponder handles the response to the QueryByFactory request. The method always +// closes the http.Response Body. +func (client DataFlowDebugSessionClient) QueryByFactoryResponder(resp *http.Response) (result QueryDataFlowDebugSessionsResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// queryByFactoryNextResults retrieves the next set of results, if any. +func (client DataFlowDebugSessionClient) queryByFactoryNextResults(ctx context.Context, lastResults QueryDataFlowDebugSessionsResponse) (result QueryDataFlowDebugSessionsResponse, err error) { + req, err := lastResults.queryDataFlowDebugSessionsResponsePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "queryByFactoryNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.QueryByFactorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "queryByFactoryNextResults", resp, "Failure sending next results request") + } + result, err = client.QueryByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionClient", "queryByFactoryNextResults", resp, "Failure responding to next results request") + } + return +} + +// QueryByFactoryComplete enumerates all values, automatically crossing page boundaries as required. +func (client DataFlowDebugSessionClient) QueryByFactoryComplete(ctx context.Context, resourceGroupName string, factoryName string) (result QueryDataFlowDebugSessionsResponseIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataFlowDebugSessionClient.QueryByFactory") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.QueryByFactory(ctx, resourceGroupName, factoryName) + return +} diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/dataflows.go b/services/datafactory/mgmt/2018-06-01/datafactory/dataflows.go new file mode 100644 index 000000000000..b8d003bd0f90 --- /dev/null +++ b/services/datafactory/mgmt/2018-06-01/datafactory/dataflows.go @@ -0,0 +1,471 @@ +package datafactory + +// 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" +) + +// DataFlowsClient is the the Azure Data Factory V2 management API provides a RESTful set of web services that interact +// with Azure Data Factory V2 services. +type DataFlowsClient struct { + BaseClient +} + +// NewDataFlowsClient creates an instance of the DataFlowsClient client. +func NewDataFlowsClient(subscriptionID string) DataFlowsClient { + return NewDataFlowsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDataFlowsClientWithBaseURI creates an instance of the DataFlowsClient client. +func NewDataFlowsClientWithBaseURI(baseURI string, subscriptionID string) DataFlowsClient { + return DataFlowsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a data flow. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// dataFlowName - the data flow name. +// dataFlow - data flow resource definition. +// ifMatch - eTag of the data flow entity. Should only be specified for update, for which it should match +// existing entity or can be * for unconditional update. +func (client DataFlowsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, factoryName string, dataFlowName string, dataFlow DataFlowResource, ifMatch string) (result DataFlowResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataFlowsClient.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: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: dataFlowName, + Constraints: []validation.Constraint{{Target: "dataFlowName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "dataFlowName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "dataFlowName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}, + {TargetValue: dataFlow, + Constraints: []validation.Constraint{{Target: "dataFlow.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.DataFlowsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, factoryName, dataFlowName, dataFlow, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DataFlowsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, factoryName string, dataFlowName string, dataFlow DataFlowResource, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataFlowName": autorest.Encode("path", dataFlowName), + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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.DataFactory/factories/{factoryName}/dataflows/{dataFlowName}", pathParameters), + autorest.WithJSON(dataFlow), + 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 DataFlowsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DataFlowsClient) CreateOrUpdateResponder(resp *http.Response) (result DataFlowResource, 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 a data flow. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// dataFlowName - the data flow name. +func (client DataFlowsClient) Delete(ctx context.Context, resourceGroupName string, factoryName string, dataFlowName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataFlowsClient.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: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: dataFlowName, + Constraints: []validation.Constraint{{Target: "dataFlowName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "dataFlowName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "dataFlowName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.DataFlowsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, factoryName, dataFlowName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DataFlowsClient) DeletePreparer(ctx context.Context, resourceGroupName string, factoryName string, dataFlowName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataFlowName": autorest.Encode("path", dataFlowName), + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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.DataFactory/factories/{factoryName}/dataflows/{dataFlowName}", 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 DataFlowsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DataFlowsClient) 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 data flow. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// dataFlowName - the data flow name. +// ifNoneMatch - eTag of the data flow entity. Should only be specified for get. If the ETag matches the +// existing entity tag, or if * was provided, then no content will be returned. +func (client DataFlowsClient) Get(ctx context.Context, resourceGroupName string, factoryName string, dataFlowName string, ifNoneMatch string) (result DataFlowResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataFlowsClient.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: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: dataFlowName, + Constraints: []validation.Constraint{{Target: "dataFlowName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "dataFlowName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "dataFlowName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.DataFlowsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, factoryName, dataFlowName, ifNoneMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DataFlowsClient) GetPreparer(ctx context.Context, resourceGroupName string, factoryName string, dataFlowName string, ifNoneMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataFlowName": autorest.Encode("path", dataFlowName), + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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.DataFactory/factories/{factoryName}/dataflows/{dataFlowName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + 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 DataFlowsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DataFlowsClient) GetResponder(resp *http.Response) (result DataFlowResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByFactory lists data flows. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +func (client DataFlowsClient) ListByFactory(ctx context.Context, resourceGroupName string, factoryName string) (result DataFlowListResponsePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataFlowsClient.ListByFactory") + defer func() { + sc := -1 + if result.dflr.Response.Response != nil { + sc = result.dflr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.DataFlowsClient", "ListByFactory", err.Error()) + } + + result.fn = client.listByFactoryNextResults + req, err := client.ListByFactoryPreparer(ctx, resourceGroupName, factoryName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "ListByFactory", nil, "Failure preparing request") + return + } + + resp, err := client.ListByFactorySender(req) + if err != nil { + result.dflr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "ListByFactory", resp, "Failure sending request") + return + } + + result.dflr, err = client.ListByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "ListByFactory", resp, "Failure responding to request") + } + + return +} + +// ListByFactoryPreparer prepares the ListByFactory request. +func (client DataFlowsClient) ListByFactoryPreparer(ctx context.Context, resourceGroupName string, factoryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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.DataFactory/factories/{factoryName}/dataflows", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByFactorySender sends the ListByFactory request. The method will close the +// http.Response Body if it receives an error. +func (client DataFlowsClient) ListByFactorySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByFactoryResponder handles the response to the ListByFactory request. The method always +// closes the http.Response Body. +func (client DataFlowsClient) ListByFactoryResponder(resp *http.Response) (result DataFlowListResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByFactoryNextResults retrieves the next set of results, if any. +func (client DataFlowsClient) listByFactoryNextResults(ctx context.Context, lastResults DataFlowListResponse) (result DataFlowListResponse, err error) { + req, err := lastResults.dataFlowListResponsePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "listByFactoryNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByFactorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "listByFactoryNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowsClient", "listByFactoryNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByFactoryComplete enumerates all values, automatically crossing page boundaries as required. +func (client DataFlowsClient) ListByFactoryComplete(ctx context.Context, resourceGroupName string, factoryName string) (result DataFlowListResponseIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataFlowsClient.ListByFactory") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByFactory(ctx, resourceGroupName, factoryName) + return +} diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/models.go b/services/datafactory/mgmt/2018-06-01/datafactory/models.go index dd3c922d71a8..a7f764d671c7 100644 --- a/services/datafactory/mgmt/2018-06-01/datafactory/models.go +++ b/services/datafactory/mgmt/2018-06-01/datafactory/models.go @@ -175,6 +175,40 @@ func PossibleCassandraSourceReadConsistencyLevelsValues() []CassandraSourceReadC return []CassandraSourceReadConsistencyLevels{ALL, EACHQUORUM, LOCALONE, LOCALQUORUM, LOCALSERIAL, ONE, QUORUM, SERIAL, THREE, TWO} } +// DataFlowComputeType enumerates the values for data flow compute type. +type DataFlowComputeType string + +const ( + // ComputeOptimized ... + ComputeOptimized DataFlowComputeType = "ComputeOptimized" + // General ... + General DataFlowComputeType = "General" + // MemoryOptimized ... + MemoryOptimized DataFlowComputeType = "MemoryOptimized" +) + +// PossibleDataFlowComputeTypeValues returns an array of possible values for the DataFlowComputeType const type. +func PossibleDataFlowComputeTypeValues() []DataFlowComputeType { + return []DataFlowComputeType{ComputeOptimized, General, MemoryOptimized} +} + +// DataFlowDebugCommandType enumerates the values for data flow debug command type. +type DataFlowDebugCommandType string + +const ( + // ExecuteExpressionQuery ... + ExecuteExpressionQuery DataFlowDebugCommandType = "executeExpressionQuery" + // ExecutePreviewQuery ... + ExecutePreviewQuery DataFlowDebugCommandType = "executePreviewQuery" + // ExecuteStatisticsQuery ... + ExecuteStatisticsQuery DataFlowDebugCommandType = "executeStatisticsQuery" +) + +// PossibleDataFlowDebugCommandTypeValues returns an array of possible values for the DataFlowDebugCommandType const type. +func PossibleDataFlowDebugCommandTypeValues() []DataFlowDebugCommandType { + return []DataFlowDebugCommandType{ExecuteExpressionQuery, ExecutePreviewQuery, ExecuteStatisticsQuery} +} + // DayOfWeek enumerates the values for day of week. type DayOfWeek string @@ -1382,6 +1416,8 @@ const ( TypeDataLakeAnalyticsUSQL TypeBasicActivity = "DataLakeAnalyticsU-SQL" // TypeDelete ... TypeDelete TypeBasicActivity = "Delete" + // TypeExecuteDataFlow ... + TypeExecuteDataFlow TypeBasicActivity = "ExecuteDataFlow" // TypeExecutePipeline ... TypeExecutePipeline TypeBasicActivity = "ExecutePipeline" // TypeExecuteSSISPackage ... @@ -1426,7 +1462,7 @@ const ( // PossibleTypeBasicActivityValues returns an array of possible values for the TypeBasicActivity const type. func PossibleTypeBasicActivityValues() []TypeBasicActivity { - return []TypeBasicActivity{TypeActivity, TypeAppendVariable, TypeAzureDataExplorerCommand, TypeAzureFunctionActivity, TypeAzureMLBatchExecution, TypeAzureMLUpdateResource, TypeContainer, TypeCopy, TypeCustom, TypeDatabricksNotebook, TypeDatabricksSparkJar, TypeDatabricksSparkPython, TypeDataLakeAnalyticsUSQL, TypeDelete, TypeExecutePipeline, TypeExecuteSSISPackage, TypeExecution, TypeFilter, TypeForEach, TypeGetMetadata, TypeHDInsightHive, TypeHDInsightMapReduce, TypeHDInsightPig, TypeHDInsightSpark, TypeHDInsightStreaming, TypeIfCondition, TypeLookup, TypeSetVariable, TypeSQLServerStoredProcedure, TypeUntil, TypeValidation, TypeWait, TypeWebActivity, TypeWebHook} + return []TypeBasicActivity{TypeActivity, TypeAppendVariable, TypeAzureDataExplorerCommand, TypeAzureFunctionActivity, TypeAzureMLBatchExecution, TypeAzureMLUpdateResource, TypeContainer, TypeCopy, TypeCustom, TypeDatabricksNotebook, TypeDatabricksSparkJar, TypeDatabricksSparkPython, TypeDataLakeAnalyticsUSQL, TypeDelete, TypeExecuteDataFlow, TypeExecutePipeline, TypeExecuteSSISPackage, TypeExecution, TypeFilter, TypeForEach, TypeGetMetadata, TypeHDInsightHive, TypeHDInsightMapReduce, TypeHDInsightPig, TypeHDInsightSpark, TypeHDInsightStreaming, TypeIfCondition, TypeLookup, TypeSetVariable, TypeSQLServerStoredProcedure, TypeUntil, TypeValidation, TypeWait, TypeWebActivity, TypeWebHook} } // TypeBasicCopySink enumerates the values for type basic copy sink. @@ -1463,6 +1499,8 @@ const ( TypeCopySink TypeBasicCopySink = "CopySink" // TypeCosmosDbMongoDbAPISink ... TypeCosmosDbMongoDbAPISink TypeBasicCopySink = "CosmosDbMongoDbApiSink" + // TypeCosmosDbSQLAPISink ... + TypeCosmosDbSQLAPISink TypeBasicCopySink = "CosmosDbSqlApiSink" // TypeDelimitedTextSink ... TypeDelimitedTextSink TypeBasicCopySink = "DelimitedTextSink" // TypeDocumentDbCollectionSink ... @@ -1483,6 +1521,8 @@ const ( TypeOdbcSink TypeBasicCopySink = "OdbcSink" // TypeOracleSink ... TypeOracleSink TypeBasicCopySink = "OracleSink" + // TypeOrcSink ... + TypeOrcSink TypeBasicCopySink = "OrcSink" // TypeParquetSink ... TypeParquetSink TypeBasicCopySink = "ParquetSink" // TypeSalesforceServiceCloudSink ... @@ -1503,7 +1543,7 @@ const ( // PossibleTypeBasicCopySinkValues returns an array of possible values for the TypeBasicCopySink const type. func PossibleTypeBasicCopySinkValues() []TypeBasicCopySink { - return []TypeBasicCopySink{TypeAvroSink, TypeAzureBlobFSSink, TypeAzureDataExplorerSink, TypeAzureDataLakeStoreSink, TypeAzureMySQLSink, TypeAzurePostgreSQLSink, TypeAzureQueueSink, TypeAzureSearchIndexSink, TypeAzureSQLSink, TypeAzureTableSink, TypeBinarySink, TypeBlobSink, TypeCommonDataServiceForAppsSink, TypeCopySink, TypeCosmosDbMongoDbAPISink, TypeDelimitedTextSink, TypeDocumentDbCollectionSink, TypeDynamicsCrmSink, TypeDynamicsSink, TypeFileSystemSink, TypeInformixSink, TypeJSONSink, TypeMicrosoftAccessSink, TypeOdbcSink, TypeOracleSink, TypeParquetSink, TypeSalesforceServiceCloudSink, TypeSalesforceSink, TypeSapCloudForCustomerSink, TypeSQLDWSink, TypeSQLMISink, TypeSQLServerSink, TypeSQLSink} + return []TypeBasicCopySink{TypeAvroSink, TypeAzureBlobFSSink, TypeAzureDataExplorerSink, TypeAzureDataLakeStoreSink, TypeAzureMySQLSink, TypeAzurePostgreSQLSink, TypeAzureQueueSink, TypeAzureSearchIndexSink, TypeAzureSQLSink, TypeAzureTableSink, TypeBinarySink, TypeBlobSink, TypeCommonDataServiceForAppsSink, TypeCopySink, TypeCosmosDbMongoDbAPISink, TypeCosmosDbSQLAPISink, TypeDelimitedTextSink, TypeDocumentDbCollectionSink, TypeDynamicsCrmSink, TypeDynamicsSink, TypeFileSystemSink, TypeInformixSink, TypeJSONSink, TypeMicrosoftAccessSink, TypeOdbcSink, TypeOracleSink, TypeOrcSink, TypeParquetSink, TypeSalesforceServiceCloudSink, TypeSalesforceSink, TypeSapCloudForCustomerSink, TypeSQLDWSink, TypeSQLMISink, TypeSQLServerSink, TypeSQLSink} } // TypeBasicCopySource enumerates the values for type basic copy source. @@ -1546,6 +1586,8 @@ const ( TypeCopySource TypeBasicCopySource = "CopySource" // TypeCosmosDbMongoDbAPISource ... TypeCosmosDbMongoDbAPISource TypeBasicCopySource = "CosmosDbMongoDbApiSource" + // TypeCosmosDbSQLAPISource ... + TypeCosmosDbSQLAPISource TypeBasicCopySource = "CosmosDbSqlApiSource" // TypeCouchbaseSource ... TypeCouchbaseSource TypeBasicCopySource = "CouchbaseSource" // TypeDb2Source ... @@ -1616,6 +1658,8 @@ const ( TypeOracleServiceCloudSource TypeBasicCopySource = "OracleServiceCloudSource" // TypeOracleSource ... TypeOracleSource TypeBasicCopySource = "OracleSource" + // TypeOrcSource ... + TypeOrcSource TypeBasicCopySource = "OrcSource" // TypeParquetSource ... TypeParquetSource TypeBasicCopySource = "ParquetSource" // TypePaypalSource ... @@ -1670,6 +1714,8 @@ const ( TypeSquareSource TypeBasicCopySource = "SquareSource" // TypeSybaseSource ... TypeSybaseSource TypeBasicCopySource = "SybaseSource" + // TypeTabularSource ... + TypeTabularSource TypeBasicCopySource = "TabularSource" // TypeTeradataSource ... TypeTeradataSource TypeBasicCopySource = "TeradataSource" // TypeVerticaSource ... @@ -1684,7 +1730,41 @@ const ( // 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, 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, TypeParquetSource, TypePaypalSource, TypePhoenixSource, TypePostgreSQLSource, TypePrestoSource, TypeQuickBooksSource, TypeRelationalSource, TypeResponsysSource, TypeRestSource, TypeSalesforceMarketingCloudSource, TypeSalesforceServiceCloudSource, TypeSalesforceSource, TypeSapBwSource, TypeSapCloudForCustomerSource, TypeSapEccSource, TypeSapHanaSource, TypeSapOpenHubSource, TypeSapTableSource, TypeServiceNowSource, TypeShopifySource, TypeSparkSource, TypeSQLDWSource, TypeSQLMISource, TypeSQLServerSource, TypeSQLSource, TypeSquareSource, TypeSybaseSource, 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, 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, TypeShopifySource, TypeSparkSource, TypeSQLDWSource, TypeSQLMISource, TypeSQLServerSource, TypeSQLSource, TypeSquareSource, TypeSybaseSource, TypeTabularSource, TypeTeradataSource, TypeVerticaSource, TypeWebSource, TypeXeroSource, TypeZohoSource} +} + +// TypeBasicCustomSetupBase enumerates the values for type basic custom setup base. +type TypeBasicCustomSetupBase string + +const ( + // TypeCmdkeySetup ... + TypeCmdkeySetup TypeBasicCustomSetupBase = "CmdkeySetup" + // TypeComponentSetup ... + TypeComponentSetup TypeBasicCustomSetupBase = "ComponentSetup" + // TypeCustomSetupBase ... + TypeCustomSetupBase TypeBasicCustomSetupBase = "CustomSetupBase" + // TypeEnvironmentVariableSetup ... + TypeEnvironmentVariableSetup TypeBasicCustomSetupBase = "EnvironmentVariableSetup" +) + +// PossibleTypeBasicCustomSetupBaseValues returns an array of possible values for the TypeBasicCustomSetupBase const type. +func PossibleTypeBasicCustomSetupBaseValues() []TypeBasicCustomSetupBase { + return []TypeBasicCustomSetupBase{TypeCmdkeySetup, TypeComponentSetup, TypeCustomSetupBase, TypeEnvironmentVariableSetup} +} + +// TypeBasicDataFlow enumerates the values for type basic data flow. +type TypeBasicDataFlow string + +const ( + // TypeDataFlow ... + TypeDataFlow TypeBasicDataFlow = "DataFlow" + // TypeMappingDataFlow ... + TypeMappingDataFlow TypeBasicDataFlow = "MappingDataFlow" +) + +// PossibleTypeBasicDataFlowValues returns an array of possible values for the TypeBasicDataFlow const type. +func PossibleTypeBasicDataFlowValues() []TypeBasicDataFlow { + return []TypeBasicDataFlow{TypeDataFlow, TypeMappingDataFlow} } // TypeBasicDataset enumerates the values for type basic dataset. @@ -1733,6 +1813,8 @@ const ( TypeConcurObject TypeBasicDataset = "ConcurObject" // TypeCosmosDbMongoDbAPICollection ... TypeCosmosDbMongoDbAPICollection TypeBasicDataset = "CosmosDbMongoDbApiCollection" + // TypeCosmosDbSQLAPICollection ... + TypeCosmosDbSQLAPICollection TypeBasicDataset = "CosmosDbSqlApiCollection" // TypeCouchbaseTable ... TypeCouchbaseTable TypeBasicDataset = "CouchbaseTable" // TypeCustomDataset ... @@ -1805,6 +1887,8 @@ const ( TypeOracleServiceCloudObject TypeBasicDataset = "OracleServiceCloudObject" // TypeOracleTable ... TypeOracleTable TypeBasicDataset = "OracleTable" + // TypeOrc ... + TypeOrc TypeBasicDataset = "Orc" // TypeParquet ... TypeParquet TypeBasicDataset = "Parquet" // TypePaypalObject ... @@ -1867,7 +1951,7 @@ const ( // 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, 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, TypeParquet, TypePaypalObject, TypePhoenixObject, TypePostgreSQLTable, TypePrestoObject, TypeQuickBooksObject, TypeRelationalTable, TypeResponsysObject, TypeRestResource, TypeSalesforceMarketingCloudObject, TypeSalesforceObject, TypeSalesforceServiceCloudObject, TypeSapBwCube, TypeSapCloudForCustomerResource, TypeSapEccResource, TypeSapHanaTable, TypeSapOpenHubTable, TypeSapTableResource, TypeServiceNowObject, TypeShopifyObject, 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, 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, TypeShopifyObject, TypeSparkObject, TypeSQLServerTable, TypeSquareObject, TypeSybaseTable, TypeTeradataTable, TypeVerticaTable, TypeWebTable, TypeXeroObject, TypeZohoObject} } // TypeBasicDatasetCompression enumerates the values for type basic dataset compression. @@ -2229,6 +2313,8 @@ const ( TypeBlobEventsTrigger TypeBasicTrigger = "BlobEventsTrigger" // TypeBlobTrigger ... TypeBlobTrigger TypeBasicTrigger = "BlobTrigger" + // TypeChainingTrigger ... + TypeChainingTrigger TypeBasicTrigger = "ChainingTrigger" // TypeMultiplePipelineTrigger ... TypeMultiplePipelineTrigger TypeBasicTrigger = "MultiplePipelineTrigger" // TypeRerunTumblingWindowTrigger ... @@ -2243,7 +2329,7 @@ const ( // PossibleTypeBasicTriggerValues returns an array of possible values for the TypeBasicTrigger const type. func PossibleTypeBasicTriggerValues() []TypeBasicTrigger { - return []TypeBasicTrigger{TypeBlobEventsTrigger, TypeBlobTrigger, TypeMultiplePipelineTrigger, TypeRerunTumblingWindowTrigger, TypeScheduleTrigger, TypeTrigger, TypeTumblingWindowTrigger} + return []TypeBasicTrigger{TypeBlobEventsTrigger, TypeBlobTrigger, TypeChainingTrigger, TypeMultiplePipelineTrigger, TypeRerunTumblingWindowTrigger, TypeScheduleTrigger, TypeTrigger, TypeTumblingWindowTrigger} } // VariableType enumerates the values for variable type. @@ -2308,6 +2394,7 @@ type AccessPolicyResponse struct { // BasicActivity a pipeline activity. type BasicActivity interface { + AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) AsDatabricksSparkPythonActivity() (*DatabricksSparkPythonActivity, bool) AsDatabricksSparkJarActivity() (*DatabricksSparkJarActivity, bool) @@ -2358,7 +2445,7 @@ type Activity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -2370,6 +2457,10 @@ func unmarshalBasicActivity(body []byte) (BasicActivity, error) { } switch m["type"] { + case string(TypeExecuteDataFlow): + var edfa ExecuteDataFlowActivity + err := json.Unmarshal(body, &edfa) + return edfa, err case string(TypeAzureFunctionActivity): var afa AzureFunctionActivity err := json.Unmarshal(body, &afa) @@ -2552,6 +2643,11 @@ func (a Activity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for Activity. +func (a Activity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for Activity. func (a Activity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -3185,6 +3281,13 @@ type ActivityRunsQueryResponse struct { ContinuationToken *string `json:"continuationToken,omitempty"` } +// AddDataFlowToDebugSessionResponse response body structure for starting data flow debug session. +type AddDataFlowToDebugSessionResponse struct { + autorest.Response `json:"-"` + // JobVersion - The ID of data flow debug job version. + JobVersion *string `json:"jobVersion,omitempty"` +} + // AmazonMWSLinkedService amazon Marketplace Web Service linked service. type AmazonMWSLinkedService struct { // AmazonMWSLinkedServiceTypeProperties - Amazon Marketplace Web Service linked service properties. @@ -3924,7 +4027,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -4325,6 +4428,11 @@ func (amod AmazonMWSObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbC return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AmazonMWSObjectDataset. func (amod AmazonMWSObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -4365,6 +4473,11 @@ func (amod AmazonMWSObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AmazonMWSObjectDataset. func (amod AmazonMWSObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -4512,6 +4625,8 @@ func (amod *AmazonMWSObjectDataset) UnmarshalJSON(body []byte) error { type AmazonMWSSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -4520,7 +4635,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -4531,6 +4646,9 @@ func (ams AmazonMWSSource) MarshalJSON() ([]byte, error) { if ams.Query != nil { objectMap["query"] = ams.Query } + if ams.QueryTimeout != nil { + objectMap["queryTimeout"] = ams.QueryTimeout + } if ams.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ams.SourceRetryCount } @@ -4549,6 +4667,121 @@ func (ams AmazonMWSSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for AmazonMWSSource. func (ams AmazonMWSSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -4724,81 +4957,21 @@ func (ams AmazonMWSSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return &ams, true } -// AsHTTPSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for AmazonMWSSource. func (ams AmazonMWSSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for AmazonMWSSource. func (ams AmazonMWSSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for AmazonMWSSource. func (ams AmazonMWSSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for AmazonMWSSource. func (ams AmazonMWSSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -4824,11 +4997,6 @@ func (ams AmazonMWSSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for AmazonMWSSource. func (ams AmazonMWSSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -4854,21 +5022,11 @@ func (ams AmazonMWSSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSo return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for AmazonMWSSource. func (ams AmazonMWSSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for AmazonMWSSource. func (ams AmazonMWSSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -4899,53 +5057,33 @@ func (ams AmazonMWSSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for AmazonMWSSource. func (ams AmazonMWSSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ams, true } -// AsAzureTableSource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for AmazonMWSSource. -func (ams AmazonMWSSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -4997,6 +5135,15 @@ func (ams *AmazonMWSSource) UnmarshalJSON(body []byte) error { } ams.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ams.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -5733,6 +5880,8 @@ type AmazonRedshiftSource struct { Query interface{} `json:"query,omitempty"` // RedshiftUnloadSettings - The Amazon S3 settings needed for the interim Amazon S3 when copying from Amazon Redshift with unload. With this, data from Amazon Redshift source will be unloaded into S3 first and then copied into the targeted sink from the interim S3. RedshiftUnloadSettings *RedshiftUnloadSettings `json:"redshiftUnloadSettings,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -5741,7 +5890,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -5755,6 +5904,9 @@ func (ars AmazonRedshiftSource) MarshalJSON() ([]byte, error) { if ars.RedshiftUnloadSettings != nil { objectMap["redshiftUnloadSettings"] = ars.RedshiftUnloadSettings } + if ars.QueryTimeout != nil { + objectMap["queryTimeout"] = ars.QueryTimeout + } if ars.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ars.SourceRetryCount } @@ -5773,6 +5925,121 @@ func (ars AmazonRedshiftSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for AmazonRedshiftSource. func (ars AmazonRedshiftSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return &ars, true @@ -5948,81 +6215,21 @@ func (ars AmazonRedshiftSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for AmazonRedshiftSource. func (ars AmazonRedshiftSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for AmazonRedshiftSource. func (ars AmazonRedshiftSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for AmazonRedshiftSource. func (ars AmazonRedshiftSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for AmazonRedshiftSource. func (ars AmazonRedshiftSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -6048,11 +6255,6 @@ func (ars AmazonRedshiftSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for AmazonRedshiftSource. func (ars AmazonRedshiftSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -6078,21 +6280,11 @@ func (ars AmazonRedshiftSource) AsSapCloudForCustomerSource() (*SapCloudForCusto return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for AmazonRedshiftSource. func (ars AmazonRedshiftSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for AmazonRedshiftSource. func (ars AmazonRedshiftSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -6123,53 +6315,33 @@ func (ars AmazonRedshiftSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for AmazonRedshiftSource. func (ars AmazonRedshiftSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ars, true } -// AsAzureTableSource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for AmazonRedshiftSource. -func (ars AmazonRedshiftSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -6230,6 +6402,15 @@ func (ars *AmazonRedshiftSource) UnmarshalJSON(body []byte) error { } ars.RedshiftUnloadSettings = &redshiftUnloadSettings } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ars.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -6304,7 +6485,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -6705,6 +6886,11 @@ func (artd AmazonRedshiftTableDataset) AsDocumentDbCollectionDataset() (*Documen return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AmazonRedshiftTableDataset. +func (artd AmazonRedshiftTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AmazonRedshiftTableDataset. func (artd AmazonRedshiftTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -6745,6 +6931,11 @@ func (artd AmazonRedshiftTableDataset) AsBinaryDataset() (*BinaryDataset, bool) return nil, false } +// AsOrcDataset is the BasicDataset implementation for AmazonRedshiftTableDataset. +func (artd AmazonRedshiftTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AmazonRedshiftTableDataset. func (artd AmazonRedshiftTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -6918,7 +7109,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -7319,6 +7510,11 @@ func (asd AmazonS3Dataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectio return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AmazonS3Dataset. func (asd AmazonS3Dataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -7359,6 +7555,11 @@ func (asd AmazonS3Dataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AmazonS3Dataset. func (asd AmazonS3Dataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -8555,7 +8756,7 @@ type AppendVariableActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -8587,6 +8788,11 @@ func (ava AppendVariableActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for AppendVariableActivity. +func (ava AppendVariableActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for AppendVariableActivity. func (ava AppendVariableActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -8881,7 +9087,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -9282,6 +9488,11 @@ func (ad AvroDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionData return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AvroDataset. +func (ad AvroDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AvroDataset. func (ad AvroDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -9322,6 +9533,11 @@ func (ad AvroDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for AvroDataset. +func (ad AvroDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AvroDataset. func (ad AvroDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -9612,7 +9828,7 @@ type AvroSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -9743,6 +9959,11 @@ func (as AvroSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for AvroSink. +func (as AvroSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for AvroSink. func (as AvroSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -9798,6 +10019,11 @@ func (as AvroSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for AvroSink. +func (as AvroSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for AvroSink. func (as AvroSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -9928,7 +10154,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -9957,6 +10183,121 @@ func (as AvroSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for AvroSource. func (as AvroSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -10132,81 +10473,21 @@ func (as AvroSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for AvroSource. func (as AvroSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for AvroSource. func (as AvroSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for AvroSource. func (as AvroSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for AvroSource. func (as AvroSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -10232,11 +10513,6 @@ func (as AvroSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for AvroSource. func (as AvroSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -10262,21 +10538,11 @@ func (as AvroSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for AvroSource. func (as AvroSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for AvroSource. func (as AvroSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -10307,53 +10573,33 @@ func (as AvroSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for AvroSource. func (as AvroSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for AvroSource. -func (as AvroSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -11239,7 +11485,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -11640,6 +11886,11 @@ func (abd AzureBlobDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollecti return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AzureBlobDataset. func (abd AzureBlobDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -11680,6 +11931,11 @@ func (abd AzureBlobDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureBlobDataset. func (abd AzureBlobDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -11937,7 +12193,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -12338,6 +12594,11 @@ func (abfd AzureBlobFSDataset) AsDocumentDbCollectionDataset() (*DocumentDbColle return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AzureBlobFSDataset. +func (abfd AzureBlobFSDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AzureBlobFSDataset. func (abfd AzureBlobFSDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -12378,6 +12639,11 @@ func (abfd AzureBlobFSDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for AzureBlobFSDataset. +func (abfd AzureBlobFSDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureBlobFSDataset. func (abfd AzureBlobFSDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -13526,7 +13792,7 @@ type AzureBlobFSSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -13656,6 +13922,11 @@ func (abfs AzureBlobFSSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for AzureBlobFSSink. +func (abfs AzureBlobFSSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for AzureBlobFSSink. func (abfs AzureBlobFSSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -13711,6 +13982,11 @@ func (abfs AzureBlobFSSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) return nil, false } +// AsOrcSink is the BasicCopySink implementation for AzureBlobFSSink. +func (abfs AzureBlobFSSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for AzureBlobFSSink. func (abfs AzureBlobFSSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -13837,7 +14113,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -13872,6 +14148,121 @@ func (abfs AzureBlobFSSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return &abfs, true +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for AzureBlobFSSource. func (abfs AzureBlobFSSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -14047,81 +14438,21 @@ func (abfs AzureBlobFSSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return &abfs, true -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for AzureBlobFSSource. func (abfs AzureBlobFSSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for AzureBlobFSSource. func (abfs AzureBlobFSSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for AzureBlobFSSource. func (abfs AzureBlobFSSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for AzureBlobFSSource. func (abfs AzureBlobFSSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -14147,11 +14478,6 @@ func (abfs AzureBlobFSSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for AzureBlobFSSource. func (abfs AzureBlobFSSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -14177,21 +14503,11 @@ func (abfs AzureBlobFSSource) AsSapCloudForCustomerSource() (*SapCloudForCustome return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for AzureBlobFSSource. func (abfs AzureBlobFSSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for AzureBlobFSSource. func (abfs AzureBlobFSSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -14222,53 +14538,33 @@ func (abfs AzureBlobFSSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for AzureBlobFSSource. func (abfs AzureBlobFSSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for AzureBlobFSSource. -func (abfs AzureBlobFSSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -16209,25 +16505,27 @@ type AzureDatabricksLinkedServiceTypeProperties struct { Domain interface{} `json:"domain,omitempty"` // AccessToken - Access token for databricks REST API. Refer to https://docs.azuredatabricks.net/api/latest/authentication.html. Type: string (or Expression with resultType string). AccessToken BasicSecretBase `json:"accessToken,omitempty"` - // ExistingClusterID - The id of an existing cluster that will be used for all runs of this job. Type: string (or Expression with resultType string). + // ExistingClusterID - The id of an existing interactive cluster that will be used for all runs of this activity. Type: string (or Expression with resultType string). ExistingClusterID interface{} `json:"existingClusterId,omitempty"` - // NewClusterVersion - The Spark version of new cluster. Type: string (or Expression with resultType string). + // InstancePoolID - The id of an existing instance pool that will be used for all runs of this activity. Type: string (or Expression with resultType string). + InstancePoolID interface{} `json:"instancePoolId,omitempty"` + // NewClusterVersion - If not using an existing interactive cluster, this specifies the Spark version of a new job cluster or instance pool nodes created for each run of this activity. Required if instancePoolId is specified. Type: string (or Expression with resultType string). NewClusterVersion interface{} `json:"newClusterVersion,omitempty"` - // NewClusterNumOfWorker - Number of worker nodes that new cluster should have. A string formatted Int32, like '1' means numOfWorker is 1 or '1:10' means auto-scale from 1 as min and 10 as max. Type: string (or Expression with resultType string). + // NewClusterNumOfWorker - If not using an existing interactive cluster, this specifies the number of worker nodes to use for the new job cluster or instance pool. For new job clusters, this a string-formatted Int32, like '1' means numOfWorker is 1 or '1:10' means auto-scale from 1 (min) to 10 (max). For instance pools, this is a string-formatted Int32, and can only specify a fixed number of worker nodes, such as '2'. Required if newClusterVersion is specified. Type: string (or Expression with resultType string). NewClusterNumOfWorker interface{} `json:"newClusterNumOfWorker,omitempty"` - // NewClusterNodeType - The node types of new cluster. Type: string (or Expression with resultType string). + // NewClusterNodeType - The node type of the new job cluster. This property is required if newClusterVersion is specified and instancePoolId is not specified. If instancePoolId is specified, this property is ignored. Type: string (or Expression with resultType string). NewClusterNodeType interface{} `json:"newClusterNodeType,omitempty"` // NewClusterSparkConf - A set of optional, user-specified Spark configuration key-value pairs. NewClusterSparkConf map[string]interface{} `json:"newClusterSparkConf"` // NewClusterSparkEnvVars - A set of optional, user-specified Spark environment variables key-value pairs. NewClusterSparkEnvVars map[string]interface{} `json:"newClusterSparkEnvVars"` - // NewClusterCustomTags - Additional tags for cluster resources. + // NewClusterCustomTags - Additional tags for cluster resources. This property is ignored in instance pool configurations. NewClusterCustomTags map[string]interface{} `json:"newClusterCustomTags"` - // NewClusterDriverNodeType - The driver node type for the new cluster. Type: string (or Expression with resultType string). + // NewClusterDriverNodeType - The driver node type for the new job cluster. This property is ignored in instance pool configurations. Type: string (or Expression with resultType string). NewClusterDriverNodeType interface{} `json:"newClusterDriverNodeType,omitempty"` // NewClusterInitScripts - User-defined initialization scripts for the new cluster. Type: array of strings (or Expression with resultType array of strings). NewClusterInitScripts interface{} `json:"newClusterInitScripts,omitempty"` - // NewClusterEnableElasticDisk - Enable the elastic disk on the new cluster. Type: boolean (or Expression with resultType boolean). + // NewClusterEnableElasticDisk - Enable the elastic disk on the new cluster. This property is now ignored, and takes the default elastic disk behavior in Databricks (elastic disks are always enabled). Type: boolean (or Expression with resultType boolean). NewClusterEnableElasticDisk interface{} `json:"newClusterEnableElasticDisk,omitempty"` // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` @@ -16243,6 +16541,9 @@ func (adlstp AzureDatabricksLinkedServiceTypeProperties) MarshalJSON() ([]byte, if adlstp.ExistingClusterID != nil { objectMap["existingClusterId"] = adlstp.ExistingClusterID } + if adlstp.InstancePoolID != nil { + objectMap["instancePoolId"] = adlstp.InstancePoolID + } if adlstp.NewClusterVersion != nil { objectMap["newClusterVersion"] = adlstp.NewClusterVersion } @@ -16311,6 +16612,15 @@ func (adlstp *AzureDatabricksLinkedServiceTypeProperties) UnmarshalJSON(body []b } adlstp.ExistingClusterID = existingClusterID } + case "instancePoolId": + if v != nil { + var instancePoolID interface{} + err = json.Unmarshal(*v, &instancePoolID) + if err != nil { + return err + } + adlstp.InstancePoolID = instancePoolID + } case "newClusterVersion": if v != nil { var newClusterVersion interface{} @@ -16425,7 +16735,7 @@ type AzureDataExplorerCommandActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -16463,6 +16773,11 @@ func (adeca AzureDataExplorerCommandActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for AzureDataExplorerCommandActivity. +func (adeca AzureDataExplorerCommandActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for AzureDataExplorerCommandActivity. func (adeca AzureDataExplorerCommandActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -17446,7 +17761,7 @@ type AzureDataExplorerSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -17582,6 +17897,11 @@ func (ades AzureDataExplorerSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for AzureDataExplorerSink. +func (ades AzureDataExplorerSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for AzureDataExplorerSink. func (ades AzureDataExplorerSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -17637,6 +17957,11 @@ func (ades AzureDataExplorerSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, return nil, false } +// AsOrcSink is the BasicCopySink implementation for AzureDataExplorerSink. +func (ades AzureDataExplorerSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for AzureDataExplorerSink. func (ades AzureDataExplorerSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -17781,7 +18106,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -17816,6 +18141,121 @@ func (ades AzureDataExplorerSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return &ades, true +} + +// AsHdfsSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for AzureDataExplorerSource. func (ades AzureDataExplorerSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -17991,81 +18431,21 @@ func (ades AzureDataExplorerSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) return nil, false } -// AsHTTPSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for AzureDataExplorerSource. func (ades AzureDataExplorerSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for AzureDataExplorerSource. func (ades AzureDataExplorerSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return &ades, true -} - // AsAzureMySQLSource is the BasicCopySource implementation for AzureDataExplorerSource. func (ades AzureDataExplorerSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for AzureDataExplorerSource. func (ades AzureDataExplorerSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -18091,11 +18471,6 @@ func (ades AzureDataExplorerSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for AzureDataExplorerSource. func (ades AzureDataExplorerSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -18121,21 +18496,11 @@ func (ades AzureDataExplorerSource) AsSapCloudForCustomerSource() (*SapCloudForC return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for AzureDataExplorerSource. func (ades AzureDataExplorerSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for AzureDataExplorerSource. func (ades AzureDataExplorerSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -18166,53 +18531,33 @@ func (ades AzureDataExplorerSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for AzureDataExplorerSource. func (ades AzureDataExplorerSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for AzureDataExplorerSource. -func (ades AzureDataExplorerSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -18356,7 +18701,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -18757,6 +19102,11 @@ func (adetd AzureDataExplorerTableDataset) AsDocumentDbCollectionDataset() (*Doc return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AzureDataExplorerTableDataset. +func (adetd AzureDataExplorerTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AzureDataExplorerTableDataset. func (adetd AzureDataExplorerTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -18797,6 +19147,11 @@ func (adetd AzureDataExplorerTableDataset) AsBinaryDataset() (*BinaryDataset, bo return nil, false } +// AsOrcDataset is the BasicDataset implementation for AzureDataExplorerTableDataset. +func (adetd AzureDataExplorerTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureDataExplorerTableDataset. func (adetd AzureDataExplorerTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -19658,7 +20013,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -20059,6 +20414,11 @@ func (adlsd AzureDataLakeStoreDataset) AsDocumentDbCollectionDataset() (*Documen return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. func (adlsd AzureDataLakeStoreDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -20099,6 +20459,11 @@ func (adlsd AzureDataLakeStoreDataset) AsBinaryDataset() (*BinaryDataset, bool) return nil, false } +// AsOrcDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. func (adlsd AzureDataLakeStoreDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -21257,7 +21622,7 @@ type AzureDataLakeStoreSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -21390,6 +21755,11 @@ func (adlss AzureDataLakeStoreSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for AzureDataLakeStoreSink. func (adlss AzureDataLakeStoreSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -21445,6 +21815,11 @@ func (adlss AzureDataLakeStoreSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSin return nil, false } +// AsOrcSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for AzureDataLakeStoreSink. func (adlss AzureDataLakeStoreSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -21576,7 +21951,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -21605,6 +21980,121 @@ func (adlss AzureDataLakeStoreSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return &adlss, true +} + +// AsOffice365Source is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for AzureDataLakeStoreSource. func (adlss AzureDataLakeStoreSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -21780,81 +22270,21 @@ func (adlss AzureDataLakeStoreSource) AsAmazonMWSSource() (*AmazonMWSSource, boo return nil, false } -// AsHTTPSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return &adlss, true -} - -// AsOffice365Source is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for AzureDataLakeStoreSource. func (adlss AzureDataLakeStoreSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for AzureDataLakeStoreSource. func (adlss AzureDataLakeStoreSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for AzureDataLakeStoreSource. func (adlss AzureDataLakeStoreSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for AzureDataLakeStoreSource. func (adlss AzureDataLakeStoreSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -21880,11 +22310,6 @@ func (adlss AzureDataLakeStoreSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for AzureDataLakeStoreSource. func (adlss AzureDataLakeStoreSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -21910,21 +22335,11 @@ func (adlss AzureDataLakeStoreSource) AsSapCloudForCustomerSource() (*SapCloudFo return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for AzureDataLakeStoreSource. func (adlss AzureDataLakeStoreSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for AzureDataLakeStoreSource. func (adlss AzureDataLakeStoreSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -21955,53 +22370,33 @@ func (adlss AzureDataLakeStoreSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for AzureDataLakeStoreSource. func (adlss AzureDataLakeStoreSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for AzureDataLakeStoreSource. -func (adlss AzureDataLakeStoreSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -22240,7 +22635,7 @@ type AzureFunctionActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -22278,6 +22673,11 @@ func (afa AzureFunctionActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for AzureFunctionActivity. +func (afa AzureFunctionActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for AzureFunctionActivity. func (afa AzureFunctionActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return &afa, true @@ -24472,6 +24872,8 @@ type AzureMariaDBLinkedServiceTypeProperties struct { type AzureMariaDBSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -24480,7 +24882,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -24491,6 +24893,9 @@ func (amds AzureMariaDBSource) MarshalJSON() ([]byte, error) { if amds.Query != nil { objectMap["query"] = amds.Query } + if amds.QueryTimeout != nil { + objectMap["queryTimeout"] = amds.QueryTimeout + } if amds.SourceRetryCount != nil { objectMap["sourceRetryCount"] = amds.SourceRetryCount } @@ -24509,6 +24914,121 @@ func (amds AzureMariaDBSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for AzureMariaDBSource. func (amds AzureMariaDBSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -24684,81 +25204,21 @@ func (amds AzureMariaDBSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for AzureMariaDBSource. func (amds AzureMariaDBSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for AzureMariaDBSource. func (amds AzureMariaDBSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for AzureMariaDBSource. func (amds AzureMariaDBSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for AzureMariaDBSource. func (amds AzureMariaDBSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -24784,11 +25244,6 @@ func (amds AzureMariaDBSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for AzureMariaDBSource. func (amds AzureMariaDBSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -24814,21 +25269,11 @@ func (amds AzureMariaDBSource) AsSapCloudForCustomerSource() (*SapCloudForCustom return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for AzureMariaDBSource. func (amds AzureMariaDBSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for AzureMariaDBSource. func (amds AzureMariaDBSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -24859,53 +25304,33 @@ func (amds AzureMariaDBSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for AzureMariaDBSource. func (amds AzureMariaDBSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &amds, true } -// AsAzureTableSource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for AzureMariaDBSource. -func (amds AzureMariaDBSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -24957,6 +25382,15 @@ func (amds *AzureMariaDBSource) UnmarshalJSON(body []byte) error { } amds.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + amds.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -25031,7 +25465,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -25432,6 +25866,11 @@ func (amdtd AzureMariaDBTableDataset) AsDocumentDbCollectionDataset() (*Document return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AzureMariaDBTableDataset. +func (amdtd AzureMariaDBTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AzureMariaDBTableDataset. func (amdtd AzureMariaDBTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -25472,6 +25911,11 @@ func (amdtd AzureMariaDBTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for AzureMariaDBTableDataset. +func (amdtd AzureMariaDBTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureMariaDBTableDataset. func (amdtd AzureMariaDBTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -25633,7 +26077,7 @@ type AzureMLBatchExecutionActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -25671,6 +26115,11 @@ func (ambea AzureMLBatchExecutionActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. func (ambea AzureMLBatchExecutionActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -26684,7 +27133,7 @@ type AzureMLUpdateResourceActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -26722,6 +27171,11 @@ func (amura AzureMLUpdateResourceActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. func (amura AzureMLUpdateResourceActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -27642,7 +28096,7 @@ type AzureMySQLSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -27772,6 +28226,11 @@ func (amss AzureMySQLSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for AzureMySQLSink. +func (amss AzureMySQLSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for AzureMySQLSink. func (amss AzureMySQLSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -27827,6 +28286,11 @@ func (amss AzureMySQLSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) return nil, false } +// AsOrcSink is the BasicCopySink implementation for AzureMySQLSink. +func (amss AzureMySQLSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for AzureMySQLSink. func (amss AzureMySQLSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -27941,6 +28405,8 @@ func (amss *AzureMySQLSink) UnmarshalJSON(body []byte) error { type AzureMySQLSource struct { // Query - Database query. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -27949,7 +28415,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -27960,6 +28426,9 @@ func (amss AzureMySQLSource) MarshalJSON() ([]byte, error) { if amss.Query != nil { objectMap["query"] = amss.Query } + if amss.QueryTimeout != nil { + objectMap["queryTimeout"] = amss.QueryTimeout + } if amss.SourceRetryCount != nil { objectMap["sourceRetryCount"] = amss.SourceRetryCount } @@ -27978,6 +28447,121 @@ func (amss AzureMySQLSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for AzureMySQLSource. func (amss AzureMySQLSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -28153,81 +28737,21 @@ func (amss AzureMySQLSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for AzureMySQLSource. func (amss AzureMySQLSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for AzureMySQLSource. func (amss AzureMySQLSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for AzureMySQLSource. func (amss AzureMySQLSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return &amss, true } -// AsHdfsSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for AzureMySQLSource. func (amss AzureMySQLSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -28253,11 +28777,6 @@ func (amss AzureMySQLSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for AzureMySQLSource. func (amss AzureMySQLSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -28283,21 +28802,11 @@ func (amss AzureMySQLSource) AsSapCloudForCustomerSource() (*SapCloudForCustomer return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for AzureMySQLSource. func (amss AzureMySQLSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for AzureMySQLSource. func (amss AzureMySQLSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -28328,53 +28837,33 @@ func (amss AzureMySQLSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for AzureMySQLSource. func (amss AzureMySQLSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &amss, true } -// AsAzureTableSource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for AzureMySQLSource. -func (amss AzureMySQLSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -28426,6 +28915,15 @@ func (amss *AzureMySQLSource) UnmarshalJSON(body []byte) error { } amss.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + amss.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -28500,7 +28998,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -28901,6 +29399,11 @@ func (amstd AzureMySQLTableDataset) AsDocumentDbCollectionDataset() (*DocumentDb return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AzureMySQLTableDataset. func (amstd AzureMySQLTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -28941,6 +29444,11 @@ func (amstd AzureMySQLTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureMySQLTableDataset. func (amstd AzureMySQLTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -29708,7 +30216,7 @@ type AzurePostgreSQLSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -29838,6 +30346,11 @@ func (apss AzurePostgreSQLSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for AzurePostgreSQLSink. +func (apss AzurePostgreSQLSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for AzurePostgreSQLSink. func (apss AzurePostgreSQLSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -29893,6 +30406,11 @@ func (apss AzurePostgreSQLSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, b return &apss, true } +// AsOrcSink is the BasicCopySink implementation for AzurePostgreSQLSink. +func (apss AzurePostgreSQLSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for AzurePostgreSQLSink. func (apss AzurePostgreSQLSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -30007,6 +30525,8 @@ func (apss *AzurePostgreSQLSink) UnmarshalJSON(body []byte) error { type AzurePostgreSQLSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -30015,7 +30535,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -30026,6 +30546,9 @@ func (apss AzurePostgreSQLSource) MarshalJSON() ([]byte, error) { if apss.Query != nil { objectMap["query"] = apss.Query } + if apss.QueryTimeout != nil { + objectMap["queryTimeout"] = apss.QueryTimeout + } if apss.SourceRetryCount != nil { objectMap["sourceRetryCount"] = apss.SourceRetryCount } @@ -30044,6 +30567,121 @@ func (apss AzurePostgreSQLSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for AzurePostgreSQLSource. func (apss AzurePostgreSQLSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -30219,81 +30857,21 @@ func (apss AzurePostgreSQLSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for AzurePostgreSQLSource. func (apss AzurePostgreSQLSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for AzurePostgreSQLSource. func (apss AzurePostgreSQLSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for AzurePostgreSQLSource. func (apss AzurePostgreSQLSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for AzurePostgreSQLSource. func (apss AzurePostgreSQLSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -30319,11 +30897,6 @@ func (apss AzurePostgreSQLSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for AzurePostgreSQLSource. func (apss AzurePostgreSQLSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -30349,21 +30922,11 @@ func (apss AzurePostgreSQLSource) AsSapCloudForCustomerSource() (*SapCloudForCus return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for AzurePostgreSQLSource. func (apss AzurePostgreSQLSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for AzurePostgreSQLSource. func (apss AzurePostgreSQLSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -30394,53 +30957,33 @@ func (apss AzurePostgreSQLSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for AzurePostgreSQLSource. func (apss AzurePostgreSQLSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &apss, true } -// AsAzureTableSource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for AzurePostgreSQLSource. -func (apss AzurePostgreSQLSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -30492,6 +31035,15 @@ func (apss *AzurePostgreSQLSource) UnmarshalJSON(body []byte) error { } apss.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + apss.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -30566,7 +31118,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -30967,6 +31519,11 @@ func (apstd AzurePostgreSQLTableDataset) AsDocumentDbCollectionDataset() (*Docum return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. func (apstd AzurePostgreSQLTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -31007,6 +31564,11 @@ func (apstd AzurePostgreSQLTableDataset) AsBinaryDataset() (*BinaryDataset, bool return nil, false } +// AsOrcDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. func (apstd AzurePostgreSQLTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -31174,7 +31736,7 @@ type AzureQueueSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -31301,6 +31863,11 @@ func (aqs AzureQueueSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for AzureQueueSink. func (aqs AzureQueueSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -31356,6 +31923,11 @@ func (aqs AzureQueueSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for AzureQueueSink. func (aqs AzureQueueSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -31477,7 +32049,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -31878,6 +32450,11 @@ func (asid AzureSearchIndexDataset) AsDocumentDbCollectionDataset() (*DocumentDb return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AzureSearchIndexDataset. func (asid AzureSearchIndexDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -31918,6 +32495,11 @@ func (asid AzureSearchIndexDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureSearchIndexDataset. func (asid AzureSearchIndexDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -32083,7 +32665,7 @@ type AzureSearchIndexSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -32213,6 +32795,11 @@ func (asis AzureSearchIndexSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for AzureSearchIndexSink. func (asis AzureSearchIndexSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -32268,6 +32855,11 @@ func (asis AzureSearchIndexSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, return nil, false } +// AsOrcSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for AzureSearchIndexSink. func (asis AzureSearchIndexSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -34393,7 +34985,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -34794,6 +35386,11 @@ func (asdtd AzureSQLDWTableDataset) AsDocumentDbCollectionDataset() (*DocumentDb return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AzureSQLDWTableDataset. func (asdtd AzureSQLDWTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -34834,6 +35431,11 @@ func (asdtd AzureSQLDWTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureSQLDWTableDataset. func (asdtd AzureSQLDWTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -35683,7 +36285,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -36084,6 +36686,11 @@ func (asmtd AzureSQLMITableDataset) AsDocumentDbCollectionDataset() (*DocumentDb return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AzureSQLMITableDataset. +func (asmtd AzureSQLMITableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AzureSQLMITableDataset. func (asmtd AzureSQLMITableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -36124,6 +36731,11 @@ func (asmtd AzureSQLMITableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for AzureSQLMITableDataset. +func (asmtd AzureSQLMITableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureSQLMITableDataset. func (asmtd AzureSQLMITableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -36303,7 +36915,7 @@ type AzureSQLSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -36448,6 +37060,11 @@ func (ass AzureSQLSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for AzureSQLSink. +func (ass AzureSQLSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for AzureSQLSink. func (ass AzureSQLSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -36503,6 +37120,11 @@ func (ass AzureSQLSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for AzureSQLSink. +func (ass AzureSQLSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for AzureSQLSink. func (ass AzureSQLSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -36668,6 +37290,8 @@ type AzureSQLSource struct { StoredProcedureParameters map[string]*StoredProcedureParameter `json:"storedProcedureParameters"` // ProduceAdditionalTypes - Which additional types to produce. ProduceAdditionalTypes interface{} `json:"produceAdditionalTypes,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -36676,7 +37300,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -36696,6 +37320,9 @@ func (ass AzureSQLSource) MarshalJSON() ([]byte, error) { if ass.ProduceAdditionalTypes != nil { objectMap["produceAdditionalTypes"] = ass.ProduceAdditionalTypes } + if ass.QueryTimeout != nil { + objectMap["queryTimeout"] = ass.QueryTimeout + } if ass.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ass.SourceRetryCount } @@ -36714,6 +37341,121 @@ func (ass AzureSQLSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for AzureSQLSource. func (ass AzureSQLSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -36889,81 +37631,21 @@ func (ass AzureSQLSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for AzureSQLSource. func (ass AzureSQLSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for AzureSQLSource. func (ass AzureSQLSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for AzureSQLSource. func (ass AzureSQLSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for AzureSQLSource. func (ass AzureSQLSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -36989,11 +37671,6 @@ func (ass AzureSQLSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for AzureSQLSource. func (ass AzureSQLSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -37019,21 +37696,11 @@ func (ass AzureSQLSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSou return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for AzureSQLSource. func (ass AzureSQLSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for AzureSQLSource. func (ass AzureSQLSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -37064,53 +37731,33 @@ func (ass AzureSQLSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for AzureSQLSource. func (ass AzureSQLSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ass, true } -// AsAzureTableSource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for AzureSQLSource. -func (ass AzureSQLSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -37189,6 +37836,15 @@ func (ass *AzureSQLSource) UnmarshalJSON(body []byte) error { } ass.ProduceAdditionalTypes = produceAdditionalTypes } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ass.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -37263,7 +37919,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -37664,6 +38320,11 @@ func (astd AzureSQLTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCol return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AzureSQLTableDataset. func (astd AzureSQLTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -37704,6 +38365,11 @@ func (astd AzureSQLTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureSQLTableDataset. func (astd AzureSQLTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -38483,7 +39149,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -38884,6 +39550,11 @@ func (atd AzureTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollect return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for AzureTableDataset. func (atd AzureTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -38924,6 +39595,11 @@ func (atd AzureTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureTableDataset. func (atd AzureTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -39095,7 +39771,7 @@ type AzureTableSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -39234,6 +39910,11 @@ func (ats AzureTableSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for AzureTableSink. func (ats AzureTableSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -39289,6 +39970,11 @@ func (ats AzureTableSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for AzureTableSink. func (ats AzureTableSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -39432,6 +40118,8 @@ type AzureTableSource struct { AzureTableSourceQuery interface{} `json:"azureTableSourceQuery,omitempty"` // AzureTableSourceIgnoreTableNotFound - Azure Table source ignore table not found. Type: boolean (or Expression with resultType boolean). AzureTableSourceIgnoreTableNotFound interface{} `json:"azureTableSourceIgnoreTableNotFound,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -39440,7 +40128,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -39454,6 +40142,9 @@ func (ats AzureTableSource) MarshalJSON() ([]byte, error) { if ats.AzureTableSourceIgnoreTableNotFound != nil { objectMap["azureTableSourceIgnoreTableNotFound"] = ats.AzureTableSourceIgnoreTableNotFound } + if ats.QueryTimeout != nil { + objectMap["queryTimeout"] = ats.QueryTimeout + } if ats.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ats.SourceRetryCount } @@ -39472,6 +40163,121 @@ func (ats AzureTableSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for AzureTableSource. func (ats AzureTableSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -39647,81 +40453,21 @@ func (ats AzureTableSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for AzureTableSource. func (ats AzureTableSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for AzureTableSource. func (ats AzureTableSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for AzureTableSource. func (ats AzureTableSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for AzureTableSource. func (ats AzureTableSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -39747,11 +40493,6 @@ func (ats AzureTableSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for AzureTableSource. func (ats AzureTableSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -39777,21 +40518,11 @@ func (ats AzureTableSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerS return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for AzureTableSource. func (ats AzureTableSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for AzureTableSource. func (ats AzureTableSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -39822,48 +40553,23 @@ func (ats AzureTableSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for AzureTableSource. func (ats AzureTableSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsDynamicsSource() (*DynamicsSource, bool) { - return nil, false -} - -// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { - return nil, false +// AsAzureTableSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsAzureTableSource() (*AzureTableSource, bool) { + return &ats, true } -// AsBlobSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsBlobSource() (*BlobSource, bool) { +// AsTabularSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for AzureTableSource. -func (ats AzureTableSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsBasicTabularSource() (BasicTabularSource, bool) { return &ats, true } @@ -39872,6 +40578,11 @@ func (ats AzureTableSource) AsBinarySource() (*BinarySource, bool) { return nil, false } +// AsOrcSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsOrcSource() (*OrcSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for AzureTableSource. func (ats AzureTableSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -39929,6 +40640,15 @@ func (ats *AzureTableSource) UnmarshalJSON(body []byte) error { } ats.AzureTableSourceIgnoreTableNotFound = azureTableSourceIgnoreTableNotFound } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ats.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -40595,7 +41315,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -40996,6 +41716,11 @@ func (bd BinaryDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDa return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for BinaryDataset. +func (bd BinaryDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for BinaryDataset. func (bd BinaryDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -41036,6 +41761,11 @@ func (bd BinaryDataset) AsBinaryDataset() (*BinaryDataset, bool) { return &bd, true } +// AsOrcDataset is the BasicDataset implementation for BinaryDataset. +func (bd BinaryDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for BinaryDataset. func (bd BinaryDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -41235,7 +41965,7 @@ type BinarySink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -41363,6 +42093,11 @@ func (bs BinarySink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for BinarySink. +func (bs BinarySink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for BinarySink. func (bs BinarySink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -41418,6 +42153,11 @@ func (bs BinarySink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for BinarySink. +func (bs BinarySink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for BinarySink. func (bs BinarySink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -41539,7 +42279,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -41568,6 +42308,121 @@ func (bs BinarySource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for BinarySource. func (bs BinarySource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -41743,81 +42598,21 @@ func (bs BinarySource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for BinarySource. func (bs BinarySource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for BinarySource. func (bs BinarySource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for BinarySource. func (bs BinarySource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for BinarySource. func (bs BinarySource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -41843,11 +42638,6 @@ func (bs BinarySource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for BinarySource. func (bs BinarySource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -41873,21 +42663,11 @@ func (bs BinarySource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for BinarySource. func (bs BinarySource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for BinarySource. func (bs BinarySource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -41918,48 +42698,23 @@ func (bs BinarySource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for BinarySource. func (bs BinarySource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsDynamicsSource() (*DynamicsSource, bool) { - return nil, false -} - -// AsDocumentDbCollectionSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsBlobSource() (*BlobSource, bool) { +// AsTabularSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for BinarySource. -func (bs BinarySource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } @@ -41968,6 +42723,11 @@ func (bs BinarySource) AsBinarySource() (*BinarySource, bool) { return &bs, true } +// AsOrcSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsOrcSource() (*OrcSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for BinarySource. func (bs BinarySource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -42084,7 +42844,7 @@ type BlobEventsTrigger struct { RuntimeState TriggerRuntimeState `json:"runtimeState,omitempty"` // Annotations - List of tags that can be used for describing the trigger. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' + // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeChainingTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' Type TypeBasicTrigger `json:"type,omitempty"` } @@ -42118,6 +42878,11 @@ func (bet BlobEventsTrigger) AsRerunTumblingWindowTrigger() (*RerunTumblingWindo return nil, false } +// AsChainingTrigger is the BasicTrigger implementation for BlobEventsTrigger. +func (bet BlobEventsTrigger) AsChainingTrigger() (*ChainingTrigger, bool) { + return nil, false +} + // AsTumblingWindowTrigger is the BasicTrigger implementation for BlobEventsTrigger. func (bet BlobEventsTrigger) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) { return nil, false @@ -42273,7 +43038,7 @@ type BlobSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -42412,6 +43177,11 @@ func (bs BlobSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for BlobSink. func (bs BlobSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -42467,6 +43237,11 @@ func (bs BlobSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for BlobSink. func (bs BlobSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -42620,7 +43395,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -42655,6 +43430,121 @@ func (bs BlobSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsBlobSource() (*BlobSource, bool) { + return &bs, true +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for BlobSource. func (bs BlobSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -42830,81 +43720,21 @@ func (bs BlobSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for BlobSource. func (bs BlobSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for BlobSource. func (bs BlobSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for BlobSource. func (bs BlobSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for BlobSource. func (bs BlobSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -42930,11 +43760,6 @@ func (bs BlobSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for BlobSource. func (bs BlobSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -42960,21 +43785,11 @@ func (bs BlobSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for BlobSource. func (bs BlobSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for BlobSource. func (bs BlobSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -43005,53 +43820,33 @@ func (bs BlobSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for BlobSource. func (bs BlobSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDynamicsSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsTabularSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsBlobSource() (*BlobSource, bool) { - return &bs, true -} - -// AsAzureTableSource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for BlobSource. -func (bs BlobSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -43189,7 +43984,7 @@ type BlobTrigger struct { RuntimeState TriggerRuntimeState `json:"runtimeState,omitempty"` // Annotations - List of tags that can be used for describing the trigger. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' + // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeChainingTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' Type TypeBasicTrigger `json:"type,omitempty"` } @@ -43223,6 +44018,11 @@ func (bt BlobTrigger) AsRerunTumblingWindowTrigger() (*RerunTumblingWindowTrigge return nil, false } +// AsChainingTrigger is the BasicTrigger implementation for BlobTrigger. +func (bt BlobTrigger) AsChainingTrigger() (*ChainingTrigger, bool) { + return nil, false +} + // AsTumblingWindowTrigger is the BasicTrigger implementation for BlobTrigger. func (bt BlobTrigger) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) { return nil, false @@ -44036,6 +44836,8 @@ type CassandraSource struct { Query interface{} `json:"query,omitempty"` // ConsistencyLevel - The consistency level specifies how many Cassandra servers must respond to a read request before returning data to the client application. Cassandra checks the specified number of Cassandra servers for data to satisfy the read request. Must be one of cassandraSourceReadConsistencyLevels. The default value is 'ONE'. It is case-insensitive. Possible values include: 'ALL', 'EACHQUORUM', 'QUORUM', 'LOCALQUORUM', 'ONE', 'TWO', 'THREE', 'LOCALONE', 'SERIAL', 'LOCALSERIAL' ConsistencyLevel CassandraSourceReadConsistencyLevels `json:"consistencyLevel,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -44044,7 +44846,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -44058,6 +44860,9 @@ func (cs CassandraSource) MarshalJSON() ([]byte, error) { if cs.ConsistencyLevel != "" { objectMap["consistencyLevel"] = cs.ConsistencyLevel } + if cs.QueryTimeout != nil { + objectMap["queryTimeout"] = cs.QueryTimeout + } if cs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = cs.SourceRetryCount } @@ -44076,6 +44881,121 @@ func (cs CassandraSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for CassandraSource. func (cs CassandraSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -44251,81 +45171,21 @@ func (cs CassandraSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for CassandraSource. func (cs CassandraSource) AsCassandraSource() (*CassandraSource, bool) { return &cs, true } -// AsWebSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for CassandraSource. func (cs CassandraSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for CassandraSource. func (cs CassandraSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for CassandraSource. func (cs CassandraSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -44351,11 +45211,6 @@ func (cs CassandraSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for CassandraSource. func (cs CassandraSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -44381,21 +45236,11 @@ func (cs CassandraSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSou return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for CassandraSource. func (cs CassandraSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for CassandraSource. func (cs CassandraSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -44426,53 +45271,33 @@ func (cs CassandraSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for CassandraSource. func (cs CassandraSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &cs, true } -// AsAzureTableSource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for CassandraSource. -func (cs CassandraSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -44533,6 +45358,15 @@ func (cs *CassandraSource) UnmarshalJSON(body []byte) error { } cs.ConsistencyLevel = consistencyLevel } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + cs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -44607,7 +45441,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -45008,6 +45842,11 @@ func (ctd CassandraTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCol return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for CassandraTableDataset. func (ctd CassandraTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -45048,6 +45887,11 @@ func (ctd CassandraTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for CassandraTableDataset. func (ctd CassandraTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -45199,6 +46043,191 @@ type CassandraTableDatasetTypeProperties struct { Keyspace interface{} `json:"keyspace,omitempty"` } +// ChainingTrigger trigger that allows the referenced pipeline to depend on other pipeline runs based on +// runDimension Name/Value pairs. Upstream pipelines should declare the same runDimension Name and their +// runs should have the values for those runDimensions. The referenced pipeline run would be triggered if +// the values for the runDimension match for all upstream pipeline runs. +type ChainingTrigger struct { + // Pipeline - Pipeline for which runs are created when all upstream pipelines complete successfully. + Pipeline *TriggerPipelineReference `json:"pipeline,omitempty"` + // ChainingTriggerTypeProperties - Chaining Trigger properties. + *ChainingTriggerTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Trigger description. + Description *string `json:"description,omitempty"` + // RuntimeState - READ-ONLY; Indicates if trigger is running or not. Updated when Start/Stop APIs are called on the Trigger. Possible values include: 'TriggerRuntimeStateStarted', 'TriggerRuntimeStateStopped', 'TriggerRuntimeStateDisabled' + RuntimeState TriggerRuntimeState `json:"runtimeState,omitempty"` + // Annotations - List of tags that can be used for describing the trigger. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeChainingTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' + Type TypeBasicTrigger `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ChainingTrigger. +func (ct ChainingTrigger) MarshalJSON() ([]byte, error) { + ct.Type = TypeChainingTrigger + objectMap := make(map[string]interface{}) + if ct.Pipeline != nil { + objectMap["pipeline"] = ct.Pipeline + } + if ct.ChainingTriggerTypeProperties != nil { + objectMap["typeProperties"] = ct.ChainingTriggerTypeProperties + } + if ct.Description != nil { + objectMap["description"] = ct.Description + } + if ct.Annotations != nil { + objectMap["annotations"] = ct.Annotations + } + if ct.Type != "" { + objectMap["type"] = ct.Type + } + for k, v := range ct.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsRerunTumblingWindowTrigger is the BasicTrigger implementation for ChainingTrigger. +func (ct ChainingTrigger) AsRerunTumblingWindowTrigger() (*RerunTumblingWindowTrigger, bool) { + return nil, false +} + +// AsChainingTrigger is the BasicTrigger implementation for ChainingTrigger. +func (ct ChainingTrigger) AsChainingTrigger() (*ChainingTrigger, bool) { + return &ct, true +} + +// AsTumblingWindowTrigger is the BasicTrigger implementation for ChainingTrigger. +func (ct ChainingTrigger) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) { + return nil, false +} + +// AsBlobEventsTrigger is the BasicTrigger implementation for ChainingTrigger. +func (ct ChainingTrigger) AsBlobEventsTrigger() (*BlobEventsTrigger, bool) { + return nil, false +} + +// AsBlobTrigger is the BasicTrigger implementation for ChainingTrigger. +func (ct ChainingTrigger) AsBlobTrigger() (*BlobTrigger, bool) { + return nil, false +} + +// AsScheduleTrigger is the BasicTrigger implementation for ChainingTrigger. +func (ct ChainingTrigger) AsScheduleTrigger() (*ScheduleTrigger, bool) { + return nil, false +} + +// AsMultiplePipelineTrigger is the BasicTrigger implementation for ChainingTrigger. +func (ct ChainingTrigger) AsMultiplePipelineTrigger() (*MultiplePipelineTrigger, bool) { + return nil, false +} + +// AsBasicMultiplePipelineTrigger is the BasicTrigger implementation for ChainingTrigger. +func (ct ChainingTrigger) AsBasicMultiplePipelineTrigger() (BasicMultiplePipelineTrigger, bool) { + return nil, false +} + +// AsTrigger is the BasicTrigger implementation for ChainingTrigger. +func (ct ChainingTrigger) AsTrigger() (*Trigger, bool) { + return nil, false +} + +// AsBasicTrigger is the BasicTrigger implementation for ChainingTrigger. +func (ct ChainingTrigger) AsBasicTrigger() (BasicTrigger, bool) { + return &ct, true +} + +// UnmarshalJSON is the custom unmarshaler for ChainingTrigger struct. +func (ct *ChainingTrigger) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "pipeline": + if v != nil { + var pipeline TriggerPipelineReference + err = json.Unmarshal(*v, &pipeline) + if err != nil { + return err + } + ct.Pipeline = &pipeline + } + case "typeProperties": + if v != nil { + var chainingTriggerTypeProperties ChainingTriggerTypeProperties + err = json.Unmarshal(*v, &chainingTriggerTypeProperties) + if err != nil { + return err + } + ct.ChainingTriggerTypeProperties = &chainingTriggerTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ct.AdditionalProperties == nil { + ct.AdditionalProperties = make(map[string]interface{}) + } + ct.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ct.Description = &description + } + case "runtimeState": + if v != nil { + var runtimeState TriggerRuntimeState + err = json.Unmarshal(*v, &runtimeState) + if err != nil { + return err + } + ct.RuntimeState = runtimeState + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + ct.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicTrigger + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ct.Type = typeVar + } + } + } + + return nil +} + +// ChainingTriggerTypeProperties chaining Trigger properties. +type ChainingTriggerTypeProperties struct { + // DependsOn - Upstream Pipelines. + DependsOn *[]PipelineReference `json:"dependsOn,omitempty"` + // RunDimension - Run Dimension property that needs to be emitted by upstream pipelines. + RunDimension *string `json:"runDimension,omitempty"` +} + // CloudError the object that defines the structure of an Azure Data Factory error response. type CloudError struct { // CloudErrorBody - Error data @@ -45250,6 +46279,136 @@ type CloudErrorBody struct { Details *[]CloudError `json:"details,omitempty"` } +// CmdkeySetup the custom setup of running cmdkey commands. +type CmdkeySetup struct { + // CmdkeySetupTypeProperties - Cmdkey command custom setup type properties. + *CmdkeySetupTypeProperties `json:"typeProperties,omitempty"` + // Type - Possible values include: 'TypeCustomSetupBase', 'TypeComponentSetup', 'TypeEnvironmentVariableSetup', 'TypeCmdkeySetup' + Type TypeBasicCustomSetupBase `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CmdkeySetup. +func (cs CmdkeySetup) MarshalJSON() ([]byte, error) { + cs.Type = TypeCmdkeySetup + objectMap := make(map[string]interface{}) + if cs.CmdkeySetupTypeProperties != nil { + objectMap["typeProperties"] = cs.CmdkeySetupTypeProperties + } + if cs.Type != "" { + objectMap["type"] = cs.Type + } + return json.Marshal(objectMap) +} + +// AsComponentSetup is the BasicCustomSetupBase implementation for CmdkeySetup. +func (cs CmdkeySetup) AsComponentSetup() (*ComponentSetup, bool) { + return nil, false +} + +// AsEnvironmentVariableSetup is the BasicCustomSetupBase implementation for CmdkeySetup. +func (cs CmdkeySetup) AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) { + return nil, false +} + +// AsCmdkeySetup is the BasicCustomSetupBase implementation for CmdkeySetup. +func (cs CmdkeySetup) AsCmdkeySetup() (*CmdkeySetup, bool) { + return &cs, true +} + +// AsCustomSetupBase is the BasicCustomSetupBase implementation for CmdkeySetup. +func (cs CmdkeySetup) AsCustomSetupBase() (*CustomSetupBase, bool) { + return nil, false +} + +// AsBasicCustomSetupBase is the BasicCustomSetupBase implementation for CmdkeySetup. +func (cs CmdkeySetup) AsBasicCustomSetupBase() (BasicCustomSetupBase, bool) { + return &cs, true +} + +// UnmarshalJSON is the custom unmarshaler for CmdkeySetup struct. +func (cs *CmdkeySetup) UnmarshalJSON(body []byte) error { + 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 cmdkeySetupTypeProperties CmdkeySetupTypeProperties + err = json.Unmarshal(*v, &cmdkeySetupTypeProperties) + if err != nil { + return err + } + cs.CmdkeySetupTypeProperties = &cmdkeySetupTypeProperties + } + case "type": + if v != nil { + var typeVar TypeBasicCustomSetupBase + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cs.Type = typeVar + } + } + } + + return nil +} + +// CmdkeySetupTypeProperties cmdkey command custom setup type properties. +type CmdkeySetupTypeProperties struct { + // TargetName - The server name of data source access. + TargetName interface{} `json:"targetName,omitempty"` + // UserName - The user name of data source access. + UserName interface{} `json:"userName,omitempty"` + // Password - The password of data source access. + Password BasicSecretBase `json:"password,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CmdkeySetupTypeProperties struct. +func (cstp *CmdkeySetupTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetName": + if v != nil { + var targetName interface{} + err = json.Unmarshal(*v, &targetName) + if err != nil { + return err + } + cstp.TargetName = targetName + } + case "userName": + if v != nil { + var userName interface{} + err = json.Unmarshal(*v, &userName) + if err != nil { + return err + } + cstp.UserName = userName + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + cstp.Password = password + } + } + } + + return nil +} + // CommonDataServiceForAppsEntityDataset the Common Data Service for Apps entity dataset. type CommonDataServiceForAppsEntityDataset struct { // CommonDataServiceForAppsEntityDatasetTypeProperties - Common Data Service for Apps entity dataset properties. @@ -45270,7 +46429,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -45671,6 +46830,11 @@ func (cdsfaed CommonDataServiceForAppsEntityDataset) AsDocumentDbCollectionDatas return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for CommonDataServiceForAppsEntityDataset. +func (cdsfaed CommonDataServiceForAppsEntityDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for CommonDataServiceForAppsEntityDataset. func (cdsfaed CommonDataServiceForAppsEntityDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -45711,6 +46875,11 @@ func (cdsfaed CommonDataServiceForAppsEntityDataset) AsBinaryDataset() (*BinaryD return nil, false } +// AsOrcDataset is the BasicDataset implementation for CommonDataServiceForAppsEntityDataset. +func (cdsfaed CommonDataServiceForAppsEntityDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for CommonDataServiceForAppsEntityDataset. func (cdsfaed CommonDataServiceForAppsEntityDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -46577,6 +47746,8 @@ type CommonDataServiceForAppsSink struct { WriteBehavior *string `json:"writeBehavior,omitempty"` // IgnoreNullValues - The flag indicating whether to ignore null values from input dataset (except key fields) during write operation. Default is false. Type: boolean (or Expression with resultType boolean). IgnoreNullValues interface{} `json:"ignoreNullValues,omitempty"` + // AlternateKeyName - The logical name of the alternate key which will be used when upserting records. Type: string (or Expression with resultType string). + AlternateKeyName interface{} `json:"alternateKeyName,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. @@ -46589,7 +47760,7 @@ type CommonDataServiceForAppsSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -46603,6 +47774,9 @@ func (cdsfas CommonDataServiceForAppsSink) MarshalJSON() ([]byte, error) { if cdsfas.IgnoreNullValues != nil { objectMap["ignoreNullValues"] = cdsfas.IgnoreNullValues } + if cdsfas.AlternateKeyName != nil { + objectMap["alternateKeyName"] = cdsfas.AlternateKeyName + } if cdsfas.WriteBatchSize != nil { objectMap["writeBatchSize"] = cdsfas.WriteBatchSize } @@ -46722,6 +47896,11 @@ func (cdsfas CommonDataServiceForAppsSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for CommonDataServiceForAppsSink. +func (cdsfas CommonDataServiceForAppsSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for CommonDataServiceForAppsSink. func (cdsfas CommonDataServiceForAppsSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -46777,6 +47956,11 @@ func (cdsfas CommonDataServiceForAppsSink) AsAzurePostgreSQLSink() (*AzurePostgr return nil, false } +// AsOrcSink is the BasicCopySink implementation for CommonDataServiceForAppsSink. +func (cdsfas CommonDataServiceForAppsSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for CommonDataServiceForAppsSink. func (cdsfas CommonDataServiceForAppsSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -46824,6 +48008,15 @@ func (cdsfas *CommonDataServiceForAppsSink) UnmarshalJSON(body []byte) error { } cdsfas.IgnoreNullValues = ignoreNullValues } + case "alternateKeyName": + if v != nil { + var alternateKeyName interface{} + err = json.Unmarshal(*v, &alternateKeyName) + if err != nil { + return err + } + cdsfas.AlternateKeyName = alternateKeyName + } default: if v != nil { var additionalProperties interface{} @@ -46908,7 +48101,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -46937,6 +48130,121 @@ func (cdsfas CommonDataServiceForAppsSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return &cdsfas, true +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. func (cdsfas CommonDataServiceForAppsSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -47112,81 +48420,21 @@ func (cdsfas CommonDataServiceForAppsSource) AsAmazonMWSSource() (*AmazonMWSSour return nil, false } -// AsHTTPSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. func (cdsfas CommonDataServiceForAppsSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. func (cdsfas CommonDataServiceForAppsSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. func (cdsfas CommonDataServiceForAppsSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. func (cdsfas CommonDataServiceForAppsSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -47212,11 +48460,6 @@ func (cdsfas CommonDataServiceForAppsSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. func (cdsfas CommonDataServiceForAppsSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -47242,21 +48485,11 @@ func (cdsfas CommonDataServiceForAppsSource) AsSapCloudForCustomerSource() (*Sap return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. func (cdsfas CommonDataServiceForAppsSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. func (cdsfas CommonDataServiceForAppsSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -47287,53 +48520,33 @@ func (cdsfas CommonDataServiceForAppsSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. func (cdsfas CommonDataServiceForAppsSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return &cdsfas, true -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for CommonDataServiceForAppsSource. -func (cdsfas CommonDataServiceForAppsSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -47439,6 +48652,85 @@ func (cdsfas *CommonDataServiceForAppsSource) UnmarshalJSON(body []byte) error { return nil } +// ComponentSetup the custom setup of installing 3rd party components. +type ComponentSetup struct { + // LicensedComponentSetupTypeProperties - Install 3rd party component type properties. + *LicensedComponentSetupTypeProperties `json:"typeProperties,omitempty"` + // Type - Possible values include: 'TypeCustomSetupBase', 'TypeComponentSetup', 'TypeEnvironmentVariableSetup', 'TypeCmdkeySetup' + Type TypeBasicCustomSetupBase `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ComponentSetup. +func (cs ComponentSetup) MarshalJSON() ([]byte, error) { + cs.Type = TypeComponentSetup + objectMap := make(map[string]interface{}) + if cs.LicensedComponentSetupTypeProperties != nil { + objectMap["typeProperties"] = cs.LicensedComponentSetupTypeProperties + } + if cs.Type != "" { + objectMap["type"] = cs.Type + } + return json.Marshal(objectMap) +} + +// AsComponentSetup is the BasicCustomSetupBase implementation for ComponentSetup. +func (cs ComponentSetup) AsComponentSetup() (*ComponentSetup, bool) { + return &cs, true +} + +// AsEnvironmentVariableSetup is the BasicCustomSetupBase implementation for ComponentSetup. +func (cs ComponentSetup) AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) { + return nil, false +} + +// AsCmdkeySetup is the BasicCustomSetupBase implementation for ComponentSetup. +func (cs ComponentSetup) AsCmdkeySetup() (*CmdkeySetup, bool) { + return nil, false +} + +// AsCustomSetupBase is the BasicCustomSetupBase implementation for ComponentSetup. +func (cs ComponentSetup) AsCustomSetupBase() (*CustomSetupBase, bool) { + return nil, false +} + +// AsBasicCustomSetupBase is the BasicCustomSetupBase implementation for ComponentSetup. +func (cs ComponentSetup) AsBasicCustomSetupBase() (BasicCustomSetupBase, bool) { + return &cs, true +} + +// UnmarshalJSON is the custom unmarshaler for ComponentSetup struct. +func (cs *ComponentSetup) UnmarshalJSON(body []byte) error { + 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 licensedComponentSetupTypeProperties LicensedComponentSetupTypeProperties + err = json.Unmarshal(*v, &licensedComponentSetupTypeProperties) + if err != nil { + return err + } + cs.LicensedComponentSetupTypeProperties = &licensedComponentSetupTypeProperties + } + case "type": + if v != nil { + var typeVar TypeBasicCustomSetupBase + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cs.Type = typeVar + } + } + } + + return nil +} + // ConcurLinkedService concur Service linked service. type ConcurLinkedService struct { // ConcurLinkedServiceTypeProperties - Concur Service linked service properties. @@ -48146,7 +49438,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -48547,6 +49839,11 @@ func (cod ConcurObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbColle return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for ConcurObjectDataset. func (cod ConcurObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -48587,6 +49884,11 @@ func (cod ConcurObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ConcurObjectDataset. func (cod ConcurObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -48734,6 +50036,8 @@ func (cod *ConcurObjectDataset) UnmarshalJSON(body []byte) error { type ConcurSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -48742,7 +50046,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -48753,6 +50057,9 @@ func (cs ConcurSource) MarshalJSON() ([]byte, error) { if cs.Query != nil { objectMap["query"] = cs.Query } + if cs.QueryTimeout != nil { + objectMap["queryTimeout"] = cs.QueryTimeout + } if cs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = cs.SourceRetryCount } @@ -48771,6 +50078,121 @@ func (cs ConcurSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for ConcurSource. func (cs ConcurSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -48946,81 +50368,21 @@ func (cs ConcurSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for ConcurSource. func (cs ConcurSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for ConcurSource. func (cs ConcurSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for ConcurSource. func (cs ConcurSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for ConcurSource. func (cs ConcurSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -49046,11 +50408,6 @@ func (cs ConcurSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for ConcurSource. func (cs ConcurSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -49076,21 +50433,11 @@ func (cs ConcurSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for ConcurSource. func (cs ConcurSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for ConcurSource. func (cs ConcurSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -49121,53 +50468,33 @@ func (cs ConcurSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for ConcurSource. func (cs ConcurSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &cs, true } -// AsAzureTableSource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for ConcurSource. -func (cs ConcurSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -49219,6 +50546,15 @@ func (cs *ConcurSource) UnmarshalJSON(body []byte) error { } cs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + cs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -49300,7 +50636,7 @@ type ControlActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -49402,6 +50738,11 @@ func (ca ControlActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for ControlActivity. func (ca ControlActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -49681,7 +51022,7 @@ type CopyActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -49725,6 +51066,11 @@ func (ca CopyActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for CopyActivity. func (ca CopyActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -50186,6 +51532,7 @@ type BasicCopySink interface { AsAzureSQLSink() (*AzureSQLSink, bool) AsSQLServerSink() (*SQLServerSink, bool) AsSQLSink() (*SQLSink, bool) + AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) AsFileSystemSink() (*FileSystemSink, bool) AsBlobSink() (*BlobSink, bool) @@ -50197,6 +51544,7 @@ type BasicCopySink interface { AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) AsAzureMySQLSink() (*AzureMySQLSink, bool) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) + AsOrcSink() (*OrcSink, bool) AsJSONSink() (*JSONSink, bool) AsDelimitedTextSink() (*DelimitedTextSink, bool) AsCopySink() (*CopySink, bool) @@ -50216,7 +51564,7 @@ type CopySink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -50304,6 +51652,10 @@ func unmarshalBasicCopySink(body []byte) (BasicCopySink, error) { var ss SQLSink err := json.Unmarshal(body, &ss) return ss, err + case string(TypeCosmosDbSQLAPISink): + var cdsas CosmosDbSQLAPISink + err := json.Unmarshal(body, &cdsas) + return cdsas, err case string(TypeDocumentDbCollectionSink): var ddcs DocumentDbCollectionSink err := json.Unmarshal(body, &ddcs) @@ -50348,6 +51700,10 @@ func unmarshalBasicCopySink(body []byte) (BasicCopySink, error) { var apss AzurePostgreSQLSink err := json.Unmarshal(body, &apss) return apss, err + case string(TypeOrcSink): + var osVar OrcSink + err := json.Unmarshal(body, &osVar) + return osVar, err case string(TypeJSONSink): var js JSONSink err := json.Unmarshal(body, &js) @@ -50504,6 +51860,11 @@ func (cs CopySink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for CopySink. func (cs CopySink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -50559,6 +51920,11 @@ func (cs CopySink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for CopySink. func (cs CopySink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -50662,6 +52028,29 @@ func (cs *CopySink) UnmarshalJSON(body []byte) error { // BasicCopySource a copy activity source. type BasicCopySource interface { + AsHTTPSource() (*HTTPSource, bool) + AsAzureBlobFSSource() (*AzureBlobFSSource, bool) + AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) + AsOffice365Source() (*Office365Source, bool) + AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) + AsMongoDbV2Source() (*MongoDbV2Source, bool) + AsMongoDbSource() (*MongoDbSource, bool) + AsWebSource() (*WebSource, bool) + AsOracleSource() (*OracleSource, bool) + AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) + AsHdfsSource() (*HdfsSource, bool) + AsFileSystemSource() (*FileSystemSource, bool) + AsRestSource() (*RestSource, bool) + AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) + AsODataSource() (*ODataSource, bool) + AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) + AsRelationalSource() (*RelationalSource, bool) + AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) + AsDynamicsCrmSource() (*DynamicsCrmSource, bool) + AsDynamicsSource() (*DynamicsSource, bool) + AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) + AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) + AsBlobSource() (*BlobSource, bool) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) AsGoogleAdWordsSource() (*GoogleAdWordsSource, bool) AsOracleServiceCloudSource() (*OracleServiceCloudSource, bool) @@ -50697,51 +52086,32 @@ type BasicCopySource interface { AsConcurSource() (*ConcurSource, bool) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) AsAmazonMWSSource() (*AmazonMWSSource, bool) - AsHTTPSource() (*HTTPSource, bool) - AsAzureBlobFSSource() (*AzureBlobFSSource, bool) - AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) - AsOffice365Source() (*Office365Source, bool) - AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) - AsMongoDbV2Source() (*MongoDbV2Source, bool) - AsMongoDbSource() (*MongoDbSource, bool) AsCassandraSource() (*CassandraSource, bool) - AsWebSource() (*WebSource, bool) AsTeradataSource() (*TeradataSource, bool) - AsOracleSource() (*OracleSource, bool) - AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) AsAzureMySQLSource() (*AzureMySQLSource, bool) - AsHdfsSource() (*HdfsSource, bool) - AsFileSystemSource() (*FileSystemSource, bool) AsSQLDWSource() (*SQLDWSource, bool) AsSQLMISource() (*SQLMISource, bool) AsAzureSQLSource() (*AzureSQLSource, bool) AsSQLServerSource() (*SQLServerSource, bool) AsSQLSource() (*SQLSource, bool) - AsRestSource() (*RestSource, bool) AsSapTableSource() (*SapTableSource, bool) AsSapOpenHubSource() (*SapOpenHubSource, bool) AsSapHanaSource() (*SapHanaSource, bool) AsSapEccSource() (*SapEccSource, bool) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) - AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) AsSalesforceSource() (*SalesforceSource, bool) - AsODataSource() (*ODataSource, bool) AsSapBwSource() (*SapBwSource, bool) AsSybaseSource() (*SybaseSource, bool) AsPostgreSQLSource() (*PostgreSQLSource, bool) AsMySQLSource() (*MySQLSource, bool) AsOdbcSource() (*OdbcSource, bool) AsDb2Source() (*Db2Source, bool) - AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) AsInformixSource() (*InformixSource, bool) - AsRelationalSource() (*RelationalSource, bool) - AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) - AsDynamicsCrmSource() (*DynamicsCrmSource, bool) - AsDynamicsSource() (*DynamicsSource, bool) - AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) - AsBlobSource() (*BlobSource, bool) AsAzureTableSource() (*AzureTableSource, bool) + AsTabularSource() (*TabularSource, bool) + AsBasicTabularSource() (BasicTabularSource, bool) AsBinarySource() (*BinarySource, bool) + AsOrcSource() (*OrcSource, bool) AsJSONSource() (*JSONSource, bool) AsDelimitedTextSource() (*DelimitedTextSource, bool) AsParquetSource() (*ParquetSource, bool) @@ -50759,7 +52129,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -50771,6 +52141,98 @@ func unmarshalBasicCopySource(body []byte) (BasicCopySource, error) { } switch m["type"] { + case string(TypeHTTPSource): + var hs HTTPSource + err := json.Unmarshal(body, &hs) + return hs, err + case string(TypeAzureBlobFSSource): + var abfs AzureBlobFSSource + err := json.Unmarshal(body, &abfs) + return abfs, err + case string(TypeAzureDataLakeStoreSource): + var adlss AzureDataLakeStoreSource + err := json.Unmarshal(body, &adlss) + return adlss, err + case string(TypeOffice365Source): + var o3s Office365Source + err := json.Unmarshal(body, &o3s) + return o3s, err + case string(TypeCosmosDbMongoDbAPISource): + var cdmdas CosmosDbMongoDbAPISource + err := json.Unmarshal(body, &cdmdas) + return cdmdas, err + case string(TypeMongoDbV2Source): + var mdvs MongoDbV2Source + err := json.Unmarshal(body, &mdvs) + return mdvs, err + case string(TypeMongoDbSource): + var mds MongoDbSource + err := json.Unmarshal(body, &mds) + return mds, err + case string(TypeWebSource): + var ws WebSource + err := json.Unmarshal(body, &ws) + return ws, err + case string(TypeOracleSource): + var osVar OracleSource + err := json.Unmarshal(body, &osVar) + return osVar, err + case string(TypeAzureDataExplorerSource): + var ades AzureDataExplorerSource + err := json.Unmarshal(body, &ades) + return ades, err + case string(TypeHdfsSource): + var hs HdfsSource + err := json.Unmarshal(body, &hs) + return hs, err + case string(TypeFileSystemSource): + var fss FileSystemSource + err := json.Unmarshal(body, &fss) + return fss, err + case string(TypeRestSource): + var rs RestSource + err := json.Unmarshal(body, &rs) + return rs, err + case string(TypeSalesforceServiceCloudSource): + var sscs SalesforceServiceCloudSource + err := json.Unmarshal(body, &sscs) + return sscs, err + case string(TypeODataSource): + var ods ODataSource + err := json.Unmarshal(body, &ods) + return ods, err + case string(TypeMicrosoftAccessSource): + var mas MicrosoftAccessSource + err := json.Unmarshal(body, &mas) + return mas, err + case string(TypeRelationalSource): + var rs RelationalSource + err := json.Unmarshal(body, &rs) + return rs, err + case string(TypeCommonDataServiceForAppsSource): + var cdsfas CommonDataServiceForAppsSource + err := json.Unmarshal(body, &cdsfas) + return cdsfas, err + case string(TypeDynamicsCrmSource): + var dcs DynamicsCrmSource + err := json.Unmarshal(body, &dcs) + return dcs, err + case string(TypeDynamicsSource): + var ds DynamicsSource + err := json.Unmarshal(body, &ds) + return ds, err + case string(TypeCosmosDbSQLAPISource): + var cdsas CosmosDbSQLAPISource + err := json.Unmarshal(body, &cdsas) + return cdsas, err + case string(TypeDocumentDbCollectionSource): + var ddcs DocumentDbCollectionSource + err := json.Unmarshal(body, &ddcs) + return ddcs, err + case string(TypeBlobSource): + var bs BlobSource + err := json.Unmarshal(body, &bs) + return bs, err case string(TypeAmazonRedshiftSource): var ars AmazonRedshiftSource err := json.Unmarshal(body, &ars) @@ -50911,66 +52373,18 @@ func unmarshalBasicCopySource(body []byte) (BasicCopySource, error) { var ams AmazonMWSSource err := json.Unmarshal(body, &ams) return ams, err - case string(TypeHTTPSource): - var hs HTTPSource - err := json.Unmarshal(body, &hs) - return hs, err - case string(TypeAzureBlobFSSource): - var abfs AzureBlobFSSource - err := json.Unmarshal(body, &abfs) - return abfs, err - case string(TypeAzureDataLakeStoreSource): - var adlss AzureDataLakeStoreSource - err := json.Unmarshal(body, &adlss) - return adlss, err - case string(TypeOffice365Source): - var o3s Office365Source - err := json.Unmarshal(body, &o3s) - return o3s, err - case string(TypeCosmosDbMongoDbAPISource): - var cdmdas CosmosDbMongoDbAPISource - err := json.Unmarshal(body, &cdmdas) - return cdmdas, err - case string(TypeMongoDbV2Source): - var mdvs MongoDbV2Source - err := json.Unmarshal(body, &mdvs) - return mdvs, err - case string(TypeMongoDbSource): - var mds MongoDbSource - err := json.Unmarshal(body, &mds) - return mds, err case string(TypeCassandraSource): var cs CassandraSource err := json.Unmarshal(body, &cs) return cs, err - case string(TypeWebSource): - var ws WebSource - err := json.Unmarshal(body, &ws) - return ws, err case string(TypeTeradataSource): var ts TeradataSource err := json.Unmarshal(body, &ts) return ts, err - case string(TypeOracleSource): - var osVar OracleSource - err := json.Unmarshal(body, &osVar) - return osVar, err - case string(TypeAzureDataExplorerSource): - var ades AzureDataExplorerSource - err := json.Unmarshal(body, &ades) - return ades, err case string(TypeAzureMySQLSource): var amss AzureMySQLSource err := json.Unmarshal(body, &amss) return amss, err - case string(TypeHdfsSource): - var hs HdfsSource - err := json.Unmarshal(body, &hs) - return hs, err - case string(TypeFileSystemSource): - var fss FileSystemSource - err := json.Unmarshal(body, &fss) - return fss, err case string(TypeSQLDWSource): var sds SQLDWSource err := json.Unmarshal(body, &sds) @@ -50991,10 +52405,6 @@ func unmarshalBasicCopySource(body []byte) (BasicCopySource, error) { var ss SQLSource err := json.Unmarshal(body, &ss) return ss, err - case string(TypeRestSource): - var rs RestSource - err := json.Unmarshal(body, &rs) - return rs, err case string(TypeSapTableSource): var sts SapTableSource err := json.Unmarshal(body, &sts) @@ -51015,18 +52425,10 @@ func unmarshalBasicCopySource(body []byte) (BasicCopySource, error) { var scfcs SapCloudForCustomerSource err := json.Unmarshal(body, &scfcs) return scfcs, err - case string(TypeSalesforceServiceCloudSource): - var sscs SalesforceServiceCloudSource - err := json.Unmarshal(body, &sscs) - return sscs, err case string(TypeSalesforceSource): var ss SalesforceSource err := json.Unmarshal(body, &ss) return ss, err - case string(TypeODataSource): - var ods ODataSource - err := json.Unmarshal(body, &ods) - return ods, err case string(TypeSapBwSource): var sbs SapBwSource err := json.Unmarshal(body, &sbs) @@ -51051,46 +52453,26 @@ func unmarshalBasicCopySource(body []byte) (BasicCopySource, error) { var d2s Db2Source err := json.Unmarshal(body, &d2s) return d2s, err - case string(TypeMicrosoftAccessSource): - var mas MicrosoftAccessSource - err := json.Unmarshal(body, &mas) - return mas, err case string(TypeInformixSource): var is InformixSource err := json.Unmarshal(body, &is) return is, err - case string(TypeRelationalSource): - var rs RelationalSource - err := json.Unmarshal(body, &rs) - return rs, err - case string(TypeCommonDataServiceForAppsSource): - var cdsfas CommonDataServiceForAppsSource - err := json.Unmarshal(body, &cdsfas) - return cdsfas, err - case string(TypeDynamicsCrmSource): - var dcs DynamicsCrmSource - err := json.Unmarshal(body, &dcs) - return dcs, err - case string(TypeDynamicsSource): - var ds DynamicsSource - err := json.Unmarshal(body, &ds) - return ds, err - case string(TypeDocumentDbCollectionSource): - var ddcs DocumentDbCollectionSource - err := json.Unmarshal(body, &ddcs) - return ddcs, err - case string(TypeBlobSource): - var bs BlobSource - err := json.Unmarshal(body, &bs) - return bs, err case string(TypeAzureTableSource): var ats AzureTableSource err := json.Unmarshal(body, &ats) return ats, err + case string(TypeTabularSource): + var ts TabularSource + err := json.Unmarshal(body, &ts) + return ts, err case string(TypeBinarySource): var bs BinarySource err := json.Unmarshal(body, &bs) return bs, err + case string(TypeOrcSource): + var osVar OrcSource + err := json.Unmarshal(body, &osVar) + return osVar, err case string(TypeJSONSource): var js JSONSource err := json.Unmarshal(body, &js) @@ -51154,6 +52536,121 @@ func (cs CopySource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for CopySource. func (cs CopySource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -51329,81 +52826,21 @@ func (cs CopySource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for CopySource. func (cs CopySource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for CopySource. func (cs CopySource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for CopySource. func (cs CopySource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for CopySource. func (cs CopySource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -51429,11 +52866,6 @@ func (cs CopySource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for CopySource. func (cs CopySource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -51459,21 +52891,11 @@ func (cs CopySource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for CopySource. func (cs CopySource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for CopySource. func (cs CopySource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -51504,53 +52926,33 @@ func (cs CopySource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for CopySource. func (cs CopySource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for CopySource. -func (cs CopySource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -52243,12 +53645,75 @@ func (cdls *CosmosDbLinkedService) UnmarshalJSON(body []byte) error { type CosmosDbLinkedServiceTypeProperties struct { // ConnectionString - The connection string. Type: string, SecureString or AzureKeyVaultSecretReference. ConnectionString interface{} `json:"connectionString,omitempty"` - // AccountKey - The Azure key vault secret reference of accountKey in connection string. - AccountKey *AzureKeyVaultSecretReference `json:"accountKey,omitempty"` + // AccountEndpoint - The endpoint of the Azure CosmosDB account. Type: string (or Expression with resultType string) + AccountEndpoint interface{} `json:"accountEndpoint,omitempty"` + // Database - The name of the database. Type: string (or Expression with resultType string) + Database interface{} `json:"database,omitempty"` + // AccountKey - The account key of the Azure CosmosDB account. Type: SecureString or AzureKeyVaultSecretReference. + AccountKey BasicSecretBase `json:"accountKey,omitempty"` // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` } +// UnmarshalJSON is the custom unmarshaler for CosmosDbLinkedServiceTypeProperties struct. +func (cdlstp *CosmosDbLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "connectionString": + if v != nil { + var connectionString interface{} + err = json.Unmarshal(*v, &connectionString) + if err != nil { + return err + } + cdlstp.ConnectionString = connectionString + } + case "accountEndpoint": + if v != nil { + var accountEndpoint interface{} + err = json.Unmarshal(*v, &accountEndpoint) + if err != nil { + return err + } + cdlstp.AccountEndpoint = accountEndpoint + } + case "database": + if v != nil { + var databaseVar interface{} + err = json.Unmarshal(*v, &databaseVar) + if err != nil { + return err + } + cdlstp.Database = databaseVar + } + case "accountKey": + if v != nil { + accountKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + cdlstp.AccountKey = accountKey + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + cdlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + // CosmosDbMongoDbAPICollectionDataset the CosmosDB (MongoDB API) database dataset. type CosmosDbMongoDbAPICollectionDataset struct { // CosmosDbMongoDbAPICollectionDatasetTypeProperties - CosmosDB (MongoDB API) database dataset properties. @@ -52269,7 +53734,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -52670,6 +54135,11 @@ func (cdmdacd CosmosDbMongoDbAPICollectionDataset) AsDocumentDbCollectionDataset return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for CosmosDbMongoDbAPICollectionDataset. +func (cdmdacd CosmosDbMongoDbAPICollectionDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for CosmosDbMongoDbAPICollectionDataset. func (cdmdacd CosmosDbMongoDbAPICollectionDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -52710,6 +54180,11 @@ func (cdmdacd CosmosDbMongoDbAPICollectionDataset) AsBinaryDataset() (*BinaryDat return nil, false } +// AsOrcDataset is the BasicDataset implementation for CosmosDbMongoDbAPICollectionDataset. +func (cdmdacd CosmosDbMongoDbAPICollectionDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for CosmosDbMongoDbAPICollectionDataset. func (cdmdacd CosmosDbMongoDbAPICollectionDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -53475,7 +54950,7 @@ type CosmosDbMongoDbAPISink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -53605,6 +55080,11 @@ func (cdmdas CosmosDbMongoDbAPISink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for CosmosDbMongoDbAPISink. +func (cdmdas CosmosDbMongoDbAPISink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for CosmosDbMongoDbAPISink. func (cdmdas CosmosDbMongoDbAPISink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -53660,6 +55140,11 @@ func (cdmdas CosmosDbMongoDbAPISink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSi return nil, false } +// AsOrcSink is the BasicCopySink implementation for CosmosDbMongoDbAPISink. +func (cdmdas CosmosDbMongoDbAPISink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for CosmosDbMongoDbAPISink. func (cdmdas CosmosDbMongoDbAPISink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -53778,6 +55263,8 @@ type CosmosDbMongoDbAPISource struct { CursorMethods *MongoDbCursorMethodsProperties `json:"cursorMethods,omitempty"` // BatchSize - Specifies the number of documents to return in each batch of the response from MongoDB instance. In most cases, modifying the batch size will not affect the user or the application. This property's main purpose is to avoid hit the limitation of response size. Type: integer (or Expression with resultType integer). BatchSize interface{} `json:"batchSize,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -53786,7 +55273,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -53803,6 +55290,9 @@ func (cdmdas CosmosDbMongoDbAPISource) MarshalJSON() ([]byte, error) { if cdmdas.BatchSize != nil { objectMap["batchSize"] = cdmdas.BatchSize } + if cdmdas.QueryTimeout != nil { + objectMap["queryTimeout"] = cdmdas.QueryTimeout + } if cdmdas.SourceRetryCount != nil { objectMap["sourceRetryCount"] = cdmdas.SourceRetryCount } @@ -53821,6 +55311,121 @@ func (cdmdas CosmosDbMongoDbAPISource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return &cdmdas, true +} + +// AsMongoDbV2Source is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. func (cdmdas CosmosDbMongoDbAPISource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -53996,81 +55601,21 @@ func (cdmdas CosmosDbMongoDbAPISource) AsAmazonMWSSource() (*AmazonMWSSource, bo return nil, false } -// AsHTTPSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return &cdmdas, true -} - -// AsMongoDbV2Source is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. func (cdmdas CosmosDbMongoDbAPISource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. func (cdmdas CosmosDbMongoDbAPISource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. func (cdmdas CosmosDbMongoDbAPISource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. func (cdmdas CosmosDbMongoDbAPISource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -54096,11 +55641,6 @@ func (cdmdas CosmosDbMongoDbAPISource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. func (cdmdas CosmosDbMongoDbAPISource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -54126,21 +55666,11 @@ func (cdmdas CosmosDbMongoDbAPISource) AsSapCloudForCustomerSource() (*SapCloudF return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. func (cdmdas CosmosDbMongoDbAPISource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. func (cdmdas CosmosDbMongoDbAPISource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -54171,53 +55701,33 @@ func (cdmdas CosmosDbMongoDbAPISource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. func (cdmdas CosmosDbMongoDbAPISource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. -func (cdmdas CosmosDbMongoDbAPISource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -54287,6 +55797,15 @@ func (cdmdas *CosmosDbMongoDbAPISource) UnmarshalJSON(body []byte) error { } cdmdas.BatchSize = batchSize } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + cdmdas.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -54341,6 +55860,1538 @@ func (cdmdas *CosmosDbMongoDbAPISource) UnmarshalJSON(body []byte) error { return nil } +// CosmosDbSQLAPICollectionDataset microsoft Azure CosmosDB (SQL API) Collection dataset. +type CosmosDbSQLAPICollectionDataset struct { + // CosmosDbSQLAPICollectionDatasetTypeProperties - CosmosDB (SQL API) Collection dataset properties. + *CosmosDbSQLAPICollectionDatasetTypeProperties `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', '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 TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) MarshalJSON() ([]byte, error) { + cdsacd.Type = TypeCosmosDbSQLAPICollection + objectMap := make(map[string]interface{}) + if cdsacd.CosmosDbSQLAPICollectionDatasetTypeProperties != nil { + objectMap["typeProperties"] = cdsacd.CosmosDbSQLAPICollectionDatasetTypeProperties + } + if cdsacd.Description != nil { + objectMap["description"] = cdsacd.Description + } + if cdsacd.Structure != nil { + objectMap["structure"] = cdsacd.Structure + } + if cdsacd.Schema != nil { + objectMap["schema"] = cdsacd.Schema + } + if cdsacd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = cdsacd.LinkedServiceName + } + if cdsacd.Parameters != nil { + objectMap["parameters"] = cdsacd.Parameters + } + if cdsacd.Annotations != nil { + objectMap["annotations"] = cdsacd.Annotations + } + if cdsacd.Folder != nil { + objectMap["folder"] = cdsacd.Folder + } + if cdsacd.Type != "" { + objectMap["type"] = cdsacd.Type + } + for k, v := range cdsacd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsGoogleAdWordsObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsGoogleAdWordsObjectDataset() (*GoogleAdWordsObjectDataset, bool) { + return nil, false +} + +// AsAzureDataExplorerTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAzureDataExplorerTableDataset() (*AzureDataExplorerTableDataset, bool) { + return nil, false +} + +// AsOracleServiceCloudObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsOracleServiceCloudObjectDataset() (*OracleServiceCloudObjectDataset, bool) { + return nil, false +} + +// AsDynamicsAXResourceDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsDynamicsAXResourceDataset() (*DynamicsAXResourceDataset, bool) { + return nil, false +} + +// AsResponsysObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsAzureMariaDBTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAzureMariaDBTableDataset() (*AzureMariaDBTableDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSapTableResourceDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsSapTableResourceDataset() (*SapTableResourceDataset, bool) { + return nil, false +} + +// AsRestResourceDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsRestResourceDataset() (*RestResourceDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapOpenHubTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsSapOpenHubTableDataset() (*SapOpenHubTableDataset, bool) { + return nil, false +} + +// AsSapHanaTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsSapHanaTableDataset() (*SapHanaTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSapBwCubeDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsSapBwCubeDataset() (*SapBwCubeDataset, bool) { + return nil, false +} + +// AsSybaseTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsSybaseTableDataset() (*SybaseTableDataset, bool) { + return nil, false +} + +// AsSalesforceServiceCloudObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsSalesforceServiceCloudObjectDataset() (*SalesforceServiceCloudObjectDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsMicrosoftAccessTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsMicrosoftAccessTableDataset() (*MicrosoftAccessTableDataset, bool) { + return nil, false +} + +// AsPostgreSQLTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsPostgreSQLTableDataset() (*PostgreSQLTableDataset, bool) { + return nil, false +} + +// AsMySQLTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsMySQLTableDataset() (*MySQLTableDataset, bool) { + return nil, false +} + +// AsOdbcTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsOdbcTableDataset() (*OdbcTableDataset, bool) { + return nil, false +} + +// AsInformixTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsInformixTableDataset() (*InformixTableDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsDb2TableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsDb2TableDataset() (*Db2TableDataset, bool) { + return nil, false +} + +// AsAmazonRedshiftTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAmazonRedshiftTableDataset() (*AmazonRedshiftTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsTeradataTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsTeradataTableDataset() (*TeradataTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPICollectionDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsCosmosDbMongoDbAPICollectionDataset() (*CosmosDbMongoDbAPICollectionDataset, bool) { + return nil, false +} + +// AsMongoDbV2CollectionDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsMongoDbV2CollectionDataset() (*MongoDbV2CollectionDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsOffice365Dataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsOffice365Dataset() (*Office365Dataset, bool) { + return nil, false +} + +// AsAzureBlobFSDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAzureBlobFSDataset() (*AzureBlobFSDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsEntityDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsCommonDataServiceForAppsEntityDataset() (*CommonDataServiceForAppsEntityDataset, bool) { + return nil, false +} + +// AsDynamicsCrmEntityDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsDynamicsCrmEntityDataset() (*DynamicsCrmEntityDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return &cdsacd, true +} + +// AsCustomDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLMITableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAzureSQLMITableDataset() (*AzureSQLMITableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsBinaryDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsBinaryDataset() (*BinaryDataset, bool) { + return nil, false +} + +// AsOrcDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + +// AsJSONDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsJSONDataset() (*JSONDataset, bool) { + return nil, false +} + +// AsDelimitedTextDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsDelimitedTextDataset() (*DelimitedTextDataset, bool) { + return nil, false +} + +// AsParquetDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsParquetDataset() (*ParquetDataset, bool) { + return nil, false +} + +// AsAvroDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAvroDataset() (*AvroDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsBasicDataset() (BasicDataset, bool) { + return &cdsacd, true +} + +// UnmarshalJSON is the custom unmarshaler for CosmosDbSQLAPICollectionDataset struct. +func (cdsacd *CosmosDbSQLAPICollectionDataset) UnmarshalJSON(body []byte) error { + 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 cosmosDbSQLAPICollectionDatasetTypeProperties CosmosDbSQLAPICollectionDatasetTypeProperties + err = json.Unmarshal(*v, &cosmosDbSQLAPICollectionDatasetTypeProperties) + if err != nil { + return err + } + cdsacd.CosmosDbSQLAPICollectionDatasetTypeProperties = &cosmosDbSQLAPICollectionDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if cdsacd.AdditionalProperties == nil { + cdsacd.AdditionalProperties = make(map[string]interface{}) + } + cdsacd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + cdsacd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + cdsacd.Structure = structure + } + case "schema": + if v != nil { + var schema interface{} + err = json.Unmarshal(*v, &schema) + if err != nil { + return err + } + cdsacd.Schema = schema + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + cdsacd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + cdsacd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + cdsacd.Annotations = &annotations + } + case "folder": + if v != nil { + var folder DatasetFolder + err = json.Unmarshal(*v, &folder) + if err != nil { + return err + } + cdsacd.Folder = &folder + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cdsacd.Type = typeVar + } + } + } + + return nil +} + +// CosmosDbSQLAPICollectionDatasetTypeProperties cosmosDB (SQL API) Collection dataset properties. +type CosmosDbSQLAPICollectionDatasetTypeProperties struct { + // CollectionName - CosmosDB (SQL API) collection name. Type: string (or Expression with resultType string). + CollectionName interface{} `json:"collectionName,omitempty"` +} + +// CosmosDbSQLAPISink a copy activity Azure CosmosDB (SQL API) Collection sink. +type CosmosDbSQLAPISink struct { + // WriteBehavior - Describes how to write data to Azure Cosmos DB. Type: string (or Expression with resultType string). Allowed values: insert and upsert. + WriteBehavior interface{} `json:"writeBehavior,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). + MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) MarshalJSON() ([]byte, error) { + cdsas.Type = TypeCosmosDbSQLAPISink + objectMap := make(map[string]interface{}) + if cdsas.WriteBehavior != nil { + objectMap["writeBehavior"] = cdsas.WriteBehavior + } + if cdsas.WriteBatchSize != nil { + objectMap["writeBatchSize"] = cdsas.WriteBatchSize + } + if cdsas.WriteBatchTimeout != nil { + objectMap["writeBatchTimeout"] = cdsas.WriteBatchTimeout + } + if cdsas.SinkRetryCount != nil { + objectMap["sinkRetryCount"] = cdsas.SinkRetryCount + } + if cdsas.SinkRetryWait != nil { + objectMap["sinkRetryWait"] = cdsas.SinkRetryWait + } + if cdsas.MaxConcurrentConnections != nil { + objectMap["maxConcurrentConnections"] = cdsas.MaxConcurrentConnections + } + if cdsas.Type != "" { + objectMap["type"] = cdsas.Type + } + for k, v := range cdsas.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsCosmosDbMongoDbAPISink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsCosmosDbMongoDbAPISink() (*CosmosDbMongoDbAPISink, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsSalesforceServiceCloudSink() (*SalesforceServiceCloudSink, bool) { + return nil, false +} + +// AsSalesforceSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsAzureDataExplorerSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsAzureDataExplorerSink() (*AzureDataExplorerSink, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsCommonDataServiceForAppsSink() (*CommonDataServiceForAppsSink, bool) { + return nil, false +} + +// AsDynamicsCrmSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsDynamicsCrmSink() (*DynamicsCrmSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsMicrosoftAccessSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsMicrosoftAccessSink() (*MicrosoftAccessSink, bool) { + return nil, false +} + +// AsInformixSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsInformixSink() (*InformixSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureBlobFSSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsAzureBlobFSSink() (*AzureBlobFSSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLMISink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsSQLMISink() (*SQLMISink, bool) { + return nil, false +} + +// AsAzureSQLSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsAzureSQLSink() (*AzureSQLSink, bool) { + return nil, false +} + +// AsSQLServerSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsSQLServerSink() (*SQLServerSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return &cdsas, true +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsBinarySink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsBinarySink() (*BinarySink, bool) { + return nil, false +} + +// AsParquetSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsParquetSink() (*ParquetSink, bool) { + return nil, false +} + +// AsAvroSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsAvroSink() (*AvroSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsAzureMySQLSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsAzureMySQLSink() (*AzureMySQLSink, bool) { + return nil, false +} + +// AsAzurePostgreSQLSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { + return nil, false +} + +// AsOrcSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + +// AsJSONSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsJSONSink() (*JSONSink, bool) { + return nil, false +} + +// AsDelimitedTextSink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsDelimitedTextSink() (*DelimitedTextSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for CosmosDbSQLAPISink. +func (cdsas CosmosDbSQLAPISink) AsBasicCopySink() (BasicCopySink, bool) { + return &cdsas, true +} + +// UnmarshalJSON is the custom unmarshaler for CosmosDbSQLAPISink struct. +func (cdsas *CosmosDbSQLAPISink) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "writeBehavior": + if v != nil { + var writeBehavior interface{} + err = json.Unmarshal(*v, &writeBehavior) + if err != nil { + return err + } + cdsas.WriteBehavior = writeBehavior + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if cdsas.AdditionalProperties == nil { + cdsas.AdditionalProperties = make(map[string]interface{}) + } + cdsas.AdditionalProperties[k] = additionalProperties + } + case "writeBatchSize": + if v != nil { + var writeBatchSize interface{} + err = json.Unmarshal(*v, &writeBatchSize) + if err != nil { + return err + } + cdsas.WriteBatchSize = writeBatchSize + } + case "writeBatchTimeout": + if v != nil { + var writeBatchTimeout interface{} + err = json.Unmarshal(*v, &writeBatchTimeout) + if err != nil { + return err + } + cdsas.WriteBatchTimeout = writeBatchTimeout + } + case "sinkRetryCount": + if v != nil { + var sinkRetryCount interface{} + err = json.Unmarshal(*v, &sinkRetryCount) + if err != nil { + return err + } + cdsas.SinkRetryCount = sinkRetryCount + } + case "sinkRetryWait": + if v != nil { + var sinkRetryWait interface{} + err = json.Unmarshal(*v, &sinkRetryWait) + if err != nil { + return err + } + cdsas.SinkRetryWait = sinkRetryWait + } + case "maxConcurrentConnections": + if v != nil { + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) + if err != nil { + return err + } + cdsas.MaxConcurrentConnections = maxConcurrentConnections + } + case "type": + if v != nil { + var typeVar TypeBasicCopySink + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cdsas.Type = typeVar + } + } + } + + return nil +} + +// CosmosDbSQLAPISource a copy activity Azure CosmosDB (SQL API) Collection source. +type CosmosDbSQLAPISource struct { + // Query - SQL API query. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // PageSize - Page size of the result. Type: integer (or Expression with resultType integer). + PageSize interface{} `json:"pageSize,omitempty"` + // PreferredRegions - Preferred regions. Type: array of strings (or Expression with resultType array of strings). + PreferredRegions interface{} `json:"preferredRegions,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', '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 TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) MarshalJSON() ([]byte, error) { + cdsas.Type = TypeCosmosDbSQLAPISource + objectMap := make(map[string]interface{}) + if cdsas.Query != nil { + objectMap["query"] = cdsas.Query + } + if cdsas.PageSize != nil { + objectMap["pageSize"] = cdsas.PageSize + } + if cdsas.PreferredRegions != nil { + objectMap["preferredRegions"] = cdsas.PreferredRegions + } + if cdsas.SourceRetryCount != nil { + objectMap["sourceRetryCount"] = cdsas.SourceRetryCount + } + if cdsas.SourceRetryWait != nil { + objectMap["sourceRetryWait"] = cdsas.SourceRetryWait + } + if cdsas.MaxConcurrentConnections != nil { + objectMap["maxConcurrentConnections"] = cdsas.MaxConcurrentConnections + } + if cdsas.Type != "" { + objectMap["type"] = cdsas.Type + } + for k, v := range cdsas.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsHTTPSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return &cdsas, true +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsGoogleAdWordsSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsGoogleAdWordsSource() (*GoogleAdWordsSource, bool) { + return nil, false +} + +// AsOracleServiceCloudSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsOracleServiceCloudSource() (*OracleServiceCloudSource, bool) { + return nil, false +} + +// AsDynamicsAXSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsDynamicsAXSource() (*DynamicsAXSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsAzureMariaDBSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsAzureMariaDBSource() (*AzureMariaDBSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsTeradataSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsTeradataSource() (*TeradataSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLMISource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSQLMISource() (*SQLMISource, bool) { + return nil, false +} + +// AsAzureSQLSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsAzureSQLSource() (*AzureSQLSource, bool) { + return nil, false +} + +// AsSQLServerSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSQLServerSource() (*SQLServerSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapTableSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSapTableSource() (*SapTableSource, bool) { + return nil, false +} + +// AsSapOpenHubSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSapOpenHubSource() (*SapOpenHubSource, bool) { + return nil, false +} + +// AsSapHanaSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSapHanaSource() (*SapHanaSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsSapBwSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSapBwSource() (*SapBwSource, bool) { + return nil, false +} + +// AsSybaseSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsSybaseSource() (*SybaseSource, bool) { + return nil, false +} + +// AsPostgreSQLSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsPostgreSQLSource() (*PostgreSQLSource, bool) { + return nil, false +} + +// AsMySQLSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsMySQLSource() (*MySQLSource, bool) { + return nil, false +} + +// AsOdbcSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsOdbcSource() (*OdbcSource, bool) { + return nil, false +} + +// AsDb2Source is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsDb2Source() (*Db2Source, bool) { + return nil, false +} + +// AsInformixSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsInformixSource() (*InformixSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsTabularSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsTabularSource() (*TabularSource, bool) { + return nil, false +} + +// AsBasicTabularSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsBasicTabularSource() (BasicTabularSource, bool) { + return nil, false +} + +// AsBinarySource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsBinarySource() (*BinarySource, bool) { + return nil, false +} + +// AsOrcSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsOrcSource() (*OrcSource, bool) { + return nil, false +} + +// AsJSONSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsJSONSource() (*JSONSource, bool) { + return nil, false +} + +// AsDelimitedTextSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsDelimitedTextSource() (*DelimitedTextSource, bool) { + return nil, false +} + +// AsParquetSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsParquetSource() (*ParquetSource, bool) { + return nil, false +} + +// AsAvroSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsAvroSource() (*AvroSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsBasicCopySource() (BasicCopySource, bool) { + return &cdsas, true +} + +// UnmarshalJSON is the custom unmarshaler for CosmosDbSQLAPISource struct. +func (cdsas *CosmosDbSQLAPISource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "query": + if v != nil { + var query interface{} + err = json.Unmarshal(*v, &query) + if err != nil { + return err + } + cdsas.Query = query + } + case "pageSize": + if v != nil { + var pageSize interface{} + err = json.Unmarshal(*v, &pageSize) + if err != nil { + return err + } + cdsas.PageSize = pageSize + } + case "preferredRegions": + if v != nil { + var preferredRegions interface{} + err = json.Unmarshal(*v, &preferredRegions) + if err != nil { + return err + } + cdsas.PreferredRegions = preferredRegions + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if cdsas.AdditionalProperties == nil { + cdsas.AdditionalProperties = make(map[string]interface{}) + } + cdsas.AdditionalProperties[k] = additionalProperties + } + case "sourceRetryCount": + if v != nil { + var sourceRetryCount interface{} + err = json.Unmarshal(*v, &sourceRetryCount) + if err != nil { + return err + } + cdsas.SourceRetryCount = sourceRetryCount + } + case "sourceRetryWait": + if v != nil { + var sourceRetryWait interface{} + err = json.Unmarshal(*v, &sourceRetryWait) + if err != nil { + return err + } + cdsas.SourceRetryWait = sourceRetryWait + } + case "maxConcurrentConnections": + if v != nil { + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) + if err != nil { + return err + } + cdsas.MaxConcurrentConnections = maxConcurrentConnections + } + case "type": + if v != nil { + var typeVar TypeBasicCopySource + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cdsas.Type = typeVar + } + } + } + + return nil +} + // CouchbaseLinkedService couchbase server linked service. type CouchbaseLinkedService struct { // CouchbaseLinkedServiceTypeProperties - Couchbase server linked service properties. @@ -54947,6 +57998,8 @@ type CouchbaseLinkedServiceTypeProperties struct { type CouchbaseSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -54955,7 +58008,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -54966,6 +58019,9 @@ func (cs CouchbaseSource) MarshalJSON() ([]byte, error) { if cs.Query != nil { objectMap["query"] = cs.Query } + if cs.QueryTimeout != nil { + objectMap["queryTimeout"] = cs.QueryTimeout + } if cs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = cs.SourceRetryCount } @@ -54984,6 +58040,121 @@ func (cs CouchbaseSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for CouchbaseSource. func (cs CouchbaseSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -55159,81 +58330,21 @@ func (cs CouchbaseSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for CouchbaseSource. func (cs CouchbaseSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for CouchbaseSource. func (cs CouchbaseSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for CouchbaseSource. func (cs CouchbaseSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for CouchbaseSource. func (cs CouchbaseSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -55259,11 +58370,6 @@ func (cs CouchbaseSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for CouchbaseSource. func (cs CouchbaseSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -55289,21 +58395,11 @@ func (cs CouchbaseSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSou return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for CouchbaseSource. func (cs CouchbaseSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for CouchbaseSource. func (cs CouchbaseSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -55334,53 +58430,33 @@ func (cs CouchbaseSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for CouchbaseSource. func (cs CouchbaseSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &cs, true } -// AsAzureTableSource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for CouchbaseSource. -func (cs CouchbaseSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -55432,6 +58508,15 @@ func (cs *CouchbaseSource) UnmarshalJSON(body []byte) error { } cs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + cs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -55506,7 +58591,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -55907,6 +58992,11 @@ func (ctd CouchbaseTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCol return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for CouchbaseTableDataset. func (ctd CouchbaseTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -55947,6 +59037,11 @@ func (ctd CouchbaseTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for CouchbaseTableDataset. func (ctd CouchbaseTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -56090,6 +59185,27 @@ func (ctd *CouchbaseTableDataset) UnmarshalJSON(body []byte) error { return nil } +// CreateDataFlowDebugSessionRequest request body structure for creating data flow debug session. +type CreateDataFlowDebugSessionRequest struct { + // ComputeType - Compute type of the cluster. The value will be overwritten by the same setting in integration runtime if provided. + ComputeType *string `json:"computeType,omitempty"` + // CoreCount - Core count of the cluster. The value will be overwritten by the same setting in integration runtime if provided. + CoreCount *int32 `json:"coreCount,omitempty"` + // TimeToLive - Time to live setting of the cluster in minutes. + TimeToLive *int32 `json:"timeToLive,omitempty"` + // IntegrationRuntime - Set to use integration runtime setting for data flow debug session. + IntegrationRuntime *IntegrationRuntimeResource `json:"integrationRuntime,omitempty"` +} + +// CreateDataFlowDebugSessionResponse response body structure for creating data flow debug session. +type CreateDataFlowDebugSessionResponse struct { + autorest.Response `json:"-"` + // Status - The state of the debug session. + Status *string `json:"status,omitempty"` + // SessionID - The ID of data flow debug session. + SessionID *string `json:"sessionId,omitempty"` +} + // CreateLinkedIntegrationRuntimeRequest the linked integration runtime information. type CreateLinkedIntegrationRuntimeRequest struct { // Name - The name of the linked integration runtime. @@ -56127,7 +59243,7 @@ type CustomActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -56165,6 +59281,11 @@ func (ca CustomActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for CustomActivity. func (ca CustomActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -56517,7 +59638,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -56918,6 +60039,11 @@ func (cd CustomDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDa return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for CustomDataset. func (cd CustomDataset) AsCustomDataset() (*CustomDataset, bool) { return &cd, true @@ -56958,6 +60084,11 @@ func (cd CustomDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for CustomDataset. func (cd CustomDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -57693,6 +60824,100 @@ func (cdsls *CustomDataSourceLinkedService) UnmarshalJSON(body []byte) error { return nil } +// BasicCustomSetupBase the base definition of the custom setup. +type BasicCustomSetupBase interface { + AsComponentSetup() (*ComponentSetup, bool) + AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) + AsCmdkeySetup() (*CmdkeySetup, bool) + AsCustomSetupBase() (*CustomSetupBase, bool) +} + +// CustomSetupBase the base definition of the custom setup. +type CustomSetupBase struct { + // Type - Possible values include: 'TypeCustomSetupBase', 'TypeComponentSetup', 'TypeEnvironmentVariableSetup', 'TypeCmdkeySetup' + Type TypeBasicCustomSetupBase `json:"type,omitempty"` +} + +func unmarshalBasicCustomSetupBase(body []byte) (BasicCustomSetupBase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeComponentSetup): + var cs ComponentSetup + err := json.Unmarshal(body, &cs) + return cs, err + case string(TypeEnvironmentVariableSetup): + var evs EnvironmentVariableSetup + err := json.Unmarshal(body, &evs) + return evs, err + case string(TypeCmdkeySetup): + var cs CmdkeySetup + err := json.Unmarshal(body, &cs) + return cs, err + default: + var csb CustomSetupBase + err := json.Unmarshal(body, &csb) + return csb, err + } +} +func unmarshalBasicCustomSetupBaseArray(body []byte) ([]BasicCustomSetupBase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + csbArray := make([]BasicCustomSetupBase, len(rawMessages)) + + for index, rawMessage := range rawMessages { + csb, err := unmarshalBasicCustomSetupBase(*rawMessage) + if err != nil { + return nil, err + } + csbArray[index] = csb + } + return csbArray, nil +} + +// MarshalJSON is the custom marshaler for CustomSetupBase. +func (csb CustomSetupBase) MarshalJSON() ([]byte, error) { + csb.Type = TypeCustomSetupBase + objectMap := make(map[string]interface{}) + if csb.Type != "" { + objectMap["type"] = csb.Type + } + return json.Marshal(objectMap) +} + +// AsComponentSetup is the BasicCustomSetupBase implementation for CustomSetupBase. +func (csb CustomSetupBase) AsComponentSetup() (*ComponentSetup, bool) { + return nil, false +} + +// AsEnvironmentVariableSetup is the BasicCustomSetupBase implementation for CustomSetupBase. +func (csb CustomSetupBase) AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) { + return nil, false +} + +// AsCmdkeySetup is the BasicCustomSetupBase implementation for CustomSetupBase. +func (csb CustomSetupBase) AsCmdkeySetup() (*CmdkeySetup, bool) { + return nil, false +} + +// AsCustomSetupBase is the BasicCustomSetupBase implementation for CustomSetupBase. +func (csb CustomSetupBase) AsCustomSetupBase() (*CustomSetupBase, bool) { + return &csb, true +} + +// AsBasicCustomSetupBase is the BasicCustomSetupBase implementation for CustomSetupBase. +func (csb CustomSetupBase) AsBasicCustomSetupBase() (BasicCustomSetupBase, bool) { + return &csb, true +} + // DatabricksNotebookActivity databricksNotebook activity. type DatabricksNotebookActivity struct { // DatabricksNotebookActivityTypeProperties - Databricks Notebook activity properties. @@ -57711,7 +60936,7 @@ type DatabricksNotebookActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -57749,6 +60974,11 @@ func (dna DatabricksNotebookActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for DatabricksNotebookActivity. func (dna DatabricksNotebookActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -58076,7 +61306,7 @@ type DatabricksSparkJarActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -58114,6 +61344,11 @@ func (dsja DatabricksSparkJarActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for DatabricksSparkJarActivity. +func (dsja DatabricksSparkJarActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for DatabricksSparkJarActivity. func (dsja DatabricksSparkJarActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -58426,7 +61661,7 @@ type DatabricksSparkPythonActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -58464,6 +61699,11 @@ func (dspa DatabricksSparkPythonActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for DatabricksSparkPythonActivity. +func (dspa DatabricksSparkPythonActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for DatabricksSparkPythonActivity. func (dspa DatabricksSparkPythonActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -58758,6 +61998,839 @@ type DatabricksSparkPythonActivityTypeProperties struct { Libraries *[]map[string]interface{} `json:"libraries,omitempty"` } +// BasicDataFlow azure Data Factory nested object which contains a flow with data movements and transformations. +type BasicDataFlow interface { + AsMappingDataFlow() (*MappingDataFlow, bool) + AsDataFlow() (*DataFlow, bool) +} + +// DataFlow azure Data Factory nested object which contains a flow with data movements and transformations. +type DataFlow struct { + // Description - The description of the data flow. + Description *string `json:"description,omitempty"` + // Annotations - List of tags that can be used for describing the data flow. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Folder - The folder that this data flow is in. If not specified, Data flow will appear at the root level. + Folder *DataFlowFolder `json:"folder,omitempty"` + // Type - Possible values include: 'TypeDataFlow', 'TypeMappingDataFlow' + Type TypeBasicDataFlow `json:"type,omitempty"` +} + +func unmarshalBasicDataFlow(body []byte) (BasicDataFlow, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeMappingDataFlow): + var mdf MappingDataFlow + err := json.Unmarshal(body, &mdf) + return mdf, err + default: + var df DataFlow + err := json.Unmarshal(body, &df) + return df, err + } +} +func unmarshalBasicDataFlowArray(body []byte) ([]BasicDataFlow, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dfArray := make([]BasicDataFlow, len(rawMessages)) + + for index, rawMessage := range rawMessages { + df, err := unmarshalBasicDataFlow(*rawMessage) + if err != nil { + return nil, err + } + dfArray[index] = df + } + return dfArray, nil +} + +// MarshalJSON is the custom marshaler for DataFlow. +func (df DataFlow) MarshalJSON() ([]byte, error) { + df.Type = TypeDataFlow + objectMap := make(map[string]interface{}) + if df.Description != nil { + objectMap["description"] = df.Description + } + if df.Annotations != nil { + objectMap["annotations"] = df.Annotations + } + if df.Folder != nil { + objectMap["folder"] = df.Folder + } + if df.Type != "" { + objectMap["type"] = df.Type + } + return json.Marshal(objectMap) +} + +// AsMappingDataFlow is the BasicDataFlow implementation for DataFlow. +func (df DataFlow) AsMappingDataFlow() (*MappingDataFlow, bool) { + return nil, false +} + +// AsDataFlow is the BasicDataFlow implementation for DataFlow. +func (df DataFlow) AsDataFlow() (*DataFlow, bool) { + return &df, true +} + +// AsBasicDataFlow is the BasicDataFlow implementation for DataFlow. +func (df DataFlow) AsBasicDataFlow() (BasicDataFlow, bool) { + return &df, true +} + +// DataFlowDebugCommandPayload structure of command payload. +type DataFlowDebugCommandPayload struct { + // StreamName - The stream name which is used for preview. + StreamName *string `json:"streamName,omitempty"` + // RowLimits - Row limits for preview response. + RowLimits *int32 `json:"rowLimits,omitempty"` + // Columns - Array of column names. + Columns *[]string `json:"columns,omitempty"` + // Expression - The expression which is used for preview. + Expression *string `json:"expression,omitempty"` +} + +// DataFlowDebugCommandRequest request body structure for data flow debug command. +type DataFlowDebugCommandRequest struct { + // SessionID - The ID of data flow debug session. + SessionID *string `json:"sessionId,omitempty"` + // Command - The command type. Possible values include: 'ExecutePreviewQuery', 'ExecuteStatisticsQuery', 'ExecuteExpressionQuery' + Command DataFlowDebugCommandType `json:"command,omitempty"` + // CommandPayload - The command payload object. + CommandPayload *DataFlowDebugCommandPayload `json:"commandPayload,omitempty"` +} + +// DataFlowDebugCommandResponse response body structure of data flow result for data preview, statistics or +// expression preview. +type DataFlowDebugCommandResponse struct { + autorest.Response `json:"-"` + // Status - The run status of data preview, statistics or expression preview. + Status *string `json:"status,omitempty"` + // Data - The result data of data preview, statistics or expression preview. + Data *string `json:"data,omitempty"` +} + +// DataFlowDebugPackage request body structure for starting data flow debug session. +type DataFlowDebugPackage struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SessionID - The ID of data flow debug session. + SessionID *string `json:"sessionId,omitempty"` + // DataFlow - Data flow instance. + DataFlow *DataFlowResource `json:"dataFlow,omitempty"` + // Datasets - List of datasets. + Datasets *[]DatasetResource `json:"datasets,omitempty"` + // LinkedServices - List of linked services. + LinkedServices *[]LinkedServiceResource `json:"linkedServices,omitempty"` + // Staging - Staging info for debug session. + Staging *DataFlowStagingInfo `json:"staging,omitempty"` + // DebugSettings - Data flow debug settings. + DebugSettings *DataFlowDebugPackageDebugSettings `json:"debugSettings,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataFlowDebugPackage. +func (dfdp DataFlowDebugPackage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dfdp.SessionID != nil { + objectMap["sessionId"] = dfdp.SessionID + } + if dfdp.DataFlow != nil { + objectMap["dataFlow"] = dfdp.DataFlow + } + if dfdp.Datasets != nil { + objectMap["datasets"] = dfdp.Datasets + } + if dfdp.LinkedServices != nil { + objectMap["linkedServices"] = dfdp.LinkedServices + } + if dfdp.Staging != nil { + objectMap["staging"] = dfdp.Staging + } + if dfdp.DebugSettings != nil { + objectMap["debugSettings"] = dfdp.DebugSettings + } + for k, v := range dfdp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DataFlowDebugPackage struct. +func (dfdp *DataFlowDebugPackage) UnmarshalJSON(body []byte) 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 dfdp.AdditionalProperties == nil { + dfdp.AdditionalProperties = make(map[string]interface{}) + } + dfdp.AdditionalProperties[k] = additionalProperties + } + case "sessionId": + if v != nil { + var sessionID string + err = json.Unmarshal(*v, &sessionID) + if err != nil { + return err + } + dfdp.SessionID = &sessionID + } + case "dataFlow": + if v != nil { + var dataFlow DataFlowResource + err = json.Unmarshal(*v, &dataFlow) + if err != nil { + return err + } + dfdp.DataFlow = &dataFlow + } + case "datasets": + if v != nil { + var datasets []DatasetResource + err = json.Unmarshal(*v, &datasets) + if err != nil { + return err + } + dfdp.Datasets = &datasets + } + case "linkedServices": + if v != nil { + var linkedServices []LinkedServiceResource + err = json.Unmarshal(*v, &linkedServices) + if err != nil { + return err + } + dfdp.LinkedServices = &linkedServices + } + case "staging": + if v != nil { + var staging DataFlowStagingInfo + err = json.Unmarshal(*v, &staging) + if err != nil { + return err + } + dfdp.Staging = &staging + } + case "debugSettings": + if v != nil { + var debugSettings DataFlowDebugPackageDebugSettings + err = json.Unmarshal(*v, &debugSettings) + if err != nil { + return err + } + dfdp.DebugSettings = &debugSettings + } + } + } + + return nil +} + +// DataFlowDebugPackageDebugSettings data flow debug settings. +type DataFlowDebugPackageDebugSettings struct { + // SourceSettings - Source setting for data flow debug. + SourceSettings *[]DataFlowSourceSetting `json:"sourceSettings,omitempty"` + // Parameters - Data flow parameters. + Parameters map[string]interface{} `json:"parameters"` + // DatasetParameters - Parameters for dataset. + DatasetParameters interface{} `json:"datasetParameters,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataFlowDebugPackageDebugSettings. +func (dfdpS DataFlowDebugPackageDebugSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dfdpS.SourceSettings != nil { + objectMap["sourceSettings"] = dfdpS.SourceSettings + } + if dfdpS.Parameters != nil { + objectMap["parameters"] = dfdpS.Parameters + } + if dfdpS.DatasetParameters != nil { + objectMap["datasetParameters"] = dfdpS.DatasetParameters + } + return json.Marshal(objectMap) +} + +// DataFlowDebugSessionCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DataFlowDebugSessionCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DataFlowDebugSessionCreateFuture) Result(client DataFlowDebugSessionClient) (cdfdsr CreateDataFlowDebugSessionResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datafactory.DataFlowDebugSessionCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cdfdsr.Response.Response, err = future.GetResult(sender); err == nil && cdfdsr.Response.Response.StatusCode != http.StatusNoContent { + cdfdsr, err = client.CreateResponder(cdfdsr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionCreateFuture", "Result", cdfdsr.Response.Response, "Failure responding to request") + } + } + return +} + +// DataFlowDebugSessionExecuteCommandFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DataFlowDebugSessionExecuteCommandFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DataFlowDebugSessionExecuteCommandFuture) Result(client DataFlowDebugSessionClient) (dfdcr DataFlowDebugCommandResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionExecuteCommandFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datafactory.DataFlowDebugSessionExecuteCommandFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dfdcr.Response.Response, err = future.GetResult(sender); err == nil && dfdcr.Response.Response.StatusCode != http.StatusNoContent { + dfdcr, err = client.ExecuteCommandResponder(dfdcr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DataFlowDebugSessionExecuteCommandFuture", "Result", dfdcr.Response.Response, "Failure responding to request") + } + } + return +} + +// DataFlowDebugSessionInfo data flow debug session info. +type DataFlowDebugSessionInfo struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // DataFlowName - The name of the data flow. + DataFlowName *string `json:"dataFlowName,omitempty"` + // ComputeType - Compute type of the cluster. + ComputeType *string `json:"computeType,omitempty"` + // CoreCount - Core count of the cluster. + CoreCount *int32 `json:"coreCount,omitempty"` + // NodeCount - Node count of the cluster. (deprecated property) + NodeCount *int32 `json:"nodeCount,omitempty"` + // IntegrationRuntimeName - Attached integration runtime name of data flow debug session. + IntegrationRuntimeName *string `json:"integrationRuntimeName,omitempty"` + // SessionID - The ID of data flow debug session. + SessionID *string `json:"sessionId,omitempty"` + // StartTime - Start time of data flow debug session. + StartTime *string `json:"startTime,omitempty"` + // TimeToLiveInMinutes - Compute type of the cluster. + TimeToLiveInMinutes *int32 `json:"timeToLiveInMinutes,omitempty"` + // LastActivityTime - Last activity time of data flow debug session. + LastActivityTime *string `json:"lastActivityTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataFlowDebugSessionInfo. +func (dfdsi DataFlowDebugSessionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dfdsi.DataFlowName != nil { + objectMap["dataFlowName"] = dfdsi.DataFlowName + } + if dfdsi.ComputeType != nil { + objectMap["computeType"] = dfdsi.ComputeType + } + if dfdsi.CoreCount != nil { + objectMap["coreCount"] = dfdsi.CoreCount + } + if dfdsi.NodeCount != nil { + objectMap["nodeCount"] = dfdsi.NodeCount + } + if dfdsi.IntegrationRuntimeName != nil { + objectMap["integrationRuntimeName"] = dfdsi.IntegrationRuntimeName + } + if dfdsi.SessionID != nil { + objectMap["sessionId"] = dfdsi.SessionID + } + if dfdsi.StartTime != nil { + objectMap["startTime"] = dfdsi.StartTime + } + if dfdsi.TimeToLiveInMinutes != nil { + objectMap["timeToLiveInMinutes"] = dfdsi.TimeToLiveInMinutes + } + if dfdsi.LastActivityTime != nil { + objectMap["lastActivityTime"] = dfdsi.LastActivityTime + } + for k, v := range dfdsi.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DataFlowDebugSessionInfo struct. +func (dfdsi *DataFlowDebugSessionInfo) UnmarshalJSON(body []byte) 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 dfdsi.AdditionalProperties == nil { + dfdsi.AdditionalProperties = make(map[string]interface{}) + } + dfdsi.AdditionalProperties[k] = additionalProperties + } + case "dataFlowName": + if v != nil { + var dataFlowName string + err = json.Unmarshal(*v, &dataFlowName) + if err != nil { + return err + } + dfdsi.DataFlowName = &dataFlowName + } + case "computeType": + if v != nil { + var computeType string + err = json.Unmarshal(*v, &computeType) + if err != nil { + return err + } + dfdsi.ComputeType = &computeType + } + case "coreCount": + if v != nil { + var coreCount int32 + err = json.Unmarshal(*v, &coreCount) + if err != nil { + return err + } + dfdsi.CoreCount = &coreCount + } + case "nodeCount": + if v != nil { + var nodeCount int32 + err = json.Unmarshal(*v, &nodeCount) + if err != nil { + return err + } + dfdsi.NodeCount = &nodeCount + } + case "integrationRuntimeName": + if v != nil { + var integrationRuntimeName string + err = json.Unmarshal(*v, &integrationRuntimeName) + if err != nil { + return err + } + dfdsi.IntegrationRuntimeName = &integrationRuntimeName + } + case "sessionId": + if v != nil { + var sessionID string + err = json.Unmarshal(*v, &sessionID) + if err != nil { + return err + } + dfdsi.SessionID = &sessionID + } + case "startTime": + if v != nil { + var startTime string + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + dfdsi.StartTime = &startTime + } + case "timeToLiveInMinutes": + if v != nil { + var timeToLiveInMinutes int32 + err = json.Unmarshal(*v, &timeToLiveInMinutes) + if err != nil { + return err + } + dfdsi.TimeToLiveInMinutes = &timeToLiveInMinutes + } + case "lastActivityTime": + if v != nil { + var lastActivityTime string + err = json.Unmarshal(*v, &lastActivityTime) + if err != nil { + return err + } + dfdsi.LastActivityTime = &lastActivityTime + } + } + } + + return nil +} + +// DataFlowFolder the folder that this data flow is in. If not specified, Data flow will appear at the root +// level. +type DataFlowFolder struct { + // Name - The name of the folder that this data flow is in. + Name *string `json:"name,omitempty"` +} + +// DataFlowListResponse a list of data flow resources. +type DataFlowListResponse struct { + autorest.Response `json:"-"` + // Value - List of data flows. + Value *[]DataFlowResource `json:"value,omitempty"` + // NextLink - The link to the next page of results, if any remaining results exist. + NextLink *string `json:"nextLink,omitempty"` +} + +// DataFlowListResponseIterator provides access to a complete listing of DataFlowResource values. +type DataFlowListResponseIterator struct { + i int + page DataFlowListResponsePage +} + +// 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 *DataFlowListResponseIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataFlowListResponseIterator.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 *DataFlowListResponseIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DataFlowListResponseIterator) 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 DataFlowListResponseIterator) Response() DataFlowListResponse { + 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 DataFlowListResponseIterator) Value() DataFlowResource { + if !iter.page.NotDone() { + return DataFlowResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DataFlowListResponseIterator type. +func NewDataFlowListResponseIterator(page DataFlowListResponsePage) DataFlowListResponseIterator { + return DataFlowListResponseIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dflr DataFlowListResponse) IsEmpty() bool { + return dflr.Value == nil || len(*dflr.Value) == 0 +} + +// dataFlowListResponsePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dflr DataFlowListResponse) dataFlowListResponsePreparer(ctx context.Context) (*http.Request, error) { + if dflr.NextLink == nil || len(to.String(dflr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dflr.NextLink))) +} + +// DataFlowListResponsePage contains a page of DataFlowResource values. +type DataFlowListResponsePage struct { + fn func(context.Context, DataFlowListResponse) (DataFlowListResponse, error) + dflr DataFlowListResponse +} + +// 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 *DataFlowListResponsePage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataFlowListResponsePage.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.dflr) + if err != nil { + return err + } + page.dflr = 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 *DataFlowListResponsePage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DataFlowListResponsePage) NotDone() bool { + return !page.dflr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DataFlowListResponsePage) Response() DataFlowListResponse { + return page.dflr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DataFlowListResponsePage) Values() []DataFlowResource { + if page.dflr.IsEmpty() { + return nil + } + return *page.dflr.Value +} + +// Creates a new instance of the DataFlowListResponsePage type. +func NewDataFlowListResponsePage(getNextPage func(context.Context, DataFlowListResponse) (DataFlowListResponse, error)) DataFlowListResponsePage { + return DataFlowListResponsePage{fn: getNextPage} +} + +// DataFlowReference data flow reference type. +type DataFlowReference struct { + // Type - Data flow reference type. + Type *string `json:"type,omitempty"` + // ReferenceName - Reference data flow name. + ReferenceName *string `json:"referenceName,omitempty"` + // DatasetParameters - Reference data flow parameters from dataset. + DatasetParameters interface{} `json:"datasetParameters,omitempty"` +} + +// DataFlowResource data flow resource type. +type DataFlowResource struct { + autorest.Response `json:"-"` + // Properties - Data flow properties. + Properties BasicDataFlow `json:"properties,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"` + // Etag - READ-ONLY; Etag identifies change in the resource. + Etag *string `json:"etag,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataFlowResource struct. +func (dfr *DataFlowResource) UnmarshalJSON(body []byte) error { + var m map[string]*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 := unmarshalBasicDataFlow(*v) + if err != nil { + return err + } + dfr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dfr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dfr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dfr.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + dfr.Etag = &etag + } + } + } + + return nil +} + +// DataFlowSink transformation for data flow sink. +type DataFlowSink struct { + // Dataset - Dataset reference. + Dataset *DatasetReference `json:"dataset,omitempty"` + // Name - Transformation name. + Name *string `json:"name,omitempty"` + // Description - Transformation description. + Description *string `json:"description,omitempty"` +} + +// DataFlowSource transformation for data flow source. +type DataFlowSource struct { + // Dataset - Dataset reference. + Dataset *DatasetReference `json:"dataset,omitempty"` + // Name - Transformation name. + Name *string `json:"name,omitempty"` + // Description - Transformation description. + Description *string `json:"description,omitempty"` +} + +// DataFlowSourceSetting definition of data flow source setting for debug. +type DataFlowSourceSetting struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceName - The data flow source name. + SourceName *string `json:"sourceName,omitempty"` + // RowLimit - Defines the row limit of data flow source in debug. + RowLimit *int32 `json:"rowLimit,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataFlowSourceSetting. +func (dfss DataFlowSourceSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dfss.SourceName != nil { + objectMap["sourceName"] = dfss.SourceName + } + if dfss.RowLimit != nil { + objectMap["rowLimit"] = dfss.RowLimit + } + for k, v := range dfss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DataFlowSourceSetting struct. +func (dfss *DataFlowSourceSetting) UnmarshalJSON(body []byte) 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 dfss.AdditionalProperties == nil { + dfss.AdditionalProperties = make(map[string]interface{}) + } + dfss.AdditionalProperties[k] = additionalProperties + } + case "sourceName": + if v != nil { + var sourceName string + err = json.Unmarshal(*v, &sourceName) + if err != nil { + return err + } + dfss.SourceName = &sourceName + } + case "rowLimit": + if v != nil { + var rowLimit int32 + err = json.Unmarshal(*v, &rowLimit) + if err != nil { + return err + } + dfss.RowLimit = &rowLimit + } + } + } + + return nil +} + +// DataFlowStagingInfo staging info for execute data flow activity. +type DataFlowStagingInfo struct { + // LinkedService - Staging linked service reference. + LinkedService *LinkedServiceReference `json:"linkedService,omitempty"` + // FolderPath - Folder path for staging blob. + FolderPath *string `json:"folderPath,omitempty"` +} + // DataLakeAnalyticsUSQLActivity data Lake Analytics U-SQL activity. type DataLakeAnalyticsUSQLActivity struct { // DataLakeAnalyticsUSQLActivityTypeProperties - Data Lake Analytics U-SQL activity properties. @@ -58776,7 +62849,7 @@ type DataLakeAnalyticsUSQLActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -58814,6 +62887,11 @@ func (dlaua DataLakeAnalyticsUSQLActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. func (dlaua DataLakeAnalyticsUSQLActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -59218,6 +63296,7 @@ type BasicDataset interface { AsDynamicsCrmEntityDataset() (*DynamicsCrmEntityDataset, bool) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) + AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) AsCustomDataset() (*CustomDataset, bool) AsCassandraTableDataset() (*CassandraTableDataset, bool) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) @@ -59226,6 +63305,7 @@ type BasicDataset interface { AsAzureTableDataset() (*AzureTableDataset, bool) AsAzureBlobDataset() (*AzureBlobDataset, bool) AsBinaryDataset() (*BinaryDataset, bool) + AsOrcDataset() (*OrcDataset, bool) AsJSONDataset() (*JSONDataset, bool) AsDelimitedTextDataset() (*DelimitedTextDataset, bool) AsParquetDataset() (*ParquetDataset, bool) @@ -59253,7 +63333,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -59553,6 +63633,10 @@ func unmarshalBasicDataset(body []byte) (BasicDataset, error) { var ddcd DocumentDbCollectionDataset err := json.Unmarshal(body, &ddcd) return ddcd, err + case string(TypeCosmosDbSQLAPICollection): + var cdsacd CosmosDbSQLAPICollectionDataset + err := json.Unmarshal(body, &cdsacd) + return cdsacd, err case string(TypeCustomDataset): var cd CustomDataset err := json.Unmarshal(body, &cd) @@ -59585,6 +63669,10 @@ func unmarshalBasicDataset(body []byte) (BasicDataset, error) { var bd BinaryDataset err := json.Unmarshal(body, &bd) return bd, err + case string(TypeOrc): + var od OrcDataset + err := json.Unmarshal(body, &od) + return od, err case string(TypeJSON): var jd JSONDataset err := json.Unmarshal(body, &jd) @@ -60024,6 +64112,11 @@ func (d Dataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for Dataset. func (d Dataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -60064,6 +64157,11 @@ func (d Dataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for Dataset. func (d Dataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -61932,6 +66030,8 @@ func (d2lstp *Db2LinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { type Db2Source struct { // Query - Database query. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -61940,7 +66040,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -61951,6 +66051,9 @@ func (d2s Db2Source) MarshalJSON() ([]byte, error) { if d2s.Query != nil { objectMap["query"] = d2s.Query } + if d2s.QueryTimeout != nil { + objectMap["queryTimeout"] = d2s.QueryTimeout + } if d2s.SourceRetryCount != nil { objectMap["sourceRetryCount"] = d2s.SourceRetryCount } @@ -61969,6 +66072,121 @@ func (d2s Db2Source) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for Db2Source. func (d2s Db2Source) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -62144,81 +66362,21 @@ func (d2s Db2Source) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for Db2Source. func (d2s Db2Source) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for Db2Source. func (d2s Db2Source) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for Db2Source. func (d2s Db2Source) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for Db2Source. func (d2s Db2Source) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -62244,11 +66402,6 @@ func (d2s Db2Source) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for Db2Source. func (d2s Db2Source) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -62274,21 +66427,11 @@ func (d2s Db2Source) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for Db2Source. func (d2s Db2Source) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for Db2Source. func (d2s Db2Source) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -62319,53 +66462,33 @@ func (d2s Db2Source) AsDb2Source() (*Db2Source, bool) { return &d2s, true } -// AsMicrosoftAccessSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for Db2Source. func (d2s Db2Source) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsBasicTabularSource() (BasicTabularSource, bool) { + return &d2s, true } -// AsAzureTableSource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for Db2Source. -func (d2s Db2Source) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -62417,6 +66540,15 @@ func (d2s *Db2Source) UnmarshalJSON(body []byte) error { } d2s.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + d2s.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -62491,7 +66623,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -62892,6 +67024,11 @@ func (d2td Db2TableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollecti return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for Db2TableDataset. +func (d2td Db2TableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for Db2TableDataset. func (d2td Db2TableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -62932,6 +67069,11 @@ func (d2td Db2TableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for Db2TableDataset. +func (d2td Db2TableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for Db2TableDataset. func (d2td Db2TableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -63103,7 +67245,7 @@ type DeleteActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -63141,6 +67283,11 @@ func (da DeleteActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for DeleteActivity. +func (da DeleteActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for DeleteActivity. func (da DeleteActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -63439,6 +67586,12 @@ type DeleteActivityTypeProperties struct { Dataset *DatasetReference `json:"dataset,omitempty"` } +// DeleteDataFlowDebugSessionRequest request body structure for deleting data flow debug session. +type DeleteDataFlowDebugSessionRequest struct { + // SessionID - The ID of data flow debug session. + SessionID *string `json:"sessionId,omitempty"` +} + // DelimitedTextDataset delimited text dataset. type DelimitedTextDataset struct { // DelimitedTextDatasetTypeProperties - Delimited text dataset properties. @@ -63459,7 +67612,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -63860,6 +68013,11 @@ func (dtd DelimitedTextDataset) AsDocumentDbCollectionDataset() (*DocumentDbColl return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for DelimitedTextDataset. +func (dtd DelimitedTextDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for DelimitedTextDataset. func (dtd DelimitedTextDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -63900,6 +68058,11 @@ func (dtd DelimitedTextDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for DelimitedTextDataset. +func (dtd DelimitedTextDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for DelimitedTextDataset. func (dtd DelimitedTextDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -64154,7 +68317,7 @@ type DelimitedTextSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -64285,6 +68448,11 @@ func (dts DelimitedTextSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for DelimitedTextSink. +func (dts DelimitedTextSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for DelimitedTextSink. func (dts DelimitedTextSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -64340,6 +68508,11 @@ func (dts DelimitedTextSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool return nil, false } +// AsOrcSink is the BasicCopySink implementation for DelimitedTextSink. +func (dts DelimitedTextSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for DelimitedTextSink. func (dts DelimitedTextSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -64472,7 +68645,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -64504,6 +68677,121 @@ func (dts DelimitedTextSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for DelimitedTextSource. func (dts DelimitedTextSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -64679,81 +68967,21 @@ func (dts DelimitedTextSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for DelimitedTextSource. func (dts DelimitedTextSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for DelimitedTextSource. func (dts DelimitedTextSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for DelimitedTextSource. func (dts DelimitedTextSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for DelimitedTextSource. func (dts DelimitedTextSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -64779,11 +69007,6 @@ func (dts DelimitedTextSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for DelimitedTextSource. func (dts DelimitedTextSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -64809,21 +69032,11 @@ func (dts DelimitedTextSource) AsSapCloudForCustomerSource() (*SapCloudForCustom return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for DelimitedTextSource. func (dts DelimitedTextSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for DelimitedTextSource. func (dts DelimitedTextSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -64854,53 +69067,33 @@ func (dts DelimitedTextSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for DelimitedTextSource. func (dts DelimitedTextSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for DelimitedTextSource. -func (dts DelimitedTextSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -65229,7 +69422,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -65630,6 +69823,11 @@ func (ddcd DocumentDbCollectionDataset) AsDocumentDbCollectionDataset() (*Docume return &ddcd, true } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for DocumentDbCollectionDataset. func (ddcd DocumentDbCollectionDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -65670,6 +69868,11 @@ func (ddcd DocumentDbCollectionDataset) AsBinaryDataset() (*BinaryDataset, bool) return nil, false } +// AsOrcDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for DocumentDbCollectionDataset. func (ddcd DocumentDbCollectionDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -65823,7 +70026,7 @@ type DocumentDbCollectionDatasetTypeProperties struct { type DocumentDbCollectionSink struct { // NestingSeparator - Nested properties separator. Default is . (dot). Type: string (or Expression with resultType string). NestingSeparator interface{} `json:"nestingSeparator,omitempty"` - // WriteBehavior - Describes how to write data to Azure Cosmos DB. Allowed values: insert and upsert. + // WriteBehavior - Describes how to write data to Azure Cosmos DB. Type: string (or Expression with resultType string). Allowed values: insert and upsert. WriteBehavior interface{} `json:"writeBehavior,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` @@ -65837,7 +70040,7 @@ type DocumentDbCollectionSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -65970,6 +70173,11 @@ func (ddcs DocumentDbCollectionSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for DocumentDbCollectionSink. func (ddcs DocumentDbCollectionSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return &ddcs, true @@ -66025,6 +70233,11 @@ func (ddcs DocumentDbCollectionSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSi return nil, false } +// AsOrcSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for DocumentDbCollectionSink. func (ddcs DocumentDbCollectionSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -66150,6 +70363,8 @@ type DocumentDbCollectionSource struct { Query interface{} `json:"query,omitempty"` // NestingSeparator - Nested properties separator. Type: string (or Expression with resultType string). NestingSeparator interface{} `json:"nestingSeparator,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -66158,7 +70373,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -66172,6 +70387,9 @@ func (ddcs DocumentDbCollectionSource) MarshalJSON() ([]byte, error) { if ddcs.NestingSeparator != nil { objectMap["nestingSeparator"] = ddcs.NestingSeparator } + if ddcs.QueryTimeout != nil { + objectMap["queryTimeout"] = ddcs.QueryTimeout + } if ddcs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ddcs.SourceRetryCount } @@ -66190,6 +70408,121 @@ func (ddcs DocumentDbCollectionSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return &ddcs, true +} + +// AsBlobSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for DocumentDbCollectionSource. func (ddcs DocumentDbCollectionSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -66365,81 +70698,21 @@ func (ddcs DocumentDbCollectionSource) AsAmazonMWSSource() (*AmazonMWSSource, bo return nil, false } -// AsHTTPSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for DocumentDbCollectionSource. func (ddcs DocumentDbCollectionSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for DocumentDbCollectionSource. func (ddcs DocumentDbCollectionSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for DocumentDbCollectionSource. func (ddcs DocumentDbCollectionSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for DocumentDbCollectionSource. func (ddcs DocumentDbCollectionSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -66465,11 +70738,6 @@ func (ddcs DocumentDbCollectionSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for DocumentDbCollectionSource. func (ddcs DocumentDbCollectionSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -66495,21 +70763,11 @@ func (ddcs DocumentDbCollectionSource) AsSapCloudForCustomerSource() (*SapCloudF return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for DocumentDbCollectionSource. func (ddcs DocumentDbCollectionSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for DocumentDbCollectionSource. func (ddcs DocumentDbCollectionSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -66540,53 +70798,33 @@ func (ddcs DocumentDbCollectionSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for DocumentDbCollectionSource. func (ddcs DocumentDbCollectionSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDynamicsCrmSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { +// AsTabularSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsDynamicsSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { - return &ddcs, true -} - -// AsBlobSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsBlobSource() (*BlobSource, bool) { - return nil, false -} - -// AsAzureTableSource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for DocumentDbCollectionSource. -func (ddcs DocumentDbCollectionSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -66647,6 +70885,15 @@ func (ddcs *DocumentDbCollectionSource) UnmarshalJSON(body []byte) error { } ddcs.NestingSeparator = nestingSeparator } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ddcs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -67317,6 +71564,8 @@ type DrillLinkedServiceTypeProperties struct { type DrillSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -67325,7 +71574,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -67336,6 +71585,9 @@ func (ds DrillSource) MarshalJSON() ([]byte, error) { if ds.Query != nil { objectMap["query"] = ds.Query } + if ds.QueryTimeout != nil { + objectMap["queryTimeout"] = ds.QueryTimeout + } if ds.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ds.SourceRetryCount } @@ -67354,6 +71606,121 @@ func (ds DrillSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for DrillSource. func (ds DrillSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -67529,81 +71896,21 @@ func (ds DrillSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for DrillSource. func (ds DrillSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for DrillSource. func (ds DrillSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for DrillSource. func (ds DrillSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for DrillSource. func (ds DrillSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -67629,11 +71936,6 @@ func (ds DrillSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for DrillSource. func (ds DrillSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -67659,21 +71961,11 @@ func (ds DrillSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for DrillSource. func (ds DrillSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for DrillSource. func (ds DrillSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -67704,53 +71996,33 @@ func (ds DrillSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for DrillSource. func (ds DrillSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ds, true } -// AsAzureTableSource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for DrillSource. -func (ds DrillSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -67802,6 +72074,15 @@ func (ds *DrillSource) UnmarshalJSON(body []byte) error { } ds.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ds.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -67876,7 +72157,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -68277,6 +72558,11 @@ func (dtd DrillTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollect return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for DrillTableDataset. func (dtd DrillTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -68317,6 +72603,11 @@ func (dtd DrillTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for DrillTableDataset. func (dtd DrillTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -69156,7 +73447,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -69557,6 +73848,11 @@ func (dard DynamicsAXResourceDataset) AsDocumentDbCollectionDataset() (*Document return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for DynamicsAXResourceDataset. +func (dard DynamicsAXResourceDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for DynamicsAXResourceDataset. func (dard DynamicsAXResourceDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -69597,6 +73893,11 @@ func (dard DynamicsAXResourceDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for DynamicsAXResourceDataset. +func (dard DynamicsAXResourceDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for DynamicsAXResourceDataset. func (dard DynamicsAXResourceDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -69750,6 +74051,8 @@ type DynamicsAXResourceDatasetTypeProperties struct { type DynamicsAXSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -69758,7 +74061,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -69769,6 +74072,9 @@ func (das DynamicsAXSource) MarshalJSON() ([]byte, error) { if das.Query != nil { objectMap["query"] = das.Query } + if das.QueryTimeout != nil { + objectMap["queryTimeout"] = das.QueryTimeout + } if das.SourceRetryCount != nil { objectMap["sourceRetryCount"] = das.SourceRetryCount } @@ -69787,6 +74093,121 @@ func (das DynamicsAXSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for DynamicsAXSource. func (das DynamicsAXSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -69962,81 +74383,21 @@ func (das DynamicsAXSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for DynamicsAXSource. func (das DynamicsAXSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for DynamicsAXSource. func (das DynamicsAXSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for DynamicsAXSource. func (das DynamicsAXSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for DynamicsAXSource. func (das DynamicsAXSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -70062,11 +74423,6 @@ func (das DynamicsAXSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for DynamicsAXSource. func (das DynamicsAXSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -70092,21 +74448,11 @@ func (das DynamicsAXSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerS return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for DynamicsAXSource. func (das DynamicsAXSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for DynamicsAXSource. func (das DynamicsAXSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -70137,53 +74483,33 @@ func (das DynamicsAXSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for DynamicsAXSource. func (das DynamicsAXSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &das, true } -// AsAzureTableSource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for DynamicsAXSource. -func (das DynamicsAXSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -70235,6 +74561,15 @@ func (das *DynamicsAXSource) UnmarshalJSON(body []byte) error { } das.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + das.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -70309,7 +74644,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -70710,6 +75045,11 @@ func (dced DynamicsCrmEntityDataset) AsDocumentDbCollectionDataset() (*DocumentD return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for DynamicsCrmEntityDataset. +func (dced DynamicsCrmEntityDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for DynamicsCrmEntityDataset. func (dced DynamicsCrmEntityDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -70750,6 +75090,11 @@ func (dced DynamicsCrmEntityDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for DynamicsCrmEntityDataset. +func (dced DynamicsCrmEntityDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for DynamicsCrmEntityDataset. func (dced DynamicsCrmEntityDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -71614,6 +75959,8 @@ type DynamicsCrmSink struct { WriteBehavior *string `json:"writeBehavior,omitempty"` // IgnoreNullValues - The flag indicating whether to ignore null values from input dataset (except key fields) during write operation. Default is false. Type: boolean (or Expression with resultType boolean). IgnoreNullValues interface{} `json:"ignoreNullValues,omitempty"` + // AlternateKeyName - The logical name of the alternate key which will be used when upserting records. Type: string (or Expression with resultType string). + AlternateKeyName interface{} `json:"alternateKeyName,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. @@ -71626,7 +75973,7 @@ type DynamicsCrmSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -71640,6 +75987,9 @@ func (dcs DynamicsCrmSink) MarshalJSON() ([]byte, error) { if dcs.IgnoreNullValues != nil { objectMap["ignoreNullValues"] = dcs.IgnoreNullValues } + if dcs.AlternateKeyName != nil { + objectMap["alternateKeyName"] = dcs.AlternateKeyName + } if dcs.WriteBatchSize != nil { objectMap["writeBatchSize"] = dcs.WriteBatchSize } @@ -71759,6 +76109,11 @@ func (dcs DynamicsCrmSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for DynamicsCrmSink. +func (dcs DynamicsCrmSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for DynamicsCrmSink. func (dcs DynamicsCrmSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -71814,6 +76169,11 @@ func (dcs DynamicsCrmSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) return nil, false } +// AsOrcSink is the BasicCopySink implementation for DynamicsCrmSink. +func (dcs DynamicsCrmSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for DynamicsCrmSink. func (dcs DynamicsCrmSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -71861,6 +76221,15 @@ func (dcs *DynamicsCrmSink) UnmarshalJSON(body []byte) error { } dcs.IgnoreNullValues = ignoreNullValues } + case "alternateKeyName": + if v != nil { + var alternateKeyName interface{} + err = json.Unmarshal(*v, &alternateKeyName) + if err != nil { + return err + } + dcs.AlternateKeyName = alternateKeyName + } default: if v != nil { var additionalProperties interface{} @@ -71945,7 +76314,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -71974,6 +76343,121 @@ func (dcs DynamicsCrmSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return &dcs, true +} + +// AsDynamicsSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for DynamicsCrmSource. func (dcs DynamicsCrmSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -72149,81 +76633,21 @@ func (dcs DynamicsCrmSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for DynamicsCrmSource. func (dcs DynamicsCrmSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for DynamicsCrmSource. func (dcs DynamicsCrmSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for DynamicsCrmSource. func (dcs DynamicsCrmSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for DynamicsCrmSource. func (dcs DynamicsCrmSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -72249,11 +76673,6 @@ func (dcs DynamicsCrmSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for DynamicsCrmSource. func (dcs DynamicsCrmSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -72279,21 +76698,11 @@ func (dcs DynamicsCrmSource) AsSapCloudForCustomerSource() (*SapCloudForCustomer return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for DynamicsCrmSource. func (dcs DynamicsCrmSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for DynamicsCrmSource. func (dcs DynamicsCrmSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -72324,53 +76733,33 @@ func (dcs DynamicsCrmSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for DynamicsCrmSource. func (dcs DynamicsCrmSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return &dcs, true -} - -// AsDynamicsSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for DynamicsCrmSource. -func (dcs DynamicsCrmSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -72496,7 +76885,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -72897,6 +77286,11 @@ func (ded DynamicsEntityDataset) AsDocumentDbCollectionDataset() (*DocumentDbCol return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for DynamicsEntityDataset. func (ded DynamicsEntityDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -72937,6 +77331,11 @@ func (ded DynamicsEntityDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for DynamicsEntityDataset. func (ded DynamicsEntityDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -73801,6 +78200,8 @@ type DynamicsSink struct { WriteBehavior *string `json:"writeBehavior,omitempty"` // IgnoreNullValues - The flag indicating whether ignore null values from input dataset (except key fields) during write operation. Default is false. Type: boolean (or Expression with resultType boolean). IgnoreNullValues interface{} `json:"ignoreNullValues,omitempty"` + // AlternateKeyName - The logical name of the alternate key which will be used when upserting records. Type: string (or Expression with resultType string). + AlternateKeyName interface{} `json:"alternateKeyName,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. @@ -73813,7 +78214,7 @@ type DynamicsSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -73827,6 +78228,9 @@ func (ds DynamicsSink) MarshalJSON() ([]byte, error) { if ds.IgnoreNullValues != nil { objectMap["ignoreNullValues"] = ds.IgnoreNullValues } + if ds.AlternateKeyName != nil { + objectMap["alternateKeyName"] = ds.AlternateKeyName + } if ds.WriteBatchSize != nil { objectMap["writeBatchSize"] = ds.WriteBatchSize } @@ -73946,6 +78350,11 @@ func (ds DynamicsSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for DynamicsSink. func (ds DynamicsSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -74001,6 +78410,11 @@ func (ds DynamicsSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for DynamicsSink. func (ds DynamicsSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -74048,6 +78462,15 @@ func (ds *DynamicsSink) UnmarshalJSON(body []byte) error { } ds.IgnoreNullValues = ignoreNullValues } + case "alternateKeyName": + if v != nil { + var alternateKeyName interface{} + err = json.Unmarshal(*v, &alternateKeyName) + if err != nil { + return err + } + ds.AlternateKeyName = alternateKeyName + } default: if v != nil { var additionalProperties interface{} @@ -74132,7 +78555,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -74161,6 +78584,121 @@ func (ds DynamicsSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsDynamicsSource() (*DynamicsSource, bool) { + return &ds, true +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for DynamicsSource. func (ds DynamicsSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -74336,81 +78874,21 @@ func (ds DynamicsSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for DynamicsSource. func (ds DynamicsSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for DynamicsSource. func (ds DynamicsSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for DynamicsSource. func (ds DynamicsSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for DynamicsSource. func (ds DynamicsSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -74436,11 +78914,6 @@ func (ds DynamicsSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for DynamicsSource. func (ds DynamicsSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -74466,21 +78939,11 @@ func (ds DynamicsSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSour return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for DynamicsSource. func (ds DynamicsSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for DynamicsSource. func (ds DynamicsSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -74511,53 +78974,33 @@ func (ds DynamicsSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for DynamicsSource. func (ds DynamicsSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDynamicsSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsDynamicsSource() (*DynamicsSource, bool) { - return &ds, true -} - -// AsDocumentDbCollectionSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for DynamicsSource. -func (ds DynamicsSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -75370,7 +79813,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -75771,6 +80214,11 @@ func (eod EloquaObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbColle return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for EloquaObjectDataset. func (eod EloquaObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -75811,6 +80259,11 @@ func (eod EloquaObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for EloquaObjectDataset. func (eod EloquaObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -75958,6 +80411,8 @@ func (eod *EloquaObjectDataset) UnmarshalJSON(body []byte) error { type EloquaSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -75966,7 +80421,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -75977,6 +80432,9 @@ func (es EloquaSource) MarshalJSON() ([]byte, error) { if es.Query != nil { objectMap["query"] = es.Query } + if es.QueryTimeout != nil { + objectMap["queryTimeout"] = es.QueryTimeout + } if es.SourceRetryCount != nil { objectMap["sourceRetryCount"] = es.SourceRetryCount } @@ -75995,6 +80453,121 @@ func (es EloquaSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for EloquaSource. func (es EloquaSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -76170,81 +80743,21 @@ func (es EloquaSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for EloquaSource. func (es EloquaSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for EloquaSource. func (es EloquaSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for EloquaSource. func (es EloquaSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for EloquaSource. func (es EloquaSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -76270,11 +80783,6 @@ func (es EloquaSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for EloquaSource. func (es EloquaSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -76300,21 +80808,11 @@ func (es EloquaSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for EloquaSource. func (es EloquaSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for EloquaSource. func (es EloquaSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -76345,53 +80843,33 @@ func (es EloquaSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for EloquaSource. func (es EloquaSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &es, true } -// AsAzureTableSource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for EloquaSource. -func (es EloquaSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -76443,6 +80921,15 @@ func (es *EloquaSource) UnmarshalJSON(body []byte) error { } es.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + es.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -76505,6 +80992,448 @@ type EntityReference struct { ReferenceName *string `json:"referenceName,omitempty"` } +// EnvironmentVariableSetup the custom setup of setting environment variable. +type EnvironmentVariableSetup struct { + // EnvironmentVariableSetupTypeProperties - Add environment variable type properties. + *EnvironmentVariableSetupTypeProperties `json:"typeProperties,omitempty"` + // Type - Possible values include: 'TypeCustomSetupBase', 'TypeComponentSetup', 'TypeEnvironmentVariableSetup', 'TypeCmdkeySetup' + Type TypeBasicCustomSetupBase `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EnvironmentVariableSetup. +func (evs EnvironmentVariableSetup) MarshalJSON() ([]byte, error) { + evs.Type = TypeEnvironmentVariableSetup + objectMap := make(map[string]interface{}) + if evs.EnvironmentVariableSetupTypeProperties != nil { + objectMap["typeProperties"] = evs.EnvironmentVariableSetupTypeProperties + } + if evs.Type != "" { + objectMap["type"] = evs.Type + } + return json.Marshal(objectMap) +} + +// AsComponentSetup is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. +func (evs EnvironmentVariableSetup) AsComponentSetup() (*ComponentSetup, bool) { + return nil, false +} + +// AsEnvironmentVariableSetup is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. +func (evs EnvironmentVariableSetup) AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) { + return &evs, true +} + +// AsCmdkeySetup is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. +func (evs EnvironmentVariableSetup) AsCmdkeySetup() (*CmdkeySetup, bool) { + return nil, false +} + +// AsCustomSetupBase is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. +func (evs EnvironmentVariableSetup) AsCustomSetupBase() (*CustomSetupBase, bool) { + return nil, false +} + +// AsBasicCustomSetupBase is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. +func (evs EnvironmentVariableSetup) AsBasicCustomSetupBase() (BasicCustomSetupBase, bool) { + return &evs, true +} + +// UnmarshalJSON is the custom unmarshaler for EnvironmentVariableSetup struct. +func (evs *EnvironmentVariableSetup) UnmarshalJSON(body []byte) error { + 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 environmentVariableSetupTypeProperties EnvironmentVariableSetupTypeProperties + err = json.Unmarshal(*v, &environmentVariableSetupTypeProperties) + if err != nil { + return err + } + evs.EnvironmentVariableSetupTypeProperties = &environmentVariableSetupTypeProperties + } + case "type": + if v != nil { + var typeVar TypeBasicCustomSetupBase + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + evs.Type = typeVar + } + } + } + + return nil +} + +// EnvironmentVariableSetupTypeProperties environment variable custom setup type properties. +type EnvironmentVariableSetupTypeProperties struct { + // VariableName - The name of the environment variable. + VariableName *string `json:"variableName,omitempty"` + // VariableValue - The value of the environment variable. + VariableValue *string `json:"variableValue,omitempty"` +} + +// ExecuteDataFlowActivity execute data flow activity. +type ExecuteDataFlowActivity struct { + // ExecuteDataFlowActivityTypeProperties - Execute data flow activity properties. + *ExecuteDataFlowActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties *[]UserProperty `json:"userProperties,omitempty"` + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) MarshalJSON() ([]byte, error) { + edfa.Type = TypeExecuteDataFlow + objectMap := make(map[string]interface{}) + if edfa.ExecuteDataFlowActivityTypeProperties != nil { + objectMap["typeProperties"] = edfa.ExecuteDataFlowActivityTypeProperties + } + if edfa.LinkedServiceName != nil { + objectMap["linkedServiceName"] = edfa.LinkedServiceName + } + if edfa.Policy != nil { + objectMap["policy"] = edfa.Policy + } + if edfa.Name != nil { + objectMap["name"] = edfa.Name + } + if edfa.Description != nil { + objectMap["description"] = edfa.Description + } + if edfa.DependsOn != nil { + objectMap["dependsOn"] = edfa.DependsOn + } + if edfa.UserProperties != nil { + objectMap["userProperties"] = edfa.UserProperties + } + if edfa.Type != "" { + objectMap["type"] = edfa.Type + } + for k, v := range edfa.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsExecuteDataFlowActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return &edfa, true +} + +// AsAzureFunctionActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { + return nil, false +} + +// AsDatabricksSparkPythonActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsDatabricksSparkPythonActivity() (*DatabricksSparkPythonActivity, bool) { + return nil, false +} + +// AsDatabricksSparkJarActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsDatabricksSparkJarActivity() (*DatabricksSparkJarActivity, bool) { + return nil, false +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsAzureDataExplorerCommandActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsAzureDataExplorerCommandActivity() (*AzureDataExplorerCommandActivity, bool) { + return nil, false +} + +// AsDeleteActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsDeleteActivity() (*DeleteActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &edfa, true +} + +// AsWebHookActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsWebHookActivity() (*WebHookActivity, bool) { + return nil, false +} + +// AsAppendVariableActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsAppendVariableActivity() (*AppendVariableActivity, bool) { + return nil, false +} + +// AsSetVariableActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsSetVariableActivity() (*SetVariableActivity, bool) { + return nil, false +} + +// AsFilterActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsValidationActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsValidationActivity() (*ValidationActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsBasicActivity() (BasicActivity, bool) { + return &edfa, true +} + +// UnmarshalJSON is the custom unmarshaler for ExecuteDataFlowActivity struct. +func (edfa *ExecuteDataFlowActivity) UnmarshalJSON(body []byte) error { + 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 executeDataFlowActivityTypeProperties ExecuteDataFlowActivityTypeProperties + err = json.Unmarshal(*v, &executeDataFlowActivityTypeProperties) + if err != nil { + return err + } + edfa.ExecuteDataFlowActivityTypeProperties = &executeDataFlowActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + edfa.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + edfa.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if edfa.AdditionalProperties == nil { + edfa.AdditionalProperties = make(map[string]interface{}) + } + edfa.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + edfa.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + edfa.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + edfa.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties []UserProperty + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + edfa.UserProperties = &userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + edfa.Type = typeVar + } + } + } + + return nil +} + +// ExecuteDataFlowActivityTypeProperties execute data flow activity properties. +type ExecuteDataFlowActivityTypeProperties struct { + // DataFlow - Data flow reference. + DataFlow *DataFlowReference `json:"dataFlow,omitempty"` + // Staging - Staging info for execute data flow activity. + Staging *DataFlowStagingInfo `json:"staging,omitempty"` + // IntegrationRuntime - The integration runtime reference. + IntegrationRuntime *IntegrationRuntimeReference `json:"integrationRuntime,omitempty"` +} + // ExecutePipelineActivity execute pipeline activity. type ExecutePipelineActivity struct { // ExecutePipelineActivityTypeProperties - Execute pipeline activity properties. @@ -76519,7 +81448,7 @@ type ExecutePipelineActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -76551,6 +81480,11 @@ func (epa ExecutePipelineActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for ExecutePipelineActivity. func (epa ExecutePipelineActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -76860,7 +81794,7 @@ type ExecuteSSISPackageActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -76898,6 +81832,11 @@ func (espa ExecuteSSISPackageActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. func (espa ExecuteSSISPackageActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -77254,6 +82193,7 @@ func (espatp ExecuteSSISPackageActivityTypeProperties) MarshalJSON() ([]byte, er // BasicExecutionActivity base class for all execution activities. type BasicExecutionActivity interface { + AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) AsDatabricksSparkPythonActivity() (*DatabricksSparkPythonActivity, bool) AsDatabricksSparkJarActivity() (*DatabricksSparkJarActivity, bool) @@ -77294,7 +82234,7 @@ type ExecutionActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -77306,6 +82246,10 @@ func unmarshalBasicExecutionActivity(body []byte) (BasicExecutionActivity, error } switch m["type"] { + case string(TypeExecuteDataFlow): + var edfa ExecuteDataFlowActivity + err := json.Unmarshal(body, &edfa) + return edfa, err case string(TypeAzureFunctionActivity): var afa AzureFunctionActivity err := json.Unmarshal(body, &afa) @@ -77446,6 +82390,11 @@ func (ea ExecutionActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for ExecutionActivity. func (ea ExecutionActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -79440,7 +84389,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -79841,6 +84790,11 @@ func (fsd FileShareDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollecti return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for FileShareDataset. func (fsd FileShareDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -79881,6 +84835,11 @@ func (fsd FileShareDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for FileShareDataset. func (fsd FileShareDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -80134,7 +85093,7 @@ type FileSystemSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -80264,6 +85223,11 @@ func (fss FileSystemSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for FileSystemSink. func (fss FileSystemSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -80319,6 +85283,11 @@ func (fss FileSystemSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for FileSystemSink. func (fss FileSystemSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -80441,7 +85410,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -80470,6 +85439,121 @@ func (fss FileSystemSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsFileSystemSource() (*FileSystemSource, bool) { + return &fss, true +} + +// AsRestSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for FileSystemSource. func (fss FileSystemSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -80645,81 +85729,21 @@ func (fss FileSystemSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for FileSystemSource. func (fss FileSystemSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for FileSystemSource. func (fss FileSystemSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for FileSystemSource. func (fss FileSystemSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsFileSystemSource() (*FileSystemSource, bool) { - return &fss, true -} - // AsSQLDWSource is the BasicCopySource implementation for FileSystemSource. func (fss FileSystemSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -80745,11 +85769,6 @@ func (fss FileSystemSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for FileSystemSource. func (fss FileSystemSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -80775,21 +85794,11 @@ func (fss FileSystemSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerS return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for FileSystemSource. func (fss FileSystemSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for FileSystemSource. func (fss FileSystemSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -80820,53 +85829,33 @@ func (fss FileSystemSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for FileSystemSource. func (fss FileSystemSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for FileSystemSource. -func (fss FileSystemSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -80986,7 +85975,7 @@ type FilterActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -81018,6 +86007,11 @@ func (fa FilterActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for FilterActivity. func (fa FilterActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -81306,7 +86300,7 @@ type ForEachActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -81338,6 +86332,11 @@ func (fea ForEachActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for ForEachActivity. func (fea ForEachActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -82692,6 +87691,62 @@ type GenericDatasetTypeProperties struct { TableName interface{} `json:"tableName,omitempty"` } +// GetDataFactoryOperationStatusResponse response body structure for get data factory operation status. +type GetDataFactoryOperationStatusResponse struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Status - Status of the operation. + Status *string `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for GetDataFactoryOperationStatusResponse. +func (gdfosr GetDataFactoryOperationStatusResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gdfosr.Status != nil { + objectMap["status"] = gdfosr.Status + } + for k, v := range gdfosr.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GetDataFactoryOperationStatusResponse struct. +func (gdfosr *GetDataFactoryOperationStatusResponse) UnmarshalJSON(body []byte) 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 gdfosr.AdditionalProperties == nil { + gdfosr.AdditionalProperties = make(map[string]interface{}) + } + gdfosr.AdditionalProperties[k] = additionalProperties + } + case "status": + if v != nil { + var status string + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + gdfosr.Status = &status + } + } + } + + return nil +} + // GetMetadataActivity activity to get metadata of dataset type GetMetadataActivity struct { // GetMetadataActivityTypeProperties - GetMetadata activity properties. @@ -82710,7 +87765,7 @@ type GetMetadataActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -82748,6 +87803,11 @@ func (gma GetMetadataActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for GetMetadataActivity. func (gma GetMetadataActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -83811,7 +88871,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -84212,6 +89272,11 @@ func (gawod GoogleAdWordsObjectDataset) AsDocumentDbCollectionDataset() (*Docume return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for GoogleAdWordsObjectDataset. +func (gawod GoogleAdWordsObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for GoogleAdWordsObjectDataset. func (gawod GoogleAdWordsObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -84252,6 +89317,11 @@ func (gawod GoogleAdWordsObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) return nil, false } +// AsOrcDataset is the BasicDataset implementation for GoogleAdWordsObjectDataset. +func (gawod GoogleAdWordsObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for GoogleAdWordsObjectDataset. func (gawod GoogleAdWordsObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -84399,6 +89469,8 @@ func (gawod *GoogleAdWordsObjectDataset) UnmarshalJSON(body []byte) error { type GoogleAdWordsSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -84407,7 +89479,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -84418,6 +89490,9 @@ func (gaws GoogleAdWordsSource) MarshalJSON() ([]byte, error) { if gaws.Query != nil { objectMap["query"] = gaws.Query } + if gaws.QueryTimeout != nil { + objectMap["queryTimeout"] = gaws.QueryTimeout + } if gaws.SourceRetryCount != nil { objectMap["sourceRetryCount"] = gaws.SourceRetryCount } @@ -84436,6 +89511,121 @@ func (gaws GoogleAdWordsSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for GoogleAdWordsSource. func (gaws GoogleAdWordsSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -84611,81 +89801,21 @@ func (gaws GoogleAdWordsSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for GoogleAdWordsSource. func (gaws GoogleAdWordsSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for GoogleAdWordsSource. func (gaws GoogleAdWordsSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for GoogleAdWordsSource. func (gaws GoogleAdWordsSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for GoogleAdWordsSource. func (gaws GoogleAdWordsSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -84711,11 +89841,6 @@ func (gaws GoogleAdWordsSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for GoogleAdWordsSource. func (gaws GoogleAdWordsSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -84741,21 +89866,11 @@ func (gaws GoogleAdWordsSource) AsSapCloudForCustomerSource() (*SapCloudForCusto return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for GoogleAdWordsSource. func (gaws GoogleAdWordsSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for GoogleAdWordsSource. func (gaws GoogleAdWordsSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -84786,53 +89901,33 @@ func (gaws GoogleAdWordsSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for GoogleAdWordsSource. func (gaws GoogleAdWordsSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &gaws, true } -// AsAzureTableSource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for GoogleAdWordsSource. -func (gaws GoogleAdWordsSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -84884,6 +89979,15 @@ func (gaws *GoogleAdWordsSource) UnmarshalJSON(body []byte) error { } gaws.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + gaws.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -85708,7 +90812,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -86109,6 +91213,11 @@ func (gbqod GoogleBigQueryObjectDataset) AsDocumentDbCollectionDataset() (*Docum return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. func (gbqod GoogleBigQueryObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -86149,6 +91258,11 @@ func (gbqod GoogleBigQueryObjectDataset) AsBinaryDataset() (*BinaryDataset, bool return nil, false } +// AsOrcDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. func (gbqod GoogleBigQueryObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -86296,6 +91410,8 @@ func (gbqod *GoogleBigQueryObjectDataset) UnmarshalJSON(body []byte) error { type GoogleBigQuerySource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -86304,7 +91420,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -86315,6 +91431,9 @@ func (gbqs GoogleBigQuerySource) MarshalJSON() ([]byte, error) { if gbqs.Query != nil { objectMap["query"] = gbqs.Query } + if gbqs.QueryTimeout != nil { + objectMap["queryTimeout"] = gbqs.QueryTimeout + } if gbqs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = gbqs.SourceRetryCount } @@ -86333,6 +91452,121 @@ func (gbqs GoogleBigQuerySource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for GoogleBigQuerySource. func (gbqs GoogleBigQuerySource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -86508,81 +91742,21 @@ func (gbqs GoogleBigQuerySource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for GoogleBigQuerySource. func (gbqs GoogleBigQuerySource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for GoogleBigQuerySource. func (gbqs GoogleBigQuerySource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for GoogleBigQuerySource. func (gbqs GoogleBigQuerySource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for GoogleBigQuerySource. func (gbqs GoogleBigQuerySource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -86608,11 +91782,6 @@ func (gbqs GoogleBigQuerySource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for GoogleBigQuerySource. func (gbqs GoogleBigQuerySource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -86638,21 +91807,11 @@ func (gbqs GoogleBigQuerySource) AsSapCloudForCustomerSource() (*SapCloudForCust return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for GoogleBigQuerySource. func (gbqs GoogleBigQuerySource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for GoogleBigQuerySource. func (gbqs GoogleBigQuerySource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -86683,53 +91842,33 @@ func (gbqs GoogleBigQuerySource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for GoogleBigQuerySource. func (gbqs GoogleBigQuerySource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &gbqs, true } -// AsAzureTableSource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for GoogleBigQuerySource. -func (gbqs GoogleBigQuerySource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -86781,6 +91920,15 @@ func (gbqs *GoogleBigQuerySource) UnmarshalJSON(body []byte) error { } gbqs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + gbqs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -87451,6 +92599,8 @@ type GreenplumLinkedServiceTypeProperties struct { type GreenplumSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -87459,7 +92609,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -87470,6 +92620,9 @@ func (gs GreenplumSource) MarshalJSON() ([]byte, error) { if gs.Query != nil { objectMap["query"] = gs.Query } + if gs.QueryTimeout != nil { + objectMap["queryTimeout"] = gs.QueryTimeout + } if gs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = gs.SourceRetryCount } @@ -87488,6 +92641,121 @@ func (gs GreenplumSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for GreenplumSource. func (gs GreenplumSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -87663,81 +92931,21 @@ func (gs GreenplumSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for GreenplumSource. func (gs GreenplumSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for GreenplumSource. func (gs GreenplumSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for GreenplumSource. func (gs GreenplumSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for GreenplumSource. func (gs GreenplumSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -87763,11 +92971,6 @@ func (gs GreenplumSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for GreenplumSource. func (gs GreenplumSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -87793,21 +92996,11 @@ func (gs GreenplumSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSou return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for GreenplumSource. func (gs GreenplumSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for GreenplumSource. func (gs GreenplumSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -87838,53 +93031,33 @@ func (gs GreenplumSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for GreenplumSource. func (gs GreenplumSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &gs, true } -// AsAzureTableSource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for GreenplumSource. -func (gs GreenplumSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -87936,6 +93109,15 @@ func (gs *GreenplumSource) UnmarshalJSON(body []byte) error { } gs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + gs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -88010,7 +93192,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -88411,6 +93593,11 @@ func (gtd GreenplumTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCol return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for GreenplumTableDataset. func (gtd GreenplumTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -88451,6 +93638,11 @@ func (gtd GreenplumTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for GreenplumTableDataset. func (gtd GreenplumTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -89345,7 +94537,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -89746,6 +94938,11 @@ func (hbod HBaseObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbColle return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for HBaseObjectDataset. func (hbod HBaseObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -89786,6 +94983,11 @@ func (hbod HBaseObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for HBaseObjectDataset. func (hbod HBaseObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -89933,6 +95135,8 @@ func (hbod *HBaseObjectDataset) UnmarshalJSON(body []byte) error { type HBaseSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -89941,7 +95145,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -89952,6 +95156,9 @@ func (hbs HBaseSource) MarshalJSON() ([]byte, error) { if hbs.Query != nil { objectMap["query"] = hbs.Query } + if hbs.QueryTimeout != nil { + objectMap["queryTimeout"] = hbs.QueryTimeout + } if hbs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = hbs.SourceRetryCount } @@ -89970,6 +95177,121 @@ func (hbs HBaseSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for HBaseSource. func (hbs HBaseSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -90145,81 +95467,21 @@ func (hbs HBaseSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for HBaseSource. func (hbs HBaseSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for HBaseSource. func (hbs HBaseSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for HBaseSource. func (hbs HBaseSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for HBaseSource. func (hbs HBaseSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -90245,11 +95507,6 @@ func (hbs HBaseSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for HBaseSource. func (hbs HBaseSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -90275,21 +95532,11 @@ func (hbs HBaseSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for HBaseSource. func (hbs HBaseSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for HBaseSource. func (hbs HBaseSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -90320,53 +95567,33 @@ func (hbs HBaseSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for HBaseSource. func (hbs HBaseSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &hbs, true } -// AsAzureTableSource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for HBaseSource. -func (hbs HBaseSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -90418,6 +95645,15 @@ func (hbs *HBaseSource) UnmarshalJSON(body []byte) error { } hbs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + hbs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -91403,7 +96639,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -91435,6 +96671,121 @@ func (hs HdfsSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsHdfsSource() (*HdfsSource, bool) { + return &hs, true +} + +// AsFileSystemSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for HdfsSource. func (hs HdfsSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -91610,81 +96961,21 @@ func (hs HdfsSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for HdfsSource. func (hs HdfsSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for HdfsSource. func (hs HdfsSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for HdfsSource. func (hs HdfsSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsHdfsSource() (*HdfsSource, bool) { - return &hs, true -} - -// AsFileSystemSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for HdfsSource. func (hs HdfsSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -91710,11 +97001,6 @@ func (hs HdfsSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for HdfsSource. func (hs HdfsSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -91740,21 +97026,11 @@ func (hs HdfsSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for HdfsSource. func (hs HdfsSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for HdfsSource. func (hs HdfsSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -91785,53 +97061,33 @@ func (hs HdfsSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for HdfsSource. func (hs HdfsSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for HdfsSource. -func (hs HdfsSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -91964,7 +97220,7 @@ type HDInsightHiveActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -92002,6 +97258,11 @@ func (hiha HDInsightHiveActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for HDInsightHiveActivity. func (hiha HDInsightHiveActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -93052,7 +98313,7 @@ type HDInsightMapReduceActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -93090,6 +98351,11 @@ func (himra HDInsightMapReduceActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for HDInsightMapReduceActivity. func (himra HDInsightMapReduceActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -94413,7 +99679,7 @@ type HDInsightPigActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -94451,6 +99717,11 @@ func (hipa HDInsightPigActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for HDInsightPigActivity. func (hipa HDInsightPigActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -94793,7 +100064,7 @@ type HDInsightSparkActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -94831,6 +100102,11 @@ func (hisa HDInsightSparkActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for HDInsightSparkActivity. func (hisa HDInsightSparkActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -95183,7 +100459,7 @@ type HDInsightStreamingActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -95221,6 +100497,11 @@ func (hisa HDInsightStreamingActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for HDInsightStreamingActivity. func (hisa HDInsightStreamingActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -96402,7 +101683,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -96803,6 +102084,11 @@ func (hod HiveObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollect return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for HiveObjectDataset. func (hod HiveObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -96843,6 +102129,11 @@ func (hod HiveObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for HiveObjectDataset. func (hod HiveObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -96990,6 +102281,8 @@ func (hod *HiveObjectDataset) UnmarshalJSON(body []byte) error { type HiveSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -96998,7 +102291,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -97009,6 +102302,9 @@ func (hs HiveSource) MarshalJSON() ([]byte, error) { if hs.Query != nil { objectMap["query"] = hs.Query } + if hs.QueryTimeout != nil { + objectMap["queryTimeout"] = hs.QueryTimeout + } if hs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = hs.SourceRetryCount } @@ -97027,6 +102323,121 @@ func (hs HiveSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for HiveSource. func (hs HiveSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -97202,81 +102613,21 @@ func (hs HiveSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for HiveSource. func (hs HiveSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for HiveSource. func (hs HiveSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for HiveSource. func (hs HiveSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for HiveSource. func (hs HiveSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -97302,11 +102653,6 @@ func (hs HiveSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for HiveSource. func (hs HiveSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -97332,21 +102678,11 @@ func (hs HiveSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for HiveSource. func (hs HiveSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for HiveSource. func (hs HiveSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -97377,53 +102713,33 @@ func (hs HiveSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for HiveSource. func (hs HiveSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &hs, true } -// AsAzureTableSource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for HiveSource. -func (hs HiveSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -97475,6 +102791,15 @@ func (hs *HiveSource) UnmarshalJSON(body []byte) error { } hs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + hs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -97549,7 +102874,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -97950,6 +103275,11 @@ func (hd HTTPDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionData return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for HTTPDataset. func (hd HTTPDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -97990,6 +103320,11 @@ func (hd HTTPDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for HTTPDataset. func (hd HTTPDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -99152,7 +104487,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -99181,6 +104516,121 @@ func (hs HTTPSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsHTTPSource() (*HTTPSource, bool) { + return &hs, true +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for HTTPSource. func (hs HTTPSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -99356,81 +104806,21 @@ func (hs HTTPSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsHTTPSource() (*HTTPSource, bool) { - return &hs, true -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for HTTPSource. func (hs HTTPSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for HTTPSource. func (hs HTTPSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for HTTPSource. func (hs HTTPSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for HTTPSource. func (hs HTTPSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -99456,11 +104846,6 @@ func (hs HTTPSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for HTTPSource. func (hs HTTPSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -99486,21 +104871,11 @@ func (hs HTTPSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for HTTPSource. func (hs HTTPSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for HTTPSource. func (hs HTTPSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -99531,53 +104906,33 @@ func (hs HTTPSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for HTTPSource. func (hs HTTPSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for HTTPSource. -func (hs HTTPSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -100399,7 +105754,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -100800,6 +106155,11 @@ func (hod HubspotObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbColl return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for HubspotObjectDataset. func (hod HubspotObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -100840,6 +106200,11 @@ func (hod HubspotObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for HubspotObjectDataset. func (hod HubspotObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -100987,6 +106352,8 @@ func (hod *HubspotObjectDataset) UnmarshalJSON(body []byte) error { type HubspotSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -100995,7 +106362,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -101006,6 +106373,9 @@ func (hs HubspotSource) MarshalJSON() ([]byte, error) { if hs.Query != nil { objectMap["query"] = hs.Query } + if hs.QueryTimeout != nil { + objectMap["queryTimeout"] = hs.QueryTimeout + } if hs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = hs.SourceRetryCount } @@ -101024,6 +106394,121 @@ func (hs HubspotSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for HubspotSource. func (hs HubspotSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -101199,81 +106684,21 @@ func (hs HubspotSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for HubspotSource. func (hs HubspotSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for HubspotSource. func (hs HubspotSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for HubspotSource. func (hs HubspotSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for HubspotSource. func (hs HubspotSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -101299,11 +106724,6 @@ func (hs HubspotSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for HubspotSource. func (hs HubspotSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -101329,21 +106749,11 @@ func (hs HubspotSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSourc return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for HubspotSource. func (hs HubspotSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for HubspotSource. func (hs HubspotSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -101374,53 +106784,33 @@ func (hs HubspotSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for HubspotSource. func (hs HubspotSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &hs, true } -// AsAzureTableSource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for HubspotSource. -func (hs HubspotSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -101472,6 +106862,15 @@ func (hs *HubspotSource) UnmarshalJSON(body []byte) error { } hs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + hs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -101542,7 +106941,7 @@ type IfConditionActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -101574,6 +106973,11 @@ func (ica IfConditionActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for IfConditionActivity. func (ica IfConditionActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -102651,7 +108055,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -103052,6 +108456,11 @@ func (iod ImpalaObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbColle return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for ImpalaObjectDataset. func (iod ImpalaObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -103092,6 +108501,11 @@ func (iod ImpalaObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ImpalaObjectDataset. func (iod ImpalaObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -103239,6 +108653,8 @@ func (iod *ImpalaObjectDataset) UnmarshalJSON(body []byte) error { type ImpalaSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -103247,7 +108663,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -103258,6 +108674,9 @@ func (is ImpalaSource) MarshalJSON() ([]byte, error) { if is.Query != nil { objectMap["query"] = is.Query } + if is.QueryTimeout != nil { + objectMap["queryTimeout"] = is.QueryTimeout + } if is.SourceRetryCount != nil { objectMap["sourceRetryCount"] = is.SourceRetryCount } @@ -103276,6 +108695,121 @@ func (is ImpalaSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for ImpalaSource. func (is ImpalaSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -103451,81 +108985,21 @@ func (is ImpalaSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for ImpalaSource. func (is ImpalaSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for ImpalaSource. func (is ImpalaSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for ImpalaSource. func (is ImpalaSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for ImpalaSource. func (is ImpalaSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -103551,11 +109025,6 @@ func (is ImpalaSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for ImpalaSource. func (is ImpalaSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -103581,21 +109050,11 @@ func (is ImpalaSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for ImpalaSource. func (is ImpalaSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for ImpalaSource. func (is ImpalaSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -103626,53 +109085,33 @@ func (is ImpalaSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for ImpalaSource. func (is ImpalaSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &is, true } -// AsAzureTableSource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for ImpalaSource. -func (is ImpalaSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -103724,6 +109163,15 @@ func (is *ImpalaSource) UnmarshalJSON(body []byte) error { } is.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + is.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -104469,7 +109917,7 @@ type InformixSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -104599,6 +110047,11 @@ func (is InformixSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for InformixSink. +func (is InformixSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for InformixSink. func (is InformixSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -104654,6 +110107,11 @@ func (is InformixSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for InformixSink. +func (is InformixSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for InformixSink. func (is InformixSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -104768,6 +110226,8 @@ func (is *InformixSink) UnmarshalJSON(body []byte) error { type InformixSource struct { // Query - Database query. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -104776,7 +110236,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -104787,6 +110247,9 @@ func (is InformixSource) MarshalJSON() ([]byte, error) { if is.Query != nil { objectMap["query"] = is.Query } + if is.QueryTimeout != nil { + objectMap["queryTimeout"] = is.QueryTimeout + } if is.SourceRetryCount != nil { objectMap["sourceRetryCount"] = is.SourceRetryCount } @@ -104805,6 +110268,121 @@ func (is InformixSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for InformixSource. func (is InformixSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -104980,81 +110558,21 @@ func (is InformixSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for InformixSource. func (is InformixSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for InformixSource. func (is InformixSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for InformixSource. func (is InformixSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for InformixSource. func (is InformixSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -105080,11 +110598,6 @@ func (is InformixSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for InformixSource. func (is InformixSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -105110,21 +110623,11 @@ func (is InformixSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSour return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for InformixSource. func (is InformixSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for InformixSource. func (is InformixSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -105155,53 +110658,33 @@ func (is InformixSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for InformixSource. func (is InformixSource) AsInformixSource() (*InformixSource, bool) { return &is, true } -// AsRelationalSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDynamicsSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsTabularSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { - return nil, false -} - -// AsBlobSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &is, true } -// AsAzureTableSource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for InformixSource. -func (is InformixSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -105253,6 +110736,15 @@ func (is *InformixSource) UnmarshalJSON(body []byte) error { } is.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + is.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -105327,7 +110819,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -105728,6 +111220,11 @@ func (itd InformixTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbColl return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for InformixTableDataset. +func (itd InformixTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for InformixTableDataset. func (itd InformixTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -105768,6 +111265,11 @@ func (itd InformixTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for InformixTableDataset. +func (itd InformixTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for InformixTableDataset. func (itd InformixTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -106077,6 +111579,8 @@ type IntegrationRuntimeComputeProperties struct { NumberOfNodes *int32 `json:"numberOfNodes,omitempty"` // MaxParallelExecutionsPerNode - Maximum parallel executions count per node for managed integration runtime. MaxParallelExecutionsPerNode *int32 `json:"maxParallelExecutionsPerNode,omitempty"` + // DataFlowProperties - Data flow properties for managed integration runtime. + DataFlowProperties *IntegrationRuntimeDataFlowProperties `json:"dataFlowProperties,omitempty"` // VNetProperties - VNet properties for managed integration runtime. VNetProperties *IntegrationRuntimeVNetProperties `json:"vNetProperties,omitempty"` } @@ -106096,6 +111600,9 @@ func (ircp IntegrationRuntimeComputeProperties) MarshalJSON() ([]byte, error) { if ircp.MaxParallelExecutionsPerNode != nil { objectMap["maxParallelExecutionsPerNode"] = ircp.MaxParallelExecutionsPerNode } + if ircp.DataFlowProperties != nil { + objectMap["dataFlowProperties"] = ircp.DataFlowProperties + } if ircp.VNetProperties != nil { objectMap["vNetProperties"] = ircp.VNetProperties } @@ -106162,6 +111669,15 @@ func (ircp *IntegrationRuntimeComputeProperties) UnmarshalJSON(body []byte) erro } ircp.MaxParallelExecutionsPerNode = &maxParallelExecutionsPerNode } + case "dataFlowProperties": + if v != nil { + var dataFlowProperties IntegrationRuntimeDataFlowProperties + err = json.Unmarshal(*v, &dataFlowProperties) + if err != nil { + return err + } + ircp.DataFlowProperties = &dataFlowProperties + } case "vNetProperties": if v != nil { var vNetProperties IntegrationRuntimeVNetProperties @@ -106296,6 +111812,90 @@ type IntegrationRuntimeCustomSetupScriptProperties struct { SasToken *SecureString `json:"sasToken,omitempty"` } +// IntegrationRuntimeDataFlowProperties data flow properties for managed integration runtime. +type IntegrationRuntimeDataFlowProperties struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ComputeType - Compute type of the cluster which will execute data flow job. Possible values include: 'General', 'MemoryOptimized', 'ComputeOptimized' + ComputeType DataFlowComputeType `json:"computeType,omitempty"` + // CoreCount - Core count of the cluster which will execute data flow job. Supported values are: 8, 16, 32, 48, 80, 144 and 272. + CoreCount *int32 `json:"coreCount,omitempty"` + // TimeToLive - Time to live (in minutes) setting of the cluster which will execute data flow job. + TimeToLive *int32 `json:"timeToLive,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeDataFlowProperties. +func (irdfp IntegrationRuntimeDataFlowProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if irdfp.ComputeType != "" { + objectMap["computeType"] = irdfp.ComputeType + } + if irdfp.CoreCount != nil { + objectMap["coreCount"] = irdfp.CoreCount + } + if irdfp.TimeToLive != nil { + objectMap["timeToLive"] = irdfp.TimeToLive + } + for k, v := range irdfp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeDataFlowProperties struct. +func (irdfp *IntegrationRuntimeDataFlowProperties) UnmarshalJSON(body []byte) 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 irdfp.AdditionalProperties == nil { + irdfp.AdditionalProperties = make(map[string]interface{}) + } + irdfp.AdditionalProperties[k] = additionalProperties + } + case "computeType": + if v != nil { + var computeType DataFlowComputeType + err = json.Unmarshal(*v, &computeType) + if err != nil { + return err + } + irdfp.ComputeType = computeType + } + case "coreCount": + if v != nil { + var coreCount int32 + err = json.Unmarshal(*v, &coreCount) + if err != nil { + return err + } + irdfp.CoreCount = &coreCount + } + case "timeToLive": + if v != nil { + var timeToLive int32 + err = json.Unmarshal(*v, &timeToLive) + if err != nil { + return err + } + irdfp.TimeToLive = &timeToLive + } + } + } + + return nil +} + // IntegrationRuntimeDataProxyProperties data proxy properties for a managed dedicated integration runtime. type IntegrationRuntimeDataProxyProperties struct { // ConnectVia - The self-hosted integration runtime reference. @@ -106845,6 +112445,8 @@ type IntegrationRuntimeSsisProperties struct { DataProxyProperties *IntegrationRuntimeDataProxyProperties `json:"dataProxyProperties,omitempty"` // Edition - The edition for the SSIS Integration Runtime. Possible values include: 'Standard', 'Enterprise' Edition IntegrationRuntimeEdition `json:"edition,omitempty"` + // ExpressCustomSetupProperties - Custom setup without script properties for a SSIS integration runtime. + ExpressCustomSetupProperties *[]BasicCustomSetupBase `json:"expressCustomSetupProperties,omitempty"` } // MarshalJSON is the custom marshaler for IntegrationRuntimeSsisProperties. @@ -106865,6 +112467,9 @@ func (irsp IntegrationRuntimeSsisProperties) MarshalJSON() ([]byte, error) { if irsp.Edition != "" { objectMap["edition"] = irsp.Edition } + if irsp.ExpressCustomSetupProperties != nil { + objectMap["expressCustomSetupProperties"] = irsp.ExpressCustomSetupProperties + } for k, v := range irsp.AdditionalProperties { objectMap[k] = v } @@ -106937,6 +112542,14 @@ func (irsp *IntegrationRuntimeSsisProperties) UnmarshalJSON(body []byte) error { } irsp.Edition = edition } + case "expressCustomSetupProperties": + if v != nil { + expressCustomSetupProperties, err := unmarshalBasicCustomSetupBaseArray(*v) + if err != nil { + return err + } + irsp.ExpressCustomSetupProperties = &expressCustomSetupProperties + } } } @@ -107979,7 +113592,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -108380,6 +113993,11 @@ func (jod JiraObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollect return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for JiraObjectDataset. func (jod JiraObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -108420,6 +114038,11 @@ func (jod JiraObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for JiraObjectDataset. func (jod JiraObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -108567,6 +114190,8 @@ func (jod *JiraObjectDataset) UnmarshalJSON(body []byte) error { type JiraSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -108575,7 +114200,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -108586,6 +114211,9 @@ func (js JiraSource) MarshalJSON() ([]byte, error) { if js.Query != nil { objectMap["query"] = js.Query } + if js.QueryTimeout != nil { + objectMap["queryTimeout"] = js.QueryTimeout + } if js.SourceRetryCount != nil { objectMap["sourceRetryCount"] = js.SourceRetryCount } @@ -108604,6 +114232,121 @@ func (js JiraSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for JiraSource. func (js JiraSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -108779,81 +114522,21 @@ func (js JiraSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for JiraSource. func (js JiraSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for JiraSource. func (js JiraSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for JiraSource. func (js JiraSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for JiraSource. func (js JiraSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -108879,11 +114562,6 @@ func (js JiraSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for JiraSource. func (js JiraSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -108909,21 +114587,11 @@ func (js JiraSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for JiraSource. func (js JiraSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for JiraSource. func (js JiraSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -108954,53 +114622,33 @@ func (js JiraSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for JiraSource. func (js JiraSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDynamicsSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsTabularSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { - return nil, false -} - -// AsBlobSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &js, true } -// AsAzureTableSource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for JiraSource. -func (js JiraSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -109052,6 +114700,15 @@ func (js *JiraSource) UnmarshalJSON(body []byte) error { } js.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + js.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -109126,7 +114783,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -109527,6 +115184,11 @@ func (jd JSONDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionData return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for JSONDataset. +func (jd JSONDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for JSONDataset. func (jd JSONDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -109567,6 +115229,11 @@ func (jd JSONDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for JSONDataset. +func (jd JSONDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for JSONDataset. func (jd JSONDataset) AsJSONDataset() (*JSONDataset, bool) { return &jd, true @@ -109969,7 +115636,7 @@ type JSONSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -110100,6 +115767,11 @@ func (js JSONSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for JSONSink. +func (js JSONSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for JSONSink. func (js JSONSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -110155,6 +115827,11 @@ func (js JSONSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for JSONSink. +func (js JSONSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for JSONSink. func (js JSONSink) AsJSONSink() (*JSONSink, bool) { return &js, true @@ -110285,7 +115962,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -110314,6 +115991,121 @@ func (js JSONSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for JSONSource. func (js JSONSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -110489,81 +116281,21 @@ func (js JSONSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for JSONSource. func (js JSONSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for JSONSource. func (js JSONSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for JSONSource. func (js JSONSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for JSONSource. func (js JSONSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -110589,11 +116321,6 @@ func (js JSONSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for JSONSource. func (js JSONSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -110619,21 +116346,11 @@ func (js JSONSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for JSONSource. func (js JSONSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for JSONSource. func (js JSONSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -110664,53 +116381,33 @@ func (js JSONSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for JSONSource. func (js JSONSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for JSONSource. -func (js JSONSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -110886,6 +116583,46 @@ func (jws *JSONWriteSettings) UnmarshalJSON(body []byte) error { return nil } +// LicensedComponentSetupTypeProperties installation of licensed component setup type properties. +type LicensedComponentSetupTypeProperties struct { + // ComponentName - The name of the 3rd party component. + ComponentName *string `json:"componentName,omitempty"` + // LicenseKey - The license key to activate the component. + LicenseKey BasicSecretBase `json:"licenseKey,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for LicensedComponentSetupTypeProperties struct. +func (lcstp *LicensedComponentSetupTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "componentName": + if v != nil { + var componentName string + err = json.Unmarshal(*v, &componentName) + if err != nil { + return err + } + lcstp.ComponentName = &componentName + } + case "licenseKey": + if v != nil { + licenseKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + lcstp.LicenseKey = licenseKey + } + } + } + + return nil +} + // LinkedIntegrationRuntime the linked integration runtime information. type LinkedIntegrationRuntime struct { // Name - READ-ONLY; The name of the linked integration runtime. @@ -112479,7 +118216,7 @@ type LookupActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -112517,6 +118254,11 @@ func (la LookupActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for LookupActivity. func (la LookupActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -113548,7 +119290,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -113949,6 +119691,11 @@ func (mod MagentoObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbColl return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for MagentoObjectDataset. func (mod MagentoObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -113989,6 +119736,11 @@ func (mod MagentoObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for MagentoObjectDataset. func (mod MagentoObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -114136,6 +119888,8 @@ func (mod *MagentoObjectDataset) UnmarshalJSON(body []byte) error { type MagentoSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -114144,7 +119898,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -114155,6 +119909,9 @@ func (ms MagentoSource) MarshalJSON() ([]byte, error) { if ms.Query != nil { objectMap["query"] = ms.Query } + if ms.QueryTimeout != nil { + objectMap["queryTimeout"] = ms.QueryTimeout + } if ms.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ms.SourceRetryCount } @@ -114173,6 +119930,121 @@ func (ms MagentoSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for MagentoSource. func (ms MagentoSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -114348,81 +120220,21 @@ func (ms MagentoSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for MagentoSource. func (ms MagentoSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for MagentoSource. func (ms MagentoSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for MagentoSource. func (ms MagentoSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for MagentoSource. func (ms MagentoSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -114448,11 +120260,6 @@ func (ms MagentoSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for MagentoSource. func (ms MagentoSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -114478,21 +120285,11 @@ func (ms MagentoSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSourc return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for MagentoSource. func (ms MagentoSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for MagentoSource. func (ms MagentoSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -114523,53 +120320,33 @@ func (ms MagentoSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for MagentoSource. func (ms MagentoSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ms, true } -// AsAzureTableSource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for MagentoSource. -func (ms MagentoSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -114621,6 +120398,15 @@ func (ms *MagentoSource) UnmarshalJSON(body []byte) error { } ms.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ms.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -114963,6 +120749,129 @@ type ManagedIntegrationRuntimeTypeProperties struct { SsisProperties *IntegrationRuntimeSsisProperties `json:"ssisProperties,omitempty"` } +// MappingDataFlow mapping data flow. +type MappingDataFlow struct { + // MappingDataFlowTypeProperties - Mapping data flow type properties. + *MappingDataFlowTypeProperties `json:"typeProperties,omitempty"` + // Description - The description of the data flow. + Description *string `json:"description,omitempty"` + // Annotations - List of tags that can be used for describing the data flow. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Folder - The folder that this data flow is in. If not specified, Data flow will appear at the root level. + Folder *DataFlowFolder `json:"folder,omitempty"` + // Type - Possible values include: 'TypeDataFlow', 'TypeMappingDataFlow' + Type TypeBasicDataFlow `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MappingDataFlow. +func (mdf MappingDataFlow) MarshalJSON() ([]byte, error) { + mdf.Type = TypeMappingDataFlow + objectMap := make(map[string]interface{}) + if mdf.MappingDataFlowTypeProperties != nil { + objectMap["typeProperties"] = mdf.MappingDataFlowTypeProperties + } + if mdf.Description != nil { + objectMap["description"] = mdf.Description + } + if mdf.Annotations != nil { + objectMap["annotations"] = mdf.Annotations + } + if mdf.Folder != nil { + objectMap["folder"] = mdf.Folder + } + if mdf.Type != "" { + objectMap["type"] = mdf.Type + } + return json.Marshal(objectMap) +} + +// AsMappingDataFlow is the BasicDataFlow implementation for MappingDataFlow. +func (mdf MappingDataFlow) AsMappingDataFlow() (*MappingDataFlow, bool) { + return &mdf, true +} + +// AsDataFlow is the BasicDataFlow implementation for MappingDataFlow. +func (mdf MappingDataFlow) AsDataFlow() (*DataFlow, bool) { + return nil, false +} + +// AsBasicDataFlow is the BasicDataFlow implementation for MappingDataFlow. +func (mdf MappingDataFlow) AsBasicDataFlow() (BasicDataFlow, bool) { + return &mdf, true +} + +// UnmarshalJSON is the custom unmarshaler for MappingDataFlow struct. +func (mdf *MappingDataFlow) UnmarshalJSON(body []byte) error { + 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 mappingDataFlowTypeProperties MappingDataFlowTypeProperties + err = json.Unmarshal(*v, &mappingDataFlowTypeProperties) + if err != nil { + return err + } + mdf.MappingDataFlowTypeProperties = &mappingDataFlowTypeProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + mdf.Description = &description + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + mdf.Annotations = &annotations + } + case "folder": + if v != nil { + var folder DataFlowFolder + err = json.Unmarshal(*v, &folder) + if err != nil { + return err + } + mdf.Folder = &folder + } + case "type": + if v != nil { + var typeVar TypeBasicDataFlow + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mdf.Type = typeVar + } + } + } + + return nil +} + +// MappingDataFlowTypeProperties mapping data flow type properties. +type MappingDataFlowTypeProperties struct { + // Sources - List of sources in data flow. + Sources *[]DataFlowSource `json:"sources,omitempty"` + // Sinks - List of sinks in data flow. + Sinks *[]DataFlowSink `json:"sinks,omitempty"` + // Transformations - List of transformations in data flow. + Transformations *[]Transformation `json:"transformations,omitempty"` + // Script - DataFlow script. + Script *string `json:"script,omitempty"` +} + // MariaDBLinkedService mariaDB server linked service. type MariaDBLinkedService struct { // MariaDBLinkedServiceTypeProperties - MariaDB server linked service properties. @@ -115569,6 +121478,8 @@ type MariaDBLinkedServiceTypeProperties struct { type MariaDBSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -115577,7 +121488,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -115588,6 +121499,9 @@ func (mds MariaDBSource) MarshalJSON() ([]byte, error) { if mds.Query != nil { objectMap["query"] = mds.Query } + if mds.QueryTimeout != nil { + objectMap["queryTimeout"] = mds.QueryTimeout + } if mds.SourceRetryCount != nil { objectMap["sourceRetryCount"] = mds.SourceRetryCount } @@ -115606,6 +121520,121 @@ func (mds MariaDBSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for MariaDBSource. func (mds MariaDBSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -115781,81 +121810,21 @@ func (mds MariaDBSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for MariaDBSource. func (mds MariaDBSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for MariaDBSource. func (mds MariaDBSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for MariaDBSource. func (mds MariaDBSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for MariaDBSource. func (mds MariaDBSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -115881,11 +121850,6 @@ func (mds MariaDBSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for MariaDBSource. func (mds MariaDBSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -115911,21 +121875,11 @@ func (mds MariaDBSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSour return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for MariaDBSource. func (mds MariaDBSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for MariaDBSource. func (mds MariaDBSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -115956,53 +121910,33 @@ func (mds MariaDBSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for MariaDBSource. func (mds MariaDBSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &mds, true } -// AsAzureTableSource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for MariaDBSource. -func (mds MariaDBSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -116054,6 +121988,15 @@ func (mds *MariaDBSource) UnmarshalJSON(body []byte) error { } mds.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + mds.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -116128,7 +122071,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -116529,6 +122472,11 @@ func (mdtd MariaDBTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbColl return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for MariaDBTableDataset. func (mdtd MariaDBTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -116569,6 +122517,11 @@ func (mdtd MariaDBTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for MariaDBTableDataset. func (mdtd MariaDBTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -117419,7 +123372,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -117820,6 +123773,11 @@ func (mod MarketoObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbColl return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for MarketoObjectDataset. func (mod MarketoObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -117860,6 +123818,11 @@ func (mod MarketoObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for MarketoObjectDataset. func (mod MarketoObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -118007,6 +123970,8 @@ func (mod *MarketoObjectDataset) UnmarshalJSON(body []byte) error { type MarketoSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -118015,7 +123980,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -118026,6 +123991,9 @@ func (ms MarketoSource) MarshalJSON() ([]byte, error) { if ms.Query != nil { objectMap["query"] = ms.Query } + if ms.QueryTimeout != nil { + objectMap["queryTimeout"] = ms.QueryTimeout + } if ms.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ms.SourceRetryCount } @@ -118044,6 +124012,121 @@ func (ms MarketoSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for MarketoSource. func (ms MarketoSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -118219,81 +124302,21 @@ func (ms MarketoSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for MarketoSource. func (ms MarketoSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for MarketoSource. func (ms MarketoSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for MarketoSource. func (ms MarketoSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for MarketoSource. func (ms MarketoSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -118319,11 +124342,6 @@ func (ms MarketoSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for MarketoSource. func (ms MarketoSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -118349,21 +124367,11 @@ func (ms MarketoSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSourc return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for MarketoSource. func (ms MarketoSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for MarketoSource. func (ms MarketoSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -118394,53 +124402,33 @@ func (ms MarketoSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for MarketoSource. func (ms MarketoSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDynamicsSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsTabularSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ms, true } -// AsBlobSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsBlobSource() (*BlobSource, bool) { +// AsBinarySource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsAzureTableSource() (*AzureTableSource, bool) { - return nil, false -} - -// AsBinarySource is the BasicCopySource implementation for MarketoSource. -func (ms MarketoSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -118492,6 +124480,15 @@ func (ms *MarketoSource) UnmarshalJSON(body []byte) error { } ms.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ms.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -119237,7 +125234,7 @@ type MicrosoftAccessSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -119367,6 +125364,11 @@ func (mas MicrosoftAccessSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for MicrosoftAccessSink. +func (mas MicrosoftAccessSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for MicrosoftAccessSink. func (mas MicrosoftAccessSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -119422,6 +125424,11 @@ func (mas MicrosoftAccessSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bo return nil, false } +// AsOrcSink is the BasicCopySink implementation for MicrosoftAccessSink. +func (mas MicrosoftAccessSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for MicrosoftAccessSink. func (mas MicrosoftAccessSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -119544,7 +125551,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -119573,6 +125580,121 @@ func (mas MicrosoftAccessSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return &mas, true +} + +// AsRelationalSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for MicrosoftAccessSource. func (mas MicrosoftAccessSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -119748,81 +125870,21 @@ func (mas MicrosoftAccessSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for MicrosoftAccessSource. func (mas MicrosoftAccessSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for MicrosoftAccessSource. func (mas MicrosoftAccessSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for MicrosoftAccessSource. func (mas MicrosoftAccessSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for MicrosoftAccessSource. func (mas MicrosoftAccessSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -119848,11 +125910,6 @@ func (mas MicrosoftAccessSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for MicrosoftAccessSource. func (mas MicrosoftAccessSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -119878,21 +125935,11 @@ func (mas MicrosoftAccessSource) AsSapCloudForCustomerSource() (*SapCloudForCust return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for MicrosoftAccessSource. func (mas MicrosoftAccessSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for MicrosoftAccessSource. func (mas MicrosoftAccessSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -119923,53 +125970,33 @@ func (mas MicrosoftAccessSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return &mas, true -} - // AsInformixSource is the BasicCopySource implementation for MicrosoftAccessSource. func (mas MicrosoftAccessSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for MicrosoftAccessSource. -func (mas MicrosoftAccessSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -120095,7 +126122,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -120496,6 +126523,11 @@ func (matd MicrosoftAccessTableDataset) AsDocumentDbCollectionDataset() (*Docume return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for MicrosoftAccessTableDataset. +func (matd MicrosoftAccessTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for MicrosoftAccessTableDataset. func (matd MicrosoftAccessTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -120536,6 +126568,11 @@ func (matd MicrosoftAccessTableDataset) AsBinaryDataset() (*BinaryDataset, bool) return nil, false } +// AsOrcDataset is the BasicDataset implementation for MicrosoftAccessTableDataset. +func (matd MicrosoftAccessTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for MicrosoftAccessTableDataset. func (matd MicrosoftAccessTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -120705,7 +126742,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -121106,6 +127143,11 @@ func (mdcd MongoDbCollectionDataset) AsDocumentDbCollectionDataset() (*DocumentD return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for MongoDbCollectionDataset. func (mdcd MongoDbCollectionDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -121146,6 +127188,11 @@ func (mdcd MongoDbCollectionDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for MongoDbCollectionDataset. func (mdcd MongoDbCollectionDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -122125,7 +128172,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -122154,6 +128201,121 @@ func (mds MongoDbSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsMongoDbSource() (*MongoDbSource, bool) { + return &mds, true +} + +// AsWebSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for MongoDbSource. func (mds MongoDbSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -122329,81 +128491,21 @@ func (mds MongoDbSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsMongoDbSource() (*MongoDbSource, bool) { - return &mds, true -} - // AsCassandraSource is the BasicCopySource implementation for MongoDbSource. func (mds MongoDbSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for MongoDbSource. func (mds MongoDbSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for MongoDbSource. func (mds MongoDbSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for MongoDbSource. func (mds MongoDbSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -122429,11 +128531,6 @@ func (mds MongoDbSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for MongoDbSource. func (mds MongoDbSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -122459,21 +128556,11 @@ func (mds MongoDbSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSour return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for MongoDbSource. func (mds MongoDbSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for MongoDbSource. func (mds MongoDbSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -122504,53 +128591,33 @@ func (mds MongoDbSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for MongoDbSource. func (mds MongoDbSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for MongoDbSource. -func (mds MongoDbSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -122676,7 +128743,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -123077,6 +129144,11 @@ func (mdvcd MongoDbV2CollectionDataset) AsDocumentDbCollectionDataset() (*Docume return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for MongoDbV2CollectionDataset. +func (mdvcd MongoDbV2CollectionDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for MongoDbV2CollectionDataset. func (mdvcd MongoDbV2CollectionDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -123117,6 +129189,11 @@ func (mdvcd MongoDbV2CollectionDataset) AsBinaryDataset() (*BinaryDataset, bool) return nil, false } +// AsOrcDataset is the BasicDataset implementation for MongoDbV2CollectionDataset. +func (mdvcd MongoDbV2CollectionDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for MongoDbV2CollectionDataset. func (mdvcd MongoDbV2CollectionDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -123874,6 +129951,8 @@ type MongoDbV2Source struct { CursorMethods *MongoDbCursorMethodsProperties `json:"cursorMethods,omitempty"` // BatchSize - Specifies the number of documents to return in each batch of the response from MongoDB instance. In most cases, modifying the batch size will not affect the user or the application. This property's main purpose is to avoid hit the limitation of response size. Type: integer (or Expression with resultType integer). BatchSize interface{} `json:"batchSize,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -123882,7 +129961,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -123899,6 +129978,9 @@ func (mdvs MongoDbV2Source) MarshalJSON() ([]byte, error) { if mdvs.BatchSize != nil { objectMap["batchSize"] = mdvs.BatchSize } + if mdvs.QueryTimeout != nil { + objectMap["queryTimeout"] = mdvs.QueryTimeout + } if mdvs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = mdvs.SourceRetryCount } @@ -123917,6 +129999,121 @@ func (mdvs MongoDbV2Source) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return &mdvs, true +} + +// AsMongoDbSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for MongoDbV2Source. func (mdvs MongoDbV2Source) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -124092,81 +130289,21 @@ func (mdvs MongoDbV2Source) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return &mdvs, true -} - -// AsMongoDbSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for MongoDbV2Source. func (mdvs MongoDbV2Source) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for MongoDbV2Source. func (mdvs MongoDbV2Source) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for MongoDbV2Source. func (mdvs MongoDbV2Source) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for MongoDbV2Source. func (mdvs MongoDbV2Source) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -124192,11 +130329,6 @@ func (mdvs MongoDbV2Source) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for MongoDbV2Source. func (mdvs MongoDbV2Source) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -124222,21 +130354,11 @@ func (mdvs MongoDbV2Source) AsSapCloudForCustomerSource() (*SapCloudForCustomerS return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for MongoDbV2Source. func (mdvs MongoDbV2Source) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for MongoDbV2Source. func (mdvs MongoDbV2Source) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -124267,53 +130389,33 @@ func (mdvs MongoDbV2Source) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for MongoDbV2Source. func (mdvs MongoDbV2Source) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for MongoDbV2Source. -func (mdvs MongoDbV2Source) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -124383,6 +130485,15 @@ func (mdvs *MongoDbV2Source) UnmarshalJSON(body []byte) error { } mdvs.BatchSize = batchSize } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + mdvs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -124457,7 +130568,7 @@ type MultiplePipelineTrigger struct { RuntimeState TriggerRuntimeState `json:"runtimeState,omitempty"` // Annotations - List of tags that can be used for describing the trigger. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' + // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeChainingTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' Type TypeBasicTrigger `json:"type,omitempty"` } @@ -124533,6 +130644,11 @@ func (mpt MultiplePipelineTrigger) AsRerunTumblingWindowTrigger() (*RerunTumblin return nil, false } +// AsChainingTrigger is the BasicTrigger implementation for MultiplePipelineTrigger. +func (mpt MultiplePipelineTrigger) AsChainingTrigger() (*ChainingTrigger, bool) { + return nil, false +} + // AsTumblingWindowTrigger is the BasicTrigger implementation for MultiplePipelineTrigger. func (mpt MultiplePipelineTrigger) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) { return nil, false @@ -125292,6 +131408,8 @@ func (mslstp *MySQLLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error type MySQLSource struct { // Query - Database query. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -125300,7 +131418,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -125311,6 +131429,9 @@ func (mss MySQLSource) MarshalJSON() ([]byte, error) { if mss.Query != nil { objectMap["query"] = mss.Query } + if mss.QueryTimeout != nil { + objectMap["queryTimeout"] = mss.QueryTimeout + } if mss.SourceRetryCount != nil { objectMap["sourceRetryCount"] = mss.SourceRetryCount } @@ -125329,6 +131450,121 @@ func (mss MySQLSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for MySQLSource. func (mss MySQLSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -125504,81 +131740,21 @@ func (mss MySQLSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for MySQLSource. func (mss MySQLSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for MySQLSource. func (mss MySQLSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for MySQLSource. func (mss MySQLSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for MySQLSource. func (mss MySQLSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -125604,11 +131780,6 @@ func (mss MySQLSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for MySQLSource. func (mss MySQLSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -125634,21 +131805,11 @@ func (mss MySQLSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for MySQLSource. func (mss MySQLSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for MySQLSource. func (mss MySQLSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -125679,53 +131840,33 @@ func (mss MySQLSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for MySQLSource. func (mss MySQLSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &mss, true } -// AsAzureTableSource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for MySQLSource. -func (mss MySQLSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -125777,6 +131918,15 @@ func (mss *MySQLSource) UnmarshalJSON(body []byte) error { } mss.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + mss.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -125851,7 +132001,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -126252,6 +132402,11 @@ func (mstd MySQLTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollec return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for MySQLTableDataset. +func (mstd MySQLTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for MySQLTableDataset. func (mstd MySQLTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -126292,6 +132447,11 @@ func (mstd MySQLTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for MySQLTableDataset. +func (mstd MySQLTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for MySQLTableDataset. func (mstd MySQLTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -127061,6 +133221,8 @@ type NetezzaSource struct { PartitionOption NetezzaPartitionOption `json:"partitionOption,omitempty"` // PartitionSettings - The settings that will be leveraged for Netezza source partitioning. PartitionSettings *NetezzaPartitionSettings `json:"partitionSettings,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -127069,7 +133231,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -127086,6 +133248,9 @@ func (ns NetezzaSource) MarshalJSON() ([]byte, error) { if ns.PartitionSettings != nil { objectMap["partitionSettings"] = ns.PartitionSettings } + if ns.QueryTimeout != nil { + objectMap["queryTimeout"] = ns.QueryTimeout + } if ns.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ns.SourceRetryCount } @@ -127104,6 +133269,121 @@ func (ns NetezzaSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for NetezzaSource. func (ns NetezzaSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -127279,81 +133559,21 @@ func (ns NetezzaSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for NetezzaSource. func (ns NetezzaSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for NetezzaSource. func (ns NetezzaSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for NetezzaSource. func (ns NetezzaSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for NetezzaSource. func (ns NetezzaSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -127379,11 +133599,6 @@ func (ns NetezzaSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for NetezzaSource. func (ns NetezzaSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -127409,21 +133624,11 @@ func (ns NetezzaSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSourc return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for NetezzaSource. func (ns NetezzaSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for NetezzaSource. func (ns NetezzaSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -127454,53 +133659,33 @@ func (ns NetezzaSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for NetezzaSource. func (ns NetezzaSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ns, true } -// AsAzureTableSource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for NetezzaSource. -func (ns NetezzaSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -127570,6 +133755,15 @@ func (ns *NetezzaSource) UnmarshalJSON(body []byte) error { } ns.PartitionSettings = &partitionSettings } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ns.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -127644,7 +133838,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -128045,6 +134239,11 @@ func (ntd NetezzaTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbColle return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for NetezzaTableDataset. func (ntd NetezzaTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -128085,6 +134284,11 @@ func (ntd NetezzaTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for NetezzaTableDataset. func (ntd NetezzaTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -128997,7 +135201,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -129398,6 +135602,11 @@ func (odrd ODataResourceDataset) AsDocumentDbCollectionDataset() (*DocumentDbCol return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for ODataResourceDataset. func (odrd ODataResourceDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -129438,6 +135647,11 @@ func (odrd ODataResourceDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ODataResourceDataset. func (odrd ODataResourceDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -129599,7 +135813,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -129628,6 +135842,121 @@ func (ods ODataSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsODataSource() (*ODataSource, bool) { + return &ods, true +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for ODataSource. func (ods ODataSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -129803,81 +136132,21 @@ func (ods ODataSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for ODataSource. func (ods ODataSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for ODataSource. func (ods ODataSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for ODataSource. func (ods ODataSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for ODataSource. func (ods ODataSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -129903,11 +136172,6 @@ func (ods ODataSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for ODataSource. func (ods ODataSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -129933,21 +136197,11 @@ func (ods ODataSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for ODataSource. func (ods ODataSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsODataSource() (*ODataSource, bool) { - return &ods, true -} - // AsSapBwSource is the BasicCopySource implementation for ODataSource. func (ods ODataSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -129978,53 +136232,33 @@ func (ods ODataSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for ODataSource. func (ods ODataSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for ODataSource. -func (ods ODataSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -130821,7 +137055,7 @@ type OdbcSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -130951,6 +137185,11 @@ func (osVar OdbcSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for OdbcSink. func (osVar OdbcSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -131006,6 +137245,11 @@ func (osVar OdbcSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for OdbcSink. func (osVar OdbcSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -131120,6 +137364,8 @@ func (osVar *OdbcSink) UnmarshalJSON(body []byte) error { type OdbcSource struct { // Query - Database query. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -131128,7 +137374,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -131139,6 +137385,9 @@ func (osVar OdbcSource) MarshalJSON() ([]byte, error) { if osVar.Query != nil { objectMap["query"] = osVar.Query } + if osVar.QueryTimeout != nil { + objectMap["queryTimeout"] = osVar.QueryTimeout + } if osVar.SourceRetryCount != nil { objectMap["sourceRetryCount"] = osVar.SourceRetryCount } @@ -131157,6 +137406,121 @@ func (osVar OdbcSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for OdbcSource. func (osVar OdbcSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -131332,81 +137696,21 @@ func (osVar OdbcSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for OdbcSource. func (osVar OdbcSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for OdbcSource. func (osVar OdbcSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for OdbcSource. func (osVar OdbcSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for OdbcSource. func (osVar OdbcSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -131432,11 +137736,6 @@ func (osVar OdbcSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for OdbcSource. func (osVar OdbcSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -131462,21 +137761,11 @@ func (osVar OdbcSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSourc return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for OdbcSource. func (osVar OdbcSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for OdbcSource. func (osVar OdbcSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -131507,53 +137796,33 @@ func (osVar OdbcSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for OdbcSource. func (osVar OdbcSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDynamicsSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsTabularSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &osVar, true } -// AsBlobSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsBlobSource() (*BlobSource, bool) { +// AsBinarySource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsAzureTableSource() (*AzureTableSource, bool) { - return nil, false -} - -// AsBinarySource is the BasicCopySource implementation for OdbcSource. -func (osVar OdbcSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -131605,6 +137874,15 @@ func (osVar *OdbcSource) UnmarshalJSON(body []byte) error { } osVar.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + osVar.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -131679,7 +137957,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -132080,6 +138358,11 @@ func (otd OdbcTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollecti return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for OdbcTableDataset. +func (otd OdbcTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for OdbcTableDataset. func (otd OdbcTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -132120,6 +138403,11 @@ func (otd OdbcTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for OdbcTableDataset. +func (otd OdbcTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for OdbcTableDataset. func (otd OdbcTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -132289,7 +138577,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -132690,6 +138978,11 @@ func (o3d Office365Dataset) AsDocumentDbCollectionDataset() (*DocumentDbCollecti return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for Office365Dataset. +func (o3d Office365Dataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for Office365Dataset. func (o3d Office365Dataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -132730,6 +139023,11 @@ func (o3d Office365Dataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for Office365Dataset. +func (o3d Office365Dataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for Office365Dataset. func (o3d Office365Dataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -133546,7 +139844,7 @@ func (o3lstp *Office365LinkedServiceTypeProperties) UnmarshalJSON(body []byte) e return nil } -// Office365Source a copy activity source for an Office365 service. +// Office365Source a copy activity source for an Office 365 service. type Office365Source struct { // AllowedGroups - The groups containing all the users. Type: array of strings (or Expression with resultType array of strings). AllowedGroups interface{} `json:"allowedGroups,omitempty"` @@ -133558,6 +139856,8 @@ type Office365Source struct { StartTime interface{} `json:"startTime,omitempty"` // EndTime - End time of the requested range for this dataset. Type: string (or Expression with resultType string). EndTime interface{} `json:"endTime,omitempty"` + // OutputColumns - The columns to be read out from the Office 365 table. Type: array of objects (or Expression with resultType array of objects). Example: [ { "name": "Id" }, { "name": "CreatedDateTime" } ] + OutputColumns interface{} `json:"outputColumns,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). @@ -133566,7 +139866,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -133589,6 +139889,9 @@ func (o3s Office365Source) MarshalJSON() ([]byte, error) { if o3s.EndTime != nil { objectMap["endTime"] = o3s.EndTime } + if o3s.OutputColumns != nil { + objectMap["outputColumns"] = o3s.OutputColumns + } if o3s.SourceRetryCount != nil { objectMap["sourceRetryCount"] = o3s.SourceRetryCount } @@ -133607,6 +139910,121 @@ func (o3s Office365Source) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsOffice365Source() (*Office365Source, bool) { + return &o3s, true +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for Office365Source. func (o3s Office365Source) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -133782,81 +140200,21 @@ func (o3s Office365Source) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsOffice365Source() (*Office365Source, bool) { - return &o3s, true -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for Office365Source. func (o3s Office365Source) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for Office365Source. func (o3s Office365Source) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for Office365Source. func (o3s Office365Source) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for Office365Source. func (o3s Office365Source) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -133882,11 +140240,6 @@ func (o3s Office365Source) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for Office365Source. func (o3s Office365Source) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -133912,21 +140265,11 @@ func (o3s Office365Source) AsSapCloudForCustomerSource() (*SapCloudForCustomerSo return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for Office365Source. func (o3s Office365Source) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for Office365Source. func (o3s Office365Source) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -133957,53 +140300,33 @@ func (o3s Office365Source) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for Office365Source. func (o3s Office365Source) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for Office365Source. -func (o3s Office365Source) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -134091,6 +140414,15 @@ func (o3s *Office365Source) UnmarshalJSON(body []byte) error { } o3s.EndTime = endTime } + case "outputColumns": + if v != nil { + var outputColumns interface{} + err = json.Unmarshal(*v, &outputColumns) + if err != nil { + return err + } + o3s.OutputColumns = outputColumns + } default: if v != nil { var additionalProperties interface{} @@ -135771,7 +142103,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -136172,6 +142504,11 @@ func (oscod OracleServiceCloudObjectDataset) AsDocumentDbCollectionDataset() (*D return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for OracleServiceCloudObjectDataset. +func (oscod OracleServiceCloudObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for OracleServiceCloudObjectDataset. func (oscod OracleServiceCloudObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -136212,6 +142549,11 @@ func (oscod OracleServiceCloudObjectDataset) AsBinaryDataset() (*BinaryDataset, return nil, false } +// AsOrcDataset is the BasicDataset implementation for OracleServiceCloudObjectDataset. +func (oscod OracleServiceCloudObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for OracleServiceCloudObjectDataset. func (oscod OracleServiceCloudObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -136359,6 +142701,8 @@ func (oscod *OracleServiceCloudObjectDataset) UnmarshalJSON(body []byte) error { type OracleServiceCloudSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -136367,7 +142711,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -136378,6 +142722,9 @@ func (oscs OracleServiceCloudSource) MarshalJSON() ([]byte, error) { if oscs.Query != nil { objectMap["query"] = oscs.Query } + if oscs.QueryTimeout != nil { + objectMap["queryTimeout"] = oscs.QueryTimeout + } if oscs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = oscs.SourceRetryCount } @@ -136396,6 +142743,121 @@ func (oscs OracleServiceCloudSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for OracleServiceCloudSource. func (oscs OracleServiceCloudSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -136571,81 +143033,21 @@ func (oscs OracleServiceCloudSource) AsAmazonMWSSource() (*AmazonMWSSource, bool return nil, false } -// AsHTTPSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for OracleServiceCloudSource. func (oscs OracleServiceCloudSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for OracleServiceCloudSource. func (oscs OracleServiceCloudSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for OracleServiceCloudSource. func (oscs OracleServiceCloudSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for OracleServiceCloudSource. func (oscs OracleServiceCloudSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -136671,11 +143073,6 @@ func (oscs OracleServiceCloudSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for OracleServiceCloudSource. func (oscs OracleServiceCloudSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -136701,21 +143098,11 @@ func (oscs OracleServiceCloudSource) AsSapCloudForCustomerSource() (*SapCloudFor return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for OracleServiceCloudSource. func (oscs OracleServiceCloudSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for OracleServiceCloudSource. func (oscs OracleServiceCloudSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -136746,53 +143133,33 @@ func (oscs OracleServiceCloudSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for OracleServiceCloudSource. func (oscs OracleServiceCloudSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &oscs, true } -// AsAzureTableSource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for OracleServiceCloudSource. -func (oscs OracleServiceCloudSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -136844,6 +143211,15 @@ func (oscs *OracleServiceCloudSource) UnmarshalJSON(body []byte) error { } oscs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + oscs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -136914,7 +143290,7 @@ type OracleSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -137044,6 +143420,11 @@ func (osVar OracleSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for OracleSink. func (osVar OracleSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -137099,6 +143480,11 @@ func (osVar OracleSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for OracleSink. func (osVar OracleSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -137227,7 +143613,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -137265,6 +143651,121 @@ func (osVar OracleSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsOracleSource() (*OracleSource, bool) { + return &osVar, true +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for OracleSource. func (osVar OracleSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -137440,81 +143941,21 @@ func (osVar OracleSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for OracleSource. func (osVar OracleSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for OracleSource. func (osVar OracleSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsOracleSource() (*OracleSource, bool) { - return &osVar, true -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for OracleSource. func (osVar OracleSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for OracleSource. func (osVar OracleSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -137540,11 +143981,6 @@ func (osVar OracleSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for OracleSource. func (osVar OracleSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -137570,21 +144006,11 @@ func (osVar OracleSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSou return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for OracleSource. func (osVar OracleSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for OracleSource. func (osVar OracleSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -137615,48 +144041,23 @@ func (osVar OracleSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for OracleSource. func (osVar OracleSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsDynamicsSource() (*DynamicsSource, bool) { - return nil, false -} - -// AsDocumentDbCollectionSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } - -// AsBlobSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsBlobSource() (*BlobSource, bool) { + +// AsTabularSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for OracleSource. -func (osVar OracleSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } @@ -137665,6 +144066,11 @@ func (osVar OracleSource) AsBinarySource() (*BinarySource, bool) { return nil, false } +// AsOrcSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsOrcSource() (*OrcSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for OracleSource. func (osVar OracleSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -137814,7 +144220,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -138215,6 +144621,11 @@ func (otd OracleTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollec return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for OracleTableDataset. func (otd OracleTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -138255,6 +144666,11 @@ func (otd OracleTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for OracleTableDataset. func (otd OracleTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -138408,6 +144824,626 @@ type OracleTableDatasetTypeProperties struct { Table interface{} `json:"table,omitempty"` } +// OrcDataset ORC dataset. +type OrcDataset struct { + // OrcDatasetTypeProperties - ORC dataset properties. + *OrcDatasetTypeProperties `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', '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 TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OrcDataset. +func (od OrcDataset) MarshalJSON() ([]byte, error) { + od.Type = TypeOrc + objectMap := make(map[string]interface{}) + if od.OrcDatasetTypeProperties != nil { + objectMap["typeProperties"] = od.OrcDatasetTypeProperties + } + if od.Description != nil { + objectMap["description"] = od.Description + } + if od.Structure != nil { + objectMap["structure"] = od.Structure + } + if od.Schema != nil { + objectMap["schema"] = od.Schema + } + if od.LinkedServiceName != nil { + objectMap["linkedServiceName"] = od.LinkedServiceName + } + if od.Parameters != nil { + objectMap["parameters"] = od.Parameters + } + if od.Annotations != nil { + objectMap["annotations"] = od.Annotations + } + if od.Folder != nil { + objectMap["folder"] = od.Folder + } + if od.Type != "" { + objectMap["type"] = od.Type + } + for k, v := range od.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsGoogleAdWordsObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsGoogleAdWordsObjectDataset() (*GoogleAdWordsObjectDataset, bool) { + return nil, false +} + +// AsAzureDataExplorerTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAzureDataExplorerTableDataset() (*AzureDataExplorerTableDataset, bool) { + return nil, false +} + +// AsOracleServiceCloudObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsOracleServiceCloudObjectDataset() (*OracleServiceCloudObjectDataset, bool) { + return nil, false +} + +// AsDynamicsAXResourceDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsDynamicsAXResourceDataset() (*DynamicsAXResourceDataset, bool) { + return nil, false +} + +// AsResponsysObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsAzureMariaDBTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAzureMariaDBTableDataset() (*AzureMariaDBTableDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSapTableResourceDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsSapTableResourceDataset() (*SapTableResourceDataset, bool) { + return nil, false +} + +// AsRestResourceDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsRestResourceDataset() (*RestResourceDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapOpenHubTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsSapOpenHubTableDataset() (*SapOpenHubTableDataset, bool) { + return nil, false +} + +// AsSapHanaTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsSapHanaTableDataset() (*SapHanaTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSapBwCubeDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsSapBwCubeDataset() (*SapBwCubeDataset, bool) { + return nil, false +} + +// AsSybaseTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsSybaseTableDataset() (*SybaseTableDataset, bool) { + return nil, false +} + +// AsSalesforceServiceCloudObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsSalesforceServiceCloudObjectDataset() (*SalesforceServiceCloudObjectDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsMicrosoftAccessTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsMicrosoftAccessTableDataset() (*MicrosoftAccessTableDataset, bool) { + return nil, false +} + +// AsPostgreSQLTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsPostgreSQLTableDataset() (*PostgreSQLTableDataset, bool) { + return nil, false +} + +// AsMySQLTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsMySQLTableDataset() (*MySQLTableDataset, bool) { + return nil, false +} + +// AsOdbcTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsOdbcTableDataset() (*OdbcTableDataset, bool) { + return nil, false +} + +// AsInformixTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsInformixTableDataset() (*InformixTableDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsDb2TableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsDb2TableDataset() (*Db2TableDataset, bool) { + return nil, false +} + +// AsAmazonRedshiftTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAmazonRedshiftTableDataset() (*AmazonRedshiftTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsTeradataTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsTeradataTableDataset() (*TeradataTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPICollectionDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsCosmosDbMongoDbAPICollectionDataset() (*CosmosDbMongoDbAPICollectionDataset, bool) { + return nil, false +} + +// AsMongoDbV2CollectionDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsMongoDbV2CollectionDataset() (*MongoDbV2CollectionDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsOffice365Dataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsOffice365Dataset() (*Office365Dataset, bool) { + return nil, false +} + +// AsAzureBlobFSDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAzureBlobFSDataset() (*AzureBlobFSDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsEntityDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsCommonDataServiceForAppsEntityDataset() (*CommonDataServiceForAppsEntityDataset, bool) { + return nil, false +} + +// AsDynamicsCrmEntityDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsDynamicsCrmEntityDataset() (*DynamicsCrmEntityDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLMITableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAzureSQLMITableDataset() (*AzureSQLMITableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsBinaryDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsBinaryDataset() (*BinaryDataset, bool) { + return nil, false +} + +// AsOrcDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsOrcDataset() (*OrcDataset, bool) { + return &od, true +} + +// AsJSONDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsJSONDataset() (*JSONDataset, bool) { + return nil, false +} + +// AsDelimitedTextDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsDelimitedTextDataset() (*DelimitedTextDataset, bool) { + return nil, false +} + +// AsParquetDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsParquetDataset() (*ParquetDataset, bool) { + return nil, false +} + +// AsAvroDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAvroDataset() (*AvroDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsBasicDataset() (BasicDataset, bool) { + return &od, true +} + +// UnmarshalJSON is the custom unmarshaler for OrcDataset struct. +func (od *OrcDataset) UnmarshalJSON(body []byte) error { + 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 orcDatasetTypeProperties OrcDatasetTypeProperties + err = json.Unmarshal(*v, &orcDatasetTypeProperties) + if err != nil { + return err + } + od.OrcDatasetTypeProperties = &orcDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if od.AdditionalProperties == nil { + od.AdditionalProperties = make(map[string]interface{}) + } + od.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + od.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + od.Structure = structure + } + case "schema": + if v != nil { + var schema interface{} + err = json.Unmarshal(*v, &schema) + if err != nil { + return err + } + od.Schema = schema + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + od.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + od.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + od.Annotations = &annotations + } + case "folder": + if v != nil { + var folder DatasetFolder + err = json.Unmarshal(*v, &folder) + if err != nil { + return err + } + od.Folder = &folder + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + od.Type = typeVar + } + } + } + + return nil +} + +// OrcDatasetTypeProperties ORC dataset properties. +type OrcDatasetTypeProperties struct { + // Location - The location of the ORC data storage. + Location *DatasetLocation `json:"location,omitempty"` +} + // OrcFormat the data stored in Optimized Row Columnar (ORC) format. type OrcFormat struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection @@ -138528,6 +145564,887 @@ func (of *OrcFormat) UnmarshalJSON(body []byte) error { return nil } +// OrcSink a copy activity ORC sink. +type OrcSink struct { + // StoreSettings - ORC store settings. + StoreSettings BasicStoreWriteSettings `json:"storeSettings,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). + MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OrcSink. +func (osVar OrcSink) MarshalJSON() ([]byte, error) { + osVar.Type = TypeOrcSink + objectMap := make(map[string]interface{}) + objectMap["storeSettings"] = osVar.StoreSettings + if osVar.WriteBatchSize != nil { + objectMap["writeBatchSize"] = osVar.WriteBatchSize + } + if osVar.WriteBatchTimeout != nil { + objectMap["writeBatchTimeout"] = osVar.WriteBatchTimeout + } + if osVar.SinkRetryCount != nil { + objectMap["sinkRetryCount"] = osVar.SinkRetryCount + } + if osVar.SinkRetryWait != nil { + objectMap["sinkRetryWait"] = osVar.SinkRetryWait + } + if osVar.MaxConcurrentConnections != nil { + objectMap["maxConcurrentConnections"] = osVar.MaxConcurrentConnections + } + if osVar.Type != "" { + objectMap["type"] = osVar.Type + } + for k, v := range osVar.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsCosmosDbMongoDbAPISink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsCosmosDbMongoDbAPISink() (*CosmosDbMongoDbAPISink, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsSalesforceServiceCloudSink() (*SalesforceServiceCloudSink, bool) { + return nil, false +} + +// AsSalesforceSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsAzureDataExplorerSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsAzureDataExplorerSink() (*AzureDataExplorerSink, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsCommonDataServiceForAppsSink() (*CommonDataServiceForAppsSink, bool) { + return nil, false +} + +// AsDynamicsCrmSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsDynamicsCrmSink() (*DynamicsCrmSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsMicrosoftAccessSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsMicrosoftAccessSink() (*MicrosoftAccessSink, bool) { + return nil, false +} + +// AsInformixSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsInformixSink() (*InformixSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureBlobFSSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsAzureBlobFSSink() (*AzureBlobFSSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLMISink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsSQLMISink() (*SQLMISink, bool) { + return nil, false +} + +// AsAzureSQLSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsAzureSQLSink() (*AzureSQLSink, bool) { + return nil, false +} + +// AsSQLServerSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsSQLServerSink() (*SQLServerSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsBinarySink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsBinarySink() (*BinarySink, bool) { + return nil, false +} + +// AsParquetSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsParquetSink() (*ParquetSink, bool) { + return nil, false +} + +// AsAvroSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsAvroSink() (*AvroSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsAzureMySQLSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsAzureMySQLSink() (*AzureMySQLSink, bool) { + return nil, false +} + +// AsAzurePostgreSQLSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { + return nil, false +} + +// AsOrcSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsOrcSink() (*OrcSink, bool) { + return &osVar, true +} + +// AsJSONSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsJSONSink() (*JSONSink, bool) { + return nil, false +} + +// AsDelimitedTextSink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsDelimitedTextSink() (*DelimitedTextSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for OrcSink. +func (osVar OrcSink) AsBasicCopySink() (BasicCopySink, bool) { + return &osVar, true +} + +// UnmarshalJSON is the custom unmarshaler for OrcSink struct. +func (osVar *OrcSink) UnmarshalJSON(body []byte) error { + 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 := unmarshalBasicStoreWriteSettings(*v) + if err != nil { + return err + } + osVar.StoreSettings = storeSettings + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if osVar.AdditionalProperties == nil { + osVar.AdditionalProperties = make(map[string]interface{}) + } + osVar.AdditionalProperties[k] = additionalProperties + } + case "writeBatchSize": + if v != nil { + var writeBatchSize interface{} + err = json.Unmarshal(*v, &writeBatchSize) + if err != nil { + return err + } + osVar.WriteBatchSize = writeBatchSize + } + case "writeBatchTimeout": + if v != nil { + var writeBatchTimeout interface{} + err = json.Unmarshal(*v, &writeBatchTimeout) + if err != nil { + return err + } + osVar.WriteBatchTimeout = writeBatchTimeout + } + case "sinkRetryCount": + if v != nil { + var sinkRetryCount interface{} + err = json.Unmarshal(*v, &sinkRetryCount) + if err != nil { + return err + } + osVar.SinkRetryCount = sinkRetryCount + } + case "sinkRetryWait": + if v != nil { + var sinkRetryWait interface{} + err = json.Unmarshal(*v, &sinkRetryWait) + if err != nil { + return err + } + osVar.SinkRetryWait = sinkRetryWait + } + case "maxConcurrentConnections": + if v != nil { + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) + if err != nil { + return err + } + osVar.MaxConcurrentConnections = maxConcurrentConnections + } + case "type": + if v != nil { + var typeVar TypeBasicCopySink + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + osVar.Type = typeVar + } + } + } + + return nil +} + +// OrcSource a copy activity ORC source. +type OrcSource struct { + // StoreSettings - ORC store settings. + StoreSettings *StoreReadSettings `json:"storeSettings,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', '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 TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OrcSource. +func (osVar OrcSource) MarshalJSON() ([]byte, error) { + osVar.Type = TypeOrcSource + objectMap := make(map[string]interface{}) + if osVar.StoreSettings != nil { + objectMap["storeSettings"] = osVar.StoreSettings + } + if osVar.SourceRetryCount != nil { + objectMap["sourceRetryCount"] = osVar.SourceRetryCount + } + if osVar.SourceRetryWait != nil { + objectMap["sourceRetryWait"] = osVar.SourceRetryWait + } + if osVar.MaxConcurrentConnections != nil { + objectMap["maxConcurrentConnections"] = osVar.MaxConcurrentConnections + } + if osVar.Type != "" { + objectMap["type"] = osVar.Type + } + for k, v := range osVar.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsHTTPSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsGoogleAdWordsSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsGoogleAdWordsSource() (*GoogleAdWordsSource, bool) { + return nil, false +} + +// AsOracleServiceCloudSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsOracleServiceCloudSource() (*OracleServiceCloudSource, bool) { + return nil, false +} + +// AsDynamicsAXSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsDynamicsAXSource() (*DynamicsAXSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsAzureMariaDBSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsAzureMariaDBSource() (*AzureMariaDBSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsTeradataSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsTeradataSource() (*TeradataSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLMISource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSQLMISource() (*SQLMISource, bool) { + return nil, false +} + +// AsAzureSQLSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsAzureSQLSource() (*AzureSQLSource, bool) { + return nil, false +} + +// AsSQLServerSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSQLServerSource() (*SQLServerSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapTableSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSapTableSource() (*SapTableSource, bool) { + return nil, false +} + +// AsSapOpenHubSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSapOpenHubSource() (*SapOpenHubSource, bool) { + return nil, false +} + +// AsSapHanaSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSapHanaSource() (*SapHanaSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsSapBwSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSapBwSource() (*SapBwSource, bool) { + return nil, false +} + +// AsSybaseSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsSybaseSource() (*SybaseSource, bool) { + return nil, false +} + +// AsPostgreSQLSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsPostgreSQLSource() (*PostgreSQLSource, bool) { + return nil, false +} + +// AsMySQLSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsMySQLSource() (*MySQLSource, bool) { + return nil, false +} + +// AsOdbcSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsOdbcSource() (*OdbcSource, bool) { + return nil, false +} + +// AsDb2Source is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsDb2Source() (*Db2Source, bool) { + return nil, false +} + +// AsInformixSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsInformixSource() (*InformixSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsTabularSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsTabularSource() (*TabularSource, bool) { + return nil, false +} + +// AsBasicTabularSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return nil, false +} + +// AsBinarySource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsBinarySource() (*BinarySource, bool) { + return nil, false +} + +// AsOrcSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsOrcSource() (*OrcSource, bool) { + return &osVar, true +} + +// AsJSONSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsJSONSource() (*JSONSource, bool) { + return nil, false +} + +// AsDelimitedTextSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsDelimitedTextSource() (*DelimitedTextSource, bool) { + return nil, false +} + +// AsParquetSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsParquetSource() (*ParquetSource, bool) { + return nil, false +} + +// AsAvroSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsAvroSource() (*AvroSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsBasicCopySource() (BasicCopySource, bool) { + return &osVar, true +} + +// UnmarshalJSON is the custom unmarshaler for OrcSource struct. +func (osVar *OrcSource) UnmarshalJSON(body []byte) error { + 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 { + var storeSettings StoreReadSettings + err = json.Unmarshal(*v, &storeSettings) + if err != nil { + return err + } + osVar.StoreSettings = &storeSettings + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if osVar.AdditionalProperties == nil { + osVar.AdditionalProperties = make(map[string]interface{}) + } + osVar.AdditionalProperties[k] = additionalProperties + } + case "sourceRetryCount": + if v != nil { + var sourceRetryCount interface{} + err = json.Unmarshal(*v, &sourceRetryCount) + if err != nil { + return err + } + osVar.SourceRetryCount = sourceRetryCount + } + case "sourceRetryWait": + if v != nil { + var sourceRetryWait interface{} + err = json.Unmarshal(*v, &sourceRetryWait) + if err != nil { + return err + } + osVar.SourceRetryWait = sourceRetryWait + } + case "maxConcurrentConnections": + if v != nil { + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) + if err != nil { + return err + } + osVar.MaxConcurrentConnections = maxConcurrentConnections + } + case "type": + if v != nil { + var typeVar TypeBasicCopySource + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + osVar.Type = typeVar + } + } + } + + return nil +} + // ParameterSpecification definition of a single parameter for an entity. type ParameterSpecification struct { // Type - Parameter type. Possible values include: 'ParameterTypeObject', 'ParameterTypeString', 'ParameterTypeInt', 'ParameterTypeFloat', 'ParameterTypeBool', 'ParameterTypeArray', 'ParameterTypeSecureString' @@ -138556,7 +146473,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -138957,6 +146874,11 @@ func (pd ParquetDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionD return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for ParquetDataset. +func (pd ParquetDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for ParquetDataset. func (pd ParquetDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -138997,6 +146919,11 @@ func (pd ParquetDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for ParquetDataset. +func (pd ParquetDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ParquetDataset. func (pd ParquetDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -139283,7 +147210,7 @@ type ParquetSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -139411,6 +147338,11 @@ func (ps ParquetSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for ParquetSink. +func (ps ParquetSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for ParquetSink. func (ps ParquetSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -139466,6 +147398,11 @@ func (ps ParquetSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for ParquetSink. +func (ps ParquetSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for ParquetSink. func (ps ParquetSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -139587,7 +147524,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -139616,6 +147553,121 @@ func (ps ParquetSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for ParquetSource. func (ps ParquetSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -139791,81 +147843,21 @@ func (ps ParquetSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for ParquetSource. func (ps ParquetSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for ParquetSource. func (ps ParquetSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for ParquetSource. func (ps ParquetSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for ParquetSource. func (ps ParquetSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -139891,11 +147883,6 @@ func (ps ParquetSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for ParquetSource. func (ps ParquetSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -139921,21 +147908,11 @@ func (ps ParquetSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSourc return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for ParquetSource. func (ps ParquetSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for ParquetSource. func (ps ParquetSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -139966,53 +147943,33 @@ func (ps ParquetSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for ParquetSource. func (ps ParquetSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for ParquetSource. -func (ps ParquetSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -140825,7 +148782,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -141226,6 +149183,11 @@ func (pod PaypalObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbColle return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for PaypalObjectDataset. func (pod PaypalObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -141266,6 +149228,11 @@ func (pod PaypalObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for PaypalObjectDataset. func (pod PaypalObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -141413,6 +149380,8 @@ func (pod *PaypalObjectDataset) UnmarshalJSON(body []byte) error { type PaypalSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -141421,7 +149390,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -141432,6 +149401,9 @@ func (ps PaypalSource) MarshalJSON() ([]byte, error) { if ps.Query != nil { objectMap["query"] = ps.Query } + if ps.QueryTimeout != nil { + objectMap["queryTimeout"] = ps.QueryTimeout + } if ps.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ps.SourceRetryCount } @@ -141450,6 +149422,121 @@ func (ps PaypalSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for PaypalSource. func (ps PaypalSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -141625,81 +149712,21 @@ func (ps PaypalSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for PaypalSource. func (ps PaypalSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for PaypalSource. func (ps PaypalSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for PaypalSource. func (ps PaypalSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for PaypalSource. func (ps PaypalSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -141725,11 +149752,6 @@ func (ps PaypalSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for PaypalSource. func (ps PaypalSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -141755,21 +149777,11 @@ func (ps PaypalSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for PaypalSource. func (ps PaypalSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for PaypalSource. func (ps PaypalSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -141800,53 +149812,33 @@ func (ps PaypalSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for PaypalSource. func (ps PaypalSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ps, true } -// AsAzureTableSource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for PaypalSource. -func (ps PaypalSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -141898,6 +149890,15 @@ func (ps *PaypalSource) UnmarshalJSON(body []byte) error { } ps.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ps.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -142724,7 +150725,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -143125,6 +151126,11 @@ func (pod PhoenixObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbColl return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for PhoenixObjectDataset. func (pod PhoenixObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -143165,6 +151171,11 @@ func (pod PhoenixObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for PhoenixObjectDataset. func (pod PhoenixObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -143312,6 +151323,8 @@ func (pod *PhoenixObjectDataset) UnmarshalJSON(body []byte) error { type PhoenixSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -143320,7 +151333,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -143331,6 +151344,9 @@ func (ps PhoenixSource) MarshalJSON() ([]byte, error) { if ps.Query != nil { objectMap["query"] = ps.Query } + if ps.QueryTimeout != nil { + objectMap["queryTimeout"] = ps.QueryTimeout + } if ps.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ps.SourceRetryCount } @@ -143349,6 +151365,121 @@ func (ps PhoenixSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for PhoenixSource. func (ps PhoenixSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -143524,81 +151655,21 @@ func (ps PhoenixSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for PhoenixSource. func (ps PhoenixSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for PhoenixSource. func (ps PhoenixSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for PhoenixSource. func (ps PhoenixSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for PhoenixSource. func (ps PhoenixSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -143624,11 +151695,6 @@ func (ps PhoenixSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for PhoenixSource. func (ps PhoenixSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -143654,21 +151720,11 @@ func (ps PhoenixSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSourc return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for PhoenixSource. func (ps PhoenixSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for PhoenixSource. func (ps PhoenixSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -143699,53 +151755,33 @@ func (ps PhoenixSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for PhoenixSource. func (ps PhoenixSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ps, true } -// AsAzureTableSource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for PhoenixSource. -func (ps PhoenixSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -143797,6 +151833,15 @@ func (ps *PhoenixSource) UnmarshalJSON(body []byte) error { } ps.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ps.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -143865,6 +151910,8 @@ type Pipeline struct { Concurrency *int32 `json:"concurrency,omitempty"` // Annotations - List of tags that can be used for describing the Pipeline. Annotations *[]interface{} `json:"annotations,omitempty"` + // RunDimensions - Dimensions emitted by Pipeline. + RunDimensions map[string]interface{} `json:"runDimensions"` // Folder - The folder that this Pipeline is in. If not specified, Pipeline will appear at the root level. Folder *PipelineFolder `json:"folder,omitempty"` } @@ -143890,6 +151937,9 @@ func (p Pipeline) MarshalJSON() ([]byte, error) { if p.Annotations != nil { objectMap["annotations"] = p.Annotations } + if p.RunDimensions != nil { + objectMap["runDimensions"] = p.RunDimensions + } if p.Folder != nil { objectMap["folder"] = p.Folder } @@ -143958,6 +152008,15 @@ func (p *Pipeline) UnmarshalJSON(body []byte) error { } p.Annotations = &annotations } + case "runDimensions": + if v != nil { + var runDimensions map[string]interface{} + err = json.Unmarshal(*v, &runDimensions) + if err != nil { + return err + } + p.RunDimensions = runDimensions + } case "folder": if v != nil { var folder PipelineFolder @@ -144252,6 +152311,8 @@ type PipelineRun struct { PipelineName *string `json:"pipelineName,omitempty"` // Parameters - READ-ONLY; The full or partial list of parameter name, value pair used in the pipeline run. Parameters map[string]*string `json:"parameters"` + // RunDimensions - READ-ONLY; Run dimensions emitted by Pipeline run. + RunDimensions map[string]*string `json:"runDimensions"` // InvokedBy - READ-ONLY; Entity that started the pipeline run. InvokedBy *PipelineRunInvokedBy `json:"invokedBy,omitempty"` // LastUpdated - READ-ONLY; The last updated timestamp for the pipeline run event in ISO8601 format. @@ -144343,6 +152404,15 @@ func (pr *PipelineRun) UnmarshalJSON(body []byte) error { } pr.Parameters = parameters } + case "runDimensions": + if v != nil { + var runDimensions map[string]*string + err = json.Unmarshal(*v, &runDimensions) + if err != nil { + return err + } + pr.RunDimensions = runDimensions + } case "invokedBy": if v != nil { var invokedBy PipelineRunInvokedBy @@ -145176,6 +153246,8 @@ func (pslstp *PostgreSQLLinkedServiceTypeProperties) UnmarshalJSON(body []byte) type PostgreSQLSource struct { // Query - Database query. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -145184,7 +153256,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -145195,6 +153267,9 @@ func (pss PostgreSQLSource) MarshalJSON() ([]byte, error) { if pss.Query != nil { objectMap["query"] = pss.Query } + if pss.QueryTimeout != nil { + objectMap["queryTimeout"] = pss.QueryTimeout + } if pss.SourceRetryCount != nil { objectMap["sourceRetryCount"] = pss.SourceRetryCount } @@ -145213,6 +153288,121 @@ func (pss PostgreSQLSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for PostgreSQLSource. func (pss PostgreSQLSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -145388,81 +153578,21 @@ func (pss PostgreSQLSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for PostgreSQLSource. func (pss PostgreSQLSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for PostgreSQLSource. func (pss PostgreSQLSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for PostgreSQLSource. func (pss PostgreSQLSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for PostgreSQLSource. func (pss PostgreSQLSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -145488,11 +153618,6 @@ func (pss PostgreSQLSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for PostgreSQLSource. func (pss PostgreSQLSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -145518,21 +153643,11 @@ func (pss PostgreSQLSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerS return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for PostgreSQLSource. func (pss PostgreSQLSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for PostgreSQLSource. func (pss PostgreSQLSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -145563,53 +153678,33 @@ func (pss PostgreSQLSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for PostgreSQLSource. func (pss PostgreSQLSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &pss, true } -// AsAzureTableSource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for PostgreSQLSource. -func (pss PostgreSQLSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -145661,6 +153756,15 @@ func (pss *PostgreSQLSource) UnmarshalJSON(body []byte) error { } pss.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + pss.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -145735,7 +153839,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -146136,6 +154240,11 @@ func (pstd PostgreSQLTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbC return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for PostgreSQLTableDataset. +func (pstd PostgreSQLTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for PostgreSQLTableDataset. func (pstd PostgreSQLTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -146176,6 +154285,11 @@ func (pstd PostgreSQLTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for PostgreSQLTableDataset. +func (pstd PostgreSQLTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for PostgreSQLTableDataset. func (pstd PostgreSQLTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -147123,7 +155237,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -147524,6 +155638,11 @@ func (pod PrestoObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbColle return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for PrestoObjectDataset. func (pod PrestoObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -147564,6 +155683,11 @@ func (pod PrestoObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for PrestoObjectDataset. func (pod PrestoObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -147711,6 +155835,8 @@ func (pod *PrestoObjectDataset) UnmarshalJSON(body []byte) error { type PrestoSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -147719,7 +155845,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -147730,6 +155856,9 @@ func (ps PrestoSource) MarshalJSON() ([]byte, error) { if ps.Query != nil { objectMap["query"] = ps.Query } + if ps.QueryTimeout != nil { + objectMap["queryTimeout"] = ps.QueryTimeout + } if ps.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ps.SourceRetryCount } @@ -147748,6 +155877,121 @@ func (ps PrestoSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for PrestoSource. func (ps PrestoSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -147923,81 +156167,21 @@ func (ps PrestoSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for PrestoSource. func (ps PrestoSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for PrestoSource. func (ps PrestoSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for PrestoSource. func (ps PrestoSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for PrestoSource. func (ps PrestoSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -148023,11 +156207,6 @@ func (ps PrestoSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for PrestoSource. func (ps PrestoSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -148053,21 +156232,11 @@ func (ps PrestoSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for PrestoSource. func (ps PrestoSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for PrestoSource. func (ps PrestoSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -148098,53 +156267,33 @@ func (ps PrestoSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for PrestoSource. func (ps PrestoSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ps, true } -// AsAzureTableSource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for PrestoSource. -func (ps PrestoSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -148196,6 +156345,15 @@ func (ps *PrestoSource) UnmarshalJSON(body []byte) error { } ps.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ps.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -148250,6 +156408,153 @@ func (ps *PrestoSource) UnmarshalJSON(body []byte) error { return nil } +// QueryDataFlowDebugSessionsResponse a list of active debug sessions. +type QueryDataFlowDebugSessionsResponse struct { + autorest.Response `json:"-"` + // Value - Array with all active debug sessions. + Value *[]DataFlowDebugSessionInfo `json:"value,omitempty"` + // NextLink - The link to the next page of results, if any remaining results exist. + NextLink *string `json:"nextLink,omitempty"` +} + +// QueryDataFlowDebugSessionsResponseIterator provides access to a complete listing of +// DataFlowDebugSessionInfo values. +type QueryDataFlowDebugSessionsResponseIterator struct { + i int + page QueryDataFlowDebugSessionsResponsePage +} + +// 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 *QueryDataFlowDebugSessionsResponseIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueryDataFlowDebugSessionsResponseIterator.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 *QueryDataFlowDebugSessionsResponseIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter QueryDataFlowDebugSessionsResponseIterator) 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 QueryDataFlowDebugSessionsResponseIterator) Response() QueryDataFlowDebugSessionsResponse { + 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 QueryDataFlowDebugSessionsResponseIterator) Value() DataFlowDebugSessionInfo { + if !iter.page.NotDone() { + return DataFlowDebugSessionInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the QueryDataFlowDebugSessionsResponseIterator type. +func NewQueryDataFlowDebugSessionsResponseIterator(page QueryDataFlowDebugSessionsResponsePage) QueryDataFlowDebugSessionsResponseIterator { + return QueryDataFlowDebugSessionsResponseIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (qdfdsr QueryDataFlowDebugSessionsResponse) IsEmpty() bool { + return qdfdsr.Value == nil || len(*qdfdsr.Value) == 0 +} + +// queryDataFlowDebugSessionsResponsePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (qdfdsr QueryDataFlowDebugSessionsResponse) queryDataFlowDebugSessionsResponsePreparer(ctx context.Context) (*http.Request, error) { + if qdfdsr.NextLink == nil || len(to.String(qdfdsr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(qdfdsr.NextLink))) +} + +// QueryDataFlowDebugSessionsResponsePage contains a page of DataFlowDebugSessionInfo values. +type QueryDataFlowDebugSessionsResponsePage struct { + fn func(context.Context, QueryDataFlowDebugSessionsResponse) (QueryDataFlowDebugSessionsResponse, error) + qdfdsr QueryDataFlowDebugSessionsResponse +} + +// 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 *QueryDataFlowDebugSessionsResponsePage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueryDataFlowDebugSessionsResponsePage.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.qdfdsr) + if err != nil { + return err + } + page.qdfdsr = 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 *QueryDataFlowDebugSessionsResponsePage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page QueryDataFlowDebugSessionsResponsePage) NotDone() bool { + return !page.qdfdsr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page QueryDataFlowDebugSessionsResponsePage) Response() QueryDataFlowDebugSessionsResponse { + return page.qdfdsr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page QueryDataFlowDebugSessionsResponsePage) Values() []DataFlowDebugSessionInfo { + if page.qdfdsr.IsEmpty() { + return nil + } + return *page.qdfdsr.Value +} + +// Creates a new instance of the QueryDataFlowDebugSessionsResponsePage type. +func NewQueryDataFlowDebugSessionsResponsePage(getNextPage func(context.Context, QueryDataFlowDebugSessionsResponse) (QueryDataFlowDebugSessionsResponse, error)) QueryDataFlowDebugSessionsResponsePage { + return QueryDataFlowDebugSessionsResponsePage{fn: getNextPage} +} + // QuickBooksLinkedService quickBooks server linked service. type QuickBooksLinkedService struct { // QuickBooksLinkedServiceTypeProperties - QuickBooks server linked service properties. @@ -148966,7 +157271,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -149367,6 +157672,11 @@ func (qbod QuickBooksObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDb return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for QuickBooksObjectDataset. func (qbod QuickBooksObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -149407,6 +157717,11 @@ func (qbod QuickBooksObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for QuickBooksObjectDataset. func (qbod QuickBooksObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -149554,6 +157869,8 @@ func (qbod *QuickBooksObjectDataset) UnmarshalJSON(body []byte) error { type QuickBooksSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -149562,7 +157879,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -149573,6 +157890,9 @@ func (qbs QuickBooksSource) MarshalJSON() ([]byte, error) { if qbs.Query != nil { objectMap["query"] = qbs.Query } + if qbs.QueryTimeout != nil { + objectMap["queryTimeout"] = qbs.QueryTimeout + } if qbs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = qbs.SourceRetryCount } @@ -149591,6 +157911,121 @@ func (qbs QuickBooksSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for QuickBooksSource. func (qbs QuickBooksSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -149766,81 +158201,21 @@ func (qbs QuickBooksSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for QuickBooksSource. func (qbs QuickBooksSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for QuickBooksSource. func (qbs QuickBooksSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for QuickBooksSource. func (qbs QuickBooksSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for QuickBooksSource. func (qbs QuickBooksSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -149866,11 +158241,6 @@ func (qbs QuickBooksSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for QuickBooksSource. func (qbs QuickBooksSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -149896,21 +158266,11 @@ func (qbs QuickBooksSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerS return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for QuickBooksSource. func (qbs QuickBooksSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for QuickBooksSource. func (qbs QuickBooksSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -149941,53 +158301,33 @@ func (qbs QuickBooksSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for QuickBooksSource. func (qbs QuickBooksSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &qbs, true } -// AsAzureTableSource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for QuickBooksSource. -func (qbs QuickBooksSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -150039,6 +158379,15 @@ func (qbs *QuickBooksSource) UnmarshalJSON(body []byte) error { } qbs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + qbs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -150367,7 +158716,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -150396,6 +158745,121 @@ func (rs RelationalSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsRelationalSource() (*RelationalSource, bool) { + return &rs, true +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for RelationalSource. func (rs RelationalSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -150571,81 +159035,21 @@ func (rs RelationalSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for RelationalSource. func (rs RelationalSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for RelationalSource. func (rs RelationalSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for RelationalSource. func (rs RelationalSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for RelationalSource. func (rs RelationalSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -150671,11 +159075,6 @@ func (rs RelationalSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for RelationalSource. func (rs RelationalSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -150701,21 +159100,11 @@ func (rs RelationalSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSo return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for RelationalSource. func (rs RelationalSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for RelationalSource. func (rs RelationalSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -150746,53 +159135,33 @@ func (rs RelationalSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for RelationalSource. func (rs RelationalSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsRelationalSource() (*RelationalSource, bool) { - return &rs, true -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDynamicsSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsTabularSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsBlobSource() (*BlobSource, bool) { +// AsBinarySource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsAzureTableSource() (*AzureTableSource, bool) { - return nil, false -} - -// AsBinarySource is the BasicCopySource implementation for RelationalSource. -func (rs RelationalSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -150918,7 +159287,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -151319,6 +159688,11 @@ func (rtd RelationalTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCo return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for RelationalTableDataset. func (rtd RelationalTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -151359,6 +159733,11 @@ func (rtd RelationalTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for RelationalTableDataset. func (rtd RelationalTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -151750,7 +160129,7 @@ type RerunTumblingWindowTrigger struct { RuntimeState TriggerRuntimeState `json:"runtimeState,omitempty"` // Annotations - List of tags that can be used for describing the trigger. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' + // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeChainingTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' Type TypeBasicTrigger `json:"type,omitempty"` } @@ -151781,6 +160160,11 @@ func (rtwt RerunTumblingWindowTrigger) AsRerunTumblingWindowTrigger() (*RerunTum return &rtwt, true } +// AsChainingTrigger is the BasicTrigger implementation for RerunTumblingWindowTrigger. +func (rtwt RerunTumblingWindowTrigger) AsChainingTrigger() (*ChainingTrigger, bool) { + return nil, false +} + // AsTumblingWindowTrigger is the BasicTrigger implementation for RerunTumblingWindowTrigger. func (rtwt RerunTumblingWindowTrigger) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) { return nil, false @@ -152650,7 +161034,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -153051,6 +161435,11 @@ func (rod ResponsysObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCo return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for ResponsysObjectDataset. func (rod ResponsysObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -153091,6 +161480,11 @@ func (rod ResponsysObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ResponsysObjectDataset. func (rod ResponsysObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -153238,6 +161632,8 @@ func (rod *ResponsysObjectDataset) UnmarshalJSON(body []byte) error { type ResponsysSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -153246,7 +161642,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -153257,6 +161653,9 @@ func (rs ResponsysSource) MarshalJSON() ([]byte, error) { if rs.Query != nil { objectMap["query"] = rs.Query } + if rs.QueryTimeout != nil { + objectMap["queryTimeout"] = rs.QueryTimeout + } if rs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = rs.SourceRetryCount } @@ -153275,6 +161674,121 @@ func (rs ResponsysSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for ResponsysSource. func (rs ResponsysSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -153450,81 +161964,21 @@ func (rs ResponsysSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for ResponsysSource. func (rs ResponsysSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for ResponsysSource. func (rs ResponsysSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for ResponsysSource. func (rs ResponsysSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for ResponsysSource. func (rs ResponsysSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -153550,11 +162004,6 @@ func (rs ResponsysSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for ResponsysSource. func (rs ResponsysSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -153580,21 +162029,11 @@ func (rs ResponsysSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSou return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for ResponsysSource. func (rs ResponsysSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for ResponsysSource. func (rs ResponsysSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -153625,53 +162064,33 @@ func (rs ResponsysSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for ResponsysSource. func (rs ResponsysSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &rs, true } -// AsAzureTableSource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for ResponsysSource. -func (rs ResponsysSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -153723,6 +162142,15 @@ func (rs *ResponsysSource) UnmarshalJSON(body []byte) error { } rs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + rs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -153797,7 +162225,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -154198,6 +162626,11 @@ func (rrd RestResourceDataset) AsDocumentDbCollectionDataset() (*DocumentDbColle return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for RestResourceDataset. +func (rrd RestResourceDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for RestResourceDataset. func (rrd RestResourceDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -154238,6 +162671,11 @@ func (rrd RestResourceDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for RestResourceDataset. +func (rrd RestResourceDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for RestResourceDataset. func (rrd RestResourceDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -155136,7 +163574,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -155180,6 +163618,121 @@ func (rs RestSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsRestSource() (*RestSource, bool) { + return &rs, true +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for RestSource. func (rs RestSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -155355,81 +163908,21 @@ func (rs RestSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for RestSource. func (rs RestSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for RestSource. func (rs RestSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for RestSource. func (rs RestSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for RestSource. func (rs RestSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -155455,11 +163948,6 @@ func (rs RestSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsRestSource() (*RestSource, bool) { - return &rs, true -} - // AsSapTableSource is the BasicCopySource implementation for RestSource. func (rs RestSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -155485,21 +163973,11 @@ func (rs RestSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for RestSource. func (rs RestSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for RestSource. func (rs RestSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -155530,53 +164008,33 @@ func (rs RestSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for RestSource. func (rs RestSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for RestSource. -func (rs RestSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -157128,7 +165586,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -157529,6 +165987,11 @@ func (smcod SalesforceMarketingCloudObjectDataset) AsDocumentDbCollectionDataset return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. func (smcod SalesforceMarketingCloudObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -157569,6 +166032,11 @@ func (smcod SalesforceMarketingCloudObjectDataset) AsBinaryDataset() (*BinaryDat return nil, false } +// AsOrcDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. func (smcod SalesforceMarketingCloudObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -157716,6 +166184,8 @@ func (smcod *SalesforceMarketingCloudObjectDataset) UnmarshalJSON(body []byte) e type SalesforceMarketingCloudSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -157724,7 +166194,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -157735,6 +166205,9 @@ func (smcs SalesforceMarketingCloudSource) MarshalJSON() ([]byte, error) { if smcs.Query != nil { objectMap["query"] = smcs.Query } + if smcs.QueryTimeout != nil { + objectMap["queryTimeout"] = smcs.QueryTimeout + } if smcs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = smcs.SourceRetryCount } @@ -157753,6 +166226,121 @@ func (smcs SalesforceMarketingCloudSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. func (smcs SalesforceMarketingCloudSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -157928,81 +166516,21 @@ func (smcs SalesforceMarketingCloudSource) AsAmazonMWSSource() (*AmazonMWSSource return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. func (smcs SalesforceMarketingCloudSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. func (smcs SalesforceMarketingCloudSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. func (smcs SalesforceMarketingCloudSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. func (smcs SalesforceMarketingCloudSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -158028,11 +166556,6 @@ func (smcs SalesforceMarketingCloudSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. func (smcs SalesforceMarketingCloudSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -158058,21 +166581,11 @@ func (smcs SalesforceMarketingCloudSource) AsSapCloudForCustomerSource() (*SapCl return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. func (smcs SalesforceMarketingCloudSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. func (smcs SalesforceMarketingCloudSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -158103,53 +166616,33 @@ func (smcs SalesforceMarketingCloudSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. func (smcs SalesforceMarketingCloudSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &smcs, true } -// AsAzureTableSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SalesforceMarketingCloudSource. -func (smcs SalesforceMarketingCloudSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -158201,6 +166694,15 @@ func (smcs *SalesforceMarketingCloudSource) UnmarshalJSON(body []byte) error { } smcs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + smcs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -158275,7 +166777,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -158676,6 +167178,11 @@ func (sod SalesforceObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbC return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for SalesforceObjectDataset. func (sod SalesforceObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -158716,6 +167223,11 @@ func (sod SalesforceObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SalesforceObjectDataset. func (sod SalesforceObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -159560,7 +168072,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -159961,6 +168473,11 @@ func (sscod SalesforceServiceCloudObjectDataset) AsDocumentDbCollectionDataset() return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for SalesforceServiceCloudObjectDataset. +func (sscod SalesforceServiceCloudObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for SalesforceServiceCloudObjectDataset. func (sscod SalesforceServiceCloudObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -160001,6 +168518,11 @@ func (sscod SalesforceServiceCloudObjectDataset) AsBinaryDataset() (*BinaryDatas return nil, false } +// AsOrcDataset is the BasicDataset implementation for SalesforceServiceCloudObjectDataset. +func (sscod SalesforceServiceCloudObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SalesforceServiceCloudObjectDataset. func (sscod SalesforceServiceCloudObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -160170,7 +168692,7 @@ type SalesforceServiceCloudSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -160306,6 +168828,11 @@ func (sscs SalesforceServiceCloudSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for SalesforceServiceCloudSink. +func (sscs SalesforceServiceCloudSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for SalesforceServiceCloudSink. func (sscs SalesforceServiceCloudSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -160361,6 +168888,11 @@ func (sscs SalesforceServiceCloudSink) AsAzurePostgreSQLSink() (*AzurePostgreSQL return nil, false } +// AsOrcSink is the BasicCopySink implementation for SalesforceServiceCloudSink. +func (sscs SalesforceServiceCloudSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for SalesforceServiceCloudSink. func (sscs SalesforceServiceCloudSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -160503,7 +169035,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -160535,6 +169067,121 @@ func (sscs SalesforceServiceCloudSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return &sscs, true +} + +// AsODataSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SalesforceServiceCloudSource. func (sscs SalesforceServiceCloudSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -160710,81 +169357,21 @@ func (sscs SalesforceServiceCloudSource) AsAmazonMWSSource() (*AmazonMWSSource, return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SalesforceServiceCloudSource. func (sscs SalesforceServiceCloudSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SalesforceServiceCloudSource. func (sscs SalesforceServiceCloudSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SalesforceServiceCloudSource. func (sscs SalesforceServiceCloudSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SalesforceServiceCloudSource. func (sscs SalesforceServiceCloudSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -160810,11 +169397,6 @@ func (sscs SalesforceServiceCloudSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SalesforceServiceCloudSource. func (sscs SalesforceServiceCloudSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -160840,21 +169422,11 @@ func (sscs SalesforceServiceCloudSource) AsSapCloudForCustomerSource() (*SapClou return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return &sscs, true -} - // AsSalesforceSource is the BasicCopySource implementation for SalesforceServiceCloudSource. func (sscs SalesforceServiceCloudSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SalesforceServiceCloudSource. func (sscs SalesforceServiceCloudSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -160885,53 +169457,33 @@ func (sscs SalesforceServiceCloudSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SalesforceServiceCloudSource. func (sscs SalesforceServiceCloudSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SalesforceServiceCloudSource. -func (sscs SalesforceServiceCloudSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -161066,7 +169618,7 @@ type SalesforceSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -161202,6 +169754,11 @@ func (ss SalesforceSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for SalesforceSink. func (ss SalesforceSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -161257,6 +169814,11 @@ func (ss SalesforceSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for SalesforceSink. func (ss SalesforceSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -161391,6 +169953,8 @@ type SalesforceSource struct { Query interface{} `json:"query,omitempty"` // ReadBehavior - The read behavior for the operation. Default is Query. Possible values include: 'Query', 'QueryAll' ReadBehavior SalesforceSourceReadBehavior `json:"readBehavior,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -161399,7 +169963,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -161413,6 +169977,9 @@ func (ss SalesforceSource) MarshalJSON() ([]byte, error) { if ss.ReadBehavior != "" { objectMap["readBehavior"] = ss.ReadBehavior } + if ss.QueryTimeout != nil { + objectMap["queryTimeout"] = ss.QueryTimeout + } if ss.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ss.SourceRetryCount } @@ -161431,6 +169998,121 @@ func (ss SalesforceSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SalesforceSource. func (ss SalesforceSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -161606,81 +170288,21 @@ func (ss SalesforceSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SalesforceSource. func (ss SalesforceSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SalesforceSource. func (ss SalesforceSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SalesforceSource. func (ss SalesforceSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SalesforceSource. func (ss SalesforceSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -161706,11 +170328,6 @@ func (ss SalesforceSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SalesforceSource. func (ss SalesforceSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -161736,21 +170353,11 @@ func (ss SalesforceSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSo return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SalesforceSource. func (ss SalesforceSource) AsSalesforceSource() (*SalesforceSource, bool) { return &ss, true } -// AsODataSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SalesforceSource. func (ss SalesforceSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -161781,53 +170388,33 @@ func (ss SalesforceSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SalesforceSource. func (ss SalesforceSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ss, true } -// AsAzureTableSource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SalesforceSource. -func (ss SalesforceSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -161888,6 +170475,15 @@ func (ss *SalesforceSource) UnmarshalJSON(body []byte) error { } ss.ReadBehavior = readBehavior } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ss.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -161960,7 +170556,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -162358,6 +170954,11 @@ func (sbcd SapBwCubeDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollect return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for SapBwCubeDataset. +func (sbcd SapBwCubeDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for SapBwCubeDataset. func (sbcd SapBwCubeDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -162398,6 +170999,11 @@ func (sbcd SapBwCubeDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for SapBwCubeDataset. +func (sbcd SapBwCubeDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SapBwCubeDataset. func (sbcd SapBwCubeDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -163212,6 +171818,8 @@ func (sblstp *SapBWLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error type SapBwSource struct { // Query - MDX query. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -163220,7 +171828,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -163231,6 +171839,9 @@ func (sbs SapBwSource) MarshalJSON() ([]byte, error) { if sbs.Query != nil { objectMap["query"] = sbs.Query } + if sbs.QueryTimeout != nil { + objectMap["queryTimeout"] = sbs.QueryTimeout + } if sbs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = sbs.SourceRetryCount } @@ -163249,6 +171860,121 @@ func (sbs SapBwSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SapBwSource. func (sbs SapBwSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -163424,81 +172150,21 @@ func (sbs SapBwSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SapBwSource. func (sbs SapBwSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SapBwSource. func (sbs SapBwSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SapBwSource. func (sbs SapBwSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SapBwSource. func (sbs SapBwSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -163524,11 +172190,6 @@ func (sbs SapBwSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SapBwSource. func (sbs SapBwSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -163554,21 +172215,11 @@ func (sbs SapBwSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SapBwSource. func (sbs SapBwSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SapBwSource. func (sbs SapBwSource) AsSapBwSource() (*SapBwSource, bool) { return &sbs, true @@ -163599,53 +172250,33 @@ func (sbs SapBwSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SapBwSource. func (sbs SapBwSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDynamicsSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { - return nil, false -} - -// AsBlobSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &sbs, true } -// AsAzureTableSource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SapBwSource. -func (sbs SapBwSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -163697,6 +172328,15 @@ func (sbs *SapBwSource) UnmarshalJSON(body []byte) error { } sbs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + sbs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -164425,7 +173065,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -164826,6 +173466,11 @@ func (scfcrd SapCloudForCustomerResourceDataset) AsDocumentDbCollectionDataset() return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. func (scfcrd SapCloudForCustomerResourceDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -164866,6 +173511,11 @@ func (scfcrd SapCloudForCustomerResourceDataset) AsBinaryDataset() (*BinaryDatas return nil, false } +// AsOrcDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. func (scfcrd SapCloudForCustomerResourceDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -165032,7 +173682,7 @@ type SapCloudForCustomerSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -165162,6 +173812,11 @@ func (scfcs SapCloudForCustomerSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for SapCloudForCustomerSink. func (scfcs SapCloudForCustomerSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -165217,6 +173872,11 @@ func (scfcs SapCloudForCustomerSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSi return nil, false } +// AsOrcSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for SapCloudForCustomerSink. func (scfcs SapCloudForCustomerSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -165331,6 +173991,8 @@ func (scfcs *SapCloudForCustomerSink) UnmarshalJSON(body []byte) error { type SapCloudForCustomerSource struct { // Query - SAP Cloud for Customer OData query. For example, "$top=1". Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -165339,7 +174001,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -165350,6 +174012,9 @@ func (scfcs SapCloudForCustomerSource) MarshalJSON() ([]byte, error) { if scfcs.Query != nil { objectMap["query"] = scfcs.Query } + if scfcs.QueryTimeout != nil { + objectMap["queryTimeout"] = scfcs.QueryTimeout + } if scfcs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = scfcs.SourceRetryCount } @@ -165368,6 +174033,121 @@ func (scfcs SapCloudForCustomerSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SapCloudForCustomerSource. func (scfcs SapCloudForCustomerSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -165543,81 +174323,21 @@ func (scfcs SapCloudForCustomerSource) AsAmazonMWSSource() (*AmazonMWSSource, bo return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SapCloudForCustomerSource. func (scfcs SapCloudForCustomerSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SapCloudForCustomerSource. func (scfcs SapCloudForCustomerSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SapCloudForCustomerSource. func (scfcs SapCloudForCustomerSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SapCloudForCustomerSource. func (scfcs SapCloudForCustomerSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -165643,11 +174363,6 @@ func (scfcs SapCloudForCustomerSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SapCloudForCustomerSource. func (scfcs SapCloudForCustomerSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -165673,21 +174388,11 @@ func (scfcs SapCloudForCustomerSource) AsSapCloudForCustomerSource() (*SapCloudF return &scfcs, true } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SapCloudForCustomerSource. func (scfcs SapCloudForCustomerSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SapCloudForCustomerSource. func (scfcs SapCloudForCustomerSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -165718,53 +174423,33 @@ func (scfcs SapCloudForCustomerSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SapCloudForCustomerSource. func (scfcs SapCloudForCustomerSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &scfcs, true } -// AsAzureTableSource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SapCloudForCustomerSource. -func (scfcs SapCloudForCustomerSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -165816,6 +174501,15 @@ func (scfcs *SapCloudForCustomerSource) UnmarshalJSON(body []byte) error { } scfcs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + scfcs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -166544,7 +175238,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -166945,6 +175639,11 @@ func (serd SapEccResourceDataset) AsDocumentDbCollectionDataset() (*DocumentDbCo return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for SapEccResourceDataset. func (serd SapEccResourceDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -166985,6 +175684,11 @@ func (serd SapEccResourceDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SapEccResourceDataset. func (serd SapEccResourceDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -167138,6 +175842,8 @@ type SapEccResourceDatasetTypeProperties struct { type SapEccSource struct { // Query - SAP ECC OData query. For example, "$top=1". Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -167146,7 +175852,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -167157,6 +175863,9 @@ func (ses SapEccSource) MarshalJSON() ([]byte, error) { if ses.Query != nil { objectMap["query"] = ses.Query } + if ses.QueryTimeout != nil { + objectMap["queryTimeout"] = ses.QueryTimeout + } if ses.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ses.SourceRetryCount } @@ -167175,6 +175884,121 @@ func (ses SapEccSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SapEccSource. func (ses SapEccSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -167350,81 +176174,21 @@ func (ses SapEccSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SapEccSource. func (ses SapEccSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SapEccSource. func (ses SapEccSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SapEccSource. func (ses SapEccSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SapEccSource. func (ses SapEccSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -167450,11 +176214,6 @@ func (ses SapEccSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SapEccSource. func (ses SapEccSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -167480,21 +176239,11 @@ func (ses SapEccSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSourc return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SapEccSource. func (ses SapEccSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SapEccSource. func (ses SapEccSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -167525,53 +176274,33 @@ func (ses SapEccSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SapEccSource. func (ses SapEccSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ses, true } -// AsAzureTableSource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SapEccSource. -func (ses SapEccSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -167623,6 +176352,15 @@ func (ses *SapEccSource) UnmarshalJSON(body []byte) error { } ses.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ses.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -168359,6 +177097,8 @@ type SapHanaSource struct { Query interface{} `json:"query,omitempty"` // PacketSize - The packet size of data read from SAP HANA. Type: integer(or Expression with resultType integer). PacketSize interface{} `json:"packetSize,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -168367,7 +177107,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -168381,6 +177121,9 @@ func (shs SapHanaSource) MarshalJSON() ([]byte, error) { if shs.PacketSize != nil { objectMap["packetSize"] = shs.PacketSize } + if shs.QueryTimeout != nil { + objectMap["queryTimeout"] = shs.QueryTimeout + } if shs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = shs.SourceRetryCount } @@ -168399,6 +177142,121 @@ func (shs SapHanaSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SapHanaSource. func (shs SapHanaSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -168574,81 +177432,21 @@ func (shs SapHanaSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SapHanaSource. func (shs SapHanaSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SapHanaSource. func (shs SapHanaSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SapHanaSource. func (shs SapHanaSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SapHanaSource. func (shs SapHanaSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -168674,11 +177472,6 @@ func (shs SapHanaSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SapHanaSource. func (shs SapHanaSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -168704,21 +177497,11 @@ func (shs SapHanaSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSour return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SapHanaSource. func (shs SapHanaSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SapHanaSource. func (shs SapHanaSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -168749,53 +177532,33 @@ func (shs SapHanaSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SapHanaSource. func (shs SapHanaSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &shs, true } -// AsAzureTableSource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SapHanaSource. -func (shs SapHanaSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -168856,6 +177619,15 @@ func (shs *SapHanaSource) UnmarshalJSON(body []byte) error { } shs.PacketSize = packetSize } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + shs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -168930,7 +177702,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -169331,6 +178103,11 @@ func (shtd SapHanaTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbColl return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for SapHanaTableDataset. +func (shtd SapHanaTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for SapHanaTableDataset. func (shtd SapHanaTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -169371,6 +178148,11 @@ func (shtd SapHanaTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for SapHanaTableDataset. +func (shtd SapHanaTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SapHanaTableDataset. func (shtd SapHanaTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -170216,6 +178998,8 @@ type SapOpenHubSource struct { ExcludeLastRequest interface{} `json:"excludeLastRequest,omitempty"` // BaseRequestID - The ID of request for delta loading. Once it is set, only data with requestId larger than the value of this property will be retrieved. The default value is 0. Type: integer (or Expression with resultType integer ). BaseRequestID interface{} `json:"baseRequestId,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -170224,7 +179008,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -170238,6 +179022,9 @@ func (sohs SapOpenHubSource) MarshalJSON() ([]byte, error) { if sohs.BaseRequestID != nil { objectMap["baseRequestId"] = sohs.BaseRequestID } + if sohs.QueryTimeout != nil { + objectMap["queryTimeout"] = sohs.QueryTimeout + } if sohs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = sohs.SourceRetryCount } @@ -170256,6 +179043,121 @@ func (sohs SapOpenHubSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SapOpenHubSource. func (sohs SapOpenHubSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -170431,81 +179333,21 @@ func (sohs SapOpenHubSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SapOpenHubSource. func (sohs SapOpenHubSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SapOpenHubSource. func (sohs SapOpenHubSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SapOpenHubSource. func (sohs SapOpenHubSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SapOpenHubSource. func (sohs SapOpenHubSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -170531,11 +179373,6 @@ func (sohs SapOpenHubSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SapOpenHubSource. func (sohs SapOpenHubSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -170561,21 +179398,11 @@ func (sohs SapOpenHubSource) AsSapCloudForCustomerSource() (*SapCloudForCustomer return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SapOpenHubSource. func (sohs SapOpenHubSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SapOpenHubSource. func (sohs SapOpenHubSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -170606,53 +179433,33 @@ func (sohs SapOpenHubSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SapOpenHubSource. func (sohs SapOpenHubSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &sohs, true } -// AsAzureTableSource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SapOpenHubSource. -func (sohs SapOpenHubSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -170713,6 +179520,15 @@ func (sohs *SapOpenHubSource) UnmarshalJSON(body []byte) error { } sohs.BaseRequestID = baseRequestID } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + sohs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -170787,7 +179603,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -171188,6 +180004,11 @@ func (sohtd SapOpenHubTableDataset) AsDocumentDbCollectionDataset() (*DocumentDb return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for SapOpenHubTableDataset. +func (sohtd SapOpenHubTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for SapOpenHubTableDataset. func (sohtd SapOpenHubTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -171228,6 +180049,11 @@ func (sohtd SapOpenHubTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for SapOpenHubTableDataset. +func (sohtd SapOpenHubTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SapOpenHubTableDataset. func (sohtd SapOpenHubTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -172199,7 +181025,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -172600,6 +181426,11 @@ func (strd SapTableResourceDataset) AsDocumentDbCollectionDataset() (*DocumentDb return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for SapTableResourceDataset. +func (strd SapTableResourceDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for SapTableResourceDataset. func (strd SapTableResourceDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -172640,6 +181471,11 @@ func (strd SapTableResourceDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for SapTableResourceDataset. +func (strd SapTableResourceDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SapTableResourceDataset. func (strd SapTableResourceDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -172807,6 +181643,8 @@ type SapTableSource struct { PartitionOption SapTablePartitionOption `json:"partitionOption,omitempty"` // PartitionSettings - The settings that will be leveraged for SAP table source partitioning. PartitionSettings *SapTablePartitionSettings `json:"partitionSettings,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -172815,7 +181653,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -172847,6 +181685,9 @@ func (sts SapTableSource) MarshalJSON() ([]byte, error) { if sts.PartitionSettings != nil { objectMap["partitionSettings"] = sts.PartitionSettings } + if sts.QueryTimeout != nil { + objectMap["queryTimeout"] = sts.QueryTimeout + } if sts.SourceRetryCount != nil { objectMap["sourceRetryCount"] = sts.SourceRetryCount } @@ -172865,6 +181706,121 @@ func (sts SapTableSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SapTableSource. func (sts SapTableSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -173040,81 +181996,21 @@ func (sts SapTableSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SapTableSource. func (sts SapTableSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SapTableSource. func (sts SapTableSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SapTableSource. func (sts SapTableSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SapTableSource. func (sts SapTableSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -173140,11 +182036,6 @@ func (sts SapTableSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SapTableSource. func (sts SapTableSource) AsSapTableSource() (*SapTableSource, bool) { return &sts, true @@ -173170,21 +182061,11 @@ func (sts SapTableSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSou return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SapTableSource. func (sts SapTableSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SapTableSource. func (sts SapTableSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -173215,53 +182096,33 @@ func (sts SapTableSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SapTableSource. func (sts SapTableSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &sts, true } -// AsAzureTableSource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SapTableSource. -func (sts SapTableSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -173376,6 +182237,15 @@ func (sts *SapTableSource) UnmarshalJSON(body []byte) error { } sts.PartitionSettings = &partitionSettings } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + sts.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -173444,7 +182314,7 @@ type ScheduleTrigger struct { RuntimeState TriggerRuntimeState `json:"runtimeState,omitempty"` // Annotations - List of tags that can be used for describing the trigger. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' + // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeChainingTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' Type TypeBasicTrigger `json:"type,omitempty"` } @@ -173478,6 +182348,11 @@ func (st ScheduleTrigger) AsRerunTumblingWindowTrigger() (*RerunTumblingWindowTr return nil, false } +// AsChainingTrigger is the BasicTrigger implementation for ScheduleTrigger. +func (st ScheduleTrigger) AsChainingTrigger() (*ChainingTrigger, bool) { + return nil, false +} + // AsTumblingWindowTrigger is the BasicTrigger implementation for ScheduleTrigger. func (st ScheduleTrigger) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) { return nil, false @@ -175005,7 +183880,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -175406,6 +184281,11 @@ func (snod ServiceNowObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDb return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for ServiceNowObjectDataset. func (snod ServiceNowObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -175446,6 +184326,11 @@ func (snod ServiceNowObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ServiceNowObjectDataset. func (snod ServiceNowObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -175593,6 +184478,8 @@ func (snod *ServiceNowObjectDataset) UnmarshalJSON(body []byte) error { type ServiceNowSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -175601,7 +184488,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -175612,6 +184499,9 @@ func (sns ServiceNowSource) MarshalJSON() ([]byte, error) { if sns.Query != nil { objectMap["query"] = sns.Query } + if sns.QueryTimeout != nil { + objectMap["queryTimeout"] = sns.QueryTimeout + } if sns.SourceRetryCount != nil { objectMap["sourceRetryCount"] = sns.SourceRetryCount } @@ -175630,6 +184520,121 @@ func (sns ServiceNowSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for ServiceNowSource. func (sns ServiceNowSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -175805,81 +184810,21 @@ func (sns ServiceNowSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for ServiceNowSource. func (sns ServiceNowSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for ServiceNowSource. func (sns ServiceNowSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for ServiceNowSource. func (sns ServiceNowSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for ServiceNowSource. func (sns ServiceNowSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -175905,11 +184850,6 @@ func (sns ServiceNowSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for ServiceNowSource. func (sns ServiceNowSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -175935,21 +184875,11 @@ func (sns ServiceNowSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerS return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for ServiceNowSource. func (sns ServiceNowSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for ServiceNowSource. func (sns ServiceNowSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -175980,53 +184910,33 @@ func (sns ServiceNowSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for ServiceNowSource. func (sns ServiceNowSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &sns, true } -// AsAzureTableSource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for ServiceNowSource. -func (sns ServiceNowSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -176078,6 +184988,15 @@ func (sns *ServiceNowSource) UnmarshalJSON(body []byte) error { } sns.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + sns.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -176146,7 +185065,7 @@ type SetVariableActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -176178,6 +185097,11 @@ func (sva SetVariableActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for SetVariableActivity. +func (sva SetVariableActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for SetVariableActivity. func (sva SetVariableActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -178101,7 +187025,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -178502,6 +187426,11 @@ func (sod ShopifyObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbColl return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for ShopifyObjectDataset. func (sod ShopifyObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -178542,6 +187471,11 @@ func (sod ShopifyObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ShopifyObjectDataset. func (sod ShopifyObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -178689,6 +187623,8 @@ func (sod *ShopifyObjectDataset) UnmarshalJSON(body []byte) error { type ShopifySource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -178697,7 +187633,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -178708,6 +187644,9 @@ func (ss ShopifySource) MarshalJSON() ([]byte, error) { if ss.Query != nil { objectMap["query"] = ss.Query } + if ss.QueryTimeout != nil { + objectMap["queryTimeout"] = ss.QueryTimeout + } if ss.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ss.SourceRetryCount } @@ -178726,6 +187665,121 @@ func (ss ShopifySource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for ShopifySource. func (ss ShopifySource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -178901,81 +187955,21 @@ func (ss ShopifySource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for ShopifySource. func (ss ShopifySource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for ShopifySource. func (ss ShopifySource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for ShopifySource. func (ss ShopifySource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for ShopifySource. func (ss ShopifySource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -179001,11 +187995,6 @@ func (ss ShopifySource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for ShopifySource. func (ss ShopifySource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -179031,21 +188020,11 @@ func (ss ShopifySource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSourc return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for ShopifySource. func (ss ShopifySource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for ShopifySource. func (ss ShopifySource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -179076,53 +188055,33 @@ func (ss ShopifySource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for ShopifySource. func (ss ShopifySource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ss, true } -// AsAzureTableSource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for ShopifySource. -func (ss ShopifySource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -179174,6 +188133,15 @@ func (ss *ShopifySource) UnmarshalJSON(body []byte) error { } ss.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ss.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -180022,7 +188990,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -180423,6 +189391,11 @@ func (sod SparkObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollec return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for SparkObjectDataset. func (sod SparkObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -180463,6 +189436,11 @@ func (sod SparkObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SparkObjectDataset. func (sod SparkObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -180610,6 +189588,8 @@ func (sod *SparkObjectDataset) UnmarshalJSON(body []byte) error { type SparkSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -180618,7 +189598,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -180629,6 +189609,9 @@ func (ss SparkSource) MarshalJSON() ([]byte, error) { if ss.Query != nil { objectMap["query"] = ss.Query } + if ss.QueryTimeout != nil { + objectMap["queryTimeout"] = ss.QueryTimeout + } if ss.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ss.SourceRetryCount } @@ -180647,6 +189630,121 @@ func (ss SparkSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SparkSource. func (ss SparkSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -180822,81 +189920,21 @@ func (ss SparkSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SparkSource. func (ss SparkSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SparkSource. func (ss SparkSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SparkSource. func (ss SparkSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SparkSource. func (ss SparkSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -180922,11 +189960,6 @@ func (ss SparkSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SparkSource. func (ss SparkSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -180952,21 +189985,11 @@ func (ss SparkSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SparkSource. func (ss SparkSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SparkSource. func (ss SparkSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -180997,53 +190020,33 @@ func (ss SparkSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SparkSource. func (ss SparkSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ss, true } -// AsAzureTableSource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SparkSource. -func (ss SparkSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -181095,6 +190098,15 @@ func (ss *SparkSource) UnmarshalJSON(body []byte) error { } ss.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ss.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -181171,7 +190183,7 @@ type SQLDWSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -181310,6 +190322,11 @@ func (sds SQLDWSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for SQLDWSink. func (sds SQLDWSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -181365,6 +190382,11 @@ func (sds SQLDWSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for SQLDWSink. func (sds SQLDWSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -181510,6 +190532,8 @@ type SQLDWSource struct { SQLReaderStoredProcedureName interface{} `json:"sqlReaderStoredProcedureName,omitempty"` // StoredProcedureParameters - Value and type setting for stored procedure parameters. Example: "{Parameter1: {value: "1", type: "int"}}". Type: object (or Expression with resultType object), itemType: StoredProcedureParameter. StoredProcedureParameters interface{} `json:"storedProcedureParameters,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -181518,7 +190542,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -181535,6 +190559,9 @@ func (sds SQLDWSource) MarshalJSON() ([]byte, error) { if sds.StoredProcedureParameters != nil { objectMap["storedProcedureParameters"] = sds.StoredProcedureParameters } + if sds.QueryTimeout != nil { + objectMap["queryTimeout"] = sds.QueryTimeout + } if sds.SourceRetryCount != nil { objectMap["sourceRetryCount"] = sds.SourceRetryCount } @@ -181553,6 +190580,121 @@ func (sds SQLDWSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SQLDWSource. func (sds SQLDWSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -181728,81 +190870,21 @@ func (sds SQLDWSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SQLDWSource. func (sds SQLDWSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SQLDWSource. func (sds SQLDWSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SQLDWSource. func (sds SQLDWSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SQLDWSource. func (sds SQLDWSource) AsSQLDWSource() (*SQLDWSource, bool) { return &sds, true @@ -181828,11 +190910,6 @@ func (sds SQLDWSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SQLDWSource. func (sds SQLDWSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -181858,21 +190935,11 @@ func (sds SQLDWSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SQLDWSource. func (sds SQLDWSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SQLDWSource. func (sds SQLDWSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -181903,53 +190970,33 @@ func (sds SQLDWSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SQLDWSource. func (sds SQLDWSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &sds, true } -// AsAzureTableSource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SQLDWSource. -func (sds SQLDWSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -182019,6 +191066,15 @@ func (sds *SQLDWSource) UnmarshalJSON(body []byte) error { } sds.StoredProcedureParameters = storedProcedureParameters } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + sds.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -182099,7 +191155,7 @@ type SQLMISink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -182244,6 +191300,11 @@ func (sms SQLMISink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for SQLMISink. +func (sms SQLMISink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for SQLMISink. func (sms SQLMISink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -182299,6 +191360,11 @@ func (sms SQLMISink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for SQLMISink. +func (sms SQLMISink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for SQLMISink. func (sms SQLMISink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -182464,6 +191530,8 @@ type SQLMISource struct { StoredProcedureParameters map[string]*StoredProcedureParameter `json:"storedProcedureParameters"` // ProduceAdditionalTypes - Which additional types to produce. ProduceAdditionalTypes interface{} `json:"produceAdditionalTypes,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -182472,7 +191540,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -182492,6 +191560,9 @@ func (sms SQLMISource) MarshalJSON() ([]byte, error) { if sms.ProduceAdditionalTypes != nil { objectMap["produceAdditionalTypes"] = sms.ProduceAdditionalTypes } + if sms.QueryTimeout != nil { + objectMap["queryTimeout"] = sms.QueryTimeout + } if sms.SourceRetryCount != nil { objectMap["sourceRetryCount"] = sms.SourceRetryCount } @@ -182510,6 +191581,121 @@ func (sms SQLMISource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SQLMISource. func (sms SQLMISource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -182685,81 +191871,21 @@ func (sms SQLMISource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SQLMISource. func (sms SQLMISource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SQLMISource. func (sms SQLMISource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SQLMISource. func (sms SQLMISource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SQLMISource. func (sms SQLMISource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -182785,11 +191911,6 @@ func (sms SQLMISource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SQLMISource. func (sms SQLMISource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -182815,21 +191936,11 @@ func (sms SQLMISource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SQLMISource. func (sms SQLMISource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SQLMISource. func (sms SQLMISource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -182860,53 +191971,33 @@ func (sms SQLMISource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SQLMISource. func (sms SQLMISource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &sms, true } -// AsAzureTableSource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SQLMISource. -func (sms SQLMISource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -182985,6 +192076,15 @@ func (sms *SQLMISource) UnmarshalJSON(body []byte) error { } sms.ProduceAdditionalTypes = produceAdditionalTypes } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + sms.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -183719,7 +192819,7 @@ type SQLServerSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -183864,6 +192964,11 @@ func (sss SQLServerSink) AsSQLSink() (*SQLSink, bool) { return nil, false } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for SQLServerSink. +func (sss SQLServerSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for SQLServerSink. func (sss SQLServerSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -183919,6 +193024,11 @@ func (sss SQLServerSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for SQLServerSink. +func (sss SQLServerSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for SQLServerSink. func (sss SQLServerSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -184084,6 +193194,8 @@ type SQLServerSource struct { StoredProcedureParameters map[string]*StoredProcedureParameter `json:"storedProcedureParameters"` // ProduceAdditionalTypes - Which additional types to produce. ProduceAdditionalTypes interface{} `json:"produceAdditionalTypes,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -184092,7 +193204,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -184112,6 +193224,9 @@ func (sss SQLServerSource) MarshalJSON() ([]byte, error) { if sss.ProduceAdditionalTypes != nil { objectMap["produceAdditionalTypes"] = sss.ProduceAdditionalTypes } + if sss.QueryTimeout != nil { + objectMap["queryTimeout"] = sss.QueryTimeout + } if sss.SourceRetryCount != nil { objectMap["sourceRetryCount"] = sss.SourceRetryCount } @@ -184130,6 +193245,121 @@ func (sss SQLServerSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SQLServerSource. func (sss SQLServerSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -184305,81 +193535,21 @@ func (sss SQLServerSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SQLServerSource. func (sss SQLServerSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SQLServerSource. func (sss SQLServerSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SQLServerSource. func (sss SQLServerSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SQLServerSource. func (sss SQLServerSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -184405,11 +193575,6 @@ func (sss SQLServerSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SQLServerSource. func (sss SQLServerSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -184435,21 +193600,11 @@ func (sss SQLServerSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSo return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SQLServerSource. func (sss SQLServerSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SQLServerSource. func (sss SQLServerSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -184480,53 +193635,33 @@ func (sss SQLServerSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SQLServerSource. func (sss SQLServerSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &sss, true } -// AsAzureTableSource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SQLServerSource. -func (sss SQLServerSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -184605,6 +193740,15 @@ func (sss *SQLServerSource) UnmarshalJSON(body []byte) error { } sss.ProduceAdditionalTypes = produceAdditionalTypes } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + sss.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -184677,7 +193821,7 @@ type SQLServerStoredProcedureActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -184715,6 +193859,11 @@ func (ssspa SQLServerStoredProcedureActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. func (ssspa SQLServerStoredProcedureActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -185039,7 +194188,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -185440,6 +194589,11 @@ func (sstd SQLServerTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCo return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for SQLServerTableDataset. func (sstd SQLServerTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -185480,6 +194634,11 @@ func (sstd SQLServerTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SQLServerTableDataset. func (sstd SQLServerTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -185659,7 +194818,7 @@ type SQLSink struct { SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeJSONSink', 'TypeDelimitedTextSink' + // Type - Possible values include: 'TypeCopySink', 'TypeCosmosDbMongoDbAPISink', 'TypeSalesforceServiceCloudSink', 'TypeSalesforceSink', 'TypeAzureDataExplorerSink', 'TypeCommonDataServiceForAppsSink', 'TypeDynamicsCrmSink', 'TypeDynamicsSink', 'TypeMicrosoftAccessSink', 'TypeInformixSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureBlobFSSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLMISink', 'TypeAzureSQLSink', 'TypeSQLServerSink', 'TypeSQLSink', 'TypeCosmosDbSQLAPISink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeBinarySink', 'TypeParquetSink', 'TypeAvroSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink', 'TypeAzureMySQLSink', 'TypeAzurePostgreSQLSink', 'TypeOrcSink', 'TypeJSONSink', 'TypeDelimitedTextSink' Type TypeBasicCopySink `json:"type,omitempty"` } @@ -185804,6 +194963,11 @@ func (ss SQLSink) AsSQLSink() (*SQLSink, bool) { return &ss, true } +// AsCosmosDbSQLAPISink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsCosmosDbSQLAPISink() (*CosmosDbSQLAPISink, bool) { + return nil, false +} + // AsDocumentDbCollectionSink is the BasicCopySink implementation for SQLSink. func (ss SQLSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { return nil, false @@ -185859,6 +195023,11 @@ func (ss SQLSink) AsAzurePostgreSQLSink() (*AzurePostgreSQLSink, bool) { return nil, false } +// AsOrcSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsOrcSink() (*OrcSink, bool) { + return nil, false +} + // AsJSONSink is the BasicCopySink implementation for SQLSink. func (ss SQLSink) AsJSONSink() (*JSONSink, bool) { return nil, false @@ -186022,6 +195191,8 @@ type SQLSource struct { SQLReaderStoredProcedureName interface{} `json:"sqlReaderStoredProcedureName,omitempty"` // StoredProcedureParameters - Value and type setting for stored procedure parameters. Example: "{Parameter1: {value: "1", type: "int"}}". StoredProcedureParameters map[string]*StoredProcedureParameter `json:"storedProcedureParameters"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -186030,7 +195201,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -186047,6 +195218,9 @@ func (ss SQLSource) MarshalJSON() ([]byte, error) { if ss.StoredProcedureParameters != nil { objectMap["storedProcedureParameters"] = ss.StoredProcedureParameters } + if ss.QueryTimeout != nil { + objectMap["queryTimeout"] = ss.QueryTimeout + } if ss.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ss.SourceRetryCount } @@ -186065,6 +195239,121 @@ func (ss SQLSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SQLSource. func (ss SQLSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -186240,81 +195529,21 @@ func (ss SQLSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SQLSource. func (ss SQLSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SQLSource. func (ss SQLSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SQLSource. func (ss SQLSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SQLSource. func (ss SQLSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -186340,11 +195569,6 @@ func (ss SQLSource) AsSQLSource() (*SQLSource, bool) { return &ss, true } -// AsRestSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SQLSource. func (ss SQLSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -186370,21 +195594,11 @@ func (ss SQLSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, b return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SQLSource. func (ss SQLSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SQLSource. func (ss SQLSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -186415,53 +195629,33 @@ func (ss SQLSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SQLSource. func (ss SQLSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ss, true } -// AsAzureTableSource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SQLSource. -func (ss SQLSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -186531,6 +195725,15 @@ func (ss *SQLSource) UnmarshalJSON(body []byte) error { } ss.StoredProcedureParameters = storedProcedureParameters } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ss.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -187303,7 +196506,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -187704,6 +196907,11 @@ func (sod SquareObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbColle return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for SquareObjectDataset. func (sod SquareObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -187744,6 +196952,11 @@ func (sod SquareObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SquareObjectDataset. func (sod SquareObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -187891,6 +197104,8 @@ func (sod *SquareObjectDataset) UnmarshalJSON(body []byte) error { type SquareSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -187899,7 +197114,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -187910,6 +197125,9 @@ func (ss SquareSource) MarshalJSON() ([]byte, error) { if ss.Query != nil { objectMap["query"] = ss.Query } + if ss.QueryTimeout != nil { + objectMap["queryTimeout"] = ss.QueryTimeout + } if ss.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ss.SourceRetryCount } @@ -187928,6 +197146,121 @@ func (ss SquareSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SquareSource. func (ss SquareSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -188103,81 +197436,21 @@ func (ss SquareSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SquareSource. func (ss SquareSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SquareSource. func (ss SquareSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SquareSource. func (ss SquareSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SquareSource. func (ss SquareSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -188203,11 +197476,6 @@ func (ss SquareSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SquareSource. func (ss SquareSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -188233,21 +197501,11 @@ func (ss SquareSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SquareSource. func (ss SquareSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SquareSource. func (ss SquareSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -188278,53 +197536,33 @@ func (ss SquareSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SquareSource. func (ss SquareSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ss, true } -// AsAzureTableSource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SquareSource. -func (ss SquareSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -188376,6 +197614,15 @@ func (ss *SquareSource) UnmarshalJSON(body []byte) error { } ss.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ss.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -190179,6 +199426,8 @@ func (slstp *SybaseLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error type SybaseSource struct { // Query - Database query. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -190187,7 +199436,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -190198,6 +199447,9 @@ func (ss SybaseSource) MarshalJSON() ([]byte, error) { if ss.Query != nil { objectMap["query"] = ss.Query } + if ss.QueryTimeout != nil { + objectMap["queryTimeout"] = ss.QueryTimeout + } if ss.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ss.SourceRetryCount } @@ -190216,6 +199468,121 @@ func (ss SybaseSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for SybaseSource. func (ss SybaseSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -190391,81 +199758,21 @@ func (ss SybaseSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for SybaseSource. func (ss SybaseSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for SybaseSource. func (ss SybaseSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for SybaseSource. func (ss SybaseSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for SybaseSource. func (ss SybaseSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -190491,11 +199798,6 @@ func (ss SybaseSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for SybaseSource. func (ss SybaseSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -190521,21 +199823,11 @@ func (ss SybaseSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for SybaseSource. func (ss SybaseSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for SybaseSource. func (ss SybaseSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -190566,53 +199858,33 @@ func (ss SybaseSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for SybaseSource. func (ss SybaseSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ss, true } -// AsAzureTableSource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for SybaseSource. -func (ss SybaseSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -190664,6 +199936,15 @@ func (ss *SybaseSource) UnmarshalJSON(body []byte) error { } ss.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ss.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -190738,7 +200019,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -191139,6 +200420,11 @@ func (std SybaseTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollec return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for SybaseTableDataset. +func (std SybaseTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for SybaseTableDataset. func (std SybaseTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -191179,6 +200465,11 @@ func (std SybaseTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for SybaseTableDataset. +func (std SybaseTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SybaseTableDataset. func (std SybaseTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -191328,6 +200619,892 @@ type SybaseTableDatasetTypeProperties struct { TableName interface{} `json:"tableName,omitempty"` } +// BasicTabularSource copy activity sources of tabular type. +type BasicTabularSource interface { + AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) + AsGoogleAdWordsSource() (*GoogleAdWordsSource, bool) + AsOracleServiceCloudSource() (*OracleServiceCloudSource, bool) + AsDynamicsAXSource() (*DynamicsAXSource, bool) + AsResponsysSource() (*ResponsysSource, bool) + AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) + AsVerticaSource() (*VerticaSource, bool) + AsNetezzaSource() (*NetezzaSource, bool) + AsZohoSource() (*ZohoSource, bool) + AsXeroSource() (*XeroSource, bool) + AsSquareSource() (*SquareSource, bool) + AsSparkSource() (*SparkSource, bool) + AsShopifySource() (*ShopifySource, bool) + AsServiceNowSource() (*ServiceNowSource, bool) + AsQuickBooksSource() (*QuickBooksSource, bool) + AsPrestoSource() (*PrestoSource, bool) + AsPhoenixSource() (*PhoenixSource, bool) + AsPaypalSource() (*PaypalSource, bool) + AsMarketoSource() (*MarketoSource, bool) + AsAzureMariaDBSource() (*AzureMariaDBSource, bool) + AsMariaDBSource() (*MariaDBSource, bool) + AsMagentoSource() (*MagentoSource, bool) + AsJiraSource() (*JiraSource, bool) + AsImpalaSource() (*ImpalaSource, bool) + AsHubspotSource() (*HubspotSource, bool) + AsHiveSource() (*HiveSource, bool) + AsHBaseSource() (*HBaseSource, bool) + AsGreenplumSource() (*GreenplumSource, bool) + AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) + AsEloquaSource() (*EloquaSource, bool) + AsDrillSource() (*DrillSource, bool) + AsCouchbaseSource() (*CouchbaseSource, bool) + AsConcurSource() (*ConcurSource, bool) + AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) + AsAmazonMWSSource() (*AmazonMWSSource, bool) + AsCassandraSource() (*CassandraSource, bool) + AsTeradataSource() (*TeradataSource, bool) + AsAzureMySQLSource() (*AzureMySQLSource, bool) + AsSQLDWSource() (*SQLDWSource, bool) + AsSQLMISource() (*SQLMISource, bool) + AsAzureSQLSource() (*AzureSQLSource, bool) + AsSQLServerSource() (*SQLServerSource, bool) + AsSQLSource() (*SQLSource, bool) + AsSapTableSource() (*SapTableSource, bool) + AsSapOpenHubSource() (*SapOpenHubSource, bool) + AsSapHanaSource() (*SapHanaSource, bool) + AsSapEccSource() (*SapEccSource, bool) + AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) + AsSalesforceSource() (*SalesforceSource, bool) + AsSapBwSource() (*SapBwSource, bool) + AsSybaseSource() (*SybaseSource, bool) + AsPostgreSQLSource() (*PostgreSQLSource, bool) + AsMySQLSource() (*MySQLSource, bool) + AsOdbcSource() (*OdbcSource, bool) + AsDb2Source() (*Db2Source, bool) + AsInformixSource() (*InformixSource, bool) + AsAzureTableSource() (*AzureTableSource, bool) + AsTabularSource() (*TabularSource, bool) +} + +// TabularSource copy activity sources of tabular type. +type TabularSource struct { + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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', '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 TypeBasicCopySource `json:"type,omitempty"` +} + +func unmarshalBasicTabularSource(body []byte) (BasicTabularSource, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeAmazonRedshiftSource): + var ars AmazonRedshiftSource + err := json.Unmarshal(body, &ars) + return ars, err + case string(TypeGoogleAdWordsSource): + var gaws GoogleAdWordsSource + err := json.Unmarshal(body, &gaws) + return gaws, err + case string(TypeOracleServiceCloudSource): + var oscs OracleServiceCloudSource + err := json.Unmarshal(body, &oscs) + return oscs, err + case string(TypeDynamicsAXSource): + var das DynamicsAXSource + err := json.Unmarshal(body, &das) + return das, err + case string(TypeResponsysSource): + var rs ResponsysSource + err := json.Unmarshal(body, &rs) + return rs, err + case string(TypeSalesforceMarketingCloudSource): + var smcs SalesforceMarketingCloudSource + err := json.Unmarshal(body, &smcs) + return smcs, err + case string(TypeVerticaSource): + var vs VerticaSource + err := json.Unmarshal(body, &vs) + return vs, err + case string(TypeNetezzaSource): + var ns NetezzaSource + err := json.Unmarshal(body, &ns) + return ns, err + case string(TypeZohoSource): + var zs ZohoSource + err := json.Unmarshal(body, &zs) + return zs, err + case string(TypeXeroSource): + var xs XeroSource + err := json.Unmarshal(body, &xs) + return xs, err + case string(TypeSquareSource): + var ss SquareSource + err := json.Unmarshal(body, &ss) + return ss, err + case string(TypeSparkSource): + var ss SparkSource + err := json.Unmarshal(body, &ss) + return ss, err + case string(TypeShopifySource): + var ss ShopifySource + err := json.Unmarshal(body, &ss) + return ss, err + case string(TypeServiceNowSource): + var sns ServiceNowSource + err := json.Unmarshal(body, &sns) + return sns, err + case string(TypeQuickBooksSource): + var qbs QuickBooksSource + err := json.Unmarshal(body, &qbs) + return qbs, err + case string(TypePrestoSource): + var ps PrestoSource + err := json.Unmarshal(body, &ps) + return ps, err + case string(TypePhoenixSource): + var ps PhoenixSource + err := json.Unmarshal(body, &ps) + return ps, err + case string(TypePaypalSource): + var ps PaypalSource + err := json.Unmarshal(body, &ps) + return ps, err + case string(TypeMarketoSource): + var ms MarketoSource + err := json.Unmarshal(body, &ms) + return ms, err + case string(TypeAzureMariaDBSource): + var amds AzureMariaDBSource + err := json.Unmarshal(body, &amds) + return amds, err + case string(TypeMariaDBSource): + var mds MariaDBSource + err := json.Unmarshal(body, &mds) + return mds, err + case string(TypeMagentoSource): + var ms MagentoSource + err := json.Unmarshal(body, &ms) + return ms, err + case string(TypeJiraSource): + var js JiraSource + err := json.Unmarshal(body, &js) + return js, err + case string(TypeImpalaSource): + var is ImpalaSource + err := json.Unmarshal(body, &is) + return is, err + case string(TypeHubspotSource): + var hs HubspotSource + err := json.Unmarshal(body, &hs) + return hs, err + case string(TypeHiveSource): + var hs HiveSource + err := json.Unmarshal(body, &hs) + return hs, err + case string(TypeHBaseSource): + var hbs HBaseSource + err := json.Unmarshal(body, &hbs) + return hbs, err + case string(TypeGreenplumSource): + var gs GreenplumSource + err := json.Unmarshal(body, &gs) + return gs, err + case string(TypeGoogleBigQuerySource): + var gbqs GoogleBigQuerySource + err := json.Unmarshal(body, &gbqs) + return gbqs, err + case string(TypeEloquaSource): + var es EloquaSource + err := json.Unmarshal(body, &es) + return es, err + case string(TypeDrillSource): + var ds DrillSource + err := json.Unmarshal(body, &ds) + return ds, err + case string(TypeCouchbaseSource): + var cs CouchbaseSource + err := json.Unmarshal(body, &cs) + return cs, err + case string(TypeConcurSource): + var cs ConcurSource + err := json.Unmarshal(body, &cs) + return cs, err + case string(TypeAzurePostgreSQLSource): + var apss AzurePostgreSQLSource + err := json.Unmarshal(body, &apss) + return apss, err + case string(TypeAmazonMWSSource): + var ams AmazonMWSSource + err := json.Unmarshal(body, &ams) + return ams, err + case string(TypeCassandraSource): + var cs CassandraSource + err := json.Unmarshal(body, &cs) + return cs, err + case string(TypeTeradataSource): + var ts TeradataSource + err := json.Unmarshal(body, &ts) + return ts, err + case string(TypeAzureMySQLSource): + var amss AzureMySQLSource + err := json.Unmarshal(body, &amss) + return amss, err + case string(TypeSQLDWSource): + var sds SQLDWSource + err := json.Unmarshal(body, &sds) + return sds, err + case string(TypeSQLMISource): + var sms SQLMISource + err := json.Unmarshal(body, &sms) + return sms, err + case string(TypeAzureSQLSource): + var ass AzureSQLSource + err := json.Unmarshal(body, &ass) + return ass, err + case string(TypeSQLServerSource): + var sss SQLServerSource + err := json.Unmarshal(body, &sss) + return sss, err + case string(TypeSQLSource): + var ss SQLSource + err := json.Unmarshal(body, &ss) + return ss, err + case string(TypeSapTableSource): + var sts SapTableSource + err := json.Unmarshal(body, &sts) + return sts, err + case string(TypeSapOpenHubSource): + var sohs SapOpenHubSource + err := json.Unmarshal(body, &sohs) + return sohs, err + case string(TypeSapHanaSource): + var shs SapHanaSource + err := json.Unmarshal(body, &shs) + return shs, err + case string(TypeSapEccSource): + var ses SapEccSource + err := json.Unmarshal(body, &ses) + return ses, err + case string(TypeSapCloudForCustomerSource): + var scfcs SapCloudForCustomerSource + err := json.Unmarshal(body, &scfcs) + return scfcs, err + case string(TypeSalesforceSource): + var ss SalesforceSource + err := json.Unmarshal(body, &ss) + return ss, err + case string(TypeSapBwSource): + var sbs SapBwSource + err := json.Unmarshal(body, &sbs) + return sbs, err + case string(TypeSybaseSource): + var ss SybaseSource + err := json.Unmarshal(body, &ss) + return ss, err + case string(TypePostgreSQLSource): + var pss PostgreSQLSource + err := json.Unmarshal(body, &pss) + return pss, err + case string(TypeMySQLSource): + var mss MySQLSource + err := json.Unmarshal(body, &mss) + return mss, err + case string(TypeOdbcSource): + var osVar OdbcSource + err := json.Unmarshal(body, &osVar) + return osVar, err + case string(TypeDb2Source): + var d2s Db2Source + err := json.Unmarshal(body, &d2s) + return d2s, err + case string(TypeInformixSource): + var is InformixSource + err := json.Unmarshal(body, &is) + return is, err + case string(TypeAzureTableSource): + var ats AzureTableSource + err := json.Unmarshal(body, &ats) + return ats, err + default: + var ts TabularSource + err := json.Unmarshal(body, &ts) + return ts, err + } +} +func unmarshalBasicTabularSourceArray(body []byte) ([]BasicTabularSource, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tsArray := make([]BasicTabularSource, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ts, err := unmarshalBasicTabularSource(*rawMessage) + if err != nil { + return nil, err + } + tsArray[index] = ts + } + return tsArray, nil +} + +// MarshalJSON is the custom marshaler for TabularSource. +func (ts TabularSource) MarshalJSON() ([]byte, error) { + ts.Type = TypeTabularSource + objectMap := make(map[string]interface{}) + if ts.QueryTimeout != nil { + objectMap["queryTimeout"] = ts.QueryTimeout + } + if ts.SourceRetryCount != nil { + objectMap["sourceRetryCount"] = ts.SourceRetryCount + } + if ts.SourceRetryWait != nil { + objectMap["sourceRetryWait"] = ts.SourceRetryWait + } + if ts.MaxConcurrentConnections != nil { + objectMap["maxConcurrentConnections"] = ts.MaxConcurrentConnections + } + if ts.Type != "" { + objectMap["type"] = ts.Type + } + for k, v := range ts.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsHTTPSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsGoogleAdWordsSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsGoogleAdWordsSource() (*GoogleAdWordsSource, bool) { + return nil, false +} + +// AsOracleServiceCloudSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsOracleServiceCloudSource() (*OracleServiceCloudSource, bool) { + return nil, false +} + +// AsDynamicsAXSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsDynamicsAXSource() (*DynamicsAXSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsAzureMariaDBSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsAzureMariaDBSource() (*AzureMariaDBSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsTeradataSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsTeradataSource() (*TeradataSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLMISource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSQLMISource() (*SQLMISource, bool) { + return nil, false +} + +// AsAzureSQLSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsAzureSQLSource() (*AzureSQLSource, bool) { + return nil, false +} + +// AsSQLServerSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSQLServerSource() (*SQLServerSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapTableSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSapTableSource() (*SapTableSource, bool) { + return nil, false +} + +// AsSapOpenHubSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSapOpenHubSource() (*SapOpenHubSource, bool) { + return nil, false +} + +// AsSapHanaSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSapHanaSource() (*SapHanaSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsSapBwSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSapBwSource() (*SapBwSource, bool) { + return nil, false +} + +// AsSybaseSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsSybaseSource() (*SybaseSource, bool) { + return nil, false +} + +// AsPostgreSQLSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsPostgreSQLSource() (*PostgreSQLSource, bool) { + return nil, false +} + +// AsMySQLSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsMySQLSource() (*MySQLSource, bool) { + return nil, false +} + +// AsOdbcSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsOdbcSource() (*OdbcSource, bool) { + return nil, false +} + +// AsDb2Source is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsDb2Source() (*Db2Source, bool) { + return nil, false +} + +// AsInformixSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsInformixSource() (*InformixSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsTabularSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsTabularSource() (*TabularSource, bool) { + return &ts, true +} + +// AsBasicTabularSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ts, true +} + +// AsBinarySource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsBinarySource() (*BinarySource, bool) { + return nil, false +} + +// AsOrcSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsOrcSource() (*OrcSource, bool) { + return nil, false +} + +// AsJSONSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsJSONSource() (*JSONSource, bool) { + return nil, false +} + +// AsDelimitedTextSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsDelimitedTextSource() (*DelimitedTextSource, bool) { + return nil, false +} + +// AsParquetSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsParquetSource() (*ParquetSource, bool) { + return nil, false +} + +// AsAvroSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsAvroSource() (*AvroSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ts, true +} + +// UnmarshalJSON is the custom unmarshaler for TabularSource struct. +func (ts *TabularSource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ts.QueryTimeout = queryTimeout + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ts.AdditionalProperties == nil { + ts.AdditionalProperties = make(map[string]interface{}) + } + ts.AdditionalProperties[k] = additionalProperties + } + case "sourceRetryCount": + if v != nil { + var sourceRetryCount interface{} + err = json.Unmarshal(*v, &sourceRetryCount) + if err != nil { + return err + } + ts.SourceRetryCount = sourceRetryCount + } + case "sourceRetryWait": + if v != nil { + var sourceRetryWait interface{} + err = json.Unmarshal(*v, &sourceRetryWait) + if err != nil { + return err + } + ts.SourceRetryWait = sourceRetryWait + } + case "maxConcurrentConnections": + if v != nil { + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) + if err != nil { + return err + } + ts.MaxConcurrentConnections = maxConcurrentConnections + } + case "type": + if v != nil { + var typeVar TypeBasicCopySource + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ts.Type = typeVar + } + } + } + + return nil +} + // TeradataLinkedService linked service for Teradata data source. type TeradataLinkedService struct { // TeradataLinkedServiceTypeProperties - Teradata linked service properties. @@ -192022,6 +202199,8 @@ type TeradataSource struct { PartitionOption TeradataPartitionOption `json:"partitionOption,omitempty"` // PartitionSettings - The settings that will be leveraged for teradata source partitioning. PartitionSettings *TeradataPartitionSettings `json:"partitionSettings,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -192030,7 +202209,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -192047,6 +202226,9 @@ func (ts TeradataSource) MarshalJSON() ([]byte, error) { if ts.PartitionSettings != nil { objectMap["partitionSettings"] = ts.PartitionSettings } + if ts.QueryTimeout != nil { + objectMap["queryTimeout"] = ts.QueryTimeout + } if ts.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ts.SourceRetryCount } @@ -192065,6 +202247,121 @@ func (ts TeradataSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for TeradataSource. func (ts TeradataSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -192240,81 +202537,21 @@ func (ts TeradataSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for TeradataSource. func (ts TeradataSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for TeradataSource. func (ts TeradataSource) AsTeradataSource() (*TeradataSource, bool) { return &ts, true } -// AsOracleSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for TeradataSource. func (ts TeradataSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for TeradataSource. func (ts TeradataSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -192340,11 +202577,6 @@ func (ts TeradataSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for TeradataSource. func (ts TeradataSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -192370,21 +202602,11 @@ func (ts TeradataSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSour return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for TeradataSource. func (ts TeradataSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for TeradataSource. func (ts TeradataSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -192415,53 +202637,33 @@ func (ts TeradataSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for TeradataSource. func (ts TeradataSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &ts, true } -// AsAzureTableSource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for TeradataSource. -func (ts TeradataSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -192531,6 +202733,15 @@ func (ts *TeradataSource) UnmarshalJSON(body []byte) error { } ts.PartitionSettings = &partitionSettings } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + ts.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -192605,7 +202816,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -193006,6 +203217,11 @@ func (ttd TeradataTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbColl return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for TeradataTableDataset. +func (ttd TeradataTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for TeradataTableDataset. func (ttd TeradataTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -193046,6 +203262,11 @@ func (ttd TeradataTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for TeradataTableDataset. +func (ttd TeradataTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for TeradataTableDataset. func (ttd TeradataTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -193443,9 +203664,18 @@ func (tf *TextFormat) UnmarshalJSON(body []byte) error { return nil } +// Transformation a data flow transformation. +type Transformation struct { + // Name - Transformation name. + Name *string `json:"name,omitempty"` + // Description - Transformation description. + Description *string `json:"description,omitempty"` +} + // BasicTrigger azure data factory nested object which contains information about creating pipeline run type BasicTrigger interface { AsRerunTumblingWindowTrigger() (*RerunTumblingWindowTrigger, bool) + AsChainingTrigger() (*ChainingTrigger, bool) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) AsBlobEventsTrigger() (*BlobEventsTrigger, bool) AsBlobTrigger() (*BlobTrigger, bool) @@ -193465,7 +203695,7 @@ type Trigger struct { RuntimeState TriggerRuntimeState `json:"runtimeState,omitempty"` // Annotations - List of tags that can be used for describing the trigger. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' + // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeChainingTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' Type TypeBasicTrigger `json:"type,omitempty"` } @@ -193481,6 +203711,10 @@ func unmarshalBasicTrigger(body []byte) (BasicTrigger, error) { var rtwt RerunTumblingWindowTrigger err := json.Unmarshal(body, &rtwt) return rtwt, err + case string(TypeChainingTrigger): + var ct ChainingTrigger + err := json.Unmarshal(body, &ct) + return ct, err case string(TypeTumblingWindowTrigger): var twt TumblingWindowTrigger err := json.Unmarshal(body, &twt) @@ -193550,6 +203784,11 @@ func (t Trigger) AsRerunTumblingWindowTrigger() (*RerunTumblingWindowTrigger, bo return nil, false } +// AsChainingTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsChainingTrigger() (*ChainingTrigger, bool) { + return nil, false +} + // AsTumblingWindowTrigger is the BasicTrigger implementation for Trigger. func (t Trigger) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) { return nil, false @@ -194015,6 +204254,10 @@ type TriggerRun struct { Properties map[string]*string `json:"properties"` // TriggeredPipelines - READ-ONLY; List of pipeline name and run Id triggered by the trigger run. TriggeredPipelines map[string]*string `json:"triggeredPipelines"` + // RunDimension - READ-ONLY; Run dimension for which trigger was fired. + RunDimension map[string]*string `json:"runDimension"` + // DependencyStatus - READ-ONLY; Status of the upstream pipelines. + DependencyStatus map[string]interface{} `json:"dependencyStatus"` } // MarshalJSON is the custom marshaler for TriggerRun. @@ -194119,6 +204362,24 @@ func (tr *TriggerRun) UnmarshalJSON(body []byte) error { } tr.TriggeredPipelines = triggeredPipelines } + case "runDimension": + if v != nil { + var runDimension map[string]*string + err = json.Unmarshal(*v, &runDimension) + if err != nil { + return err + } + tr.RunDimension = runDimension + } + case "dependencyStatus": + if v != nil { + var dependencyStatus map[string]interface{} + err = json.Unmarshal(*v, &dependencyStatus) + if err != nil { + return err + } + tr.DependencyStatus = dependencyStatus + } } } @@ -194261,7 +204522,7 @@ type TumblingWindowTrigger struct { RuntimeState TriggerRuntimeState `json:"runtimeState,omitempty"` // Annotations - List of tags that can be used for describing the trigger. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' + // Type - Possible values include: 'TypeTrigger', 'TypeRerunTumblingWindowTrigger', 'TypeChainingTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' Type TypeBasicTrigger `json:"type,omitempty"` } @@ -194295,6 +204556,11 @@ func (twt TumblingWindowTrigger) AsRerunTumblingWindowTrigger() (*RerunTumblingW return nil, false } +// AsChainingTrigger is the BasicTrigger implementation for TumblingWindowTrigger. +func (twt TumblingWindowTrigger) AsChainingTrigger() (*ChainingTrigger, bool) { + return nil, false +} + // AsTumblingWindowTrigger is the BasicTrigger implementation for TumblingWindowTrigger. func (twt TumblingWindowTrigger) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) { return &twt, true @@ -194598,7 +204864,7 @@ type UntilActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -194630,6 +204896,11 @@ func (ua UntilActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for UntilActivity. func (ua UntilActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -194997,7 +205268,7 @@ type ValidationActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -195029,6 +205300,11 @@ func (va ValidationActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for ValidationActivity. +func (va ValidationActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for ValidationActivity. func (va ValidationActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -195933,6 +206209,8 @@ type VerticaLinkedServiceTypeProperties struct { type VerticaSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -195941,7 +206219,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -195952,6 +206230,9 @@ func (vs VerticaSource) MarshalJSON() ([]byte, error) { if vs.Query != nil { objectMap["query"] = vs.Query } + if vs.QueryTimeout != nil { + objectMap["queryTimeout"] = vs.QueryTimeout + } if vs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = vs.SourceRetryCount } @@ -195970,6 +206251,121 @@ func (vs VerticaSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for VerticaSource. func (vs VerticaSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -196145,81 +206541,21 @@ func (vs VerticaSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for VerticaSource. func (vs VerticaSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for VerticaSource. func (vs VerticaSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for VerticaSource. func (vs VerticaSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for VerticaSource. func (vs VerticaSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -196245,11 +206581,6 @@ func (vs VerticaSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for VerticaSource. func (vs VerticaSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -196275,21 +206606,11 @@ func (vs VerticaSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSourc return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for VerticaSource. func (vs VerticaSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for VerticaSource. func (vs VerticaSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -196320,53 +206641,33 @@ func (vs VerticaSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for VerticaSource. func (vs VerticaSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &vs, true } -// AsAzureTableSource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for VerticaSource. -func (vs VerticaSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -196418,6 +206719,15 @@ func (vs *VerticaSource) UnmarshalJSON(body []byte) error { } vs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + vs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -196492,7 +206802,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -196893,6 +207203,11 @@ func (vtd VerticaTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbColle return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for VerticaTableDataset. func (vtd VerticaTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -196933,6 +207248,11 @@ func (vtd VerticaTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for VerticaTableDataset. func (vtd VerticaTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -197090,7 +207410,7 @@ type WaitActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -197122,6 +207442,11 @@ func (wa WaitActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for WaitActivity. func (wa WaitActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -197412,7 +207737,7 @@ type WebActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -197450,6 +207775,11 @@ func (wa WebActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for WebActivity. func (wa WebActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -198035,7 +208365,7 @@ type WebHookActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeActivity', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeAzureDataExplorerCommand', 'TypeDelete', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeWebHook', 'TypeAppendVariable', 'TypeSetVariable', 'TypeFilter', 'TypeValidation', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -198067,6 +208397,11 @@ func (wha WebHookActivity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsExecuteDataFlowActivity is the BasicActivity implementation for WebHookActivity. +func (wha WebHookActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + // AsAzureFunctionActivity is the BasicActivity implementation for WebHookActivity. func (wha WebHookActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { return nil, false @@ -199049,7 +209384,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -199075,6 +209410,121 @@ func (ws WebSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsWebSource() (*WebSource, bool) { + return &ws, true +} + +// AsOracleSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for WebSource. func (ws WebSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -199250,81 +209700,21 @@ func (ws WebSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for WebSource. func (ws WebSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsWebSource() (*WebSource, bool) { - return &ws, true -} - // AsTeradataSource is the BasicCopySource implementation for WebSource. func (ws WebSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for WebSource. func (ws WebSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for WebSource. func (ws WebSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -199350,11 +209740,6 @@ func (ws WebSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for WebSource. func (ws WebSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -199380,21 +209765,11 @@ func (ws WebSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, b return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for WebSource. func (ws WebSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for WebSource. func (ws WebSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -199425,53 +209800,33 @@ func (ws WebSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for WebSource. func (ws WebSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsBlobSource() (*BlobSource, bool) { +// AsBasicTabularSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsBasicTabularSource() (BasicTabularSource, bool) { return nil, false } -// AsAzureTableSource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for WebSource. -func (ws WebSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -199588,7 +209943,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -199989,6 +210344,11 @@ func (wtd WebTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectio return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for WebTableDataset. func (wtd WebTableDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -200029,6 +210389,11 @@ func (wtd WebTableDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for WebTableDataset. func (wtd WebTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -200887,7 +211252,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -201288,6 +211653,11 @@ func (xod XeroObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollect return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for XeroObjectDataset. func (xod XeroObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -201328,6 +211698,11 @@ func (xod XeroObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for XeroObjectDataset. func (xod XeroObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -201475,6 +211850,8 @@ func (xod *XeroObjectDataset) UnmarshalJSON(body []byte) error { type XeroSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -201483,7 +211860,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -201494,6 +211871,9 @@ func (xs XeroSource) MarshalJSON() ([]byte, error) { if xs.Query != nil { objectMap["query"] = xs.Query } + if xs.QueryTimeout != nil { + objectMap["queryTimeout"] = xs.QueryTimeout + } if xs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = xs.SourceRetryCount } @@ -201512,6 +211892,121 @@ func (xs XeroSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for XeroSource. func (xs XeroSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -201687,81 +212182,21 @@ func (xs XeroSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for XeroSource. func (xs XeroSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for XeroSource. func (xs XeroSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for XeroSource. func (xs XeroSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for XeroSource. func (xs XeroSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -201787,11 +212222,6 @@ func (xs XeroSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for XeroSource. func (xs XeroSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -201817,21 +212247,11 @@ func (xs XeroSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for XeroSource. func (xs XeroSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for XeroSource. func (xs XeroSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -201862,53 +212282,33 @@ func (xs XeroSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for XeroSource. func (xs XeroSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &xs, true } -// AsAzureTableSource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for XeroSource. -func (xs XeroSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -201960,6 +212360,15 @@ func (xs *XeroSource) UnmarshalJSON(body []byte) error { } xs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + xs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} @@ -202710,7 +213119,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', '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', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', '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 TypeBasicDataset `json:"type,omitempty"` } @@ -203111,6 +213520,11 @@ func (zod ZohoObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollect return nil, false } +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + // AsCustomDataset is the BasicDataset implementation for ZohoObjectDataset. func (zod ZohoObjectDataset) AsCustomDataset() (*CustomDataset, bool) { return nil, false @@ -203151,6 +213565,11 @@ func (zod ZohoObjectDataset) AsBinaryDataset() (*BinaryDataset, bool) { return nil, false } +// AsOrcDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ZohoObjectDataset. func (zod ZohoObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -203298,6 +213717,8 @@ func (zod *ZohoObjectDataset) UnmarshalJSON(body []byte) error { type ZohoSource struct { // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). Query interface{} `json:"query,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,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). @@ -203306,7 +213727,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', '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', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeTeradataSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeRestSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceServiceCloudSource', 'TypeSalesforceSource', 'TypeODataSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeMicrosoftAccessSource', 'TypeInformixSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource', 'TypeBinarySource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', '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 TypeBasicCopySource `json:"type,omitempty"` } @@ -203317,6 +213738,9 @@ func (zs ZohoSource) MarshalJSON() ([]byte, error) { if zs.Query != nil { objectMap["query"] = zs.Query } + if zs.QueryTimeout != nil { + objectMap["queryTimeout"] = zs.QueryTimeout + } if zs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = zs.SourceRetryCount } @@ -203335,6 +213759,121 @@ func (zs ZohoSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsHTTPSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + // AsAmazonRedshiftSource is the BasicCopySource implementation for ZohoSource. func (zs ZohoSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { return nil, false @@ -203510,81 +214049,21 @@ func (zs ZohoSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { return nil, false } -// AsHTTPSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsHTTPSource() (*HTTPSource, bool) { - return nil, false -} - -// AsAzureBlobFSSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { - return nil, false -} - -// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { - return nil, false -} - -// AsOffice365Source is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsOffice365Source() (*Office365Source, bool) { - return nil, false -} - -// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { - return nil, false -} - -// AsMongoDbV2Source is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { - return nil, false -} - -// AsMongoDbSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsMongoDbSource() (*MongoDbSource, bool) { - return nil, false -} - // AsCassandraSource is the BasicCopySource implementation for ZohoSource. func (zs ZohoSource) AsCassandraSource() (*CassandraSource, bool) { return nil, false } -// AsWebSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsWebSource() (*WebSource, bool) { - return nil, false -} - // AsTeradataSource is the BasicCopySource implementation for ZohoSource. func (zs ZohoSource) AsTeradataSource() (*TeradataSource, bool) { return nil, false } -// AsOracleSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsOracleSource() (*OracleSource, bool) { - return nil, false -} - -// AsAzureDataExplorerSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { - return nil, false -} - // AsAzureMySQLSource is the BasicCopySource implementation for ZohoSource. func (zs ZohoSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { return nil, false } -// AsHdfsSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsHdfsSource() (*HdfsSource, bool) { - return nil, false -} - -// AsFileSystemSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsFileSystemSource() (*FileSystemSource, bool) { - return nil, false -} - // AsSQLDWSource is the BasicCopySource implementation for ZohoSource. func (zs ZohoSource) AsSQLDWSource() (*SQLDWSource, bool) { return nil, false @@ -203610,11 +214089,6 @@ func (zs ZohoSource) AsSQLSource() (*SQLSource, bool) { return nil, false } -// AsRestSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsRestSource() (*RestSource, bool) { - return nil, false -} - // AsSapTableSource is the BasicCopySource implementation for ZohoSource. func (zs ZohoSource) AsSapTableSource() (*SapTableSource, bool) { return nil, false @@ -203640,21 +214114,11 @@ func (zs ZohoSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, return nil, false } -// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { - return nil, false -} - // AsSalesforceSource is the BasicCopySource implementation for ZohoSource. func (zs ZohoSource) AsSalesforceSource() (*SalesforceSource, bool) { return nil, false } -// AsODataSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsODataSource() (*ODataSource, bool) { - return nil, false -} - // AsSapBwSource is the BasicCopySource implementation for ZohoSource. func (zs ZohoSource) AsSapBwSource() (*SapBwSource, bool) { return nil, false @@ -203685,53 +214149,33 @@ func (zs ZohoSource) AsDb2Source() (*Db2Source, bool) { return nil, false } -// AsMicrosoftAccessSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { - return nil, false -} - // AsInformixSource is the BasicCopySource implementation for ZohoSource. func (zs ZohoSource) AsInformixSource() (*InformixSource, bool) { return nil, false } -// AsRelationalSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsRelationalSource() (*RelationalSource, bool) { - return nil, false -} - -// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { - return nil, false -} - -// AsDynamicsCrmSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { - return nil, false -} - -// AsDynamicsSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsDynamicsSource() (*DynamicsSource, bool) { +// AsAzureTableSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsAzureTableSource() (*AzureTableSource, bool) { return nil, false } -// AsDocumentDbCollectionSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { +// AsTabularSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsTabularSource() (*TabularSource, bool) { return nil, false } -// AsBlobSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsBlobSource() (*BlobSource, bool) { - return nil, false +// AsBasicTabularSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return &zs, true } -// AsAzureTableSource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsAzureTableSource() (*AzureTableSource, bool) { +// AsBinarySource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsBinarySource() (*BinarySource, bool) { return nil, false } -// AsBinarySource is the BasicCopySource implementation for ZohoSource. -func (zs ZohoSource) AsBinarySource() (*BinarySource, bool) { +// AsOrcSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsOrcSource() (*OrcSource, bool) { return nil, false } @@ -203783,6 +214227,15 @@ func (zs *ZohoSource) UnmarshalJSON(body []byte) error { } zs.Query = query } + case "queryTimeout": + if v != nil { + var queryTimeout interface{} + err = json.Unmarshal(*v, &queryTimeout) + if err != nil { + return err + } + zs.QueryTimeout = queryTimeout + } default: if v != nil { var additionalProperties interface{} diff --git a/services/datalake/analytics/2016-11-01-preview/catalog/models.go b/services/datalake/analytics/2016-11-01-preview/catalog/models.go index 845f50ce9888..f7fde509ba0f 100644 --- a/services/datalake/analytics/2016-11-01-preview/catalog/models.go +++ b/services/datalake/analytics/2016-11-01-preview/catalog/models.go @@ -405,9 +405,9 @@ type USQLAssemblyDependencyInfo struct { type USQLAssemblyFileInfo struct { // Type - the assembly file type. Possible values include: 'Assembly', 'Resource', 'Nodeploy' Type FileType `json:"type,omitempty"` - // OriginalPath - the the original path to the assembly file. + // OriginalPath - The original path to the assembly file. OriginalPath *string `json:"originalPath,omitempty"` - // ContentPath - the the content path to the assembly file. + // ContentPath - The content path to the assembly file. ContentPath *string `json:"contentPath,omitempty"` } @@ -2318,15 +2318,15 @@ type USQLTableType struct { SchemaID *int32 `json:"schemaId,omitempty"` // PrincipalID - the principal ID for this type. PrincipalID *int32 `json:"principalId,omitempty"` - // IsNullable - the the switch indicating if this type is nullable. + // IsNullable - The switch indicating if this type is nullable. IsNullable *bool `json:"isNullable,omitempty"` - // IsUserDefined - the the switch indicating if this type is user defined. + // IsUserDefined - The switch indicating if this type is user defined. IsUserDefined *bool `json:"isUserDefined,omitempty"` - // IsAssemblyType - the the switch indicating if this type is an assembly type. + // IsAssemblyType - The switch indicating if this type is an assembly type. IsAssemblyType *bool `json:"isAssemblyType,omitempty"` - // IsTableType - the the switch indicating if this type is a table type. + // IsTableType - The switch indicating if this type is a table type. IsTableType *bool `json:"isTableType,omitempty"` - // IsComplexType - the the switch indicating if this type is a complex type. + // IsComplexType - The switch indicating if this type is a complex type. IsComplexType *bool `json:"isComplexType,omitempty"` // ComputeAccountName - the name of the Data Lake Analytics account. ComputeAccountName *string `json:"computeAccountName,omitempty"` @@ -2666,15 +2666,15 @@ type USQLType struct { SchemaID *int32 `json:"schemaId,omitempty"` // PrincipalID - the principal ID for this type. PrincipalID *int32 `json:"principalId,omitempty"` - // IsNullable - the the switch indicating if this type is nullable. + // IsNullable - The switch indicating if this type is nullable. IsNullable *bool `json:"isNullable,omitempty"` - // IsUserDefined - the the switch indicating if this type is user defined. + // IsUserDefined - The switch indicating if this type is user defined. IsUserDefined *bool `json:"isUserDefined,omitempty"` - // IsAssemblyType - the the switch indicating if this type is an assembly type. + // IsAssemblyType - The switch indicating if this type is an assembly type. IsAssemblyType *bool `json:"isAssemblyType,omitempty"` - // IsTableType - the the switch indicating if this type is a table type. + // IsTableType - The switch indicating if this type is a table type. IsTableType *bool `json:"isTableType,omitempty"` - // IsComplexType - the the switch indicating if this type is a complex type. + // IsComplexType - The switch indicating if this type is a complex type. IsComplexType *bool `json:"isComplexType,omitempty"` // ComputeAccountName - the name of the Data Lake Analytics account. ComputeAccountName *string `json:"computeAccountName,omitempty"` diff --git a/services/datamigration/mgmt/2018-04-19/datamigration/client.go b/services/datamigration/mgmt/2018-04-19/datamigration/client.go index a32a8533f370..898cc1ada833 100644 --- a/services/datamigration/mgmt/2018-04-19/datamigration/client.go +++ b/services/datamigration/mgmt/2018-04-19/datamigration/client.go @@ -1,4 +1,4 @@ -// Package datamigration implements the Azure ARM Datamigration service API version . +// Package datamigration implements the Azure ARM Datamigration service API version 2018-04-19. // // Data Migration Client package datamigration diff --git a/services/datamigration/mgmt/2018-04-19/datamigration/models.go b/services/datamigration/mgmt/2018-04-19/datamigration/models.go index 75375eb2a75c..3becb4a76024 100644 --- a/services/datamigration/mgmt/2018-04-19/datamigration/models.go +++ b/services/datamigration/mgmt/2018-04-19/datamigration/models.go @@ -9441,8 +9441,8 @@ func (msccp MigrateSyncCompleteCommandProperties) AsBasicCommandProperties() (Ba // MigrationEligibilityInfo information about migration eligibility of a server object type MigrationEligibilityInfo struct { - // IsEligibileForMigration - READ-ONLY; Whether object is eligible for migration or not. - IsEligibileForMigration *bool `json:"isEligibileForMigration,omitempty"` + // IsEligibleForMigration - READ-ONLY; Whether object is eligible for migration or not. + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` // ValidationMessages - READ-ONLY; Information about eligibility failure for the server object. ValidationMessages *[]string `json:"validationMessages,omitempty"` } diff --git a/services/eventgrid/2018-01-01/eventgrid/models.go b/services/eventgrid/2018-01-01/eventgrid/models.go index ce5f2d0042c9..22409444354c 100644 --- a/services/eventgrid/2018-01-01/eventgrid/models.go +++ b/services/eventgrid/2018-01-01/eventgrid/models.go @@ -551,6 +551,176 @@ func (ihdted IotHubDeviceTelemetryEventData) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// KeyVaultCertificateExpiredEventData schema of the Data property of an EventGridEvent for an +// CertificateExpired event. +type KeyVaultCertificateExpiredEventData struct { + // ID - The id of the object that triggered this event. + ID *string `json:"id,omitempty"` + // VaultName - Key vault name of the object that triggered this event. + VaultName *string `json:"vaultName,omitempty"` + // ObjectType - The type of the object that triggered this event + ObjectType *string `json:"objectType,omitempty"` + // ObjectName - The name of the object that triggered this event + ObjectName *string `json:"objectName,omitempty"` + // Version - The version of the object that triggered this event + Version *string `json:"version,omitempty"` + // Nbf - Not before date of the object that triggered this event + Nbf *float64 `json:"nbf,omitempty"` + // Exp - The expiration date of the object that triggered this event + Exp *float64 `json:"exp,omitempty"` +} + +// KeyVaultCertificateNearExpiryEventData schema of the Data property of an EventGridEvent for an +// CertificateNearExpiry event. +type KeyVaultCertificateNearExpiryEventData struct { + // ID - The id of the object that triggered this event. + ID *string `json:"id,omitempty"` + // VaultName - Key vault name of the object that triggered this event. + VaultName *string `json:"vaultName,omitempty"` + // ObjectType - The type of the object that triggered this event + ObjectType *string `json:"objectType,omitempty"` + // ObjectName - The name of the object that triggered this event + ObjectName *string `json:"objectName,omitempty"` + // Version - The version of the object that triggered this event + Version *string `json:"version,omitempty"` + // Nbf - Not before date of the object that triggered this event + Nbf *float64 `json:"nbf,omitempty"` + // Exp - The expiration date of the object that triggered this event + Exp *float64 `json:"exp,omitempty"` +} + +// KeyVaultCertificateNewVersionCreatedEventData schema of the Data property of an EventGridEvent for an +// CertificateNewVersionCreated event. +type KeyVaultCertificateNewVersionCreatedEventData struct { + // ID - The id of the object that triggered this event. + ID *string `json:"id,omitempty"` + // VaultName - Key vault name of the object that triggered this event. + VaultName *string `json:"vaultName,omitempty"` + // ObjectType - The type of the object that triggered this event + ObjectType *string `json:"objectType,omitempty"` + // ObjectName - The name of the object that triggered this event + ObjectName *string `json:"objectName,omitempty"` + // Version - The version of the object that triggered this event + Version *string `json:"version,omitempty"` + // Nbf - Not before date of the object that triggered this event + Nbf *float64 `json:"nbf,omitempty"` + // Exp - The expiration date of the object that triggered this event + Exp *float64 `json:"exp,omitempty"` +} + +// KeyVaultKeyExpiredEventData schema of the Data property of an EventGridEvent for an KeyExpired event. +type KeyVaultKeyExpiredEventData struct { + // ID - The id of the object that triggered this event. + ID *string `json:"id,omitempty"` + // VaultName - Key vault name of the object that triggered this event. + VaultName *string `json:"vaultName,omitempty"` + // ObjectType - The type of the object that triggered this event + ObjectType *string `json:"objectType,omitempty"` + // ObjectName - The name of the object that triggered this event + ObjectName *string `json:"objectName,omitempty"` + // Version - The version of the object that triggered this event + Version *string `json:"version,omitempty"` + // Nbf - Not before date of the object that triggered this event + Nbf *float64 `json:"nbf,omitempty"` + // Exp - The expiration date of the object that triggered this event + Exp *float64 `json:"exp,omitempty"` +} + +// KeyVaultKeyNearExpiryEventData schema of the Data property of an EventGridEvent for an KeyNearExpiry +// event. +type KeyVaultKeyNearExpiryEventData struct { + // ID - The id of the object that triggered this event. + ID *string `json:"id,omitempty"` + // VaultName - Key vault name of the object that triggered this event. + VaultName *string `json:"vaultName,omitempty"` + // ObjectType - The type of the object that triggered this event + ObjectType *string `json:"objectType,omitempty"` + // ObjectName - The name of the object that triggered this event + ObjectName *string `json:"objectName,omitempty"` + // Version - The version of the object that triggered this event + Version *string `json:"version,omitempty"` + // Nbf - Not before date of the object that triggered this event + Nbf *float64 `json:"nbf,omitempty"` + // Exp - The expiration date of the object that triggered this event + Exp *float64 `json:"exp,omitempty"` +} + +// KeyVaultKeyNewVersionCreatedEventData schema of the Data property of an EventGridEvent for an +// KeyNewVersionCreated event. +type KeyVaultKeyNewVersionCreatedEventData struct { + // ID - The id of the object that triggered this event. + ID *string `json:"id,omitempty"` + // VaultName - Key vault name of the object that triggered this event. + VaultName *string `json:"vaultName,omitempty"` + // ObjectType - The type of the object that triggered this event + ObjectType *string `json:"objectType,omitempty"` + // ObjectName - The name of the object that triggered this event + ObjectName *string `json:"objectName,omitempty"` + // Version - The version of the object that triggered this event + Version *string `json:"version,omitempty"` + // Nbf - Not before date of the object that triggered this event + Nbf *float64 `json:"nbf,omitempty"` + // Exp - The expiration date of the object that triggered this event + Exp *float64 `json:"exp,omitempty"` +} + +// KeyVaultSecretExpiredEventData schema of the Data property of an EventGridEvent for an SecretExpired +// event. +type KeyVaultSecretExpiredEventData struct { + // ID - The id of the object that triggered this event. + ID *string `json:"id,omitempty"` + // VaultName - Key vault name of the object that triggered this event. + VaultName *string `json:"vaultName,omitempty"` + // ObjectType - The type of the object that triggered this event + ObjectType *string `json:"objectType,omitempty"` + // ObjectName - The name of the object that triggered this event + ObjectName *string `json:"objectName,omitempty"` + // Version - The version of the object that triggered this event + Version *string `json:"version,omitempty"` + // Nbf - Not before date of the object that triggered this event + Nbf *float64 `json:"nbf,omitempty"` + // Exp - The expiration date of the object that triggered this event + Exp *float64 `json:"exp,omitempty"` +} + +// KeyVaultSecretNearExpiryEventData schema of the Data property of an EventGridEvent for an +// SecretNearExpiry event. +type KeyVaultSecretNearExpiryEventData struct { + // ID - The id of the object that triggered this event. + ID *string `json:"id,omitempty"` + // VaultName - Key vault name of the object that triggered this event. + VaultName *string `json:"vaultName,omitempty"` + // ObjectType - The type of the object that triggered this event + ObjectType *string `json:"objectType,omitempty"` + // ObjectName - The name of the object that triggered this event + ObjectName *string `json:"objectName,omitempty"` + // Version - The version of the object that triggered this event + Version *string `json:"version,omitempty"` + // Nbf - Not before date of the object that triggered this event + Nbf *float64 `json:"nbf,omitempty"` + // Exp - The expiration date of the object that triggered this event + Exp *float64 `json:"exp,omitempty"` +} + +// KeyVaultSecretNewVersionCreatedEventData schema of the Data property of an EventGridEvent for an +// SecretNewVersionCreated event. +type KeyVaultSecretNewVersionCreatedEventData struct { + // ID - The id of the object that triggered this event. + ID *string `json:"id,omitempty"` + // VaultName - Key vault name of the object that triggered this event. + VaultName *string `json:"vaultName,omitempty"` + // ObjectType - The type of the object that triggered this event + ObjectType *string `json:"objectType,omitempty"` + // ObjectName - The name of the object that triggered this event + ObjectName *string `json:"objectName,omitempty"` + // Version - The version of the object that triggered this event + Version *string `json:"version,omitempty"` + // Nbf - Not before date of the object that triggered this event + Nbf *float64 `json:"nbf,omitempty"` + // Exp - The expiration date of the object that triggered this event + Exp *float64 `json:"exp,omitempty"` +} + // MapsGeofenceEnteredEventData schema of the Data property of an EventGridEvent for a // Microsoft.Maps.GeofenceEntered event. type MapsGeofenceEnteredEventData struct { diff --git a/services/eventhub/mgmt/2017-04-01/eventhub/eventhubapi/interfaces.go b/services/eventhub/mgmt/2017-04-01/eventhub/eventhubapi/interfaces.go index b7ab6ff5d7e2..80789f252a5d 100644 --- a/services/eventhub/mgmt/2017-04-01/eventhub/eventhubapi/interfaces.go +++ b/services/eventhub/mgmt/2017-04-01/eventhub/eventhubapi/interfaces.go @@ -46,6 +46,7 @@ type NamespacesClientAPI interface { ListAuthorizationRules(ctx context.Context, resourceGroupName string, namespaceName string) (result eventhub.AuthorizationRuleListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result eventhub.EHNamespaceListResultPage, err error) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string) (result eventhub.AccessKeys, err error) + ListNetworkRuleSets(ctx context.Context, resourceGroupName string, namespaceName string) (result eventhub.NetworkRuleSetListResultPage, err error) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters eventhub.RegenerateAccessKeyParameters) (result eventhub.AccessKeys, err error) Update(ctx context.Context, resourceGroupName string, namespaceName string, parameters eventhub.EHNamespace) (result eventhub.EHNamespace, err error) } diff --git a/services/eventhub/mgmt/2017-04-01/eventhub/models.go b/services/eventhub/mgmt/2017-04-01/eventhub/models.go index 4cff4d2dc750..76ef7508385a 100644 --- a/services/eventhub/mgmt/2017-04-01/eventhub/models.go +++ b/services/eventhub/mgmt/2017-04-01/eventhub/models.go @@ -1957,6 +1957,152 @@ func (nrs *NetworkRuleSet) UnmarshalJSON(body []byte) error { return nil } +// NetworkRuleSetListResult the response of the List NetworkRuleSet operation +type NetworkRuleSetListResult struct { + autorest.Response `json:"-"` + // Value - Result of the List NetworkRuleSet operation. + Value *[]NetworkRuleSet `json:"value,omitempty"` + // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of NetworkRuleSet. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkRuleSetListResultIterator provides access to a complete listing of NetworkRuleSet values. +type NetworkRuleSetListResultIterator struct { + i int + page NetworkRuleSetListResultPage +} + +// 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 *NetworkRuleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkRuleSetListResultIterator.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 *NetworkRuleSetListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkRuleSetListResultIterator) 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 NetworkRuleSetListResultIterator) Response() NetworkRuleSetListResult { + 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 NetworkRuleSetListResultIterator) Value() NetworkRuleSet { + if !iter.page.NotDone() { + return NetworkRuleSet{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkRuleSetListResultIterator type. +func NewNetworkRuleSetListResultIterator(page NetworkRuleSetListResultPage) NetworkRuleSetListResultIterator { + return NetworkRuleSetListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nrslr NetworkRuleSetListResult) IsEmpty() bool { + return nrslr.Value == nil || len(*nrslr.Value) == 0 +} + +// networkRuleSetListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nrslr NetworkRuleSetListResult) networkRuleSetListResultPreparer(ctx context.Context) (*http.Request, error) { + if nrslr.NextLink == nil || len(to.String(nrslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nrslr.NextLink))) +} + +// NetworkRuleSetListResultPage contains a page of NetworkRuleSet values. +type NetworkRuleSetListResultPage struct { + fn func(context.Context, NetworkRuleSetListResult) (NetworkRuleSetListResult, error) + nrslr NetworkRuleSetListResult +} + +// 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 *NetworkRuleSetListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkRuleSetListResultPage.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.nrslr) + if err != nil { + return err + } + page.nrslr = 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 *NetworkRuleSetListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkRuleSetListResultPage) NotDone() bool { + return !page.nrslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkRuleSetListResultPage) Response() NetworkRuleSetListResult { + return page.nrslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkRuleSetListResultPage) Values() []NetworkRuleSet { + if page.nrslr.IsEmpty() { + return nil + } + return *page.nrslr.Value +} + +// Creates a new instance of the NetworkRuleSetListResultPage type. +func NewNetworkRuleSetListResultPage(getNextPage func(context.Context, NetworkRuleSetListResult) (NetworkRuleSetListResult, error)) NetworkRuleSetListResultPage { + return NetworkRuleSetListResultPage{fn: getNextPage} +} + // NetworkRuleSetProperties networkRuleSet properties type NetworkRuleSetProperties struct { // DefaultAction - Default Action for Network Rule Set. Possible values include: 'Allow', 'Deny' diff --git a/services/eventhub/mgmt/2017-04-01/eventhub/namespaces.go b/services/eventhub/mgmt/2017-04-01/eventhub/namespaces.go index ce27612c9187..92e4987c2429 100644 --- a/services/eventhub/mgmt/2017-04-01/eventhub/namespaces.go +++ b/services/eventhub/mgmt/2017-04-01/eventhub/namespaces.go @@ -1388,6 +1388,131 @@ func (client NamespacesClient) ListKeysResponder(resp *http.Response) (result Ac return } +// ListNetworkRuleSets gets list of NetworkRuleSet for a Namespace. +// Parameters: +// resourceGroupName - name of the resource group within the azure subscription. +// namespaceName - the Namespace name +func (client NamespacesClient) ListNetworkRuleSets(ctx context.Context, resourceGroupName string, namespaceName string) (result NetworkRuleSetListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamespacesClient.ListNetworkRuleSets") + defer func() { + sc := -1 + if result.nrslr.Response.Response != nil { + sc = result.nrslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: namespaceName, + Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { + return result, validation.NewError("eventhub.NamespacesClient", "ListNetworkRuleSets", err.Error()) + } + + result.fn = client.listNetworkRuleSetsNextResults + req, err := client.ListNetworkRuleSetsPreparer(ctx, resourceGroupName, namespaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "ListNetworkRuleSets", nil, "Failure preparing request") + return + } + + resp, err := client.ListNetworkRuleSetsSender(req) + if err != nil { + result.nrslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "ListNetworkRuleSets", resp, "Failure sending request") + return + } + + result.nrslr, err = client.ListNetworkRuleSetsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "ListNetworkRuleSets", resp, "Failure responding to request") + } + + return +} + +// ListNetworkRuleSetsPreparer prepares the ListNetworkRuleSets request. +func (client NamespacesClient) ListNetworkRuleSetsPreparer(ctx context.Context, resourceGroupName string, namespaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-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.EventHub/namespaces/{namespaceName}/networkRuleSets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListNetworkRuleSetsSender sends the ListNetworkRuleSets request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) ListNetworkRuleSetsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListNetworkRuleSetsResponder handles the response to the ListNetworkRuleSets request. The method always +// closes the http.Response Body. +func (client NamespacesClient) ListNetworkRuleSetsResponder(resp *http.Response) (result NetworkRuleSetListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNetworkRuleSetsNextResults retrieves the next set of results, if any. +func (client NamespacesClient) listNetworkRuleSetsNextResults(ctx context.Context, lastResults NetworkRuleSetListResult) (result NetworkRuleSetListResult, err error) { + req, err := lastResults.networkRuleSetListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listNetworkRuleSetsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListNetworkRuleSetsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listNetworkRuleSetsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListNetworkRuleSetsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listNetworkRuleSetsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListNetworkRuleSetsComplete enumerates all values, automatically crossing page boundaries as required. +func (client NamespacesClient) ListNetworkRuleSetsComplete(ctx context.Context, resourceGroupName string, namespaceName string) (result NetworkRuleSetListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamespacesClient.ListNetworkRuleSets") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListNetworkRuleSets(ctx, resourceGroupName, namespaceName) + return +} + // RegenerateKeys regenerates the primary or secondary connection strings for the specified Namespace. // Parameters: // resourceGroupName - name of the resource group within the azure subscription. diff --git a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/client.go b/services/frontdoor/mgmt/2019-04-01/frontdoor/client.go similarity index 100% rename from services/preview/frontdoor/mgmt/2019-04-01/frontdoor/client.go rename to services/frontdoor/mgmt/2019-04-01/frontdoor/client.go diff --git a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/endpoints.go b/services/frontdoor/mgmt/2019-04-01/frontdoor/endpoints.go similarity index 100% rename from services/preview/frontdoor/mgmt/2019-04-01/frontdoor/endpoints.go rename to services/frontdoor/mgmt/2019-04-01/frontdoor/endpoints.go diff --git a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/frontdoorapi/interfaces.go b/services/frontdoor/mgmt/2019-04-01/frontdoor/frontdoorapi/interfaces.go similarity index 53% rename from services/preview/frontdoor/mgmt/2019-04-01/frontdoor/frontdoorapi/interfaces.go rename to services/frontdoor/mgmt/2019-04-01/frontdoor/frontdoorapi/interfaces.go index b332729c4f1e..f7fa78530e1e 100644 --- a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/frontdoorapi/interfaces.go +++ b/services/frontdoor/mgmt/2019-04-01/frontdoor/frontdoorapi/interfaces.go @@ -19,7 +19,7 @@ package frontdoorapi import ( "context" - "github.com/Azure/azure-sdk-for-go/services/preview/frontdoor/mgmt/2019-04-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor" ) // BaseClientAPI contains the set of methods on the BaseClient type. @@ -42,50 +42,8 @@ type FrontDoorsClientAPI interface { var _ FrontDoorsClientAPI = (*frontdoor.FrontDoorsClient)(nil) -// RoutingRulesClientAPI contains the set of methods on the RoutingRulesClient type. -type RoutingRulesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string, routingRuleParameters frontdoor.RoutingRule) (result frontdoor.RoutingRulesCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (result frontdoor.RoutingRulesDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (result frontdoor.RoutingRule, err error) - ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.RoutingRuleListResultPage, err error) -} - -var _ RoutingRulesClientAPI = (*frontdoor.RoutingRulesClient)(nil) - -// HealthProbeSettingsClientAPI contains the set of methods on the HealthProbeSettingsClient type. -type HealthProbeSettingsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string, healthProbeSettingsParameters frontdoor.HealthProbeSettingsModel) (result frontdoor.HealthProbeSettingsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (result frontdoor.HealthProbeSettingsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (result frontdoor.HealthProbeSettingsModel, err error) - ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.HealthProbeSettingsListResultPage, err error) -} - -var _ HealthProbeSettingsClientAPI = (*frontdoor.HealthProbeSettingsClient)(nil) - -// LoadBalancingSettingsClientAPI contains the set of methods on the LoadBalancingSettingsClient type. -type LoadBalancingSettingsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string, loadBalancingSettingsParameters frontdoor.LoadBalancingSettingsModel) (result frontdoor.LoadBalancingSettingsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (result frontdoor.LoadBalancingSettingsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (result frontdoor.LoadBalancingSettingsModel, err error) - ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.LoadBalancingSettingsListResultPage, err error) -} - -var _ LoadBalancingSettingsClientAPI = (*frontdoor.LoadBalancingSettingsClient)(nil) - -// BackendPoolsClientAPI contains the set of methods on the BackendPoolsClient type. -type BackendPoolsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string, backendPoolParameters frontdoor.BackendPool) (result frontdoor.BackendPoolsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (result frontdoor.BackendPoolsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (result frontdoor.BackendPool, err error) - ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.BackendPoolListResultPage, err error) -} - -var _ BackendPoolsClientAPI = (*frontdoor.BackendPoolsClient)(nil) - // FrontendEndpointsClientAPI contains the set of methods on the FrontendEndpointsClient type. type FrontendEndpointsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, frontendEndpointParameters frontdoor.FrontendEndpoint) (result frontdoor.FrontendEndpointsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (result frontdoor.FrontendEndpointsDeleteFuture, err error) 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) diff --git a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/frontdoors.go b/services/frontdoor/mgmt/2019-04-01/frontdoor/frontdoors.go similarity index 100% rename from services/preview/frontdoor/mgmt/2019-04-01/frontdoor/frontdoors.go rename to services/frontdoor/mgmt/2019-04-01/frontdoor/frontdoors.go diff --git a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/frontendendpoints.go b/services/frontdoor/mgmt/2019-04-01/frontdoor/frontendendpoints.go similarity index 69% rename from services/preview/frontdoor/mgmt/2019-04-01/frontdoor/frontendendpoints.go rename to services/frontdoor/mgmt/2019-04-01/frontdoor/frontendendpoints.go index b0f94bb20bd3..c05303c37ea4 100644 --- a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/frontendendpoints.go +++ b/services/frontdoor/mgmt/2019-04-01/frontdoor/frontendendpoints.go @@ -41,199 +41,6 @@ func NewFrontendEndpointsClientWithBaseURI(baseURI string, subscriptionID string return FrontendEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates a new frontend endpoint with the specified host 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. -// frontendEndpointParameters - frontend endpoint properties needed to create a new endpoint. -func (client FrontendEndpointsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, frontendEndpointParameters FrontendEndpoint) (result FrontendEndpointsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.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: 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", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, frontendEndpointName, frontendEndpointParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client FrontendEndpointsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, frontendEndpointParameters FrontendEndpoint) (*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 = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - frontendEndpointParameters.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.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}", pathParameters), - autorest.WithJSON(frontendEndpointParameters), - 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 FrontendEndpointsClient) CreateOrUpdateSender(req *http.Request) (future FrontendEndpointsCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 FrontendEndpointsClient) CreateOrUpdateResponder(resp *http.Response) (result FrontendEndpoint, 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 frontend endpoint 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. -// frontendEndpointName - name of the Frontend endpoint which is unique within the Front Door. -func (client FrontendEndpointsClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (result FrontendEndpointsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.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: 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", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, frontendEndpointName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client FrontendEndpointsClient) DeletePreparer(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 = "2019-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}/frontendEndpoints/{frontendEndpointName}", 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 FrontendEndpointsClient) DeleteSender(req *http.Request) (future FrontendEndpointsDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 FrontendEndpointsClient) 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 -} - // DisableHTTPS disables a frontendEndpoint for HTTPS traffic // Parameters: // resourceGroupName - name of the Resource group within the Azure subscription. diff --git a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/managedrulesets.go b/services/frontdoor/mgmt/2019-04-01/frontdoor/managedrulesets.go similarity index 100% rename from services/preview/frontdoor/mgmt/2019-04-01/frontdoor/managedrulesets.go rename to services/frontdoor/mgmt/2019-04-01/frontdoor/managedrulesets.go diff --git a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/models.go b/services/frontdoor/mgmt/2019-04-01/frontdoor/models.go similarity index 78% rename from services/preview/frontdoor/mgmt/2019-04-01/frontdoor/models.go rename to services/frontdoor/mgmt/2019-04-01/frontdoor/models.go index 04af43060476..75a2835240ef 100644 --- a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/models.go +++ b/services/frontdoor/mgmt/2019-04-01/frontdoor/models.go @@ -28,7 +28,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/frontdoor/mgmt/2019-04-01/frontdoor" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor" // ActionType enumerates the values for action type. type ActionType string @@ -620,7 +620,6 @@ type Backend struct { // BackendPool a backend pool is a collection of backends that can be routed to. type BackendPool struct { - autorest.Response `json:"-"` // BackendPoolProperties - Properties of the Front Door Backend Pool *BackendPoolProperties `json:"properties,omitempty"` // Name - Resource name. @@ -700,150 +699,12 @@ func (bp *BackendPool) UnmarshalJSON(body []byte) error { // 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 { - autorest.Response `json:"-"` // 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"` } -// BackendPoolListResultIterator provides access to a complete listing of BackendPool values. -type BackendPoolListResultIterator struct { - i int - page BackendPoolListResultPage -} - -// 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 *BackendPoolListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolListResultIterator.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 *BackendPoolListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BackendPoolListResultIterator) 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 BackendPoolListResultIterator) Response() BackendPoolListResult { - 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 BackendPoolListResultIterator) Value() BackendPool { - if !iter.page.NotDone() { - return BackendPool{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BackendPoolListResultIterator type. -func NewBackendPoolListResultIterator(page BackendPoolListResultPage) BackendPoolListResultIterator { - return BackendPoolListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (bplr BackendPoolListResult) IsEmpty() bool { - return bplr.Value == nil || len(*bplr.Value) == 0 -} - -// backendPoolListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (bplr BackendPoolListResult) backendPoolListResultPreparer(ctx context.Context) (*http.Request, error) { - if bplr.NextLink == nil || len(to.String(bplr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(bplr.NextLink))) -} - -// BackendPoolListResultPage contains a page of BackendPool values. -type BackendPoolListResultPage struct { - fn func(context.Context, BackendPoolListResult) (BackendPoolListResult, error) - bplr BackendPoolListResult -} - -// 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 *BackendPoolListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolListResultPage.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.bplr) - if err != nil { - return err - } - page.bplr = 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 *BackendPoolListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BackendPoolListResultPage) NotDone() bool { - return !page.bplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BackendPoolListResultPage) Response() BackendPoolListResult { - return page.bplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BackendPoolListResultPage) Values() []BackendPool { - if page.bplr.IsEmpty() { - return nil - } - return *page.bplr.Value -} - -// Creates a new instance of the BackendPoolListResultPage type. -func NewBackendPoolListResultPage(getNextPage func(context.Context, BackendPoolListResult) (BackendPoolListResult, error)) BackendPoolListResultPage { - return BackendPoolListResultPage{fn: getNextPage} -} - // BackendPoolProperties the JSON object that contains the properties required to create a routing rule. type BackendPoolProperties struct { // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' @@ -856,58 +717,6 @@ type BackendPoolProperties struct { HealthProbeSettings *SubResource `json:"healthProbeSettings,omitempty"` } -// BackendPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type BackendPoolsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *BackendPoolsCreateOrUpdateFuture) Result(client BackendPoolsClient) (bp BackendPool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.BackendPoolsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bp.Response.Response, err = future.GetResult(sender); err == nil && bp.Response.Response.StatusCode != http.StatusNoContent { - bp, err = client.CreateOrUpdateResponder(bp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsCreateOrUpdateFuture", "Result", bp.Response.Response, "Failure responding to request") - } - } - return -} - -// BackendPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type BackendPoolsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *BackendPoolsDeleteFuture) Result(client BackendPoolsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.BackendPoolsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // 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' @@ -1429,58 +1238,6 @@ type FrontendEndpointProperties struct { WebApplicationFirewallPolicyLink *FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` } -// FrontendEndpointsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type FrontendEndpointsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FrontendEndpointsCreateOrUpdateFuture) Result(client FrontendEndpointsClient) (fe FrontendEndpoint, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.FrontendEndpointsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fe.Response.Response, err = future.GetResult(sender); err == nil && fe.Response.Response.StatusCode != http.StatusNoContent { - fe, err = client.CreateOrUpdateResponder(fe.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsCreateOrUpdateFuture", "Result", fe.Response.Response, "Failure responding to request") - } - } - return -} - -// FrontendEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FrontendEndpointsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FrontendEndpointsDeleteFuture) 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.FrontendEndpointsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.FrontendEndpointsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // FrontendEndpointsDisableHTTPSFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type FrontendEndpointsDisableHTTPSFuture struct { @@ -1693,227 +1450,35 @@ type FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink struct { ID *string `json:"id,omitempty"` } -// HealthProbeSettingsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type HealthProbeSettingsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *HealthProbeSettingsCreateOrUpdateFuture) Result(client HealthProbeSettingsClient) (hpsm HealthProbeSettingsModel, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.HealthProbeSettingsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if hpsm.Response.Response, err = future.GetResult(sender); err == nil && hpsm.Response.Response.StatusCode != http.StatusNoContent { - hpsm, err = client.CreateOrUpdateResponder(hpsm.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsCreateOrUpdateFuture", "Result", hpsm.Response.Response, "Failure responding to request") - } - } - return -} - -// HealthProbeSettingsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type HealthProbeSettingsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *HealthProbeSettingsDeleteFuture) Result(client HealthProbeSettingsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.HealthProbeSettingsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // 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 { - autorest.Response `json:"-"` // 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"` } -// HealthProbeSettingsListResultIterator provides access to a complete listing of HealthProbeSettingsModel -// values. -type HealthProbeSettingsListResultIterator struct { - i int - page HealthProbeSettingsListResultPage +// 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"` } -// 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 *HealthProbeSettingsListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsListResultIterator.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 +// 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 } - 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 *HealthProbeSettingsListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter HealthProbeSettingsListResultIterator) 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 HealthProbeSettingsListResultIterator) Response() HealthProbeSettingsListResult { - 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 HealthProbeSettingsListResultIterator) Value() HealthProbeSettingsModel { - if !iter.page.NotDone() { - return HealthProbeSettingsModel{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the HealthProbeSettingsListResultIterator type. -func NewHealthProbeSettingsListResultIterator(page HealthProbeSettingsListResultPage) HealthProbeSettingsListResultIterator { - return HealthProbeSettingsListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (hpslr HealthProbeSettingsListResult) IsEmpty() bool { - return hpslr.Value == nil || len(*hpslr.Value) == 0 -} - -// healthProbeSettingsListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (hpslr HealthProbeSettingsListResult) healthProbeSettingsListResultPreparer(ctx context.Context) (*http.Request, error) { - if hpslr.NextLink == nil || len(to.String(hpslr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(hpslr.NextLink))) -} - -// HealthProbeSettingsListResultPage contains a page of HealthProbeSettingsModel values. -type HealthProbeSettingsListResultPage struct { - fn func(context.Context, HealthProbeSettingsListResult) (HealthProbeSettingsListResult, error) - hpslr HealthProbeSettingsListResult -} - -// 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 *HealthProbeSettingsListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsListResultPage.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.hpslr) - if err != nil { - return err - } - page.hpslr = 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 *HealthProbeSettingsListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page HealthProbeSettingsListResultPage) NotDone() bool { - return !page.hpslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page HealthProbeSettingsListResultPage) Response() HealthProbeSettingsListResult { - return page.hpslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page HealthProbeSettingsListResultPage) Values() []HealthProbeSettingsModel { - if page.hpslr.IsEmpty() { - return nil - } - return *page.hpslr.Value -} - -// Creates a new instance of the HealthProbeSettingsListResultPage type. -func NewHealthProbeSettingsListResultPage(getNextPage func(context.Context, HealthProbeSettingsListResult) (HealthProbeSettingsListResult, error)) HealthProbeSettingsListResultPage { - return HealthProbeSettingsListResultPage{fn: getNextPage} -} - -// HealthProbeSettingsModel load balancing settings for a backend pool -type HealthProbeSettingsModel struct { - autorest.Response `json:"-"` - // 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.Name != nil { + objectMap["name"] = hpsm.Name } if hpsm.ID != nil { objectMap["id"] = hpsm.ID @@ -1962,276 +1527,76 @@ func (hpsm *HealthProbeSettingsModel) UnmarshalJSON(body []byte) error { 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"` -} - -// 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"` -} - -// 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"` -} - -// 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} -} - -// LoadBalancingSettingsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LoadBalancingSettingsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LoadBalancingSettingsCreateOrUpdateFuture) Result(client LoadBalancingSettingsClient) (lbsm LoadBalancingSettingsModel, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.LoadBalancingSettingsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if lbsm.Response.Response, err = future.GetResult(sender); err == nil && lbsm.Response.Response.StatusCode != http.StatusNoContent { - lbsm, err = client.CreateOrUpdateResponder(lbsm.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsCreateOrUpdateFuture", "Result", lbsm.Response.Response, "Failure responding to request") + return err + } + hpsm.ID = &ID + } } } - return + + return nil } -// LoadBalancingSettingsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LoadBalancingSettingsDeleteFuture struct { - azure.Future +// 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"` } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LoadBalancingSettingsDeleteFuture) Result(client LoadBalancingSettingsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.LoadBalancingSettingsDeleteFuture") - return - } - ar.Response = future.Response() - return +// 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"` } -// 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 { +// 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"` +} + +// 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 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. + // 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"` } -// LoadBalancingSettingsListResultIterator provides access to a complete listing of -// LoadBalancingSettingsModel values. -type LoadBalancingSettingsListResultIterator struct { +// ListResultIterator provides access to a complete listing of FrontDoor values. +type ListResultIterator struct { i int - page LoadBalancingSettingsListResultPage + 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 *LoadBalancingSettingsListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -2256,62 +1621,62 @@ func (iter *LoadBalancingSettingsListResultIterator) NextWithContext(ctx context // 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 *LoadBalancingSettingsListResultIterator) Next() error { +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 LoadBalancingSettingsListResultIterator) NotDone() bool { +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 LoadBalancingSettingsListResultIterator) Response() LoadBalancingSettingsListResult { +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 LoadBalancingSettingsListResultIterator) Value() LoadBalancingSettingsModel { +func (iter ListResultIterator) Value() FrontDoor { if !iter.page.NotDone() { - return LoadBalancingSettingsModel{} + return FrontDoor{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the LoadBalancingSettingsListResultIterator type. -func NewLoadBalancingSettingsListResultIterator(page LoadBalancingSettingsListResultPage) LoadBalancingSettingsListResultIterator { - return LoadBalancingSettingsListResultIterator{page: page} +// 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 (lbslr LoadBalancingSettingsListResult) IsEmpty() bool { - return lbslr.Value == nil || len(*lbslr.Value) == 0 +func (lr ListResult) IsEmpty() bool { + return lr.Value == nil || len(*lr.Value) == 0 } -// loadBalancingSettingsListResultPreparer prepares a request to retrieve the next set of results. +// listResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (lbslr LoadBalancingSettingsListResult) loadBalancingSettingsListResultPreparer(ctx context.Context) (*http.Request, error) { - if lbslr.NextLink == nil || len(to.String(lbslr.NextLink)) < 1 { +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(lbslr.NextLink))) + autorest.WithBaseURL(to.String(lr.NextLink))) } -// LoadBalancingSettingsListResultPage contains a page of LoadBalancingSettingsModel values. -type LoadBalancingSettingsListResultPage struct { - fn func(context.Context, LoadBalancingSettingsListResult) (LoadBalancingSettingsListResult, error) - lbslr LoadBalancingSettingsListResult +// 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 *LoadBalancingSettingsListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -2320,47 +1685,55 @@ func (page *LoadBalancingSettingsListResultPage) NextWithContext(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lbslr) + next, err := page.fn(ctx, page.lr) if err != nil { return err } - page.lbslr = next + 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 *LoadBalancingSettingsListResultPage) Next() error { +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 LoadBalancingSettingsListResultPage) NotDone() bool { - return !page.lbslr.IsEmpty() +func (page ListResultPage) NotDone() bool { + return !page.lr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page LoadBalancingSettingsListResultPage) Response() LoadBalancingSettingsListResult { - return page.lbslr +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 LoadBalancingSettingsListResultPage) Values() []LoadBalancingSettingsModel { - if page.lbslr.IsEmpty() { +func (page ListResultPage) Values() []FrontDoor { + if page.lr.IsEmpty() { return nil } - return *page.lbslr.Value + 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} } -// Creates a new instance of the LoadBalancingSettingsListResultPage type. -func NewLoadBalancingSettingsListResultPage(getNextPage func(context.Context, LoadBalancingSettingsListResult) (LoadBalancingSettingsListResult, error)) LoadBalancingSettingsListResultPage { - return LoadBalancingSettingsListResultPage{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 { - autorest.Response `json:"-"` // LoadBalancingSettingsProperties - Properties of the load balancing settings *LoadBalancingSettingsProperties `json:"properties,omitempty"` // Name - Resource name. @@ -2464,6 +1837,10 @@ type LoadBalancingSettingsUpdateParameters struct { 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"` } @@ -3064,7 +2441,6 @@ func (rc RouteConfiguration) AsBasicRouteConfiguration() (BasicRouteConfiguratio // RoutingRule a routing rule represents a specification for traffic to treat and where to send it, along // with health probe information. type RoutingRule struct { - autorest.Response `json:"-"` // RoutingRuleProperties - Properties of the Front Door Routing Rule *RoutingRuleProperties `json:"properties,omitempty"` // Name - Resource name. @@ -3144,150 +2520,12 @@ func (rr *RoutingRule) UnmarshalJSON(body []byte) error { // 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 { - autorest.Response `json:"-"` // 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"` } -// RoutingRuleListResultIterator provides access to a complete listing of RoutingRule values. -type RoutingRuleListResultIterator struct { - i int - page RoutingRuleListResultPage -} - -// 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 *RoutingRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRuleListResultIterator.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 *RoutingRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RoutingRuleListResultIterator) 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 RoutingRuleListResultIterator) Response() RoutingRuleListResult { - 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 RoutingRuleListResultIterator) Value() RoutingRule { - if !iter.page.NotDone() { - return RoutingRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RoutingRuleListResultIterator type. -func NewRoutingRuleListResultIterator(page RoutingRuleListResultPage) RoutingRuleListResultIterator { - return RoutingRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rrlr RoutingRuleListResult) IsEmpty() bool { - return rrlr.Value == nil || len(*rrlr.Value) == 0 -} - -// routingRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rrlr RoutingRuleListResult) routingRuleListResultPreparer(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))) -} - -// RoutingRuleListResultPage contains a page of RoutingRule values. -type RoutingRuleListResultPage struct { - fn func(context.Context, RoutingRuleListResult) (RoutingRuleListResult, error) - rrlr RoutingRuleListResult -} - -// 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 *RoutingRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRuleListResultPage.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 *RoutingRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RoutingRuleListResultPage) NotDone() bool { - return !page.rrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RoutingRuleListResultPage) Response() RoutingRuleListResult { - return page.rrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RoutingRuleListResultPage) Values() []RoutingRule { - if page.rrlr.IsEmpty() { - return nil - } - return *page.rrlr.Value -} - -// Creates a new instance of the RoutingRuleListResultPage type. -func NewRoutingRuleListResultPage(getNextPage func(context.Context, RoutingRuleListResult) (RoutingRuleListResult, error)) RoutingRuleListResultPage { - return RoutingRuleListResultPage{fn: getNextPage} -} - // 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' @@ -3372,58 +2610,6 @@ func (rrp *RoutingRuleProperties) UnmarshalJSON(body []byte) error { return nil } -// RoutingRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type RoutingRulesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RoutingRulesCreateOrUpdateFuture) Result(client RoutingRulesClient) (rr RoutingRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.RoutingRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rr.Response.Response, err = future.GetResult(sender); err == nil && rr.Response.Response.StatusCode != http.StatusNoContent { - rr, err = client.CreateOrUpdateResponder(rr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesCreateOrUpdateFuture", "Result", rr.Response.Response, "Failure responding to request") - } - } - return -} - -// RoutingRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RoutingRulesDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RoutingRulesDeleteFuture) Result(client RoutingRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.RoutingRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // RoutingRuleUpdateParameters routing rules to apply to an endpoint type RoutingRuleUpdateParameters struct { // FrontendEndpoints - Frontend endpoints associated with this rule diff --git a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/policies.go b/services/frontdoor/mgmt/2019-04-01/frontdoor/policies.go similarity index 100% rename from services/preview/frontdoor/mgmt/2019-04-01/frontdoor/policies.go rename to services/frontdoor/mgmt/2019-04-01/frontdoor/policies.go diff --git a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/version.go b/services/frontdoor/mgmt/2019-04-01/frontdoor/version.go similarity index 100% rename from services/preview/frontdoor/mgmt/2019-04-01/frontdoor/version.go rename to services/frontdoor/mgmt/2019-04-01/frontdoor/version.go diff --git a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/client.go b/services/frontdoor/mgmt/2019-05-01/frontdoor/client.go similarity index 100% rename from services/preview/frontdoor/mgmt/2019-05-01/frontdoor/client.go rename to services/frontdoor/mgmt/2019-05-01/frontdoor/client.go diff --git a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/endpoints.go b/services/frontdoor/mgmt/2019-05-01/frontdoor/endpoints.go similarity index 100% rename from services/preview/frontdoor/mgmt/2019-05-01/frontdoor/endpoints.go rename to services/frontdoor/mgmt/2019-05-01/frontdoor/endpoints.go diff --git a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/frontdoorapi/interfaces.go b/services/frontdoor/mgmt/2019-05-01/frontdoor/frontdoorapi/interfaces.go similarity index 53% rename from services/preview/frontdoor/mgmt/2019-05-01/frontdoor/frontdoorapi/interfaces.go rename to services/frontdoor/mgmt/2019-05-01/frontdoor/frontdoorapi/interfaces.go index abed0a7f8810..2fa8bb51b743 100644 --- a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/frontdoorapi/interfaces.go +++ b/services/frontdoor/mgmt/2019-05-01/frontdoor/frontdoorapi/interfaces.go @@ -19,7 +19,7 @@ package frontdoorapi import ( "context" - "github.com/Azure/azure-sdk-for-go/services/preview/frontdoor/mgmt/2019-05-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-05-01/frontdoor" ) // BaseClientAPI contains the set of methods on the BaseClient type. @@ -42,50 +42,8 @@ type FrontDoorsClientAPI interface { var _ FrontDoorsClientAPI = (*frontdoor.FrontDoorsClient)(nil) -// RoutingRulesClientAPI contains the set of methods on the RoutingRulesClient type. -type RoutingRulesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string, routingRuleParameters frontdoor.RoutingRule) (result frontdoor.RoutingRulesCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (result frontdoor.RoutingRulesDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (result frontdoor.RoutingRule, err error) - ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.RoutingRuleListResultPage, err error) -} - -var _ RoutingRulesClientAPI = (*frontdoor.RoutingRulesClient)(nil) - -// HealthProbeSettingsClientAPI contains the set of methods on the HealthProbeSettingsClient type. -type HealthProbeSettingsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string, healthProbeSettingsParameters frontdoor.HealthProbeSettingsModel) (result frontdoor.HealthProbeSettingsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (result frontdoor.HealthProbeSettingsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (result frontdoor.HealthProbeSettingsModel, err error) - ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.HealthProbeSettingsListResultPage, err error) -} - -var _ HealthProbeSettingsClientAPI = (*frontdoor.HealthProbeSettingsClient)(nil) - -// LoadBalancingSettingsClientAPI contains the set of methods on the LoadBalancingSettingsClient type. -type LoadBalancingSettingsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string, loadBalancingSettingsParameters frontdoor.LoadBalancingSettingsModel) (result frontdoor.LoadBalancingSettingsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (result frontdoor.LoadBalancingSettingsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (result frontdoor.LoadBalancingSettingsModel, err error) - ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.LoadBalancingSettingsListResultPage, err error) -} - -var _ LoadBalancingSettingsClientAPI = (*frontdoor.LoadBalancingSettingsClient)(nil) - -// BackendPoolsClientAPI contains the set of methods on the BackendPoolsClient type. -type BackendPoolsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string, backendPoolParameters frontdoor.BackendPool) (result frontdoor.BackendPoolsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (result frontdoor.BackendPoolsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (result frontdoor.BackendPool, err error) - ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.BackendPoolListResultPage, err error) -} - -var _ BackendPoolsClientAPI = (*frontdoor.BackendPoolsClient)(nil) - // FrontendEndpointsClientAPI contains the set of methods on the FrontendEndpointsClient type. type FrontendEndpointsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, frontendEndpointParameters frontdoor.FrontendEndpoint) (result frontdoor.FrontendEndpointsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (result frontdoor.FrontendEndpointsDeleteFuture, err error) 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) diff --git a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/frontdoors.go b/services/frontdoor/mgmt/2019-05-01/frontdoor/frontdoors.go similarity index 100% rename from services/preview/frontdoor/mgmt/2019-05-01/frontdoor/frontdoors.go rename to services/frontdoor/mgmt/2019-05-01/frontdoor/frontdoors.go diff --git a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/frontendendpoints.go b/services/frontdoor/mgmt/2019-05-01/frontdoor/frontendendpoints.go similarity index 68% rename from services/preview/frontdoor/mgmt/2019-05-01/frontdoor/frontendendpoints.go rename to services/frontdoor/mgmt/2019-05-01/frontdoor/frontendendpoints.go index 6dbff638e20a..9fa5f132ff37 100644 --- a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/frontendendpoints.go +++ b/services/frontdoor/mgmt/2019-05-01/frontdoor/frontendendpoints.go @@ -41,204 +41,6 @@ func NewFrontendEndpointsClientWithBaseURI(baseURI string, subscriptionID string return FrontendEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates a new frontend endpoint with the specified host 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. -// frontendEndpointParameters - frontend endpoint properties needed to create a new endpoint. -func (client FrontendEndpointsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, frontendEndpointParameters FrontendEndpoint) (result FrontendEndpointsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.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: 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: frontendEndpointParameters, - Constraints: []validation.Constraint{{Target: "frontendEndpointParameters.FrontendEndpointProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "frontendEndpointParameters.FrontendEndpointProperties.CustomHTTPSConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "frontendEndpointParameters.FrontendEndpointProperties.CustomHTTPSConfiguration.ProtocolType", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("frontdoor.FrontendEndpointsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, frontendEndpointName, frontendEndpointParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client FrontendEndpointsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, frontendEndpointParameters FrontendEndpoint) (*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 = "2019-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - frontendEndpointParameters.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.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}", pathParameters), - autorest.WithJSON(frontendEndpointParameters), - 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 FrontendEndpointsClient) CreateOrUpdateSender(req *http.Request) (future FrontendEndpointsCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 FrontendEndpointsClient) CreateOrUpdateResponder(resp *http.Response) (result FrontendEndpoint, 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 frontend endpoint 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. -// frontendEndpointName - name of the Frontend endpoint which is unique within the Front Door. -func (client FrontendEndpointsClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (result FrontendEndpointsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.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: 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", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, frontendEndpointName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client FrontendEndpointsClient) DeletePreparer(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 = "2019-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}/frontendEndpoints/{frontendEndpointName}", 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 FrontendEndpointsClient) DeleteSender(req *http.Request) (future FrontendEndpointsDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 FrontendEndpointsClient) 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 -} - // DisableHTTPS disables a frontendEndpoint for HTTPS traffic // Parameters: // resourceGroupName - name of the Resource group within the Azure subscription. diff --git a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/managedrulesets.go b/services/frontdoor/mgmt/2019-05-01/frontdoor/managedrulesets.go similarity index 100% rename from services/preview/frontdoor/mgmt/2019-05-01/frontdoor/managedrulesets.go rename to services/frontdoor/mgmt/2019-05-01/frontdoor/managedrulesets.go diff --git a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/models.go b/services/frontdoor/mgmt/2019-05-01/frontdoor/models.go similarity index 79% rename from services/preview/frontdoor/mgmt/2019-05-01/frontdoor/models.go rename to services/frontdoor/mgmt/2019-05-01/frontdoor/models.go index ab92d8309169..1ebc7c3e44d0 100644 --- a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/models.go +++ b/services/frontdoor/mgmt/2019-05-01/frontdoor/models.go @@ -28,7 +28,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/frontdoor/mgmt/2019-05-01/frontdoor" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-05-01/frontdoor" // ActionType enumerates the values for action type. type ActionType string @@ -652,7 +652,6 @@ type Backend struct { // BackendPool a backend pool is a collection of backends that can be routed to. type BackendPool struct { - autorest.Response `json:"-"` // BackendPoolProperties - Properties of the Front Door Backend Pool *BackendPoolProperties `json:"properties,omitempty"` // Name - Resource name. @@ -732,150 +731,12 @@ func (bp *BackendPool) UnmarshalJSON(body []byte) error { // 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 { - autorest.Response `json:"-"` // 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"` } -// BackendPoolListResultIterator provides access to a complete listing of BackendPool values. -type BackendPoolListResultIterator struct { - i int - page BackendPoolListResultPage -} - -// 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 *BackendPoolListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolListResultIterator.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 *BackendPoolListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BackendPoolListResultIterator) 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 BackendPoolListResultIterator) Response() BackendPoolListResult { - 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 BackendPoolListResultIterator) Value() BackendPool { - if !iter.page.NotDone() { - return BackendPool{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BackendPoolListResultIterator type. -func NewBackendPoolListResultIterator(page BackendPoolListResultPage) BackendPoolListResultIterator { - return BackendPoolListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (bplr BackendPoolListResult) IsEmpty() bool { - return bplr.Value == nil || len(*bplr.Value) == 0 -} - -// backendPoolListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (bplr BackendPoolListResult) backendPoolListResultPreparer(ctx context.Context) (*http.Request, error) { - if bplr.NextLink == nil || len(to.String(bplr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(bplr.NextLink))) -} - -// BackendPoolListResultPage contains a page of BackendPool values. -type BackendPoolListResultPage struct { - fn func(context.Context, BackendPoolListResult) (BackendPoolListResult, error) - bplr BackendPoolListResult -} - -// 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 *BackendPoolListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolListResultPage.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.bplr) - if err != nil { - return err - } - page.bplr = 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 *BackendPoolListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BackendPoolListResultPage) NotDone() bool { - return !page.bplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BackendPoolListResultPage) Response() BackendPoolListResult { - return page.bplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BackendPoolListResultPage) Values() []BackendPool { - if page.bplr.IsEmpty() { - return nil - } - return *page.bplr.Value -} - -// Creates a new instance of the BackendPoolListResultPage type. -func NewBackendPoolListResultPage(getNextPage func(context.Context, BackendPoolListResult) (BackendPoolListResult, error)) BackendPoolListResultPage { - return BackendPoolListResultPage{fn: getNextPage} -} - // BackendPoolProperties the JSON object that contains the properties required to create a routing rule. type BackendPoolProperties struct { // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' @@ -888,58 +749,6 @@ type BackendPoolProperties struct { HealthProbeSettings *SubResource `json:"healthProbeSettings,omitempty"` } -// BackendPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type BackendPoolsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *BackendPoolsCreateOrUpdateFuture) Result(client BackendPoolsClient) (bp BackendPool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.BackendPoolsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bp.Response.Response, err = future.GetResult(sender); err == nil && bp.Response.Response.StatusCode != http.StatusNoContent { - bp, err = client.CreateOrUpdateResponder(bp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsCreateOrUpdateFuture", "Result", bp.Response.Response, "Failure responding to request") - } - } - return -} - -// BackendPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type BackendPoolsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *BackendPoolsDeleteFuture) Result(client BackendPoolsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.BackendPoolsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // 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' @@ -1477,58 +1286,6 @@ type FrontendEndpointProperties struct { WebApplicationFirewallPolicyLink *FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` } -// FrontendEndpointsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type FrontendEndpointsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FrontendEndpointsCreateOrUpdateFuture) Result(client FrontendEndpointsClient) (fe FrontendEndpoint, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.FrontendEndpointsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fe.Response.Response, err = future.GetResult(sender); err == nil && fe.Response.Response.StatusCode != http.StatusNoContent { - fe, err = client.CreateOrUpdateResponder(fe.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsCreateOrUpdateFuture", "Result", fe.Response.Response, "Failure responding to request") - } - } - return -} - -// FrontendEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FrontendEndpointsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FrontendEndpointsDeleteFuture) 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.FrontendEndpointsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.FrontendEndpointsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // FrontendEndpointsDisableHTTPSFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type FrontendEndpointsDisableHTTPSFuture struct { @@ -1741,209 +1498,17 @@ type FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink struct { ID *string `json:"id,omitempty"` } -// HealthProbeSettingsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type HealthProbeSettingsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *HealthProbeSettingsCreateOrUpdateFuture) Result(client HealthProbeSettingsClient) (hpsm HealthProbeSettingsModel, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.HealthProbeSettingsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if hpsm.Response.Response, err = future.GetResult(sender); err == nil && hpsm.Response.Response.StatusCode != http.StatusNoContent { - hpsm, err = client.CreateOrUpdateResponder(hpsm.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsCreateOrUpdateFuture", "Result", hpsm.Response.Response, "Failure responding to request") - } - } - return -} - -// HealthProbeSettingsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type HealthProbeSettingsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *HealthProbeSettingsDeleteFuture) Result(client HealthProbeSettingsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.HealthProbeSettingsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // 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 { - autorest.Response `json:"-"` // 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"` } -// HealthProbeSettingsListResultIterator provides access to a complete listing of HealthProbeSettingsModel -// values. -type HealthProbeSettingsListResultIterator struct { - i int - page HealthProbeSettingsListResultPage -} - -// 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 *HealthProbeSettingsListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsListResultIterator.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 *HealthProbeSettingsListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter HealthProbeSettingsListResultIterator) 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 HealthProbeSettingsListResultIterator) Response() HealthProbeSettingsListResult { - 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 HealthProbeSettingsListResultIterator) Value() HealthProbeSettingsModel { - if !iter.page.NotDone() { - return HealthProbeSettingsModel{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the HealthProbeSettingsListResultIterator type. -func NewHealthProbeSettingsListResultIterator(page HealthProbeSettingsListResultPage) HealthProbeSettingsListResultIterator { - return HealthProbeSettingsListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (hpslr HealthProbeSettingsListResult) IsEmpty() bool { - return hpslr.Value == nil || len(*hpslr.Value) == 0 -} - -// healthProbeSettingsListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (hpslr HealthProbeSettingsListResult) healthProbeSettingsListResultPreparer(ctx context.Context) (*http.Request, error) { - if hpslr.NextLink == nil || len(to.String(hpslr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(hpslr.NextLink))) -} - -// HealthProbeSettingsListResultPage contains a page of HealthProbeSettingsModel values. -type HealthProbeSettingsListResultPage struct { - fn func(context.Context, HealthProbeSettingsListResult) (HealthProbeSettingsListResult, error) - hpslr HealthProbeSettingsListResult -} - -// 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 *HealthProbeSettingsListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsListResultPage.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.hpslr) - if err != nil { - return err - } - page.hpslr = 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 *HealthProbeSettingsListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page HealthProbeSettingsListResultPage) NotDone() bool { - return !page.hpslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page HealthProbeSettingsListResultPage) Response() HealthProbeSettingsListResult { - return page.hpslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page HealthProbeSettingsListResultPage) Values() []HealthProbeSettingsModel { - if page.hpslr.IsEmpty() { - return nil - } - return *page.hpslr.Value -} - -// Creates a new instance of the HealthProbeSettingsListResultPage type. -func NewHealthProbeSettingsListResultPage(getNextPage func(context.Context, HealthProbeSettingsListResult) (HealthProbeSettingsListResult, error)) HealthProbeSettingsListResultPage { - return HealthProbeSettingsListResultPage{fn: getNextPage} -} - // HealthProbeSettingsModel load balancing settings for a backend pool type HealthProbeSettingsModel struct { - autorest.Response `json:"-"` // HealthProbeSettingsProperties - Properties of the health probe settings *HealthProbeSettingsProperties `json:"properties,omitempty"` // Name - Resource name. @@ -2032,262 +1597,62 @@ type HealthProbeSettingsProperties struct { // 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"` -} - -// 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} -} - -// LoadBalancingSettingsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LoadBalancingSettingsCreateOrUpdateFuture struct { - azure.Future + 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"` } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LoadBalancingSettingsCreateOrUpdateFuture) Result(client LoadBalancingSettingsClient) (lbsm LoadBalancingSettingsModel, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.LoadBalancingSettingsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if lbsm.Response.Response, err = future.GetResult(sender); err == nil && lbsm.Response.Response.StatusCode != http.StatusNoContent { - lbsm, err = client.CreateOrUpdateResponder(lbsm.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsCreateOrUpdateFuture", "Result", lbsm.Response.Response, "Failure responding to request") - } - } - return +// 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"` } -// LoadBalancingSettingsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LoadBalancingSettingsDeleteFuture struct { - azure.Future +// 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"` } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LoadBalancingSettingsDeleteFuture) Result(client LoadBalancingSettingsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.LoadBalancingSettingsDeleteFuture") - return - } - ar.Response = future.Response() - return +// KeyVaultCertificateSourceParametersVault the Key Vault containing the SSL certificate +type KeyVaultCertificateSourceParametersVault struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` } -// 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 { +// 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 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. + // 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"` } -// LoadBalancingSettingsListResultIterator provides access to a complete listing of -// LoadBalancingSettingsModel values. -type LoadBalancingSettingsListResultIterator struct { +// ListResultIterator provides access to a complete listing of FrontDoor values. +type ListResultIterator struct { i int - page LoadBalancingSettingsListResultPage + 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 *LoadBalancingSettingsListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -2312,62 +1677,62 @@ func (iter *LoadBalancingSettingsListResultIterator) NextWithContext(ctx context // 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 *LoadBalancingSettingsListResultIterator) Next() error { +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 LoadBalancingSettingsListResultIterator) NotDone() bool { +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 LoadBalancingSettingsListResultIterator) Response() LoadBalancingSettingsListResult { +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 LoadBalancingSettingsListResultIterator) Value() LoadBalancingSettingsModel { +func (iter ListResultIterator) Value() FrontDoor { if !iter.page.NotDone() { - return LoadBalancingSettingsModel{} + return FrontDoor{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the LoadBalancingSettingsListResultIterator type. -func NewLoadBalancingSettingsListResultIterator(page LoadBalancingSettingsListResultPage) LoadBalancingSettingsListResultIterator { - return LoadBalancingSettingsListResultIterator{page: page} +// 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 (lbslr LoadBalancingSettingsListResult) IsEmpty() bool { - return lbslr.Value == nil || len(*lbslr.Value) == 0 +func (lr ListResult) IsEmpty() bool { + return lr.Value == nil || len(*lr.Value) == 0 } -// loadBalancingSettingsListResultPreparer prepares a request to retrieve the next set of results. +// listResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (lbslr LoadBalancingSettingsListResult) loadBalancingSettingsListResultPreparer(ctx context.Context) (*http.Request, error) { - if lbslr.NextLink == nil || len(to.String(lbslr.NextLink)) < 1 { +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(lbslr.NextLink))) + autorest.WithBaseURL(to.String(lr.NextLink))) } -// LoadBalancingSettingsListResultPage contains a page of LoadBalancingSettingsModel values. -type LoadBalancingSettingsListResultPage struct { - fn func(context.Context, LoadBalancingSettingsListResult) (LoadBalancingSettingsListResult, error) - lbslr LoadBalancingSettingsListResult +// 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 *LoadBalancingSettingsListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -2376,47 +1741,55 @@ func (page *LoadBalancingSettingsListResultPage) NextWithContext(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lbslr) + next, err := page.fn(ctx, page.lr) if err != nil { return err } - page.lbslr = next + 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 *LoadBalancingSettingsListResultPage) Next() error { +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 LoadBalancingSettingsListResultPage) NotDone() bool { - return !page.lbslr.IsEmpty() +func (page ListResultPage) NotDone() bool { + return !page.lr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page LoadBalancingSettingsListResultPage) Response() LoadBalancingSettingsListResult { - return page.lbslr +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 LoadBalancingSettingsListResultPage) Values() []LoadBalancingSettingsModel { - if page.lbslr.IsEmpty() { +func (page ListResultPage) Values() []FrontDoor { + if page.lr.IsEmpty() { return nil } - return *page.lbslr.Value + 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} } -// Creates a new instance of the LoadBalancingSettingsListResultPage type. -func NewLoadBalancingSettingsListResultPage(getNextPage func(context.Context, LoadBalancingSettingsListResult) (LoadBalancingSettingsListResult, error)) LoadBalancingSettingsListResultPage { - return LoadBalancingSettingsListResultPage{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 { - autorest.Response `json:"-"` // LoadBalancingSettingsProperties - Properties of the load balancing settings *LoadBalancingSettingsProperties `json:"properties,omitempty"` // Name - Resource name. @@ -2520,6 +1893,10 @@ type LoadBalancingSettingsUpdateParameters struct { 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"` } @@ -3120,7 +2497,6 @@ func (rc RouteConfiguration) AsBasicRouteConfiguration() (BasicRouteConfiguratio // RoutingRule a routing rule represents a specification for traffic to treat and where to send it, along // with health probe information. type RoutingRule struct { - autorest.Response `json:"-"` // RoutingRuleProperties - Properties of the Front Door Routing Rule *RoutingRuleProperties `json:"properties,omitempty"` // Name - Resource name. @@ -3200,150 +2576,12 @@ func (rr *RoutingRule) UnmarshalJSON(body []byte) error { // 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 { - autorest.Response `json:"-"` // 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"` } -// RoutingRuleListResultIterator provides access to a complete listing of RoutingRule values. -type RoutingRuleListResultIterator struct { - i int - page RoutingRuleListResultPage -} - -// 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 *RoutingRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRuleListResultIterator.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 *RoutingRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RoutingRuleListResultIterator) 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 RoutingRuleListResultIterator) Response() RoutingRuleListResult { - 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 RoutingRuleListResultIterator) Value() RoutingRule { - if !iter.page.NotDone() { - return RoutingRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RoutingRuleListResultIterator type. -func NewRoutingRuleListResultIterator(page RoutingRuleListResultPage) RoutingRuleListResultIterator { - return RoutingRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rrlr RoutingRuleListResult) IsEmpty() bool { - return rrlr.Value == nil || len(*rrlr.Value) == 0 -} - -// routingRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rrlr RoutingRuleListResult) routingRuleListResultPreparer(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))) -} - -// RoutingRuleListResultPage contains a page of RoutingRule values. -type RoutingRuleListResultPage struct { - fn func(context.Context, RoutingRuleListResult) (RoutingRuleListResult, error) - rrlr RoutingRuleListResult -} - -// 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 *RoutingRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRuleListResultPage.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 *RoutingRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RoutingRuleListResultPage) NotDone() bool { - return !page.rrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RoutingRuleListResultPage) Response() RoutingRuleListResult { - return page.rrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RoutingRuleListResultPage) Values() []RoutingRule { - if page.rrlr.IsEmpty() { - return nil - } - return *page.rrlr.Value -} - -// Creates a new instance of the RoutingRuleListResultPage type. -func NewRoutingRuleListResultPage(getNextPage func(context.Context, RoutingRuleListResult) (RoutingRuleListResult, error)) RoutingRuleListResultPage { - return RoutingRuleListResultPage{fn: getNextPage} -} - // 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' @@ -3428,58 +2666,6 @@ func (rrp *RoutingRuleProperties) UnmarshalJSON(body []byte) error { return nil } -// RoutingRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type RoutingRulesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RoutingRulesCreateOrUpdateFuture) Result(client RoutingRulesClient) (rr RoutingRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.RoutingRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rr.Response.Response, err = future.GetResult(sender); err == nil && rr.Response.Response.StatusCode != http.StatusNoContent { - rr, err = client.CreateOrUpdateResponder(rr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesCreateOrUpdateFuture", "Result", rr.Response.Response, "Failure responding to request") - } - } - return -} - -// RoutingRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RoutingRulesDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RoutingRulesDeleteFuture) Result(client RoutingRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.RoutingRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // RoutingRuleUpdateParameters routing rules to apply to an endpoint type RoutingRuleUpdateParameters struct { // FrontendEndpoints - Frontend endpoints associated with this rule diff --git a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/policies.go b/services/frontdoor/mgmt/2019-05-01/frontdoor/policies.go similarity index 100% rename from services/preview/frontdoor/mgmt/2019-05-01/frontdoor/policies.go rename to services/frontdoor/mgmt/2019-05-01/frontdoor/policies.go diff --git a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/version.go b/services/frontdoor/mgmt/2019-05-01/frontdoor/version.go similarity index 100% rename from services/preview/frontdoor/mgmt/2019-05-01/frontdoor/version.go rename to services/frontdoor/mgmt/2019-05-01/frontdoor/version.go diff --git a/services/healthcareapis/mgmt/2019-09-16/healthcareapis/client.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/client.go new file mode 100644 index 000000000000..c2bd63627422 --- /dev/null +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/client.go @@ -0,0 +1,51 @@ +// Package healthcareapis implements the Azure ARM Healthcareapis service API version 2019-09-16. +// +// Azure Healthcare APIs Client +package healthcareapis + +// 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 Healthcareapis + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Healthcareapis. +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. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/healthcareapis/mgmt/2019-09-16/healthcareapis/healthcareapisapi/interfaces.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/healthcareapisapi/interfaces.go new file mode 100644 index 000000000000..1d06a54548b2 --- /dev/null +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/healthcareapisapi/interfaces.go @@ -0,0 +1,50 @@ +package healthcareapisapi + +// 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/healthcareapis/mgmt/2019-09-16/healthcareapis" +) + +// ServicesClientAPI contains the set of methods on the ServicesClient type. +type ServicesClientAPI interface { + CheckNameAvailability(ctx context.Context, checkNameAvailabilityInputs healthcareapis.CheckNameAvailabilityParameters) (result healthcareapis.ServicesNameAvailabilityInfo, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, serviceDescription healthcareapis.ServicesDescription) (result healthcareapis.ServicesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string) (result healthcareapis.ServicesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string) (result healthcareapis.ServicesDescription, err error) + List(ctx context.Context) (result healthcareapis.ServicesDescriptionListResultPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result healthcareapis.ServicesDescriptionListResultPage, err error) + Update(ctx context.Context, resourceGroupName string, resourceName string, servicePatchDescription healthcareapis.ServicesPatchDescription) (result healthcareapis.ServicesUpdateFuture, err error) +} + +var _ ServicesClientAPI = (*healthcareapis.ServicesClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result healthcareapis.OperationListResultPage, err error) +} + +var _ OperationsClientAPI = (*healthcareapis.OperationsClient)(nil) + +// OperationResultsClientAPI contains the set of methods on the OperationResultsClient type. +type OperationResultsClientAPI interface { + Get(ctx context.Context, locationName string, operationResultID string) (result healthcareapis.SetObject, err error) +} + +var _ OperationResultsClientAPI = (*healthcareapis.OperationResultsClient)(nil) diff --git a/services/healthcareapis/mgmt/2019-09-16/healthcareapis/models.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/models.go new file mode 100644 index 000000000000..23c268b77377 --- /dev/null +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/models.go @@ -0,0 +1,708 @@ +package healthcareapis + +// 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/healthcareapis/mgmt/2019-09-16/healthcareapis" + +// Kind enumerates the values for kind. +type Kind string + +const ( + // Fhir ... + Fhir Kind = "fhir" + // FhirR4 ... + FhirR4 Kind = "fhir-R4" + // FhirStu3 ... + FhirStu3 Kind = "fhir-Stu3" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{Fhir, FhirR4, FhirStu3} +} + +// OperationResultStatus enumerates the values for operation result status. +type OperationResultStatus string + +const ( + // Canceled ... + Canceled OperationResultStatus = "Canceled" + // Failed ... + Failed OperationResultStatus = "Failed" + // Requested ... + Requested OperationResultStatus = "Requested" + // Running ... + Running OperationResultStatus = "Running" + // Succeeded ... + Succeeded OperationResultStatus = "Succeeded" +) + +// PossibleOperationResultStatusValues returns an array of possible values for the OperationResultStatus const type. +func PossibleOperationResultStatusValues() []OperationResultStatus { + return []OperationResultStatus{Canceled, Failed, Requested, Running, Succeeded} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateAccepted ... + ProvisioningStateAccepted ProvisioningState = "Accepted" + // ProvisioningStateCanceled ... + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateCreating ... + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateDeprovisioned ... + ProvisioningStateDeprovisioned ProvisioningState = "Deprovisioned" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating ... + ProvisioningStateUpdating ProvisioningState = "Updating" + // ProvisioningStateVerifying ... + ProvisioningStateVerifying ProvisioningState = "Verifying" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateAccepted, ProvisioningStateCanceled, ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateDeprovisioned, ProvisioningStateFailed, ProvisioningStateSucceeded, ProvisioningStateUpdating, ProvisioningStateVerifying} +} + +// ServiceNameUnavailabilityReason enumerates the values for service name unavailability reason. +type ServiceNameUnavailabilityReason string + +const ( + // AlreadyExists ... + AlreadyExists ServiceNameUnavailabilityReason = "AlreadyExists" + // Invalid ... + Invalid ServiceNameUnavailabilityReason = "Invalid" +) + +// PossibleServiceNameUnavailabilityReasonValues returns an array of possible values for the ServiceNameUnavailabilityReason const type. +func PossibleServiceNameUnavailabilityReasonValues() []ServiceNameUnavailabilityReason { + return []ServiceNameUnavailabilityReason{AlreadyExists, Invalid} +} + +// CheckNameAvailabilityParameters input values. +type CheckNameAvailabilityParameters struct { + // Name - The name of the service instance to check. + Name *string `json:"name,omitempty"` + // Type - The fully qualified resource type which includes provider namespace. + Type *string `json:"type,omitempty"` +} + +// ErrorDetails error details. +type ErrorDetails struct { + // Error - Object containing error details. + Error *ErrorDetailsInternal `json:"error,omitempty"` +} + +// ErrorDetailsInternal error details. +type ErrorDetailsInternal 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 target of the particular error. + Target *string `json:"target,omitempty"` +} + +// Operation service REST API operation. +type Operation struct { + // Name - READ-ONLY; Operation name: {provider}/{resource}/{read | write | action | delete} + Name *string `json:"name,omitempty"` + // Origin - READ-ONLY; Default value is 'user,system'. + Origin *string `json:"origin,omitempty"` + // Display - The information displayed about the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay the object that represents the operation. +type OperationDisplay struct { + // Provider - READ-ONLY; Service provider: Microsoft.HealthcareApis + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; Resource Type: Services + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; Name of the operation + Operation *string `json:"operation,omitempty"` + // Description - READ-ONLY; Friendly description for the operation, + Description *string `json:"description,omitempty"` +} + +// OperationListResult a list of service operations. It contains a list of operations and a URL link to get +// the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // NextLink - The link used to get the next page of service description objects. + NextLink *string `json:"nextLink,omitempty"` + // Value - READ-ONLY; A list of service operations supported by the Microsoft.HealthcareApis resource provider. + Value *[]Operation `json:"value,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} +} + +// OperationResultsDescription the properties indicating the operation result of an operation on a service. +type OperationResultsDescription struct { + // ID - READ-ONLY; The ID of the operation returned. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the operation result. + Name *string `json:"name,omitempty"` + // Status - READ-ONLY; The status of the operation being performed. Possible values include: 'Canceled', 'Succeeded', 'Failed', 'Requested', 'Running' + Status OperationResultStatus `json:"status,omitempty"` + // StartTime - READ-ONLY; The time that the operation was started. + StartTime *string `json:"startTime,omitempty"` + // Properties - Additional properties of the operation result. + Properties interface{} `json:"properties,omitempty"` +} + +// Resource the common properties of a service. +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"` + // Kind - The kind of the service. Possible values include: 'Fhir', 'FhirStu3', 'FhirR4' + Kind Kind `json:"kind,omitempty"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` + // Etag - An etag associated with the resource, used for optimistic concurrency when editing it. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Kind != "" { + objectMap["kind"] = r.Kind + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.Etag != nil { + objectMap["etag"] = r.Etag + } + return json.Marshal(objectMap) +} + +// ServiceAccessPolicyEntry an access policy entry. +type ServiceAccessPolicyEntry struct { + // ObjectID - An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. + ObjectID *string `json:"objectId,omitempty"` +} + +// ServiceAuthenticationConfigurationInfo authentication configuration information +type ServiceAuthenticationConfigurationInfo struct { + // Authority - The authority url for the service + Authority *string `json:"authority,omitempty"` + // Audience - The audience url for the service + Audience *string `json:"audience,omitempty"` + // SmartProxyEnabled - If the SMART on FHIR proxy is enabled + SmartProxyEnabled *bool `json:"smartProxyEnabled,omitempty"` +} + +// ServiceCorsConfigurationInfo the settings for the CORS configuration of the service instance. +type ServiceCorsConfigurationInfo struct { + // Origins - The origins to be allowed via CORS. + Origins *[]string `json:"origins,omitempty"` + // Headers - The headers to be allowed via CORS. + Headers *[]string `json:"headers,omitempty"` + // Methods - The methods to be allowed via CORS. + Methods *[]string `json:"methods,omitempty"` + // MaxAge - The max age to be allowed via CORS. + MaxAge *int32 `json:"maxAge,omitempty"` + // AllowCredentials - If credentials are allowed via CORS. + AllowCredentials *bool `json:"allowCredentials,omitempty"` +} + +// ServiceCosmosDbConfigurationInfo the settings for the Cosmos DB database backing the service. +type ServiceCosmosDbConfigurationInfo struct { + // OfferThroughput - The provisioned throughput for the backing database. + OfferThroughput *int32 `json:"offerThroughput,omitempty"` +} + +// ServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServicesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServicesCreateOrUpdateFuture) Result(client ServicesClient) (sd ServicesDescription, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("healthcareapis.ServicesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sd.Response.Response, err = future.GetResult(sender); err == nil && sd.Response.Response.StatusCode != http.StatusNoContent { + sd, err = client.CreateOrUpdateResponder(sd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesCreateOrUpdateFuture", "Result", sd.Response.Response, "Failure responding to request") + } + } + return +} + +// ServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServicesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServicesDeleteFuture) Result(client ServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("healthcareapis.ServicesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ServicesDescription the description of the service. +type ServicesDescription struct { + autorest.Response `json:"-"` + // Properties - The common properties of a service. + Properties *ServicesProperties `json:"properties,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"` + // Kind - The kind of the service. Possible values include: 'Fhir', 'FhirStu3', 'FhirR4' + Kind Kind `json:"kind,omitempty"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` + // Etag - An etag associated with the resource, used for optimistic concurrency when editing it. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServicesDescription. +func (sd ServicesDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sd.Properties != nil { + objectMap["properties"] = sd.Properties + } + if sd.Kind != "" { + objectMap["kind"] = sd.Kind + } + if sd.Location != nil { + objectMap["location"] = sd.Location + } + if sd.Tags != nil { + objectMap["tags"] = sd.Tags + } + if sd.Etag != nil { + objectMap["etag"] = sd.Etag + } + return json.Marshal(objectMap) +} + +// ServicesDescriptionListResult a list of service description objects with a next link. +type ServicesDescriptionListResult struct { + autorest.Response `json:"-"` + // NextLink - The link used to get the next page of service description objects. + NextLink *string `json:"nextLink,omitempty"` + // Value - A list of service description objects. + Value *[]ServicesDescription `json:"value,omitempty"` +} + +// ServicesDescriptionListResultIterator provides access to a complete listing of ServicesDescription +// values. +type ServicesDescriptionListResultIterator struct { + i int + page ServicesDescriptionListResultPage +} + +// 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 *ServicesDescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesDescriptionListResultIterator.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 *ServicesDescriptionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServicesDescriptionListResultIterator) 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 ServicesDescriptionListResultIterator) Response() ServicesDescriptionListResult { + 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 ServicesDescriptionListResultIterator) Value() ServicesDescription { + if !iter.page.NotDone() { + return ServicesDescription{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServicesDescriptionListResultIterator type. +func NewServicesDescriptionListResultIterator(page ServicesDescriptionListResultPage) ServicesDescriptionListResultIterator { + return ServicesDescriptionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sdlr ServicesDescriptionListResult) IsEmpty() bool { + return sdlr.Value == nil || len(*sdlr.Value) == 0 +} + +// servicesDescriptionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sdlr ServicesDescriptionListResult) servicesDescriptionListResultPreparer(ctx context.Context) (*http.Request, error) { + if sdlr.NextLink == nil || len(to.String(sdlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sdlr.NextLink))) +} + +// ServicesDescriptionListResultPage contains a page of ServicesDescription values. +type ServicesDescriptionListResultPage struct { + fn func(context.Context, ServicesDescriptionListResult) (ServicesDescriptionListResult, error) + sdlr ServicesDescriptionListResult +} + +// 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 *ServicesDescriptionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesDescriptionListResultPage.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.sdlr) + if err != nil { + return err + } + page.sdlr = 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 *ServicesDescriptionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServicesDescriptionListResultPage) NotDone() bool { + return !page.sdlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServicesDescriptionListResultPage) Response() ServicesDescriptionListResult { + return page.sdlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServicesDescriptionListResultPage) Values() []ServicesDescription { + if page.sdlr.IsEmpty() { + return nil + } + return *page.sdlr.Value +} + +// Creates a new instance of the ServicesDescriptionListResultPage type. +func NewServicesDescriptionListResultPage(getNextPage func(context.Context, ServicesDescriptionListResult) (ServicesDescriptionListResult, error)) ServicesDescriptionListResultPage { + return ServicesDescriptionListResultPage{fn: getNextPage} +} + +// ServicesNameAvailabilityInfo the properties indicating whether a given service name is available. +type ServicesNameAvailabilityInfo 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 ServiceNameUnavailabilityReason `json:"reason,omitempty"` + // Message - The detailed reason message. + Message *string `json:"message,omitempty"` +} + +// ServicesPatchDescription the description of the service. +type ServicesPatchDescription struct { + // Tags - Instance tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ServicesPatchDescription. +func (spd ServicesPatchDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spd.Tags != nil { + objectMap["tags"] = spd.Tags + } + return json.Marshal(objectMap) +} + +// ServicesProperties the properties of a service instance. +type ServicesProperties struct { + // ProvisioningState - READ-ONLY; The provisioning state. Possible values include: 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateCreating', 'ProvisioningStateAccepted', 'ProvisioningStateVerifying', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeprovisioned' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // AccessPolicies - The access policies of the service instance. + AccessPolicies *[]ServiceAccessPolicyEntry `json:"accessPolicies,omitempty"` + // CosmosDbConfiguration - The settings for the Cosmos DB database backing the service. + CosmosDbConfiguration *ServiceCosmosDbConfigurationInfo `json:"cosmosDbConfiguration,omitempty"` + // AuthenticationConfiguration - The authentication configuration for the service instance. + AuthenticationConfiguration *ServiceAuthenticationConfigurationInfo `json:"authenticationConfiguration,omitempty"` + // CorsConfiguration - The settings for the CORS configuration of the service instance. + CorsConfiguration *ServiceCorsConfigurationInfo `json:"corsConfiguration,omitempty"` +} + +// ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServicesUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServicesUpdateFuture) Result(client ServicesClient) (sd ServicesDescription, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("healthcareapis.ServicesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sd.Response.Response, err = future.GetResult(sender); err == nil && sd.Response.Response.StatusCode != http.StatusNoContent { + sd, err = client.UpdateResponder(sd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesUpdateFuture", "Result", sd.Response.Response, "Failure responding to request") + } + } + return +} + +// SetObject ... +type SetObject struct { + autorest.Response `json:"-"` + Value interface{} `json:"value,omitempty"` +} diff --git a/services/healthcareapis/mgmt/2019-09-16/healthcareapis/operationresults.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/operationresults.go new file mode 100644 index 000000000000..10f2174c33df --- /dev/null +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/operationresults.go @@ -0,0 +1,118 @@ +package healthcareapis + +// 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" +) + +// OperationResultsClient is the azure Healthcare APIs Client +type OperationResultsClient struct { + BaseClient +} + +// NewOperationResultsClient creates an instance of the OperationResultsClient client. +func NewOperationResultsClient(subscriptionID string) OperationResultsClient { + return NewOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationResultsClientWithBaseURI creates an instance of the OperationResultsClient client. +func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationResultsClient { + return OperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get the operation result for a long running operation. +// Parameters: +// locationName - the location of the operation. +// operationResultID - the ID of the operation result to get. +func (client OperationResultsClient) Get(ctx context.Context, locationName string, operationResultID string) (result SetObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, locationName, operationResultID) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.OperationResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.OperationResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.OperationResultsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OperationResultsClient) GetPreparer(ctx context.Context, locationName string, operationResultID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "locationName": autorest.Encode("path", locationName), + "operationResultId": autorest.Encode("path", operationResultID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client OperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client OperationResultsClient) GetResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/operations.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/operations.go similarity index 80% rename from services/preview/servicefabric/mgmt/2019-03-01/servicefabric/operations.go rename to services/healthcareapis/mgmt/2019-09-16/healthcareapis/operations.go index 212b6ff8ee34..5acb766ce32c 100644 --- a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/operations.go +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/operations.go @@ -1,4 +1,4 @@ -package servicefabric +package healthcareapis // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,7 +25,7 @@ import ( "net/http" ) -// OperationsClient is the service Fabric Management Client +// OperationsClient is the azure Healthcare APIs Client type OperationsClient struct { BaseClient } @@ -40,7 +40,7 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List get the list of available Service Fabric resource provider API operations. +// List lists all of the available Healthcare service REST API operations. func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") @@ -55,20 +55,20 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "healthcareapis.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, "servicefabric.OperationsClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "healthcareapis.OperationsClient", "List", resp, "Failure sending request") return } result.olr, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "healthcareapis.OperationsClient", "List", resp, "Failure responding to request") } return @@ -76,7 +76,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-03-01-preview" + const APIVersion = "2019-09-16" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -84,7 +84,7 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.ServiceFabric/operations"), + autorest.WithPath("/providers/Microsoft.HealthcareApis/operations"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -113,7 +113,7 @@ func (client OperationsClient) ListResponder(resp *http.Response) (result Operat 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, "servicefabric.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "healthcareapis.OperationsClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -121,11 +121,11 @@ func (client OperationsClient) listNextResults(ctx context.Context, lastResults resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "healthcareapis.OperationsClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "healthcareapis.OperationsClient", "listNextResults", resp, "Failure responding to next results request") } return } diff --git a/services/healthcareapis/mgmt/2019-09-16/healthcareapis/services.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/services.go new file mode 100644 index 000000000000..129dd2f0fc13 --- /dev/null +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/services.go @@ -0,0 +1,730 @@ +package healthcareapis + +// 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 azure Healthcare APIs 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. +func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { + return ServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability check if a service instance name is available. +// Parameters: +// checkNameAvailabilityInputs - set the name parameter in the CheckNameAvailabilityParameters structure to the +// name of the service instance to check. +func (client ServicesClient) CheckNameAvailability(ctx context.Context, checkNameAvailabilityInputs CheckNameAvailabilityParameters) (result ServicesNameAvailabilityInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.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: checkNameAvailabilityInputs, + Constraints: []validation.Constraint{{Target: "checkNameAvailabilityInputs.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "checkNameAvailabilityInputs.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.ServicesClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, checkNameAvailabilityInputs) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client ServicesClient) CheckNameAvailabilityPreparer(ctx context.Context, checkNameAvailabilityInputs CheckNameAvailabilityParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16" + 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.HealthcareApis/checkNameAvailability", pathParameters), + autorest.WithJSON(checkNameAvailabilityInputs), + 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 ServicesClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client ServicesClient) CheckNameAvailabilityResponder(resp *http.Response) (result ServicesNameAvailabilityInfo, 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 a service instance. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// resourceName - the name of the service instance. +// serviceDescription - the service instance metadata. +func (client ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, serviceDescription ServicesDescription) (result ServicesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.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: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {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: 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}, + {Target: "serviceDescription.Properties.CorsConfiguration.MaxAge", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("healthcareapis.ServicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, serviceDescription) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, serviceDescription ServicesDescription) (*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-09-16" + 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.HealthcareApis/services/{resourceName}", pathParameters), + autorest.WithJSON(serviceDescription), + 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) (future ServicesCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 ServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ServicesDescription, 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 service instance. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// resourceName - the name of the service instance. +func (client ServicesClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result ServicesDeleteFuture, 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) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.ServicesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ServicesClient) 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-09-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{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 ServicesClient) DeleteSender(req *http.Request) (future ServicesDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 ServicesClient) 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 metadata of a service instance. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// resourceName - the name of the service instance. +func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ServicesDescription, 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) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.ServicesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.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, "healthcareapis.ServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServicesClient) 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-09-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{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 ServicesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetResponder(resp *http.Response) (result ServicesDescription, 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 get all the service instances in a subscription. +func (client ServicesClient) List(ctx context.Context) (result ServicesDescriptionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.List") + defer func() { + sc := -1 + if result.sdlr.Response.Response != nil { + sc = result.sdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "List", resp, "Failure sending request") + return + } + + result.sdlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ServicesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services", 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 ServicesClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ServicesClient) ListResponder(resp *http.Response) (result ServicesDescriptionListResult, 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 ServicesClient) listNextResults(ctx context.Context, lastResults ServicesDescriptionListResult) (result ServicesDescriptionListResult, err error) { + req, err := lastResults.servicesDescriptionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "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, "healthcareapis.ServicesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServicesClient) ListComplete(ctx context.Context) (result ServicesDescriptionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.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 all the service instances in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServicesDescriptionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.sdlr.Response.Response != nil { + sc = result.sdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.ServicesClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.sdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.sdlr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.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 = "2019-09-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services", 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) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ServicesDescriptionListResult, 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 ServicesDescriptionListResult) (result ServicesDescriptionListResult, err error) { + req, err := lastResults.servicesDescriptionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "healthcareapis.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, "healthcareapis.ServicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.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 ServicesDescriptionListResultIterator, 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 +} + +// Update update the metadata of a service instance. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// resourceName - the name of the service instance. +// servicePatchDescription - the service instance metadata and security metadata. +func (client ServicesClient) Update(ctx context.Context, resourceGroupName string, resourceName string, servicePatchDescription ServicesPatchDescription) (result ServicesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.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}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.ServicesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, servicePatchDescription) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, servicePatchDescription ServicesPatchDescription) (*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-09-16" + 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.HealthcareApis/services/{resourceName}", pathParameters), + autorest.WithJSON(servicePatchDescription), + 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) (future ServicesUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 ServicesClient) UpdateResponder(resp *http.Response) (result ServicesDescription, 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/healthcareapis/mgmt/2019-09-16/healthcareapis/version.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/version.go new file mode 100644 index 000000000000..f7a574efeb9b --- /dev/null +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/version.go @@ -0,0 +1,30 @@ +package healthcareapis + +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.Number + " healthcareapis/2019-09-16" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/keyvault/2015-06-01/keyvault/models.go b/services/keyvault/2015-06-01/keyvault/models.go index b67b5d1930bd..e55201488211 100644 --- a/services/keyvault/2015-06-01/keyvault/models.go +++ b/services/keyvault/2015-06-01/keyvault/models.go @@ -180,13 +180,13 @@ type AdministratorDetails struct { type Attributes struct { // Enabled - Determines whether the object is enabled Enabled *bool `json:"enabled,omitempty"` - // NotBefore - Not before date in UTC + // NotBefore - Not before date in seconds since 1970-01-01T00:00:00Z NotBefore *date.UnixTime `json:"nbf,omitempty"` - // Expires - Expiry date in UTC + // Expires - Expiry date in seconds since 1970-01-01T00:00:00Z Expires *date.UnixTime `json:"exp,omitempty"` - // Created - READ-ONLY; Creation time in UTC + // Created - READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z Created *date.UnixTime `json:"created,omitempty"` - // Updated - READ-ONLY; Last updated time in UTC + // Updated - READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z Updated *date.UnixTime `json:"updated,omitempty"` } @@ -201,13 +201,13 @@ type BackupKeyResult struct { type CertificateAttributes struct { // Enabled - Determines whether the object is enabled Enabled *bool `json:"enabled,omitempty"` - // NotBefore - Not before date in UTC + // NotBefore - Not before date in seconds since 1970-01-01T00:00:00Z NotBefore *date.UnixTime `json:"nbf,omitempty"` - // Expires - Expiry date in UTC + // Expires - Expiry date in seconds since 1970-01-01T00:00:00Z Expires *date.UnixTime `json:"exp,omitempty"` - // Created - READ-ONLY; Creation time in UTC + // Created - READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z Created *date.UnixTime `json:"created,omitempty"` - // Updated - READ-ONLY; Last updated time in UTC + // Updated - READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z Updated *date.UnixTime `json:"updated,omitempty"` } @@ -802,9 +802,9 @@ type ErrorType struct { type IssuerAttributes struct { // Enabled - Determines whether the issuer is enabled Enabled *bool `json:"enabled,omitempty"` - // Created - READ-ONLY; Creation time in UTC + // Created - READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z Created *date.UnixTime `json:"created,omitempty"` - // Updated - READ-ONLY; Last updated time in UTC + // Updated - READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z Updated *date.UnixTime `json:"updated,omitempty"` } @@ -872,13 +872,13 @@ type JSONWebKey struct { type KeyAttributes struct { // Enabled - Determines whether the object is enabled Enabled *bool `json:"enabled,omitempty"` - // NotBefore - Not before date in UTC + // NotBefore - Not before date in seconds since 1970-01-01T00:00:00Z NotBefore *date.UnixTime `json:"nbf,omitempty"` - // Expires - Expiry date in UTC + // Expires - Expiry date in seconds since 1970-01-01T00:00:00Z Expires *date.UnixTime `json:"exp,omitempty"` - // Created - READ-ONLY; Creation time in UTC + // Created - READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z Created *date.UnixTime `json:"created,omitempty"` - // Updated - READ-ONLY; Last updated time in UTC + // Updated - READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z Updated *date.UnixTime `json:"updated,omitempty"` } @@ -1257,13 +1257,13 @@ type PendingCertificateSigningRequestResult struct { type SecretAttributes struct { // Enabled - Determines whether the object is enabled Enabled *bool `json:"enabled,omitempty"` - // NotBefore - Not before date in UTC + // NotBefore - Not before date in seconds since 1970-01-01T00:00:00Z NotBefore *date.UnixTime `json:"nbf,omitempty"` - // Expires - Expiry date in UTC + // Expires - Expiry date in seconds since 1970-01-01T00:00:00Z Expires *date.UnixTime `json:"exp,omitempty"` - // Created - READ-ONLY; Creation time in UTC + // Created - READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z Created *date.UnixTime `json:"created,omitempty"` - // Updated - READ-ONLY; Last updated time in UTC + // Updated - READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z Updated *date.UnixTime `json:"updated,omitempty"` } diff --git a/services/keyvault/auth/auth.go b/services/keyvault/auth/auth.go deleted file mode 100644 index 8afaf859ac2f..000000000000 --- a/services/keyvault/auth/auth.go +++ /dev/null @@ -1,77 +0,0 @@ -package auth - -// 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. - -import ( - "os" - "strings" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/azure/auth" -) - -// NewAuthorizerFromEnvironment creates a keyvault dataplane Authorizer configured from environment variables in the order: -// 1. Client credentials -// 2. Client certificate -// 3. Username password -// 4. MSI -func NewAuthorizerFromEnvironment() (autorest.Authorizer, error) { - res, err := getResource() - if err != nil { - return nil, err - } - return auth.NewAuthorizerFromEnvironmentWithResource(*res) -} - -// NewAuthorizerFromFile creates a keyvault dataplane Authorizer configured from a configuration file -func NewAuthorizerFromFile(baseURI string) (autorest.Authorizer, error) { - res, err := getResource() - if err != nil { - return nil, err - } - return auth.NewAuthorizerFromFileWithResource(*res) -} - -// NewAuthorizerFromCLI creates a keyvault dataplane Authorizer configured from Azure CLI 2.0 for local development scenarios. -func NewAuthorizerFromCLI() (autorest.Authorizer, error) { - res, err := getResource() - if err != nil { - return nil, err - } - return auth.NewAuthorizerFromCLIWithResource(*res) -} - -func getResource() (*string, error) { - envName := os.Getenv("AZURE_ENVIRONMENT") - var env azure.Environment - var err error - - if envName == "" { - env = azure.PublicCloud - } else { - env, err = azure.EnvironmentFromName(envName) - if err != nil { - return nil, err - } - } - - resource := os.Getenv("AZURE_KEYVAULT_RESOURCE") - if resource == "" { - resource = strings.TrimSuffix(env.KeyVaultEndpoint, "/") - } - - return &resource, nil -} diff --git a/services/kusto/mgmt/2019-05-15/kusto/models.go b/services/kusto/mgmt/2019-05-15/kusto/models.go index 5860664762ec..013aac2aa229 100644 --- a/services/kusto/mgmt/2019-05-15/kusto/models.go +++ b/services/kusto/mgmt/2019-05-15/kusto/models.go @@ -161,13 +161,15 @@ const ( SOHSV DataFormat = "SOHSV" // TSV ... TSV DataFormat = "TSV" + // TSVE ... + TSVE DataFormat = "TSVE" // TXT ... TXT DataFormat = "TXT" ) // PossibleDataFormatValues returns an array of possible values for the DataFormat const type. func PossibleDataFormatValues() []DataFormat { - return []DataFormat{AVRO, CSV, JSON, MULTIJSON, PSV, RAW, SCSV, SINGLEJSON, SOHSV, TSV, TXT} + return []DataFormat{AVRO, CSV, JSON, MULTIJSON, PSV, RAW, SCSV, SINGLEJSON, SOHSV, TSV, TSVE, TXT} } // Kind enumerates the values for kind. @@ -1363,7 +1365,7 @@ type EventGridConnectionProperties struct { TableName *string `json:"tableName,omitempty"` // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. MappingRuleName *string `json:"mappingRuleName,omitempty"` - // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO' + // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE' DataFormat DataFormat `json:"dataFormat,omitempty"` } @@ -1503,7 +1505,7 @@ type EventHubConnectionProperties struct { TableName *string `json:"tableName,omitempty"` // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. MappingRuleName *string `json:"mappingRuleName,omitempty"` - // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO' + // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE' DataFormat DataFormat `json:"dataFormat,omitempty"` // EventSystemProperties - System properties of the event hub EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"` @@ -1645,7 +1647,7 @@ type IotHubConnectionProperties struct { TableName *string `json:"tableName,omitempty"` // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. MappingRuleName *string `json:"mappingRuleName,omitempty"` - // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO' + // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE' DataFormat DataFormat `json:"dataFormat,omitempty"` // EventSystemProperties - System properties of the iot hub EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"` diff --git a/services/kusto/mgmt/2019-09-07/kusto/attacheddatabaseconfigurations.go b/services/kusto/mgmt/2019-09-07/kusto/attacheddatabaseconfigurations.go new file mode 100644 index 000000000000..c2d6c459235b --- /dev/null +++ b/services/kusto/mgmt/2019-09-07/kusto/attacheddatabaseconfigurations.go @@ -0,0 +1,370 @@ +package kusto + +// 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" +) + +// AttachedDatabaseConfigurationsClient is the the Azure Kusto management API provides a RESTful set of web services +// that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, +// update, and delete clusters and databases. +type AttachedDatabaseConfigurationsClient struct { + BaseClient +} + +// NewAttachedDatabaseConfigurationsClient creates an instance of the AttachedDatabaseConfigurationsClient client. +func NewAttachedDatabaseConfigurationsClient(subscriptionID string) AttachedDatabaseConfigurationsClient { + return NewAttachedDatabaseConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAttachedDatabaseConfigurationsClientWithBaseURI creates an instance of the AttachedDatabaseConfigurationsClient +// client. +func NewAttachedDatabaseConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) AttachedDatabaseConfigurationsClient { + return AttachedDatabaseConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an attached database configuration. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// attachedDatabaseConfigurationName - the name of the attached database configuration. +// parameters - the database parameters supplied to the CreateOrUpdate operation. +func (client AttachedDatabaseConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string, parameters AttachedDatabaseConfiguration) (result AttachedDatabaseConfigurationsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AttachedDatabaseConfigurationsClient.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.AttachedDatabaseConfigurationProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.AttachedDatabaseConfigurationProperties.DatabaseName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AttachedDatabaseConfigurationProperties.ClusterResourceID", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AttachedDatabaseConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string, parameters AttachedDatabaseConfiguration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "attachedDatabaseConfigurationName": autorest.Encode("path", attachedDatabaseConfigurationName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + 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.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}", 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 AttachedDatabaseConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future AttachedDatabaseConfigurationsCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 AttachedDatabaseConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result AttachedDatabaseConfiguration, 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 attached database configuration with the given name. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// attachedDatabaseConfigurationName - the name of the attached database configuration. +func (client AttachedDatabaseConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string) (result AttachedDatabaseConfigurationsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AttachedDatabaseConfigurationsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, attachedDatabaseConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AttachedDatabaseConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "attachedDatabaseConfigurationName": autorest.Encode("path", attachedDatabaseConfigurationName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}", 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 AttachedDatabaseConfigurationsClient) DeleteSender(req *http.Request) (future AttachedDatabaseConfigurationsDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 AttachedDatabaseConfigurationsClient) 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 returns an attached database configuration. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// attachedDatabaseConfigurationName - the name of the attached database configuration. +func (client AttachedDatabaseConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string) (result AttachedDatabaseConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AttachedDatabaseConfigurationsClient.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, clusterName, attachedDatabaseConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AttachedDatabaseConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "attachedDatabaseConfigurationName": autorest.Encode("path", attachedDatabaseConfigurationName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}", 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 AttachedDatabaseConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AttachedDatabaseConfigurationsClient) GetResponder(resp *http.Response) (result AttachedDatabaseConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByCluster returns the list of attached database configurations of the given Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client AttachedDatabaseConfigurationsClient) ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result AttachedDatabaseConfigurationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AttachedDatabaseConfigurationsClient.ListByCluster") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByClusterPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "ListByCluster", nil, "Failure preparing request") + return + } + + resp, err := client.ListByClusterSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "ListByCluster", resp, "Failure sending request") + return + } + + result, err = client.ListByClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "ListByCluster", resp, "Failure responding to request") + } + + return +} + +// ListByClusterPreparer prepares the ListByCluster request. +func (client AttachedDatabaseConfigurationsClient) ListByClusterPreparer(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 = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByClusterSender sends the ListByCluster request. The method will close the +// http.Response Body if it receives an error. +func (client AttachedDatabaseConfigurationsClient) ListByClusterSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByClusterResponder handles the response to the ListByCluster request. The method always +// closes the http.Response Body. +func (client AttachedDatabaseConfigurationsClient) ListByClusterResponder(resp *http.Response) (result AttachedDatabaseConfigurationListResult, 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/mobileengagement/mgmt/2014-12-01/mobileengagement/client.go b/services/kusto/mgmt/2019-09-07/kusto/client.go similarity index 76% rename from services/mobileengagement/mgmt/2014-12-01/mobileengagement/client.go rename to services/kusto/mgmt/2019-09-07/kusto/client.go index 17c88578afe1..de3e2cda6fb4 100644 --- a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/client.go +++ b/services/kusto/mgmt/2019-09-07/kusto/client.go @@ -1,7 +1,8 @@ -// Package mobileengagement implements the Azure ARM Mobileengagement service API version 2014-12-01. +// Package kusto implements the Azure ARM Kusto service API version 2019-09-07. // -// Microsoft Azure Mobile Engagement REST APIs. -package mobileengagement +// The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to +// manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. +package kusto // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,11 +26,11 @@ import ( ) const ( - // DefaultBaseURI is the default URI used for the service Mobileengagement + // DefaultBaseURI is the default URI used for the service Kusto DefaultBaseURI = "https://management.azure.com" ) -// BaseClient is the base client for Mobileengagement. +// BaseClient is the base client for Kusto. type BaseClient struct { autorest.Client BaseURI string diff --git a/services/kusto/mgmt/2019-09-07/kusto/clusters.go b/services/kusto/mgmt/2019-09-07/kusto/clusters.go new file mode 100644 index 000000000000..3d5a6c656874 --- /dev/null +++ b/services/kusto/mgmt/2019-09-07/kusto/clusters.go @@ -0,0 +1,1079 @@ +package kusto + +// 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 the Azure Kusto management API provides a RESTful set of web services that interact with Azure +// Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and +// databases. +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. +func NewClustersClientWithBaseURI(baseURI string, subscriptionID string) ClustersClient { + return ClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability checks that the cluster name is valid and is not already in use. +// Parameters: +// location - azure location. +// clusterName - the name of the cluster. +func (client ClustersClient) CheckNameAvailability(ctx context.Context, location string, clusterName ClusterCheckNameRequest) (result CheckNameResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.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: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "clusterName.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("kusto.ClustersClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, location, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client ClustersClient) CheckNameAvailabilityPreparer(ctx context.Context, location string, clusterName ClusterCheckNameRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + 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.Kusto/locations/{location}/checkNameAvailability", pathParameters), + autorest.WithJSON(clusterName), + 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 ClustersClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client ClustersClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameResult, 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 a Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// parameters - the Kusto cluster parameters supplied to the CreateOrUpdate operation. +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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.OptimizedAutoscale", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.OptimizedAutoscale.Version", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterProperties.OptimizedAutoscale.IsEnabled", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterProperties.OptimizedAutoscale.Minimum", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterProperties.OptimizedAutoscale.Maximum", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.ClusterProperties.VirtualNetworkConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.VirtualNetworkConfiguration.SubnetID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterProperties.VirtualNetworkConfiguration.EnginePublicIPID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterProperties.VirtualNetworkConfiguration.DataManagementPublicIPID", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.ClusterProperties.KeyVaultProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.KeyVaultProperties.KeyName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterProperties.KeyVaultProperties.KeyVersion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterProperties.KeyVaultProperties.KeyVaultURI", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("kusto.ClustersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.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 = "2019-09-07" + 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.Kusto/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) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto 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) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.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 = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/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) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DetachFollowerDatabases detaches all followers of a database owned by this cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// followerDatabaseToRemove - the follower databases properties to remove. +func (client ClustersClient) DetachFollowerDatabases(ctx context.Context, resourceGroupName string, clusterName string, followerDatabaseToRemove FollowerDatabaseDefinition) (result ClustersDetachFollowerDatabasesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.DetachFollowerDatabases") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: followerDatabaseToRemove, + Constraints: []validation.Constraint{{Target: "followerDatabaseToRemove.ClusterResourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "followerDatabaseToRemove.AttachedDatabaseConfigurationName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("kusto.ClustersClient", "DetachFollowerDatabases", err.Error()) + } + + req, err := client.DetachFollowerDatabasesPreparer(ctx, resourceGroupName, clusterName, followerDatabaseToRemove) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", nil, "Failure preparing request") + return + } + + result, err = client.DetachFollowerDatabasesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", result.Response(), "Failure sending request") + return + } + + return +} + +// DetachFollowerDatabasesPreparer prepares the DetachFollowerDatabases request. +func (client ClustersClient) DetachFollowerDatabasesPreparer(ctx context.Context, resourceGroupName string, clusterName string, followerDatabaseToRemove FollowerDatabaseDefinition) (*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 = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + followerDatabaseToRemove.DatabaseName = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases", pathParameters), + autorest.WithJSON(followerDatabaseToRemove), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DetachFollowerDatabasesSender sends the DetachFollowerDatabases request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) DetachFollowerDatabasesSender(req *http.Request) (future ClustersDetachFollowerDatabasesFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DetachFollowerDatabasesResponder handles the response to the DetachFollowerDatabases request. The method always +// closes the http.Response Body. +func (client ClustersClient) DetachFollowerDatabasesResponder(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 Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto 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) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.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, "kusto.ClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.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 = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/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) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 lists all Kusto clusters within a subscription. +func (client ClustersClient) List(ctx context.Context) (result ClusterListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.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, "kusto.ClustersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.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 = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/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) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// ListByResourceGroup lists all Kusto clusters within a resource group. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ClusterListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.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 = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/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) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// ListFollowerDatabases returns a list of databases that are owned by this cluster and were followed by another +// cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ClustersClient) ListFollowerDatabases(ctx context.Context, resourceGroupName string, clusterName string) (result FollowerDatabaseListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListFollowerDatabases") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListFollowerDatabasesPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListFollowerDatabases", nil, "Failure preparing request") + return + } + + resp, err := client.ListFollowerDatabasesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListFollowerDatabases", resp, "Failure sending request") + return + } + + result, err = client.ListFollowerDatabasesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListFollowerDatabases", resp, "Failure responding to request") + } + + return +} + +// ListFollowerDatabasesPreparer prepares the ListFollowerDatabases request. +func (client ClustersClient) ListFollowerDatabasesPreparer(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 = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListFollowerDatabasesSender sends the ListFollowerDatabases request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ListFollowerDatabasesSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListFollowerDatabasesResponder handles the response to the ListFollowerDatabases request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListFollowerDatabasesResponder(resp *http.Response) (result FollowerDatabaseListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSkus lists eligible SKUs for Kusto resource provider. +func (client ClustersClient) ListSkus(ctx context.Context) (result SkuDescriptionList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListSkus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListSkusPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListSkus", nil, "Failure preparing request") + return + } + + resp, err := client.ListSkusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListSkus", resp, "Failure sending request") + return + } + + result, err = client.ListSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListSkus", resp, "Failure responding to request") + } + + return +} + +// ListSkusPreparer prepares the ListSkus request. +func (client ClustersClient) ListSkusPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/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 ClustersClient) ListSkusSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListSkusResponder handles the response to the ListSkus request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListSkusResponder(resp *http.Response) (result SkuDescriptionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSkusByResource returns the SKUs available for the provided resource. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ClustersClient) ListSkusByResource(ctx context.Context, resourceGroupName string, clusterName string) (result ListResourceSkusResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListSkusByResource") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListSkusByResourcePreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListSkusByResource", nil, "Failure preparing request") + return + } + + resp, err := client.ListSkusByResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListSkusByResource", resp, "Failure sending request") + return + } + + result, err = client.ListSkusByResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListSkusByResource", resp, "Failure responding to request") + } + + return +} + +// ListSkusByResourcePreparer prepares the ListSkusByResource request. +func (client ClustersClient) ListSkusByResourcePreparer(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 = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSkusByResourceSender sends the ListSkusByResource request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ListSkusByResourceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListSkusByResourceResponder handles the response to the ListSkusByResource request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListSkusByResourceResponder(resp *http.Response) (result ListResourceSkusResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Start starts a Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ClustersClient) Start(ctx context.Context, resourceGroupName string, clusterName string) (result ClustersStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Start") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StartPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client ClustersClient) StartPreparer(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 = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/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 ClustersClient) StartSender(req *http.Request) (future ClustersStartFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 ClustersClient) StartResponder(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 +} + +// Stop stops a Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ClustersClient) Stop(ctx context.Context, resourceGroupName string, clusterName string) (result ClustersStopFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Stop") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StopPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", nil, "Failure preparing request") + return + } + + result, err = client.StopSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", result.Response(), "Failure sending request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client ClustersClient) StopPreparer(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 = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/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 ClustersClient) StopSender(req *http.Request) (future ClustersStopFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 ClustersClient) StopResponder(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 +} + +// Update update a Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// parameters - the Kusto cluster parameters supplied to the Update operation. +func (client ClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdate) (result ClustersUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdate) (*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 = "2019-09-07" + 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.Kusto/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) (future ClustersUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 ClustersClient) UpdateResponder(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 +} diff --git a/services/kusto/mgmt/2019-09-07/kusto/databases.go b/services/kusto/mgmt/2019-09-07/kusto/databases.go new file mode 100644 index 000000000000..f9f67be0601a --- /dev/null +++ b/services/kusto/mgmt/2019-09-07/kusto/databases.go @@ -0,0 +1,771 @@ +package kusto + +// 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" +) + +// DatabasesClient is the the Azure Kusto management API provides a RESTful set of web services that interact with +// Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete +// clusters and databases. +type DatabasesClient struct { + BaseClient +} + +// NewDatabasesClient creates an instance of the DatabasesClient client. +func NewDatabasesClient(subscriptionID string) DatabasesClient { + return NewDatabasesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDatabasesClientWithBaseURI creates an instance of the DatabasesClient client. +func NewDatabasesClientWithBaseURI(baseURI string, subscriptionID string) DatabasesClient { + return DatabasesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// AddPrincipals add Database principals permissions. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// databasePrincipalsToAdd - list of database principals to add. +func (client DatabasesClient) AddPrincipals(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, databasePrincipalsToAdd DatabasePrincipalListRequest) (result DatabasePrincipalListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.AddPrincipals") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddPrincipalsPreparer(ctx, resourceGroupName, clusterName, databaseName, databasePrincipalsToAdd) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "AddPrincipals", nil, "Failure preparing request") + return + } + + resp, err := client.AddPrincipalsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "AddPrincipals", resp, "Failure sending request") + return + } + + result, err = client.AddPrincipalsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "AddPrincipals", resp, "Failure responding to request") + } + + return +} + +// AddPrincipalsPreparer prepares the AddPrincipals request. +func (client DatabasesClient) AddPrincipalsPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, databasePrincipalsToAdd DatabasePrincipalListRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + 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.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals", pathParameters), + autorest.WithJSON(databasePrincipalsToAdd), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddPrincipalsSender sends the AddPrincipals request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasesClient) AddPrincipalsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// AddPrincipalsResponder handles the response to the AddPrincipals request. The method always +// closes the http.Response Body. +func (client DatabasesClient) AddPrincipalsResponder(resp *http.Response) (result DatabasePrincipalListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CheckNameAvailability checks that the database name is valid and is not already in use. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// resourceName - the name of the resource. +func (client DatabasesClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, resourceName CheckNameRequest) (result CheckNameResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.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: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("kusto.DatabasesClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, resourceGroupName, clusterName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client DatabasesClient) CheckNameAvailabilityPreparer(ctx context.Context, resourceGroupName string, clusterName string, resourceName CheckNameRequest) (*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 = "2019-09-07" + 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.Kusto/clusters/{clusterName}/checkNameAvailability", pathParameters), + autorest.WithJSON(resourceName), + 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 DatabasesClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client DatabasesClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameResult, 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 creates or updates a database. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// parameters - the database parameters supplied to the CreateOrUpdate operation. +func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters BasicDatabase) (result DatabasesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, databaseName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters BasicDatabase) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + 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.Kusto/clusters/{clusterName}/databases/{databaseName}", 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 DatabasesClient) CreateOrUpdateSender(req *http.Request) (future DatabasesCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 DatabasesClient) CreateOrUpdateResponder(resp *http.Response) (result DatabaseModel, 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 database with the given name. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result DatabasesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}", 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 DatabasesClient) DeleteSender(req *http.Request) (future DatabasesDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 DatabasesClient) 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 returns a database. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +func (client DatabasesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result DatabaseModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.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, clusterName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DatabasesClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}", 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 DatabasesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DatabasesClient) GetResponder(resp *http.Response) (result DatabaseModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByCluster returns the list of databases of the given Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client DatabasesClient) ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result DatabaseListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.ListByCluster") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByClusterPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "ListByCluster", nil, "Failure preparing request") + return + } + + resp, err := client.ListByClusterSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "ListByCluster", resp, "Failure sending request") + return + } + + result, err = client.ListByClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "ListByCluster", resp, "Failure responding to request") + } + + return +} + +// ListByClusterPreparer prepares the ListByCluster request. +func (client DatabasesClient) ListByClusterPreparer(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 = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByClusterSender sends the ListByCluster request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasesClient) ListByClusterSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByClusterResponder handles the response to the ListByCluster request. The method always +// closes the http.Response Body. +func (client DatabasesClient) ListByClusterResponder(resp *http.Response) (result DatabaseListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListPrincipals returns a list of database principals of the given Kusto cluster and database. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +func (client DatabasesClient) ListPrincipals(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result DatabasePrincipalListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.ListPrincipals") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPrincipalsPreparer(ctx, resourceGroupName, clusterName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "ListPrincipals", nil, "Failure preparing request") + return + } + + resp, err := client.ListPrincipalsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "ListPrincipals", resp, "Failure sending request") + return + } + + result, err = client.ListPrincipalsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "ListPrincipals", resp, "Failure responding to request") + } + + return +} + +// ListPrincipalsPreparer prepares the ListPrincipals request. +func (client DatabasesClient) ListPrincipalsPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPrincipalsSender sends the ListPrincipals request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasesClient) ListPrincipalsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListPrincipalsResponder handles the response to the ListPrincipals request. The method always +// closes the http.Response Body. +func (client DatabasesClient) ListPrincipalsResponder(resp *http.Response) (result DatabasePrincipalListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RemovePrincipals remove Database principals permissions. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// databasePrincipalsToRemove - list of database principals to remove. +func (client DatabasesClient) RemovePrincipals(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, databasePrincipalsToRemove DatabasePrincipalListRequest) (result DatabasePrincipalListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.RemovePrincipals") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemovePrincipalsPreparer(ctx, resourceGroupName, clusterName, databaseName, databasePrincipalsToRemove) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "RemovePrincipals", nil, "Failure preparing request") + return + } + + resp, err := client.RemovePrincipalsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "RemovePrincipals", resp, "Failure sending request") + return + } + + result, err = client.RemovePrincipalsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "RemovePrincipals", resp, "Failure responding to request") + } + + return +} + +// RemovePrincipalsPreparer prepares the RemovePrincipals request. +func (client DatabasesClient) RemovePrincipalsPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, databasePrincipalsToRemove DatabasePrincipalListRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + 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.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals", pathParameters), + autorest.WithJSON(databasePrincipalsToRemove), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemovePrincipalsSender sends the RemovePrincipals request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasesClient) RemovePrincipalsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// RemovePrincipalsResponder handles the response to the RemovePrincipals request. The method always +// closes the http.Response Body. +func (client DatabasesClient) RemovePrincipalsResponder(resp *http.Response) (result DatabasePrincipalListResult, 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 database. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// parameters - the database parameters supplied to the Update operation. +func (client DatabasesClient) Update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters BasicDatabase) (result DatabasesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, databaseName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters BasicDatabase) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + 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.Kusto/clusters/{clusterName}/databases/{databaseName}", 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 DatabasesClient) UpdateSender(req *http.Request) (future DatabasesUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 DatabasesClient) UpdateResponder(resp *http.Response) (result DatabaseModel, 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 +} diff --git a/services/kusto/mgmt/2019-09-07/kusto/dataconnections.go b/services/kusto/mgmt/2019-09-07/kusto/dataconnections.go new file mode 100644 index 000000000000..8e3f1ff254a7 --- /dev/null +++ b/services/kusto/mgmt/2019-09-07/kusto/dataconnections.go @@ -0,0 +1,623 @@ +package kusto + +// 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" +) + +// DataConnectionsClient is the the Azure Kusto management API provides a RESTful set of web services that interact +// with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete +// clusters and databases. +type DataConnectionsClient struct { + BaseClient +} + +// NewDataConnectionsClient creates an instance of the DataConnectionsClient client. +func NewDataConnectionsClient(subscriptionID string) DataConnectionsClient { + return NewDataConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDataConnectionsClientWithBaseURI creates an instance of the DataConnectionsClient client. +func NewDataConnectionsClientWithBaseURI(baseURI string, subscriptionID string) DataConnectionsClient { + return DataConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability checks that the data connection name is valid and is not already in use. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// dataConnectionName - the name of the data connection. +func (client DataConnectionsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName DataConnectionCheckNameRequest) (result CheckNameResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectionsClient.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: dataConnectionName, + Constraints: []validation.Constraint{{Target: "dataConnectionName.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "dataConnectionName.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("kusto.DataConnectionsClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client DataConnectionsClient) CheckNameAvailabilityPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName DataConnectionCheckNameRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + 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.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability", pathParameters), + autorest.WithJSON(dataConnectionName), + 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 DataConnectionsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client DataConnectionsClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameResult, 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 creates or updates a data connection. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// dataConnectionName - the name of the data connection. +// parameters - the data connection parameters supplied to the CreateOrUpdate operation. +func (client DataConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters BasicDataConnection) (result DataConnectionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DataConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters BasicDataConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "dataConnectionName": autorest.Encode("path", dataConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + 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.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}", 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 DataConnectionsClient) CreateOrUpdateSender(req *http.Request) (future DataConnectionsCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 DataConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result DataConnectionModel, 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 +} + +// DataConnectionValidationMethod checks that the data connection parameters are valid. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// parameters - the data connection parameters supplied to the CreateOrUpdate operation. +func (client DataConnectionsClient) DataConnectionValidationMethod(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters DataConnectionValidation) (result DataConnectionValidationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectionsClient.DataConnectionValidationMethod") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DataConnectionValidationMethodPreparer(ctx, resourceGroupName, clusterName, databaseName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "DataConnectionValidationMethod", nil, "Failure preparing request") + return + } + + resp, err := client.DataConnectionValidationMethodSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "DataConnectionValidationMethod", resp, "Failure sending request") + return + } + + result, err = client.DataConnectionValidationMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "DataConnectionValidationMethod", resp, "Failure responding to request") + } + + return +} + +// DataConnectionValidationMethodPreparer prepares the DataConnectionValidationMethod request. +func (client DataConnectionsClient) DataConnectionValidationMethodPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters DataConnectionValidation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + 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.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DataConnectionValidationMethodSender sends the DataConnectionValidationMethod request. The method will close the +// http.Response Body if it receives an error. +func (client DataConnectionsClient) DataConnectionValidationMethodSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DataConnectionValidationMethodResponder handles the response to the DataConnectionValidationMethod request. The method always +// closes the http.Response Body. +func (client DataConnectionsClient) DataConnectionValidationMethodResponder(resp *http.Response) (result DataConnectionValidationListResult, 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 data connection with the given name. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// dataConnectionName - the name of the data connection. +func (client DataConnectionsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string) (result DataConnectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectionsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DataConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "dataConnectionName": autorest.Encode("path", dataConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}", 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 DataConnectionsClient) DeleteSender(req *http.Request) (future DataConnectionsDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 DataConnectionsClient) 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 returns a data connection. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// dataConnectionName - the name of the data connection. +func (client DataConnectionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string) (result DataConnectionModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectionsClient.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, clusterName, databaseName, dataConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DataConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "dataConnectionName": autorest.Encode("path", dataConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}", 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 DataConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DataConnectionsClient) GetResponder(resp *http.Response) (result DataConnectionModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDatabase returns the list of data connections of the given Kusto database. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +func (client DataConnectionsClient) ListByDatabase(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result DataConnectionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectionsClient.ListByDatabase") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, clusterName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "ListByDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "ListByDatabase", resp, "Failure sending request") + return + } + + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "ListByDatabase", resp, "Failure responding to request") + } + + return +} + +// ListByDatabasePreparer prepares the ListByDatabase request. +func (client DataConnectionsClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections", 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 DataConnectionsClient) ListByDatabaseSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDatabaseResponder handles the response to the ListByDatabase request. The method always +// closes the http.Response Body. +func (client DataConnectionsClient) ListByDatabaseResponder(resp *http.Response) (result DataConnectionListResult, 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 data connection. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// dataConnectionName - the name of the data connection. +// parameters - the data connection parameters supplied to the Update operation. +func (client DataConnectionsClient) Update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters BasicDataConnection) (result DataConnectionsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectionsClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DataConnectionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters BasicDataConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "dataConnectionName": autorest.Encode("path", dataConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-07" + 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.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}", 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 DataConnectionsClient) UpdateSender(req *http.Request) (future DataConnectionsUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 DataConnectionsClient) UpdateResponder(resp *http.Response) (result DataConnectionModel, 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 +} diff --git a/services/kusto/mgmt/2019-09-07/kusto/kustoapi/interfaces.go b/services/kusto/mgmt/2019-09-07/kusto/kustoapi/interfaces.go new file mode 100644 index 000000000000..32763ab216ba --- /dev/null +++ b/services/kusto/mgmt/2019-09-07/kusto/kustoapi/interfaces.go @@ -0,0 +1,87 @@ +package kustoapi + +// 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/kusto/mgmt/2019-09-07/kusto" +) + +// ClustersClientAPI contains the set of methods on the ClustersClient type. +type ClustersClientAPI interface { + CheckNameAvailability(ctx context.Context, location string, clusterName kusto.ClusterCheckNameRequest) (result kusto.CheckNameResult, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters kusto.Cluster) (result kusto.ClustersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.ClustersDeleteFuture, err error) + DetachFollowerDatabases(ctx context.Context, resourceGroupName string, clusterName string, followerDatabaseToRemove kusto.FollowerDatabaseDefinition) (result kusto.ClustersDetachFollowerDatabasesFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.Cluster, err error) + List(ctx context.Context) (result kusto.ClusterListResult, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result kusto.ClusterListResult, err error) + ListFollowerDatabases(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.FollowerDatabaseListResult, err error) + ListSkus(ctx context.Context) (result kusto.SkuDescriptionList, err error) + ListSkusByResource(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.ListResourceSkusResult, err error) + Start(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.ClustersStartFuture, err error) + Stop(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.ClustersStopFuture, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, parameters kusto.ClusterUpdate) (result kusto.ClustersUpdateFuture, err error) +} + +var _ ClustersClientAPI = (*kusto.ClustersClient)(nil) + +// DatabasesClientAPI contains the set of methods on the DatabasesClient type. +type DatabasesClientAPI interface { + AddPrincipals(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, databasePrincipalsToAdd kusto.DatabasePrincipalListRequest) (result kusto.DatabasePrincipalListResult, err error) + CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, resourceName kusto.CheckNameRequest) (result kusto.CheckNameResult, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters kusto.BasicDatabase) (result kusto.DatabasesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result kusto.DatabasesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result kusto.DatabaseModel, err error) + ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.DatabaseListResult, err error) + ListPrincipals(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result kusto.DatabasePrincipalListResult, err error) + RemovePrincipals(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, databasePrincipalsToRemove kusto.DatabasePrincipalListRequest) (result kusto.DatabasePrincipalListResult, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters kusto.BasicDatabase) (result kusto.DatabasesUpdateFuture, err error) +} + +var _ DatabasesClientAPI = (*kusto.DatabasesClient)(nil) + +// AttachedDatabaseConfigurationsClientAPI contains the set of methods on the AttachedDatabaseConfigurationsClient type. +type AttachedDatabaseConfigurationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string, parameters kusto.AttachedDatabaseConfiguration) (result kusto.AttachedDatabaseConfigurationsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string) (result kusto.AttachedDatabaseConfigurationsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string) (result kusto.AttachedDatabaseConfiguration, err error) + ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.AttachedDatabaseConfigurationListResult, err error) +} + +var _ AttachedDatabaseConfigurationsClientAPI = (*kusto.AttachedDatabaseConfigurationsClient)(nil) + +// DataConnectionsClientAPI contains the set of methods on the DataConnectionsClient type. +type DataConnectionsClientAPI interface { + CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName kusto.DataConnectionCheckNameRequest) (result kusto.CheckNameResult, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters kusto.BasicDataConnection) (result kusto.DataConnectionsCreateOrUpdateFuture, err error) + DataConnectionValidationMethod(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters kusto.DataConnectionValidation) (result kusto.DataConnectionValidationListResult, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string) (result kusto.DataConnectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string) (result kusto.DataConnectionModel, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result kusto.DataConnectionListResult, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters kusto.BasicDataConnection) (result kusto.DataConnectionsUpdateFuture, err error) +} + +var _ DataConnectionsClientAPI = (*kusto.DataConnectionsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result kusto.OperationListResultPage, err error) +} + +var _ OperationsClientAPI = (*kusto.OperationsClient)(nil) diff --git a/services/kusto/mgmt/2019-09-07/kusto/models.go b/services/kusto/mgmt/2019-09-07/kusto/models.go new file mode 100644 index 000000000000..982aec753533 --- /dev/null +++ b/services/kusto/mgmt/2019-09-07/kusto/models.go @@ -0,0 +1,2634 @@ +package kusto + +// 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/kusto/mgmt/2019-09-07/kusto" + +// AzureScaleType enumerates the values for azure scale type. +type AzureScaleType string + +const ( + // Automatic ... + Automatic AzureScaleType = "automatic" + // Manual ... + Manual AzureScaleType = "manual" + // None ... + None AzureScaleType = "none" +) + +// PossibleAzureScaleTypeValues returns an array of possible values for the AzureScaleType const type. +func PossibleAzureScaleTypeValues() []AzureScaleType { + return []AzureScaleType{Automatic, Manual, None} +} + +// AzureSkuName enumerates the values for azure sku name. +type AzureSkuName string + +const ( + // DevNoSLAStandardD11V2 ... + DevNoSLAStandardD11V2 AzureSkuName = "Dev(No SLA)_Standard_D11_v2" + // StandardD11V2 ... + StandardD11V2 AzureSkuName = "Standard_D11_v2" + // StandardD12V2 ... + StandardD12V2 AzureSkuName = "Standard_D12_v2" + // StandardD13V2 ... + StandardD13V2 AzureSkuName = "Standard_D13_v2" + // StandardD14V2 ... + StandardD14V2 AzureSkuName = "Standard_D14_v2" + // StandardDS13V21TBPS ... + StandardDS13V21TBPS AzureSkuName = "Standard_DS13_v2+1TB_PS" + // StandardDS13V22TBPS ... + StandardDS13V22TBPS AzureSkuName = "Standard_DS13_v2+2TB_PS" + // StandardDS14V23TBPS ... + StandardDS14V23TBPS AzureSkuName = "Standard_DS14_v2+3TB_PS" + // StandardDS14V24TBPS ... + StandardDS14V24TBPS AzureSkuName = "Standard_DS14_v2+4TB_PS" + // StandardL16s ... + StandardL16s AzureSkuName = "Standard_L16s" + // StandardL4s ... + StandardL4s AzureSkuName = "Standard_L4s" + // StandardL8s ... + StandardL8s AzureSkuName = "Standard_L8s" +) + +// PossibleAzureSkuNameValues returns an array of possible values for the AzureSkuName const type. +func PossibleAzureSkuNameValues() []AzureSkuName { + return []AzureSkuName{DevNoSLAStandardD11V2, StandardD11V2, StandardD12V2, StandardD13V2, StandardD14V2, StandardDS13V21TBPS, StandardDS13V22TBPS, StandardDS14V23TBPS, StandardDS14V24TBPS, StandardL16s, StandardL4s, StandardL8s} +} + +// AzureSkuTier enumerates the values for azure sku tier. +type AzureSkuTier string + +const ( + // Basic ... + Basic AzureSkuTier = "Basic" + // Standard ... + Standard AzureSkuTier = "Standard" +) + +// PossibleAzureSkuTierValues returns an array of possible values for the AzureSkuTier const type. +func PossibleAzureSkuTierValues() []AzureSkuTier { + return []AzureSkuTier{Basic, Standard} +} + +// DatabasePrincipalRole enumerates the values for database principal role. +type DatabasePrincipalRole string + +const ( + // Admin ... + Admin DatabasePrincipalRole = "Admin" + // Ingestor ... + Ingestor DatabasePrincipalRole = "Ingestor" + // Monitor ... + Monitor DatabasePrincipalRole = "Monitor" + // UnrestrictedViewers ... + UnrestrictedViewers DatabasePrincipalRole = "UnrestrictedViewers" + // User ... + User DatabasePrincipalRole = "User" + // Viewer ... + Viewer DatabasePrincipalRole = "Viewer" +) + +// PossibleDatabasePrincipalRoleValues returns an array of possible values for the DatabasePrincipalRole const type. +func PossibleDatabasePrincipalRoleValues() []DatabasePrincipalRole { + return []DatabasePrincipalRole{Admin, Ingestor, Monitor, UnrestrictedViewers, User, Viewer} +} + +// DatabasePrincipalType enumerates the values for database principal type. +type DatabasePrincipalType string + +const ( + // DatabasePrincipalTypeApp ... + DatabasePrincipalTypeApp DatabasePrincipalType = "App" + // DatabasePrincipalTypeGroup ... + DatabasePrincipalTypeGroup DatabasePrincipalType = "Group" + // DatabasePrincipalTypeUser ... + DatabasePrincipalTypeUser DatabasePrincipalType = "User" +) + +// PossibleDatabasePrincipalTypeValues returns an array of possible values for the DatabasePrincipalType const type. +func PossibleDatabasePrincipalTypeValues() []DatabasePrincipalType { + return []DatabasePrincipalType{DatabasePrincipalTypeApp, DatabasePrincipalTypeGroup, DatabasePrincipalTypeUser} +} + +// DataFormat enumerates the values for data format. +type DataFormat string + +const ( + // AVRO ... + AVRO DataFormat = "AVRO" + // CSV ... + CSV DataFormat = "CSV" + // JSON ... + JSON DataFormat = "JSON" + // MULTIJSON ... + MULTIJSON DataFormat = "MULTIJSON" + // PSV ... + PSV DataFormat = "PSV" + // RAW ... + RAW DataFormat = "RAW" + // SCSV ... + SCSV DataFormat = "SCSV" + // SINGLEJSON ... + SINGLEJSON DataFormat = "SINGLEJSON" + // SOHSV ... + SOHSV DataFormat = "SOHSV" + // TSV ... + TSV DataFormat = "TSV" + // TSVE ... + TSVE DataFormat = "TSVE" + // TXT ... + TXT DataFormat = "TXT" +) + +// PossibleDataFormatValues returns an array of possible values for the DataFormat const type. +func PossibleDataFormatValues() []DataFormat { + return []DataFormat{AVRO, CSV, JSON, MULTIJSON, PSV, RAW, SCSV, SINGLEJSON, SOHSV, TSV, TSVE, TXT} +} + +// DefaultPrincipalsModificationKind enumerates the values for default principals modification kind. +type DefaultPrincipalsModificationKind string + +const ( + // DefaultPrincipalsModificationKindNone ... + DefaultPrincipalsModificationKindNone DefaultPrincipalsModificationKind = "None" + // DefaultPrincipalsModificationKindReplace ... + DefaultPrincipalsModificationKindReplace DefaultPrincipalsModificationKind = "Replace" + // DefaultPrincipalsModificationKindUnion ... + DefaultPrincipalsModificationKindUnion DefaultPrincipalsModificationKind = "Union" +) + +// PossibleDefaultPrincipalsModificationKindValues returns an array of possible values for the DefaultPrincipalsModificationKind const type. +func PossibleDefaultPrincipalsModificationKindValues() []DefaultPrincipalsModificationKind { + return []DefaultPrincipalsModificationKind{DefaultPrincipalsModificationKindNone, DefaultPrincipalsModificationKindReplace, DefaultPrincipalsModificationKindUnion} +} + +// IdentityType enumerates the values for identity type. +type IdentityType string + +const ( + // IdentityTypeNone ... + IdentityTypeNone IdentityType = "None" + // IdentityTypeSystemAssigned ... + IdentityTypeSystemAssigned IdentityType = "SystemAssigned" +) + +// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. +func PossibleIdentityTypeValues() []IdentityType { + return []IdentityType{IdentityTypeNone, IdentityTypeSystemAssigned} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindDatabase ... + KindDatabase Kind = "Database" + // KindReadOnlyFollowing ... + KindReadOnlyFollowing Kind = "ReadOnlyFollowing" + // KindReadWrite ... + KindReadWrite Kind = "ReadWrite" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindDatabase, KindReadOnlyFollowing, KindReadWrite} +} + +// KindBasicDataConnection enumerates the values for kind basic data connection. +type KindBasicDataConnection string + +const ( + // KindDataConnection ... + KindDataConnection KindBasicDataConnection = "DataConnection" + // KindEventGrid ... + KindEventGrid KindBasicDataConnection = "EventGrid" + // KindEventHub ... + KindEventHub KindBasicDataConnection = "EventHub" + // KindIotHub ... + KindIotHub KindBasicDataConnection = "IotHub" +) + +// PossibleKindBasicDataConnectionValues returns an array of possible values for the KindBasicDataConnection const type. +func PossibleKindBasicDataConnectionValues() []KindBasicDataConnection { + return []KindBasicDataConnection{KindDataConnection, KindEventGrid, KindEventHub, KindIotHub} +} + +// PrincipalsModificationKind enumerates the values for principals modification kind. +type PrincipalsModificationKind string + +const ( + // PrincipalsModificationKindNone ... + PrincipalsModificationKindNone PrincipalsModificationKind = "None" + // PrincipalsModificationKindReplace ... + PrincipalsModificationKindReplace PrincipalsModificationKind = "Replace" + // PrincipalsModificationKindUnion ... + PrincipalsModificationKindUnion PrincipalsModificationKind = "Union" +) + +// PossiblePrincipalsModificationKindValues returns an array of possible values for the PrincipalsModificationKind const type. +func PossiblePrincipalsModificationKindValues() []PrincipalsModificationKind { + return []PrincipalsModificationKind{PrincipalsModificationKindNone, PrincipalsModificationKindReplace, PrincipalsModificationKindUnion} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Creating ... + Creating ProvisioningState = "Creating" + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Moving ... + Moving ProvisioningState = "Moving" + // Running ... + Running ProvisioningState = "Running" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Creating, Deleting, Failed, Moving, Running, Succeeded} +} + +// Reason enumerates the values for reason. +type Reason string + +const ( + // AlreadyExists ... + AlreadyExists Reason = "AlreadyExists" + // Invalid ... + Invalid Reason = "Invalid" +) + +// PossibleReasonValues returns an array of possible values for the Reason const type. +func PossibleReasonValues() []Reason { + return []Reason{AlreadyExists, Invalid} +} + +// State enumerates the values for state. +type State string + +const ( + // StateCreating ... + StateCreating State = "Creating" + // StateDeleted ... + StateDeleted State = "Deleted" + // StateDeleting ... + StateDeleting State = "Deleting" + // StateRunning ... + StateRunning State = "Running" + // StateStarting ... + StateStarting State = "Starting" + // StateStopped ... + StateStopped State = "Stopped" + // StateStopping ... + StateStopping State = "Stopping" + // StateUnavailable ... + StateUnavailable State = "Unavailable" + // StateUpdating ... + StateUpdating State = "Updating" +) + +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{StateCreating, StateDeleted, StateDeleting, StateRunning, StateStarting, StateStopped, StateStopping, StateUnavailable, StateUpdating} +} + +// Type enumerates the values for type. +type Type string + +const ( + // MicrosoftKustoclustersattachedDatabaseConfigurations ... + MicrosoftKustoclustersattachedDatabaseConfigurations Type = "Microsoft.Kusto/clusters/attachedDatabaseConfigurations" + // MicrosoftKustoclustersdatabases ... + MicrosoftKustoclustersdatabases Type = "Microsoft.Kusto/clusters/databases" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{MicrosoftKustoclustersattachedDatabaseConfigurations, MicrosoftKustoclustersdatabases} +} + +// AttachedDatabaseConfiguration class representing an attached database configuration. +type AttachedDatabaseConfiguration struct { + autorest.Response `json:"-"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // AttachedDatabaseConfigurationProperties - The properties of the attached database configuration. + *AttachedDatabaseConfigurationProperties `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 AttachedDatabaseConfiguration. +func (adc AttachedDatabaseConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if adc.Location != nil { + objectMap["location"] = adc.Location + } + if adc.AttachedDatabaseConfigurationProperties != nil { + objectMap["properties"] = adc.AttachedDatabaseConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AttachedDatabaseConfiguration struct. +func (adc *AttachedDatabaseConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + adc.Location = &location + } + case "properties": + if v != nil { + var attachedDatabaseConfigurationProperties AttachedDatabaseConfigurationProperties + err = json.Unmarshal(*v, &attachedDatabaseConfigurationProperties) + if err != nil { + return err + } + adc.AttachedDatabaseConfigurationProperties = &attachedDatabaseConfigurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + adc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + adc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + adc.Type = &typeVar + } + } + } + + return nil +} + +// AttachedDatabaseConfigurationListResult the list attached database configurations operation response. +type AttachedDatabaseConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - The list of attached database configurations. + Value *[]AttachedDatabaseConfiguration `json:"value,omitempty"` +} + +// AttachedDatabaseConfigurationProperties class representing the an attached database configuration +// properties of kind specific. +type AttachedDatabaseConfigurationProperties struct { + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // DatabaseName - The name of the database which you would like to attach, use * if you want to follow all current and future databases. + DatabaseName *string `json:"databaseName,omitempty"` + // ClusterResourceID - The resource id of the cluster where the databases you would like to attach reside. + ClusterResourceID *string `json:"clusterResourceId,omitempty"` + // AttachedDatabaseNames - READ-ONLY; The list of databases from the clusterResourceId which are currently attached to the cluster. + AttachedDatabaseNames *[]string `json:"attachedDatabaseNames,omitempty"` + // DefaultPrincipalsModificationKind - The default principals modification kind. Possible values include: 'DefaultPrincipalsModificationKindUnion', 'DefaultPrincipalsModificationKindReplace', 'DefaultPrincipalsModificationKindNone' + DefaultPrincipalsModificationKind DefaultPrincipalsModificationKind `json:"defaultPrincipalsModificationKind,omitempty"` +} + +// AttachedDatabaseConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type AttachedDatabaseConfigurationsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AttachedDatabaseConfigurationsCreateOrUpdateFuture) Result(client AttachedDatabaseConfigurationsClient) (adc AttachedDatabaseConfiguration, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("kusto.AttachedDatabaseConfigurationsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if adc.Response.Response, err = future.GetResult(sender); err == nil && adc.Response.Response.StatusCode != http.StatusNoContent { + adc, err = client.CreateOrUpdateResponder(adc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsCreateOrUpdateFuture", "Result", adc.Response.Response, "Failure responding to request") + } + } + return +} + +// AttachedDatabaseConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AttachedDatabaseConfigurationsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AttachedDatabaseConfigurationsDeleteFuture) Result(client AttachedDatabaseConfigurationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("kusto.AttachedDatabaseConfigurationsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// AzureCapacity azure capacity definition. +type AzureCapacity struct { + // ScaleType - Scale type. Possible values include: 'Automatic', 'Manual', 'None' + ScaleType AzureScaleType `json:"scaleType,omitempty"` + // Minimum - Minimum allowed capacity. + Minimum *int32 `json:"minimum,omitempty"` + // Maximum - Maximum allowed capacity. + Maximum *int32 `json:"maximum,omitempty"` + // Default - The default capacity that would be used. + Default *int32 `json:"default,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"` +} + +// AzureResourceSku azure resource SKU definition. +type AzureResourceSku struct { + // ResourceType - Resource Namespace and Type. + ResourceType *string `json:"resourceType,omitempty"` + // Sku - The SKU details. + Sku *AzureSku `json:"sku,omitempty"` + // Capacity - The number of instances of the cluster. + Capacity *AzureCapacity `json:"capacity,omitempty"` +} + +// AzureSku azure SKU definition. +type AzureSku struct { + // Name - SKU name. Possible values include: 'StandardDS13V21TBPS', 'StandardDS13V22TBPS', 'StandardDS14V23TBPS', 'StandardDS14V24TBPS', 'StandardD13V2', 'StandardD14V2', 'StandardL8s', 'StandardL16s', 'StandardD11V2', 'StandardD12V2', 'StandardL4s', 'DevNoSLAStandardD11V2' + Name AzureSkuName `json:"name,omitempty"` + // Capacity - The number of instances of the cluster. + Capacity *int32 `json:"capacity,omitempty"` + // Tier - SKU tier. Possible values include: 'Basic', 'Standard' + Tier AzureSkuTier `json:"tier,omitempty"` +} + +// CheckNameRequest the result returned from a database check name availability request. +type CheckNameRequest struct { + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - The type of resource, for instance Microsoft.Kusto/clusters/databases. Possible values include: 'MicrosoftKustoclustersdatabases', 'MicrosoftKustoclustersattachedDatabaseConfigurations' + Type Type `json:"type,omitempty"` +} + +// CheckNameResult the result returned from a check name availability request. +type CheckNameResult struct { + autorest.Response `json:"-"` + // NameAvailable - Specifies a Boolean value that indicates if the name is available. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Name - The name that was checked. + Name *string `json:"name,omitempty"` + // Message - Message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated. + Message *string `json:"message,omitempty"` + // Reason - Message providing the reason why the given name is invalid. Possible values include: 'Invalid', 'AlreadyExists' + Reason Reason `json:"reason,omitempty"` +} + +// CloudError an error response from Kusto. +type CloudError struct { + // Error - An error response from Kusto. + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from Kusto. +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"` +} + +// Cluster class representing a Kusto cluster. +type Cluster struct { + autorest.Response `json:"-"` + // Sku - The SKU of the cluster. + Sku *AzureSku `json:"sku,omitempty"` + // Zones - The availability zones of the cluster. + Zones *[]string `json:"zones,omitempty"` + // Identity - The identity of the cluster, if configured. + Identity *Identity `json:"identity,omitempty"` + // ClusterProperties - The 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.Sku != nil { + objectMap["sku"] = c.Sku + } + if c.Zones != nil { + objectMap["zones"] = c.Zones + } + if c.Identity != nil { + objectMap["identity"] = c.Identity + } + 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 "sku": + if v != nil { + var sku AzureSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + c.Sku = &sku + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + c.Zones = &zones + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + c.Identity = &identity + } + 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 +} + +// ClusterCheckNameRequest the result returned from a cluster check name availability request. +type ClusterCheckNameRequest struct { + // Name - Cluster name. + Name *string `json:"name,omitempty"` + // Type - The type of resource, Microsoft.Kusto/clusters. + Type *string `json:"type,omitempty"` +} + +// ClusterListResult the list Kusto clusters operation response. +type ClusterListResult struct { + autorest.Response `json:"-"` + // Value - The list of Kusto clusters. + Value *[]Cluster `json:"value,omitempty"` +} + +// ClusterProperties class representing the Kusto cluster properties. +type ClusterProperties struct { + // State - READ-ONLY; The state of the resource. Possible values include: 'StateCreating', 'StateUnavailable', 'StateRunning', 'StateDeleting', 'StateDeleted', 'StateStopping', 'StateStopped', 'StateStarting', 'StateUpdating' + State State `json:"state,omitempty"` + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // URI - READ-ONLY; The cluster URI. + URI *string `json:"uri,omitempty"` + // DataIngestionURI - READ-ONLY; The cluster data ingestion URI. + DataIngestionURI *string `json:"dataIngestionUri,omitempty"` + // TrustedExternalTenants - The cluster's external tenants. + TrustedExternalTenants *[]TrustedExternalTenant `json:"trustedExternalTenants,omitempty"` + // OptimizedAutoscale - Optimized auto scale definition. + OptimizedAutoscale *OptimizedAutoscale `json:"optimizedAutoscale,omitempty"` + // EnableDiskEncryption - A boolean value that indicates if the cluster's disks are encrypted. + EnableDiskEncryption *bool `json:"enableDiskEncryption,omitempty"` + // EnableStreamingIngest - A boolean value that indicates if the streaming ingest is enabled. + EnableStreamingIngest *bool `json:"enableStreamingIngest,omitempty"` + // VirtualNetworkConfiguration - Virtual network definition. + VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` + // KeyVaultProperties - KeyVault properties for the cluster encryption. + 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, "kusto.ClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("kusto.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, "kusto.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, "kusto.ClustersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("kusto.ClustersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ClustersDetachFollowerDatabasesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ClustersDetachFollowerDatabasesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ClustersDetachFollowerDatabasesFuture) 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, "kusto.ClustersDetachFollowerDatabasesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("kusto.ClustersDetachFollowerDatabasesFuture") + return + } + ar.Response = future.Response() + return +} + +// ClustersStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ClustersStartFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ClustersStartFuture) 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, "kusto.ClustersStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("kusto.ClustersStartFuture") + return + } + ar.Response = future.Response() + return +} + +// ClustersStopFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ClustersStopFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ClustersStopFuture) 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, "kusto.ClustersStopFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("kusto.ClustersStopFuture") + return + } + ar.Response = future.Response() + return +} + +// ClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ClustersUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ClustersUpdateFuture) Result(client ClustersClient) (c Cluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("kusto.ClustersUpdateFuture") + 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.UpdateResponder(c.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersUpdateFuture", "Result", c.Response.Response, "Failure responding to request") + } + } + return +} + +// ClusterUpdate class representing an update to a Kusto cluster. +type ClusterUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Sku - The SKU of the cluster. + Sku *AzureSku `json:"sku,omitempty"` + // Identity - The identity of the cluster, if configured. + Identity *Identity `json:"identity,omitempty"` + // ClusterProperties - The cluster properties. + *ClusterProperties `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 ClusterUpdate. +func (cu ClusterUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cu.Tags != nil { + objectMap["tags"] = cu.Tags + } + if cu.Location != nil { + objectMap["location"] = cu.Location + } + if cu.Sku != nil { + objectMap["sku"] = cu.Sku + } + if cu.Identity != nil { + objectMap["identity"] = cu.Identity + } + if cu.ClusterProperties != nil { + objectMap["properties"] = cu.ClusterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ClusterUpdate struct. +func (cu *ClusterUpdate) UnmarshalJSON(body []byte) error { + 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 + } + cu.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cu.Location = &location + } + case "sku": + if v != nil { + var sku AzureSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + cu.Sku = &sku + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + cu.Identity = &identity + } + case "properties": + if v != nil { + var clusterProperties ClusterProperties + err = json.Unmarshal(*v, &clusterProperties) + if err != nil { + return err + } + cu.ClusterProperties = &clusterProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cu.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cu.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cu.Type = &typeVar + } + } + } + + return nil +} + +// BasicDatabase class representing a Kusto database. +type BasicDatabase interface { + AsReadWriteDatabase() (*ReadWriteDatabase, bool) + AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) + AsDatabase() (*Database, bool) +} + +// Database class representing a Kusto database. +type Database struct { + autorest.Response `json:"-"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +func unmarshalBasicDatabase(body []byte) (BasicDatabase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindReadWrite): + var rwd ReadWriteDatabase + err := json.Unmarshal(body, &rwd) + return rwd, err + case string(KindReadOnlyFollowing): + var rofd ReadOnlyFollowingDatabase + err := json.Unmarshal(body, &rofd) + return rofd, err + default: + var d Database + err := json.Unmarshal(body, &d) + return d, err + } +} +func unmarshalBasicDatabaseArray(body []byte) ([]BasicDatabase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dArray := make([]BasicDatabase, len(rawMessages)) + + for index, rawMessage := range rawMessages { + d, err := unmarshalBasicDatabase(*rawMessage) + if err != nil { + return nil, err + } + dArray[index] = d + } + return dArray, nil +} + +// MarshalJSON is the custom marshaler for Database. +func (d Database) MarshalJSON() ([]byte, error) { + d.Kind = KindDatabase + objectMap := make(map[string]interface{}) + if d.Location != nil { + objectMap["location"] = d.Location + } + if d.Kind != "" { + objectMap["kind"] = d.Kind + } + return json.Marshal(objectMap) +} + +// AsReadWriteDatabase is the BasicDatabase implementation for Database. +func (d Database) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { + return nil, false +} + +// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for Database. +func (d Database) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { + return nil, false +} + +// AsDatabase is the BasicDatabase implementation for Database. +func (d Database) AsDatabase() (*Database, bool) { + return &d, true +} + +// AsBasicDatabase is the BasicDatabase implementation for Database. +func (d Database) AsBasicDatabase() (BasicDatabase, bool) { + return &d, true +} + +// DatabaseListResult the list Kusto databases operation response. +type DatabaseListResult struct { + autorest.Response `json:"-"` + // Value - The list of Kusto databases. + Value *[]BasicDatabase `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseListResult struct. +func (dlr *DatabaseListResult) UnmarshalJSON(body []byte) error { + 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 := unmarshalBasicDatabaseArray(*v) + if err != nil { + return err + } + dlr.Value = &value + } + } + } + + return nil +} + +// DatabaseModel ... +type DatabaseModel struct { + autorest.Response `json:"-"` + Value BasicDatabase `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseModel struct. +func (dm *DatabaseModel) UnmarshalJSON(body []byte) error { + d, err := unmarshalBasicDatabase(body) + if err != nil { + return err + } + dm.Value = d + + return nil +} + +// DatabasePrincipal a class representing database principal entity. +type DatabasePrincipal struct { + // Role - Database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer' + Role DatabasePrincipalRole `json:"role,omitempty"` + // Name - Database principal name. + Name *string `json:"name,omitempty"` + // Type - Database principal type. Possible values include: 'DatabasePrincipalTypeApp', 'DatabasePrincipalTypeGroup', 'DatabasePrincipalTypeUser' + Type DatabasePrincipalType `json:"type,omitempty"` + // Fqn - Database principal fully qualified name. + Fqn *string `json:"fqn,omitempty"` + // Email - Database principal email if exists. + Email *string `json:"email,omitempty"` + // AppID - Application id - relevant only for application principal type. + AppID *string `json:"appId,omitempty"` + // TenantName - READ-ONLY; The tenant name of the principal + TenantName *string `json:"tenantName,omitempty"` +} + +// DatabasePrincipalListRequest the list Kusto database principals operation request. +type DatabasePrincipalListRequest struct { + // Value - The list of Kusto database principals. + Value *[]DatabasePrincipal `json:"value,omitempty"` +} + +// DatabasePrincipalListResult the list Kusto database principals operation response. +type DatabasePrincipalListResult struct { + autorest.Response `json:"-"` + // Value - The list of Kusto database principals. + Value *[]DatabasePrincipal `json:"value,omitempty"` +} + +// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DatabasesCreateOrUpdateFuture) Result(client DatabasesClient) (dm DatabaseModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("kusto.DatabasesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dm.Response.Response, err = future.GetResult(sender); err == nil && dm.Response.Response.StatusCode != http.StatusNoContent { + dm, err = client.CreateOrUpdateResponder(dm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesCreateOrUpdateFuture", "Result", dm.Response.Response, "Failure responding to request") + } + } + return +} + +// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DatabasesDeleteFuture) Result(client DatabasesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("kusto.DatabasesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DatabaseStatistics a class that contains database statistics information. +type DatabaseStatistics struct { + // Size - The database size - the total size of compressed data and index in bytes. + Size *float64 `json:"size,omitempty"` +} + +// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DatabasesUpdateFuture) Result(client DatabasesClient) (dm DatabaseModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("kusto.DatabasesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dm.Response.Response, err = future.GetResult(sender); err == nil && dm.Response.Response.StatusCode != http.StatusNoContent { + dm, err = client.UpdateResponder(dm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesUpdateFuture", "Result", dm.Response.Response, "Failure responding to request") + } + } + return +} + +// BasicDataConnection class representing an data connection. +type BasicDataConnection interface { + AsEventHubDataConnection() (*EventHubDataConnection, bool) + AsIotHubDataConnection() (*IotHubDataConnection, bool) + AsEventGridDataConnection() (*EventGridDataConnection, bool) + AsDataConnection() (*DataConnection, bool) +} + +// DataConnection class representing an data connection. +type DataConnection struct { + autorest.Response `json:"-"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' + Kind KindBasicDataConnection `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +func unmarshalBasicDataConnection(body []byte) (BasicDataConnection, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindEventHub): + var ehdc EventHubDataConnection + err := json.Unmarshal(body, &ehdc) + return ehdc, err + case string(KindIotHub): + var ihdc IotHubDataConnection + err := json.Unmarshal(body, &ihdc) + return ihdc, err + case string(KindEventGrid): + var egdc EventGridDataConnection + err := json.Unmarshal(body, &egdc) + return egdc, err + default: + var dc DataConnection + err := json.Unmarshal(body, &dc) + return dc, err + } +} +func unmarshalBasicDataConnectionArray(body []byte) ([]BasicDataConnection, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dcArray := make([]BasicDataConnection, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dc, err := unmarshalBasicDataConnection(*rawMessage) + if err != nil { + return nil, err + } + dcArray[index] = dc + } + return dcArray, nil +} + +// MarshalJSON is the custom marshaler for DataConnection. +func (dc DataConnection) MarshalJSON() ([]byte, error) { + dc.Kind = KindDataConnection + objectMap := make(map[string]interface{}) + if dc.Location != nil { + objectMap["location"] = dc.Location + } + if dc.Kind != "" { + objectMap["kind"] = dc.Kind + } + return json.Marshal(objectMap) +} + +// AsEventHubDataConnection is the BasicDataConnection implementation for DataConnection. +func (dc DataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { + return nil, false +} + +// AsIotHubDataConnection is the BasicDataConnection implementation for DataConnection. +func (dc DataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { + return nil, false +} + +// AsEventGridDataConnection is the BasicDataConnection implementation for DataConnection. +func (dc DataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { + return nil, false +} + +// AsDataConnection is the BasicDataConnection implementation for DataConnection. +func (dc DataConnection) AsDataConnection() (*DataConnection, bool) { + return &dc, true +} + +// AsBasicDataConnection is the BasicDataConnection implementation for DataConnection. +func (dc DataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { + return &dc, true +} + +// DataConnectionCheckNameRequest the result returned from a data connections check name availability +// request. +type DataConnectionCheckNameRequest struct { + // Name - Data Connection name. + Name *string `json:"name,omitempty"` + // Type - The type of resource, Microsoft.Kusto/clusters/databases/dataConnections. + Type *string `json:"type,omitempty"` +} + +// DataConnectionListResult the list Kusto data connections operation response. +type DataConnectionListResult struct { + autorest.Response `json:"-"` + // Value - The list of Kusto data connections. + Value *[]BasicDataConnection `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataConnectionListResult struct. +func (dclr *DataConnectionListResult) UnmarshalJSON(body []byte) error { + 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 := unmarshalBasicDataConnectionArray(*v) + if err != nil { + return err + } + dclr.Value = &value + } + } + } + + return nil +} + +// DataConnectionModel ... +type DataConnectionModel struct { + autorest.Response `json:"-"` + Value BasicDataConnection `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataConnectionModel struct. +func (dcm *DataConnectionModel) UnmarshalJSON(body []byte) error { + dc, err := unmarshalBasicDataConnection(body) + if err != nil { + return err + } + dcm.Value = dc + + return nil +} + +// DataConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DataConnectionsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DataConnectionsCreateOrUpdateFuture) Result(client DataConnectionsClient) (dcm DataConnectionModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dcm.Response.Response, err = future.GetResult(sender); err == nil && dcm.Response.Response.StatusCode != http.StatusNoContent { + dcm, err = client.CreateOrUpdateResponder(dcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsCreateOrUpdateFuture", "Result", dcm.Response.Response, "Failure responding to request") + } + } + return +} + +// DataConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DataConnectionsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DataConnectionsDeleteFuture) Result(client DataConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DataConnectionsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DataConnectionsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DataConnectionsUpdateFuture) Result(client DataConnectionsClient) (dcm DataConnectionModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dcm.Response.Response, err = future.GetResult(sender); err == nil && dcm.Response.Response.StatusCode != http.StatusNoContent { + dcm, err = client.UpdateResponder(dcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsUpdateFuture", "Result", dcm.Response.Response, "Failure responding to request") + } + } + return +} + +// DataConnectionValidation class representing an data connection validation. +type DataConnectionValidation struct { + // DataConnectionName - The name of the data connection. + DataConnectionName *string `json:"dataConnectionName,omitempty"` + // Properties - The data connection properties to validate. + Properties BasicDataConnection `json:"properties,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataConnectionValidation struct. +func (dcv *DataConnectionValidation) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "dataConnectionName": + if v != nil { + var dataConnectionName string + err = json.Unmarshal(*v, &dataConnectionName) + if err != nil { + return err + } + dcv.DataConnectionName = &dataConnectionName + } + case "properties": + if v != nil { + properties, err := unmarshalBasicDataConnection(*v) + if err != nil { + return err + } + dcv.Properties = properties + } + } + } + + return nil +} + +// DataConnectionValidationListResult the list Kusto data connection validation result. +type DataConnectionValidationListResult struct { + autorest.Response `json:"-"` + // Value - The list of Kusto data connection validation errors. + Value *[]DataConnectionValidationResult `json:"value,omitempty"` +} + +// DataConnectionValidationResult the result returned from a data connection validation request. +type DataConnectionValidationResult struct { + // ErrorMessage - A message which indicates a problem in data connection validation. + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// EventGridConnectionProperties class representing the Kusto event grid connection properties. +type EventGridConnectionProperties struct { + // StorageAccountResourceID - The resource ID of the storage account where the data resides. + StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` + // EventHubResourceID - The resource ID where the event grid is configured to send events. + EventHubResourceID *string `json:"eventHubResourceId,omitempty"` + // ConsumerGroup - The event hub consumer group. + ConsumerGroup *string `json:"consumerGroup,omitempty"` + // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. + TableName *string `json:"tableName,omitempty"` + // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + MappingRuleName *string `json:"mappingRuleName,omitempty"` + // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE' + DataFormat DataFormat `json:"dataFormat,omitempty"` +} + +// EventGridDataConnection class representing an Event Grid data connection. +type EventGridDataConnection struct { + // EventGridConnectionProperties - The properties of the Event Grid data connection. + *EventGridConnectionProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' + Kind KindBasicDataConnection `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventGridDataConnection. +func (egdc EventGridDataConnection) MarshalJSON() ([]byte, error) { + egdc.Kind = KindEventGrid + objectMap := make(map[string]interface{}) + if egdc.EventGridConnectionProperties != nil { + objectMap["properties"] = egdc.EventGridConnectionProperties + } + if egdc.Location != nil { + objectMap["location"] = egdc.Location + } + if egdc.Kind != "" { + objectMap["kind"] = egdc.Kind + } + return json.Marshal(objectMap) +} + +// AsEventHubDataConnection is the BasicDataConnection implementation for EventGridDataConnection. +func (egdc EventGridDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { + return nil, false +} + +// AsIotHubDataConnection is the BasicDataConnection implementation for EventGridDataConnection. +func (egdc EventGridDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { + return nil, false +} + +// AsEventGridDataConnection is the BasicDataConnection implementation for EventGridDataConnection. +func (egdc EventGridDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { + return &egdc, true +} + +// AsDataConnection is the BasicDataConnection implementation for EventGridDataConnection. +func (egdc EventGridDataConnection) AsDataConnection() (*DataConnection, bool) { + return nil, false +} + +// AsBasicDataConnection is the BasicDataConnection implementation for EventGridDataConnection. +func (egdc EventGridDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { + return &egdc, true +} + +// UnmarshalJSON is the custom unmarshaler for EventGridDataConnection struct. +func (egdc *EventGridDataConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var eventGridConnectionProperties EventGridConnectionProperties + err = json.Unmarshal(*v, &eventGridConnectionProperties) + if err != nil { + return err + } + egdc.EventGridConnectionProperties = &eventGridConnectionProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + egdc.Location = &location + } + case "kind": + if v != nil { + var kind KindBasicDataConnection + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + egdc.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + egdc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + egdc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + egdc.Type = &typeVar + } + } + } + + return nil +} + +// EventHubConnectionProperties class representing the Kusto event hub connection properties. +type EventHubConnectionProperties struct { + // EventHubResourceID - The resource ID of the event hub to be used to create a data connection. + EventHubResourceID *string `json:"eventHubResourceId,omitempty"` + // ConsumerGroup - The event hub consumer group. + ConsumerGroup *string `json:"consumerGroup,omitempty"` + // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. + TableName *string `json:"tableName,omitempty"` + // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + MappingRuleName *string `json:"mappingRuleName,omitempty"` + // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE' + DataFormat DataFormat `json:"dataFormat,omitempty"` + // EventSystemProperties - System properties of the event hub + EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"` +} + +// EventHubDataConnection class representing an event hub data connection. +type EventHubDataConnection struct { + // EventHubConnectionProperties - The Event Hub data connection properties to validate. + *EventHubConnectionProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' + Kind KindBasicDataConnection `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventHubDataConnection. +func (ehdc EventHubDataConnection) MarshalJSON() ([]byte, error) { + ehdc.Kind = KindEventHub + objectMap := make(map[string]interface{}) + if ehdc.EventHubConnectionProperties != nil { + objectMap["properties"] = ehdc.EventHubConnectionProperties + } + if ehdc.Location != nil { + objectMap["location"] = ehdc.Location + } + if ehdc.Kind != "" { + objectMap["kind"] = ehdc.Kind + } + return json.Marshal(objectMap) +} + +// AsEventHubDataConnection is the BasicDataConnection implementation for EventHubDataConnection. +func (ehdc EventHubDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { + return &ehdc, true +} + +// AsIotHubDataConnection is the BasicDataConnection implementation for EventHubDataConnection. +func (ehdc EventHubDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { + return nil, false +} + +// AsEventGridDataConnection is the BasicDataConnection implementation for EventHubDataConnection. +func (ehdc EventHubDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { + return nil, false +} + +// AsDataConnection is the BasicDataConnection implementation for EventHubDataConnection. +func (ehdc EventHubDataConnection) AsDataConnection() (*DataConnection, bool) { + return nil, false +} + +// AsBasicDataConnection is the BasicDataConnection implementation for EventHubDataConnection. +func (ehdc EventHubDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { + return &ehdc, true +} + +// UnmarshalJSON is the custom unmarshaler for EventHubDataConnection struct. +func (ehdc *EventHubDataConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var eventHubConnectionProperties EventHubConnectionProperties + err = json.Unmarshal(*v, &eventHubConnectionProperties) + if err != nil { + return err + } + ehdc.EventHubConnectionProperties = &eventHubConnectionProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ehdc.Location = &location + } + case "kind": + if v != nil { + var kind KindBasicDataConnection + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ehdc.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ehdc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ehdc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ehdc.Type = &typeVar + } + } + } + + return nil +} + +// FollowerDatabaseDefinition a class representing follower database request. +type FollowerDatabaseDefinition struct { + // ClusterResourceID - Resource id of the cluster that follows a database owned by this cluster. + ClusterResourceID *string `json:"clusterResourceId,omitempty"` + // AttachedDatabaseConfigurationName - Resource name of the attached database configuration in the follower cluster. + AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"` + // DatabaseName - READ-ONLY; The database name owned by this cluster that was followed. * in case following all databases. + DatabaseName *string `json:"databaseName,omitempty"` +} + +// FollowerDatabaseListResult the list Kusto database principals operation response. +type FollowerDatabaseListResult struct { + autorest.Response `json:"-"` + // Value - The list of follower database result. + Value *[]FollowerDatabaseDefinition `json:"value,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: 'IdentityTypeNone', 'IdentityTypeSystemAssigned' + Type IdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The list of user identities associated with the Kusto cluster. 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"` +} + +// IotHubConnectionProperties class representing the Kusto iot hub connection properties. +type IotHubConnectionProperties struct { + // IotHubResourceID - The resource ID of the Iot hub to be used to create a data connection. + IotHubResourceID *string `json:"iotHubResourceId,omitempty"` + // ConsumerGroup - The iot hub consumer group. + ConsumerGroup *string `json:"consumerGroup,omitempty"` + // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. + TableName *string `json:"tableName,omitempty"` + // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + MappingRuleName *string `json:"mappingRuleName,omitempty"` + // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE' + DataFormat DataFormat `json:"dataFormat,omitempty"` + // EventSystemProperties - System properties of the iot hub + EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"` + // SharedAccessPolicyName - The name of the share access policy name + SharedAccessPolicyName *string `json:"sharedAccessPolicyName,omitempty"` +} + +// IotHubDataConnection class representing an iot hub data connection. +type IotHubDataConnection struct { + // IotHubConnectionProperties - The Iot Hub data connection properties. + *IotHubConnectionProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' + Kind KindBasicDataConnection `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotHubDataConnection. +func (ihdc IotHubDataConnection) MarshalJSON() ([]byte, error) { + ihdc.Kind = KindIotHub + objectMap := make(map[string]interface{}) + if ihdc.IotHubConnectionProperties != nil { + objectMap["properties"] = ihdc.IotHubConnectionProperties + } + if ihdc.Location != nil { + objectMap["location"] = ihdc.Location + } + if ihdc.Kind != "" { + objectMap["kind"] = ihdc.Kind + } + return json.Marshal(objectMap) +} + +// AsEventHubDataConnection is the BasicDataConnection implementation for IotHubDataConnection. +func (ihdc IotHubDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { + return nil, false +} + +// AsIotHubDataConnection is the BasicDataConnection implementation for IotHubDataConnection. +func (ihdc IotHubDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { + return &ihdc, true +} + +// AsEventGridDataConnection is the BasicDataConnection implementation for IotHubDataConnection. +func (ihdc IotHubDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { + return nil, false +} + +// AsDataConnection is the BasicDataConnection implementation for IotHubDataConnection. +func (ihdc IotHubDataConnection) AsDataConnection() (*DataConnection, bool) { + return nil, false +} + +// AsBasicDataConnection is the BasicDataConnection implementation for IotHubDataConnection. +func (ihdc IotHubDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { + return &ihdc, true +} + +// UnmarshalJSON is the custom unmarshaler for IotHubDataConnection struct. +func (ihdc *IotHubDataConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var iotHubConnectionProperties IotHubConnectionProperties + err = json.Unmarshal(*v, &iotHubConnectionProperties) + if err != nil { + return err + } + ihdc.IotHubConnectionProperties = &iotHubConnectionProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ihdc.Location = &location + } + case "kind": + if v != nil { + var kind KindBasicDataConnection + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ihdc.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ihdc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ihdc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ihdc.Type = &typeVar + } + } + } + + return nil +} + +// KeyVaultProperties properties of the key vault. +type KeyVaultProperties struct { + // KeyName - The name of the key vault key. + KeyName *string `json:"keyName,omitempty"` + // KeyVersion - The version of the key vault key. + KeyVersion *string `json:"keyVersion,omitempty"` + // KeyVaultURI - The Uri of the key vault. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` +} + +// ListResourceSkusResult list of available SKUs for a Kusto Cluster. +type ListResourceSkusResult struct { + autorest.Response `json:"-"` + // Value - The collection of available SKUs for an existing resource. + Value *[]AzureResourceSku `json:"value,omitempty"` +} + +// Operation ... +type Operation struct { + // Name - This is of the format {provider}/{resource}/{operation}. + Name *string `json:"name,omitempty"` + Display *OperationDisplay `json:"display,omitempty"` + Origin *string `json:"origin,omitempty"` + Properties interface{} `json:"properties,omitempty"` +} + +// OperationDisplay ... +type OperationDisplay struct { + Provider *string `json:"provider,omitempty"` + // Operation - For example: read, write, delete. + Operation *string `json:"operation,omitempty"` + Resource *string `json:"resource,omitempty"` + Description *string `json:"description,omitempty"` +} + +// OperationListResult ... +type OperationListResult struct { + autorest.Response `json:"-"` + Value *[]Operation `json:"value,omitempty"` + 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} +} + +// OptimizedAutoscale a class that contains the optimized auto scale definition. +type OptimizedAutoscale struct { + // Version - The version of the template defined, for instance 1. + Version *int32 `json:"version,omitempty"` + // IsEnabled - A boolean value that indicate if the optimized autoscale feature is enabled or not. + IsEnabled *bool `json:"isEnabled,omitempty"` + // Minimum - Minimum allowed instances count. + Minimum *int32 `json:"minimum,omitempty"` + // Maximum - Maximum allowed instances count. + Maximum *int32 `json:"maximum,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"` +} + +// ReadOnlyFollowingDatabase class representing a read only following database. +type ReadOnlyFollowingDatabase struct { + // ReadOnlyFollowingDatabaseProperties - The database properties. + *ReadOnlyFollowingDatabaseProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) MarshalJSON() ([]byte, error) { + rofd.Kind = KindReadOnlyFollowing + objectMap := make(map[string]interface{}) + if rofd.ReadOnlyFollowingDatabaseProperties != nil { + objectMap["properties"] = rofd.ReadOnlyFollowingDatabaseProperties + } + if rofd.Location != nil { + objectMap["location"] = rofd.Location + } + if rofd.Kind != "" { + objectMap["kind"] = rofd.Kind + } + return json.Marshal(objectMap) +} + +// AsReadWriteDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { + return nil, false +} + +// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { + return &rofd, true +} + +// AsDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) AsDatabase() (*Database, bool) { + return nil, false +} + +// AsBasicDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) AsBasicDatabase() (BasicDatabase, bool) { + return &rofd, true +} + +// UnmarshalJSON is the custom unmarshaler for ReadOnlyFollowingDatabase struct. +func (rofd *ReadOnlyFollowingDatabase) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var readOnlyFollowingDatabaseProperties ReadOnlyFollowingDatabaseProperties + err = json.Unmarshal(*v, &readOnlyFollowingDatabaseProperties) + if err != nil { + return err + } + rofd.ReadOnlyFollowingDatabaseProperties = &readOnlyFollowingDatabaseProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rofd.Location = &location + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rofd.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rofd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rofd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rofd.Type = &typeVar + } + } + } + + return nil +} + +// ReadOnlyFollowingDatabaseProperties class representing the Kusto database properties. +type ReadOnlyFollowingDatabaseProperties struct { + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // SoftDeletePeriod - READ-ONLY; The time the data should be kept before it stops being accessible to queries in TimeSpan. + SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"` + // HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan. + HotCachePeriod *string `json:"hotCachePeriod,omitempty"` + // Statistics - The statistics of the database. + Statistics *DatabaseStatistics `json:"statistics,omitempty"` + // LeaderClusterResourceID - READ-ONLY; The name of the leader cluster + LeaderClusterResourceID *string `json:"leaderClusterResourceId,omitempty"` + // AttachedDatabaseConfigurationName - READ-ONLY; The name of the attached database configuration cluster + AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"` + // PrincipalsModificationKind - READ-ONLY; The principals modification kind of the database. Possible values include: 'PrincipalsModificationKindUnion', 'PrincipalsModificationKindReplace', 'PrincipalsModificationKindNone' + PrincipalsModificationKind PrincipalsModificationKind `json:"principalsModificationKind,omitempty"` +} + +// ReadWriteDatabase class representing a read write database. +type ReadWriteDatabase struct { + // ReadWriteDatabaseProperties - The database properties. + *ReadWriteDatabaseProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReadWriteDatabase. +func (rwd ReadWriteDatabase) MarshalJSON() ([]byte, error) { + rwd.Kind = KindReadWrite + objectMap := make(map[string]interface{}) + if rwd.ReadWriteDatabaseProperties != nil { + objectMap["properties"] = rwd.ReadWriteDatabaseProperties + } + if rwd.Location != nil { + objectMap["location"] = rwd.Location + } + if rwd.Kind != "" { + objectMap["kind"] = rwd.Kind + } + return json.Marshal(objectMap) +} + +// AsReadWriteDatabase is the BasicDatabase implementation for ReadWriteDatabase. +func (rwd ReadWriteDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { + return &rwd, true +} + +// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadWriteDatabase. +func (rwd ReadWriteDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { + return nil, false +} + +// AsDatabase is the BasicDatabase implementation for ReadWriteDatabase. +func (rwd ReadWriteDatabase) AsDatabase() (*Database, bool) { + return nil, false +} + +// AsBasicDatabase is the BasicDatabase implementation for ReadWriteDatabase. +func (rwd ReadWriteDatabase) AsBasicDatabase() (BasicDatabase, bool) { + return &rwd, true +} + +// UnmarshalJSON is the custom unmarshaler for ReadWriteDatabase struct. +func (rwd *ReadWriteDatabase) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var readWriteDatabaseProperties ReadWriteDatabaseProperties + err = json.Unmarshal(*v, &readWriteDatabaseProperties) + if err != nil { + return err + } + rwd.ReadWriteDatabaseProperties = &readWriteDatabaseProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rwd.Location = &location + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rwd.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rwd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rwd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rwd.Type = &typeVar + } + } + } + + return nil +} + +// ReadWriteDatabaseProperties class representing the Kusto database properties. +type ReadWriteDatabaseProperties struct { + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // SoftDeletePeriod - The time the data should be kept before it stops being accessible to queries in TimeSpan. + SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"` + // HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan. + HotCachePeriod *string `json:"hotCachePeriod,omitempty"` + // Statistics - The statistics of the database. + Statistics *DatabaseStatistics `json:"statistics,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"` +} + +// SkuDescription the Kusto SKU description of given resource type +type SkuDescription struct { + // ResourceType - READ-ONLY; The resource type + ResourceType *string `json:"resourceType,omitempty"` + // Name - READ-ONLY; The name of the SKU + Name *string `json:"name,omitempty"` + // Tier - READ-ONLY; The tier of the SKU + Tier *string `json:"tier,omitempty"` + // Locations - READ-ONLY; The set of locations that the SKU is available + Locations *[]string `json:"locations,omitempty"` + // LocationInfo - READ-ONLY; Locations and zones + LocationInfo *[]SkuLocationInfoItem `json:"locationInfo,omitempty"` + // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used + Restrictions *[]interface{} `json:"restrictions,omitempty"` +} + +// SkuDescriptionList the list of the EngagementFabric SKU descriptions +type SkuDescriptionList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; SKU descriptions + Value *[]SkuDescription `json:"value,omitempty"` +} + +// SkuLocationInfoItem the locations and zones info for SKU. +type SkuLocationInfoItem struct { + // Location - The available location of the SKU. + Location *string `json:"location,omitempty"` + // Zones - The available zone of the SKU. + Zones *[]string `json:"zones,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) +} + +// TrustedExternalTenant represents a tenant ID that is trusted by the cluster. +type TrustedExternalTenant struct { + // Value - GUID representing an external tenant. + Value *string `json:"value,omitempty"` +} + +// VirtualNetworkConfiguration a class that contains virtual network definition. +type VirtualNetworkConfiguration struct { + // SubnetID - The subnet resource id. + SubnetID *string `json:"subnetId,omitempty"` + // EnginePublicIPID - Engine service's public IP address resource id. + EnginePublicIPID *string `json:"enginePublicIpId,omitempty"` + // DataManagementPublicIPID - Data management's service public IP address resource id. + DataManagementPublicIPID *string `json:"dataManagementPublicIpId,omitempty"` +} diff --git a/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/operations.go b/services/kusto/mgmt/2019-09-07/kusto/operations.go similarity index 67% rename from services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/operations.go rename to services/kusto/mgmt/2019-09-07/kusto/operations.go index 54e547567c76..3fe756252f6f 100644 --- a/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/operations.go +++ b/services/kusto/mgmt/2019-09-07/kusto/operations.go @@ -1,4 +1,4 @@ -package devspaces +package kusto // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,7 +25,9 @@ import ( "net/http" ) -// OperationsClient is the dev Spaces Client +// OperationsClient is the the Azure Kusto management API provides a RESTful set of web services that interact with +// Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete +// clusters and databases. type OperationsClient struct { BaseClient } @@ -40,14 +42,14 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. -func (client OperationsClient) List(ctx context.Context) (result ResourceProviderOperationListPage, err error) { +// List lists available operations for the Microsoft.Kusto provider. +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.rpol.Response.Response != nil { - sc = result.rpol.Response.Response.StatusCode + if result.olr.Response.Response != nil { + sc = result.olr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -55,20 +57,20 @@ func (client OperationsClient) List(ctx context.Context) (result ResourceProvide result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.OperationsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "kusto.OperationsClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { - result.rpol.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.OperationsClient", "List", resp, "Failure sending request") + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.OperationsClient", "List", resp, "Failure sending request") return } - result.rpol, err = client.ListResponder(resp) + result.olr, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.OperationsClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "kusto.OperationsClient", "List", resp, "Failure responding to request") } return @@ -76,7 +78,7 @@ func (client OperationsClient) List(ctx context.Context) (result ResourceProvide // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-01-01-preview" + const APIVersion = "2019-09-07" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -84,7 +86,7 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.DevSpaces/operations"), + autorest.WithPath("/providers/Microsoft.Kusto/operations"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -92,13 +94,13 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, // 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 autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) } // 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) { +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -110,10 +112,10 @@ func (client OperationsClient) ListResponder(resp *http.Response) (result Resour } // listNextResults retrieves the next set of results, if any. -func (client OperationsClient) listNextResults(ctx context.Context, lastResults ResourceProviderOperationList) (result ResourceProviderOperationList, err error) { - req, err := lastResults.resourceProviderOperationListPreparer(ctx) +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, "devspaces.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "kusto.OperationsClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -121,17 +123,17 @@ func (client OperationsClient) listNextResults(ctx context.Context, lastResults resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "devspaces.OperationsClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "kusto.OperationsClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "kusto.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 ResourceProviderOperationListIterator, err error) { +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { diff --git a/services/appinsights/v1/insights/version.go b/services/kusto/mgmt/2019-09-07/kusto/version.go similarity index 92% rename from services/appinsights/v1/insights/version.go rename to services/kusto/mgmt/2019-09-07/kusto/version.go index 2123a7972af4..f0ff576cbc66 100644 --- a/services/appinsights/v1/insights/version.go +++ b/services/kusto/mgmt/2019-09-07/kusto/version.go @@ -1,4 +1,4 @@ -package insights +package kusto import "github.com/Azure/azure-sdk-for-go/version" @@ -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.Number + " insights/v1" + return "Azure-SDK-For-Go/" + version.Number + " kusto/2019-09-07" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/machinelearningservicesapi/interfaces.go b/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/machinelearningservicesapi/interfaces.go index 6eee7c0c701c..7c99803ab17f 100644 --- a/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/machinelearningservicesapi/interfaces.go +++ b/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/machinelearningservicesapi/interfaces.go @@ -46,7 +46,7 @@ var _ WorkspacesClientAPI = (*machinelearningservices.WorkspacesClient)(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) + List(ctx context.Context, location string, expandChildren string) (result machinelearningservices.ListUsagesResultPage, err error) } var _ UsagesClientAPI = (*machinelearningservices.UsagesClient)(nil) @@ -58,6 +58,14 @@ type VirtualMachineSizesClientAPI interface { 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) + 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) diff --git a/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/models.go b/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/models.go index 4281ddbfef3b..7086dd2e9dad 100644 --- a/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/models.go +++ b/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/models.go @@ -181,6 +181,19 @@ func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Unknown, Updating} } +// 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} +} + // RemoteLoginPortPublicAccess enumerates the values for remote login port public access. type RemoteLoginPortPublicAccess string @@ -215,15 +228,38 @@ func PossibleResourceIdentityTypeValues() []ResourceIdentityType { type Status string const ( - // StatusDisabled ... - StatusDisabled Status = "Disabled" - // StatusEnabled ... - StatusEnabled Status = "Enabled" + // Failure ... + Failure Status = "Failure" + // InvalidQuotaBelowClusterMinimum ... + InvalidQuotaBelowClusterMinimum Status = "InvalidQuotaBelowClusterMinimum" + // InvalidQuotaExceedsSubscriptionLimit ... + InvalidQuotaExceedsSubscriptionLimit Status = "InvalidQuotaExceedsSubscriptionLimit" + // InvalidVMFamilyName ... + InvalidVMFamilyName Status = "InvalidVMFamilyName" + // 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{StatusDisabled, StatusEnabled} + return []Status{Failure, InvalidQuotaBelowClusterMinimum, InvalidQuotaExceedsSubscriptionLimit, InvalidVMFamilyName, 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. @@ -245,13 +281,13 @@ func PossibleUnderlyingResourceActionValues() []UnderlyingResourceAction { type UsageUnit string const ( - // Count ... - Count UsageUnit = "Count" + // UsageUnitCount ... + UsageUnitCount UsageUnit = "Count" ) // PossibleUsageUnitValues returns an array of possible values for the UsageUnit const type. func PossibleUsageUnitValues() []UsageUnit { - return []UsageUnit{Count} + return []UsageUnit{UsageUnitCount} } // VMPriority enumerates the values for vm priority. @@ -1735,6 +1771,152 @@ type ListWorkspaceKeysResult struct { 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 { @@ -2014,6 +2196,24 @@ type Password struct { Value *string `json:"value,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 @@ -2057,6 +2257,28 @@ type ResourceID struct { 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"` +} + // ScaleSettings scale settings for AML Compute type ScaleSettings struct { // MaxNodeCount - Max number of nodes to use @@ -2077,8 +2299,8 @@ type ServicePrincipalCredentials struct { // SslConfiguration the ssl configuration for scoring type SslConfiguration struct { - // Status - Enable or disable ssl for scoring. Possible values include: 'StatusDisabled', 'StatusEnabled' - Status Status `json:"status,omitempty"` + // 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 @@ -2097,13 +2319,36 @@ type SystemService struct { 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' + 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: 'Count' + // 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"` diff --git a/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/quotas.go b/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/quotas.go new file mode 100644 index 000000000000..72621c6e6c11 --- /dev/null +++ b/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/quotas.go @@ -0,0 +1,245 @@ +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. +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 = "2019-06-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) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 = "2019-06-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) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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/2019-06-01/machinelearningservices/usages.go b/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/usages.go index 95c27149def3..95538f0275d7 100644 --- a/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/usages.go +++ b/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/usages.go @@ -44,7 +44,8 @@ func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesCli // 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) { +// expandChildren - specifies if detailed usages of child resources are required. +func (client UsagesClient) List(ctx context.Context, location string, expandChildren string) (result ListUsagesResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") defer func() { @@ -62,7 +63,7 @@ func (client UsagesClient) List(ctx context.Context, location string) (result Li } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) + req, err := client.ListPreparer(ctx, location, expandChildren) if err != nil { err = autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "List", nil, "Failure preparing request") return @@ -84,7 +85,7 @@ func (client UsagesClient) List(ctx context.Context, location string) (result Li } // ListPreparer prepares the List request. -func (client UsagesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { +func (client UsagesClient) ListPreparer(ctx context.Context, location string, expandChildren string) (*http.Request, error) { pathParameters := map[string]interface{}{ "location": autorest.Encode("path", location), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -94,6 +95,9 @@ func (client UsagesClient) ListPreparer(ctx context.Context, location string) (* queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(expandChildren) > 0 { + queryParameters["expandChildren"] = autorest.Encode("query", expandChildren) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -145,7 +149,7 @@ func (client UsagesClient) listNextResults(ctx context.Context, lastResults List } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UsagesClient) ListComplete(ctx context.Context, location string) (result ListUsagesResultIterator, err error) { +func (client UsagesClient) ListComplete(ctx context.Context, location string, expandChildren string) (result ListUsagesResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") defer func() { @@ -156,6 +160,6 @@ func (client UsagesClient) ListComplete(ctx context.Context, location string) (r tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, location) + result.page, err = client.List(ctx, location, expandChildren) return } diff --git a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/appcollections.go b/services/mobileengagement/mgmt/2014-12-01/mobileengagement/appcollections.go deleted file mode 100644 index a92d14433656..000000000000 --- a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/appcollections.go +++ /dev/null @@ -1,195 +0,0 @@ -package mobileengagement - -// 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" - "net/http" -) - -// AppCollectionsClient is the microsoft Azure Mobile Engagement REST APIs. -type AppCollectionsClient struct { - BaseClient -} - -// NewAppCollectionsClient creates an instance of the AppCollectionsClient client. -func NewAppCollectionsClient(subscriptionID string) AppCollectionsClient { - return NewAppCollectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAppCollectionsClientWithBaseURI creates an instance of the AppCollectionsClient client. -func NewAppCollectionsClientWithBaseURI(baseURI string, subscriptionID string) AppCollectionsClient { - return AppCollectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckNameAvailability checks availability of an app collection name in the Engagement domain. -// -func (client AppCollectionsClient) CheckNameAvailability(ctx context.Context, parameters AppCollectionNameAvailability) (result AppCollectionNameAvailability, err error) { - req, err := client.CheckNameAvailabilityPreparer(ctx, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "CheckNameAvailability", nil, "Failure preparing request") - return - } - - resp, err := client.CheckNameAvailabilitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "CheckNameAvailability", resp, "Failure sending request") - return - } - - result, err = client.CheckNameAvailabilityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "CheckNameAvailability", resp, "Failure responding to request") - } - - return -} - -// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. -func (client AppCollectionsClient) CheckNameAvailabilityPreparer(ctx context.Context, parameters AppCollectionNameAvailability) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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}/providers/Microsoft.MobileEngagement/checkAppCollectionNameAvailability", pathParameters), - autorest.WithJSON(parameters), - 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 AppCollectionsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always -// closes the http.Response Body. -func (client AppCollectionsClient) CheckNameAvailabilityResponder(resp *http.Response) (result AppCollectionNameAvailability, 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 app collections in a subscription. -func (client AppCollectionsClient) List(ctx context.Context) (result AppCollectionListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "List", resp, "Failure sending request") - return - } - - result.aclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client AppCollectionsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MobileEngagement/appCollections", 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 AppCollectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AppCollectionsClient) ListResponder(resp *http.Response) (result AppCollectionListResult, 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 AppCollectionsClient) listNextResults(lastResults AppCollectionListResult) (result AppCollectionListResult, err error) { - req, err := lastResults.appCollectionListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "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, "mobileengagement.AppCollectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppCollectionsClient) ListComplete(ctx context.Context) (result AppCollectionListResultIterator, err error) { - result.page, err = client.List(ctx) - return -} diff --git a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/apps.go b/services/mobileengagement/mgmt/2014-12-01/mobileengagement/apps.go deleted file mode 100644 index 9cc89a4c3e10..000000000000 --- a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/apps.go +++ /dev/null @@ -1,134 +0,0 @@ -package mobileengagement - -// 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" - "net/http" -) - -// AppsClient is the microsoft Azure Mobile Engagement REST APIs. -type AppsClient struct { - BaseClient -} - -// NewAppsClient creates an instance of the AppsClient client. -func NewAppsClient(subscriptionID string) AppsClient { - return NewAppsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAppsClientWithBaseURI creates an instance of the AppsClient client. -func NewAppsClientWithBaseURI(baseURI string, subscriptionID string) AppsClient { - return AppsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists apps in an appCollection. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. -func (client AppsClient) List(ctx context.Context, resourceGroupName string, appCollection string) (result AppListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, appCollection) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.AppsClient", "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, "mobileengagement.AppsClient", "List", resp, "Failure sending request") - return - } - - result.alr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.AppsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client AppsClient) ListPreparer(ctx context.Context, resourceGroupName string, appCollection string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AppsClient) ListResponder(resp *http.Response) (result AppListResult, 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 AppsClient) listNextResults(lastResults AppListResult) (result AppListResult, err error) { - req, err := lastResults.appListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "mobileengagement.AppsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "mobileengagement.AppsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.AppsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListComplete(ctx context.Context, resourceGroupName string, appCollection string) (result AppListResultIterator, err error) { - result.page, err = client.List(ctx, resourceGroupName, appCollection) - return -} diff --git a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/campaigns.go b/services/mobileengagement/mgmt/2014-12-01/mobileengagement/campaigns.go deleted file mode 100644 index 3fb9248fc418..000000000000 --- a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/campaigns.go +++ /dev/null @@ -1,1065 +0,0 @@ -package mobileengagement - -// 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" - "net/http" -) - -// CampaignsClient is the microsoft Azure Mobile Engagement REST APIs. -type CampaignsClient struct { - BaseClient -} - -// NewCampaignsClient creates an instance of the CampaignsClient client. -func NewCampaignsClient(subscriptionID string) CampaignsClient { - return NewCampaignsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCampaignsClientWithBaseURI creates an instance of the CampaignsClient client. -func NewCampaignsClientWithBaseURI(baseURI string, subscriptionID string) CampaignsClient { - return CampaignsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Activate activate a campaign previously created by a call to Create campaign. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. kind is campaign kind. ID is campaign identifier. -func (client CampaignsClient) Activate(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, ID int32) (result CampaignStateResult, err error) { - req, err := client.ActivatePreparer(ctx, resourceGroupName, appCollection, appName, kind, ID) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Activate", nil, "Failure preparing request") - return - } - - resp, err := client.ActivateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Activate", resp, "Failure sending request") - return - } - - result, err = client.ActivateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Activate", resp, "Failure responding to request") - } - - return -} - -// ActivatePreparer prepares the Activate request. -func (client CampaignsClient) ActivatePreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, ID int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "id": autorest.Encode("path", ID), - "kind": autorest.Encode("path", kind), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}/activate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ActivateSender sends the Activate request. The method will close the -// http.Response Body if it receives an error. -func (client CampaignsClient) ActivateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ActivateResponder handles the response to the Activate request. The method always -// closes the http.Response Body. -func (client CampaignsClient) ActivateResponder(resp *http.Response) (result CampaignStateResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Create create a push campaign (announcement, poll, data push or native push). -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. kind is campaign kind. parameters is parameters supplied to the Update Campaign -// operation. -func (client CampaignsClient) Create(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, parameters Campaign) (result CampaignStateResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Name", Name: validation.MaxLength, Rule: 64, Chain: nil}}}, - {Target: "parameters.Category", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Category", Name: validation.MaxLength, Rule: 64, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("mobileengagement.CampaignsClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, appCollection, appName, kind, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Create", resp, "Failure responding to request") - } - - return -} - -// CreatePreparer prepares the Create request. -func (client CampaignsClient) CreatePreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, parameters Campaign) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "kind": autorest.Encode("path", kind), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}", 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 CampaignsClient) CreateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client CampaignsClient) CreateResponder(resp *http.Response) (result CampaignStateResult, 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 campaign previously created by a call to Create campaign. -// -// kind is campaign kind. ID is campaign identifier. resourceGroupName is the name of the resource group. -// appCollection is application collection. appName is application resource name. -func (client CampaignsClient) Delete(ctx context.Context, kind CampaignKinds, ID int32, resourceGroupName string, appCollection string, appName string) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, kind, ID, resourceGroupName, appCollection, appName) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CampaignsClient) DeletePreparer(ctx context.Context, kind CampaignKinds, ID int32, resourceGroupName string, appCollection string, appName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "id": autorest.Encode("path", ID), - "kind": autorest.Encode("path", kind), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}", 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 CampaignsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client CampaignsClient) 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 -} - -// Finish finish a push campaign previously activated by a call to Activate campaign. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. kind is campaign kind. ID is campaign identifier. -func (client CampaignsClient) Finish(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, ID int32) (result CampaignStateResult, err error) { - req, err := client.FinishPreparer(ctx, resourceGroupName, appCollection, appName, kind, ID) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Finish", nil, "Failure preparing request") - return - } - - resp, err := client.FinishSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Finish", resp, "Failure sending request") - return - } - - result, err = client.FinishResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Finish", resp, "Failure responding to request") - } - - return -} - -// FinishPreparer prepares the Finish request. -func (client CampaignsClient) FinishPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, ID int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "id": autorest.Encode("path", ID), - "kind": autorest.Encode("path", kind), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}/finish", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// FinishSender sends the Finish request. The method will close the -// http.Response Body if it receives an error. -func (client CampaignsClient) FinishSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// FinishResponder handles the response to the Finish request. The method always -// closes the http.Response Body. -func (client CampaignsClient) FinishResponder(resp *http.Response) (result CampaignStateResult, 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 the Get campaign operation retrieves information about a previously created campaign. -// -// kind is campaign kind. ID is campaign identifier. resourceGroupName is the name of the resource group. -// appCollection is application collection. appName is application resource name. -func (client CampaignsClient) Get(ctx context.Context, kind CampaignKinds, ID int32, resourceGroupName string, appCollection string, appName string) (result CampaignResult, err error) { - req, err := client.GetPreparer(ctx, kind, ID, resourceGroupName, appCollection, appName) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client CampaignsClient) GetPreparer(ctx context.Context, kind CampaignKinds, ID int32, resourceGroupName string, appCollection string, appName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "id": autorest.Encode("path", ID), - "kind": autorest.Encode("path", kind), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}", 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 CampaignsClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CampaignsClient) GetResponder(resp *http.Response) (result CampaignResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetByName the Get campaign operation retrieves information about a previously created campaign. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. kind is campaign kind. name is campaign name. -func (client CampaignsClient) GetByName(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, name string) (result CampaignResult, err error) { - req, err := client.GetByNamePreparer(ctx, resourceGroupName, appCollection, appName, kind, name) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "GetByName", nil, "Failure preparing request") - return - } - - resp, err := client.GetByNameSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "GetByName", resp, "Failure sending request") - return - } - - result, err = client.GetByNameResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "GetByName", resp, "Failure responding to request") - } - - return -} - -// GetByNamePreparer prepares the GetByName request. -func (client CampaignsClient) GetByNamePreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, name string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "kind": autorest.Encode("path", kind), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaignsByName/{kind}/{name}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetByNameSender sends the GetByName request. The method will close the -// http.Response Body if it receives an error. -func (client CampaignsClient) GetByNameSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetByNameResponder handles the response to the GetByName request. The method always -// closes the http.Response Body. -func (client CampaignsClient) GetByNameResponder(resp *http.Response) (result CampaignResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetStatistics get all the campaign statistics. -// -// kind is campaign kind. ID is campaign identifier. resourceGroupName is the name of the resource group. -// appCollection is application collection. appName is application resource name. -func (client CampaignsClient) GetStatistics(ctx context.Context, kind CampaignKinds, ID int32, resourceGroupName string, appCollection string, appName string) (result CampaignStatisticsResult, err error) { - req, err := client.GetStatisticsPreparer(ctx, kind, ID, resourceGroupName, appCollection, appName) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "GetStatistics", nil, "Failure preparing request") - return - } - - resp, err := client.GetStatisticsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "GetStatistics", resp, "Failure sending request") - return - } - - result, err = client.GetStatisticsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "GetStatistics", resp, "Failure responding to request") - } - - return -} - -// GetStatisticsPreparer prepares the GetStatistics request. -func (client CampaignsClient) GetStatisticsPreparer(ctx context.Context, kind CampaignKinds, ID int32, resourceGroupName string, appCollection string, appName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "id": autorest.Encode("path", ID), - "kind": autorest.Encode("path", kind), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}/statistics", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetStatisticsSender sends the GetStatistics request. The method will close the -// http.Response Body if it receives an error. -func (client CampaignsClient) GetStatisticsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetStatisticsResponder handles the response to the GetStatistics request. The method always -// closes the http.Response Body. -func (client CampaignsClient) GetStatisticsResponder(resp *http.Response) (result CampaignStatisticsResult, 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 get the list of campaigns. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. kind is campaign kind. skip is control paging of campaigns, start results at the -// given offset, defaults to 0 (1st page of data). top is control paging of campaigns, number of campaigns to -// return with each call. It returns all campaigns by default. When specifying $top parameter, the response -// contains a `nextLink` property describing the path to get the next page if there are more results. filter is -// filter can be used to restrict the results to campaigns matching a specific state. The syntax is `$filter=state -// eq 'draft'`. Valid state values are: draft, scheduled, in-progress, and finished. Only the eq operator and the -// state property are supported. orderby is sort results by an expression which looks like `$orderby=id asc` (this -// example is actually the default behavior). The syntax is orderby={property} {direction} or just -// orderby={property}. The available sorting properties are id, name, state, activatedDate, and finishedDate. The -// available directions are asc (for ascending order) and desc (for descending order). When not specified the asc -// direction is used. Only one property at a time can be used for sorting. search is restrict results to campaigns -// matching the optional `search` expression. This currently performs the search based on the name on the campaign -// only, case insensitive. If the campaign contains the value of the `search` parameter anywhere in the name, it -// matches. -func (client CampaignsClient) List(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, skip *int32, top *int32, filter string, orderby string, search string) (result CampaignsListResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, appCollection, appName, kind, skip, top, filter, orderby, search) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "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, "mobileengagement.CampaignsClient", "List", resp, "Failure sending request") - return - } - - result.clr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client CampaignsClient) ListPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, skip *int32, top *int32, filter string, orderby string, search string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "kind": autorest.Encode("path", kind), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - if len(search) > 0 { - queryParameters["$search"] = autorest.Encode("query", search) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}", 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 CampaignsClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client CampaignsClient) ListResponder(resp *http.Response) (result CampaignsListResult, 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 CampaignsClient) listNextResults(lastResults CampaignsListResult) (result CampaignsListResult, err error) { - req, err := lastResults.campaignsListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "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, "mobileengagement.CampaignsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CampaignsClient) ListComplete(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, skip *int32, top *int32, filter string, orderby string, search string) (result CampaignsListResultIterator, err error) { - result.page, err = client.List(ctx, resourceGroupName, appCollection, appName, kind, skip, top, filter, orderby, search) - return -} - -// Push push a previously saved campaign (created with Create campaign) to a set of devices. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. kind is campaign kind. ID is campaign identifier. parameters is parameters supplied -// to the Push Campaign operation. -func (client CampaignsClient) Push(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, ID int32, parameters CampaignPushParameters) (result CampaignPushResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DeviceIds", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Data", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Data.Name", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Data.Name", Name: validation.MaxLength, Rule: 64, Chain: nil}}}, - {Target: "parameters.Data.Category", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Data.Category", Name: validation.MaxLength, Rule: 64, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("mobileengagement.CampaignsClient", "Push", err.Error()) - } - - req, err := client.PushPreparer(ctx, resourceGroupName, appCollection, appName, kind, ID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Push", nil, "Failure preparing request") - return - } - - resp, err := client.PushSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Push", resp, "Failure sending request") - return - } - - result, err = client.PushResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Push", resp, "Failure responding to request") - } - - return -} - -// PushPreparer prepares the Push request. -func (client CampaignsClient) PushPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, ID int32, parameters CampaignPushParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "id": autorest.Encode("path", ID), - "kind": autorest.Encode("path", kind), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}/push", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PushSender sends the Push request. The method will close the -// http.Response Body if it receives an error. -func (client CampaignsClient) PushSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// PushResponder handles the response to the Push request. The method always -// closes the http.Response Body. -func (client CampaignsClient) PushResponder(resp *http.Response) (result CampaignPushResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Suspend suspend a push campaign previously activated by a call to Activate campaign. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. kind is campaign kind. ID is campaign identifier. -func (client CampaignsClient) Suspend(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, ID int32) (result CampaignStateResult, err error) { - req, err := client.SuspendPreparer(ctx, resourceGroupName, appCollection, appName, kind, ID) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Suspend", nil, "Failure preparing request") - return - } - - resp, err := client.SuspendSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Suspend", resp, "Failure sending request") - return - } - - result, err = client.SuspendResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Suspend", resp, "Failure responding to request") - } - - return -} - -// SuspendPreparer prepares the Suspend request. -func (client CampaignsClient) SuspendPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, ID int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "id": autorest.Encode("path", ID), - "kind": autorest.Encode("path", kind), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}/suspend", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SuspendSender sends the Suspend request. The method will close the -// http.Response Body if it receives an error. -func (client CampaignsClient) SuspendSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// SuspendResponder handles the response to the Suspend request. The method always -// closes the http.Response Body. -func (client CampaignsClient) SuspendResponder(resp *http.Response) (result CampaignStateResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// TestNew test a new campaign on a set of devices. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. kind is campaign kind. parameters is parameters supplied to the Test Campaign -// operation. -func (client CampaignsClient) TestNew(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, parameters CampaignTestNewParameters) (result CampaignState, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Data", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Data.Name", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Data.Name", Name: validation.MaxLength, Rule: 64, Chain: nil}}}, - {Target: "parameters.Data.Category", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Data.Category", Name: validation.MaxLength, Rule: 64, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("mobileengagement.CampaignsClient", "TestNew", err.Error()) - } - - req, err := client.TestNewPreparer(ctx, resourceGroupName, appCollection, appName, kind, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "TestNew", nil, "Failure preparing request") - return - } - - resp, err := client.TestNewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "TestNew", resp, "Failure sending request") - return - } - - result, err = client.TestNewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "TestNew", resp, "Failure responding to request") - } - - return -} - -// TestNewPreparer prepares the TestNew request. -func (client CampaignsClient) TestNewPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, parameters CampaignTestNewParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "kind": autorest.Encode("path", kind), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/test", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TestNewSender sends the TestNew request. The method will close the -// http.Response Body if it receives an error. -func (client CampaignsClient) TestNewSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// TestNewResponder handles the response to the TestNew request. The method always -// closes the http.Response Body. -func (client CampaignsClient) TestNewResponder(resp *http.Response) (result CampaignState, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// TestSaved test an existing campaign (created with Create campaign) on a set of devices. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. kind is campaign kind. ID is campaign identifier. parameters is parameters supplied -// to the Test Campaign operation. -func (client CampaignsClient) TestSaved(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, ID int32, parameters CampaignTestSavedParameters) (result CampaignStateResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DeviceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mobileengagement.CampaignsClient", "TestSaved", err.Error()) - } - - req, err := client.TestSavedPreparer(ctx, resourceGroupName, appCollection, appName, kind, ID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "TestSaved", nil, "Failure preparing request") - return - } - - resp, err := client.TestSavedSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "TestSaved", resp, "Failure sending request") - return - } - - result, err = client.TestSavedResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "TestSaved", resp, "Failure responding to request") - } - - return -} - -// TestSavedPreparer prepares the TestSaved request. -func (client CampaignsClient) TestSavedPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, kind CampaignKinds, ID int32, parameters CampaignTestSavedParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "id": autorest.Encode("path", ID), - "kind": autorest.Encode("path", kind), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}/test", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TestSavedSender sends the TestSaved request. The method will close the -// http.Response Body if it receives an error. -func (client CampaignsClient) TestSavedSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// TestSavedResponder handles the response to the TestSaved request. The method always -// closes the http.Response Body. -func (client CampaignsClient) TestSavedResponder(resp *http.Response) (result CampaignStateResult, 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 push campaign (announcement, poll, data push or native push). -// -// kind is campaign kind. ID is campaign identifier. parameters is parameters supplied to the Update Campaign -// operation. resourceGroupName is the name of the resource group. appCollection is application collection. appName -// is application resource name. -func (client CampaignsClient) Update(ctx context.Context, kind CampaignKinds, ID int32, parameters Campaign, resourceGroupName string, appCollection string, appName string) (result CampaignStateResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Name", Name: validation.MaxLength, Rule: 64, Chain: nil}}}, - {Target: "parameters.Category", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Category", Name: validation.MaxLength, Rule: 64, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("mobileengagement.CampaignsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, kind, ID, parameters, resourceGroupName, appCollection, appName) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client CampaignsClient) UpdatePreparer(ctx context.Context, kind CampaignKinds, ID int32, parameters Campaign, resourceGroupName string, appCollection string, appName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "id": autorest.Encode("path", ID), - "kind": autorest.Encode("path", kind), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}", 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 CampaignsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client CampaignsClient) UpdateResponder(resp *http.Response) (result CampaignStateResult, 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/mobileengagement/mgmt/2014-12-01/mobileengagement/devices.go b/services/mobileengagement/mgmt/2014-12-01/mobileengagement/devices.go deleted file mode 100644 index 2ec6b235404d..000000000000 --- a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/devices.go +++ /dev/null @@ -1,466 +0,0 @@ -package mobileengagement - -// 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" - "net/http" -) - -// DevicesClient is the microsoft Azure Mobile Engagement REST APIs. -type DevicesClient struct { - BaseClient -} - -// NewDevicesClient creates an instance of the DevicesClient client. -func NewDevicesClient(subscriptionID string) DevicesClient { - return NewDevicesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDevicesClientWithBaseURI creates an instance of the DevicesClient client. -func NewDevicesClientWithBaseURI(baseURI string, subscriptionID string) DevicesClient { - return DevicesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// GetByDeviceID get the information associated to a device running an application. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. deviceID is device identifier. -func (client DevicesClient) GetByDeviceID(ctx context.Context, resourceGroupName string, appCollection string, appName string, deviceID string) (result Device, err error) { - req, err := client.GetByDeviceIDPreparer(ctx, resourceGroupName, appCollection, appName, deviceID) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "GetByDeviceID", nil, "Failure preparing request") - return - } - - resp, err := client.GetByDeviceIDSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "GetByDeviceID", resp, "Failure sending request") - return - } - - result, err = client.GetByDeviceIDResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "GetByDeviceID", resp, "Failure responding to request") - } - - return -} - -// GetByDeviceIDPreparer prepares the GetByDeviceID request. -func (client DevicesClient) GetByDeviceIDPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, deviceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "deviceId": autorest.Encode("path", deviceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/{deviceId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetByDeviceIDSender sends the GetByDeviceID request. The method will close the -// http.Response Body if it receives an error. -func (client DevicesClient) GetByDeviceIDSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetByDeviceIDResponder handles the response to the GetByDeviceID request. The method always -// closes the http.Response Body. -func (client DevicesClient) GetByDeviceIDResponder(resp *http.Response) (result Device, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetByUserID get the information associated to a device running an application using the user identifier. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. userID is user identifier. -func (client DevicesClient) GetByUserID(ctx context.Context, resourceGroupName string, appCollection string, appName string, userID string) (result Device, err error) { - req, err := client.GetByUserIDPreparer(ctx, resourceGroupName, appCollection, appName, userID) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "GetByUserID", nil, "Failure preparing request") - return - } - - resp, err := client.GetByUserIDSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "GetByUserID", resp, "Failure sending request") - return - } - - result, err = client.GetByUserIDResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "GetByUserID", resp, "Failure responding to request") - } - - return -} - -// GetByUserIDPreparer prepares the GetByUserID request. -func (client DevicesClient) GetByUserIDPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, userID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "userId": autorest.Encode("path", userID), - } - - const APIVersion = "2014-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/users/{userId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetByUserIDSender sends the GetByUserID request. The method will close the -// http.Response Body if it receives an error. -func (client DevicesClient) GetByUserIDSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetByUserIDResponder handles the response to the GetByUserID request. The method always -// closes the http.Response Body. -func (client DevicesClient) GetByUserIDResponder(resp *http.Response) (result Device, 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 query the information associated to the devices running an application. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. top is number of devices to return with each call. Defaults to 100 and cannot return -// more. Passing a greater value is ignored. The response contains a `nextLink` property describing the URI path to -// get the next page of results if not all results could be returned at once. selectParameter is by default all -// `meta` and `appInfo` properties are returned, this property is used to restrict the output to the desired -// properties. It also excludes all devices from the output that have none of the selected properties. In other -// terms, only devices having at least one of the selected property being set is part of the results. Examples: - -// `$select=appInfo` : select all devices having at least 1 appInfo, return them all and don’t return any meta -// property. - `$select=meta` : return only meta properties in the output. - -// `$select=appInfo,meta/firstSeen,meta/lastSeen` : return all `appInfo`, plus meta object containing only -// firstSeen and lastSeen properties. The format is thus a comma separated list of properties to select. Use -// `appInfo` to select all appInfo properties, `meta` to select all meta properties. Use `appInfo/{key}` and -// `meta/{key}` to select specific appInfo and meta properties. filter is filter can be used to reduce the number -// of results. Filter is a boolean expression that can look like the following examples: * `$filter=deviceId gt -// 'abcdef0123456789abcdef0123456789'` * `$filter=lastModified le 1447284263690L` * `$filter=(deviceId ge -// 'abcdef0123456789abcdef0123456789') and (deviceId lt 'bacdef0123456789abcdef0123456789') and (lastModified gt -// 1447284263690L)` The first example is used automatically for paging when returning the `nextLink` property. The -// filter expression is a combination of checks on some properties that can be compared to their value. The -// available operators are: * `gt` : greater than * `ge` : greater than or equals * `lt` : less than * `le` : -// less than or equals * `and` : to add multiple checks (all checks must pass), optional parentheses can be used. -// The properties that can be used in the expression are the following: * `deviceId {operator} '{deviceIdValue}'` : -// a lexicographical comparison is made on the deviceId value, use single quotes for the value. * `lastModified -// {operator} {number}L` : returns only meta properties or appInfo properties whose last value modification -// timestamp compared to the specified value is matching (value is milliseconds since January 1st, 1970 UTC). -// Please note the `L` character after the number of milliseconds, its required when the number of milliseconds -// exceeds `2^31 - 1` (which is always the case for recent timestamps). Using `lastModified` excludes all devices -// from the output that have no property matching the timestamp criteria, like `$select`. Please note that the -// internal value of `lastModified` timestamp for a given property is never part of the results. -func (client DevicesClient) List(ctx context.Context, resourceGroupName string, appCollection string, appName string, top *int32, selectParameter string, filter string) (result DevicesQueryResultPage, err error) { - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, appCollection, appName, top, selectParameter, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.dqr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "List", resp, "Failure sending request") - return - } - - result.dqr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client DevicesClient) ListPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, top *int32, selectParameter string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - 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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices", 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 DevicesClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DevicesClient) ListResponder(resp *http.Response) (result DevicesQueryResult, 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 DevicesClient) listNextResults(lastResults DevicesQueryResult) (result DevicesQueryResult, err error) { - req, err := lastResults.devicesQueryResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "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, "mobileengagement.DevicesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DevicesClient) ListComplete(ctx context.Context, resourceGroupName string, appCollection string, appName string, top *int32, selectParameter string, filter string) (result DevicesQueryResultIterator, err error) { - result.page, err = client.List(ctx, resourceGroupName, appCollection, appName, top, selectParameter, filter) - return -} - -// TagByDeviceID update the tags registered for a set of devices running an application. Updates are performed -// asynchronously, meaning that a few seconds are needed before the modifications appear in the results of the Get -// device command. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. -func (client DevicesClient) TagByDeviceID(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DeviceTagsParameters) (result DeviceTagsResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Tags", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mobileengagement.DevicesClient", "TagByDeviceID", err.Error()) - } - - req, err := client.TagByDeviceIDPreparer(ctx, resourceGroupName, appCollection, appName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "TagByDeviceID", nil, "Failure preparing request") - return - } - - resp, err := client.TagByDeviceIDSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "TagByDeviceID", resp, "Failure sending request") - return - } - - result, err = client.TagByDeviceIDResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "TagByDeviceID", resp, "Failure responding to request") - } - - return -} - -// TagByDeviceIDPreparer prepares the TagByDeviceID request. -func (client DevicesClient) TagByDeviceIDPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DeviceTagsParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/tag", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TagByDeviceIDSender sends the TagByDeviceID request. The method will close the -// http.Response Body if it receives an error. -func (client DevicesClient) TagByDeviceIDSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// TagByDeviceIDResponder handles the response to the TagByDeviceID request. The method always -// closes the http.Response Body. -func (client DevicesClient) TagByDeviceIDResponder(resp *http.Response) (result DeviceTagsResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// TagByUserID update the tags registered for a set of users running an application. Updates are performed -// asynchronously, meaning that a few seconds are needed before the modifications appear in the results of the Get -// device command. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. -func (client DevicesClient) TagByUserID(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DeviceTagsParameters) (result DeviceTagsResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Tags", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mobileengagement.DevicesClient", "TagByUserID", err.Error()) - } - - req, err := client.TagByUserIDPreparer(ctx, resourceGroupName, appCollection, appName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "TagByUserID", nil, "Failure preparing request") - return - } - - resp, err := client.TagByUserIDSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "TagByUserID", resp, "Failure sending request") - return - } - - result, err = client.TagByUserIDResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "TagByUserID", resp, "Failure responding to request") - } - - return -} - -// TagByUserIDPreparer prepares the TagByUserID request. -func (client DevicesClient) TagByUserIDPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DeviceTagsParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/users/tag", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TagByUserIDSender sends the TagByUserID request. The method will close the -// http.Response Body if it receives an error. -func (client DevicesClient) TagByUserIDSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// TagByUserIDResponder handles the response to the TagByUserID request. The method always -// closes the http.Response Body. -func (client DevicesClient) TagByUserIDResponder(resp *http.Response) (result DeviceTagsResult, 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/mobileengagement/mgmt/2014-12-01/mobileengagement/exporttasks.go b/services/mobileengagement/mgmt/2014-12-01/mobileengagement/exporttasks.go deleted file mode 100644 index 69b245ea4b34..000000000000 --- a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/exporttasks.go +++ /dev/null @@ -1,1017 +0,0 @@ -package mobileengagement - -// 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" - "net/http" -) - -// ExportTasksClient is the microsoft Azure Mobile Engagement REST APIs. -type ExportTasksClient struct { - BaseClient -} - -// NewExportTasksClient creates an instance of the ExportTasksClient client. -func NewExportTasksClient(subscriptionID string) ExportTasksClient { - return NewExportTasksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExportTasksClientWithBaseURI creates an instance of the ExportTasksClient client. -func NewExportTasksClientWithBaseURI(baseURI string, subscriptionID string) ExportTasksClient { - return ExportTasksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateActivitiesTask creates a task to export activities. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. -func (client ExportTasksClient) CreateActivitiesTask(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DateRangeExportTaskParameter) (result ExportTaskResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ContainerURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.StartDate", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.EndDate", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mobileengagement.ExportTasksClient", "CreateActivitiesTask", err.Error()) - } - - req, err := client.CreateActivitiesTaskPreparer(ctx, resourceGroupName, appCollection, appName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateActivitiesTask", nil, "Failure preparing request") - return - } - - resp, err := client.CreateActivitiesTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateActivitiesTask", resp, "Failure sending request") - return - } - - result, err = client.CreateActivitiesTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateActivitiesTask", resp, "Failure responding to request") - } - - return -} - -// CreateActivitiesTaskPreparer prepares the CreateActivitiesTask request. -func (client ExportTasksClient) CreateActivitiesTaskPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DateRangeExportTaskParameter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/activities", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateActivitiesTaskSender sends the CreateActivitiesTask request. The method will close the -// http.Response Body if it receives an error. -func (client ExportTasksClient) CreateActivitiesTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateActivitiesTaskResponder handles the response to the CreateActivitiesTask request. The method always -// closes the http.Response Body. -func (client ExportTasksClient) CreateActivitiesTaskResponder(resp *http.Response) (result ExportTaskResult, 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 -} - -// CreateCrashesTask creates a task to export crashes. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. -func (client ExportTasksClient) CreateCrashesTask(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DateRangeExportTaskParameter) (result ExportTaskResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ContainerURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.StartDate", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.EndDate", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mobileengagement.ExportTasksClient", "CreateCrashesTask", err.Error()) - } - - req, err := client.CreateCrashesTaskPreparer(ctx, resourceGroupName, appCollection, appName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateCrashesTask", nil, "Failure preparing request") - return - } - - resp, err := client.CreateCrashesTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateCrashesTask", resp, "Failure sending request") - return - } - - result, err = client.CreateCrashesTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateCrashesTask", resp, "Failure responding to request") - } - - return -} - -// CreateCrashesTaskPreparer prepares the CreateCrashesTask request. -func (client ExportTasksClient) CreateCrashesTaskPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DateRangeExportTaskParameter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/crashes", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateCrashesTaskSender sends the CreateCrashesTask request. The method will close the -// http.Response Body if it receives an error. -func (client ExportTasksClient) CreateCrashesTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateCrashesTaskResponder handles the response to the CreateCrashesTask request. The method always -// closes the http.Response Body. -func (client ExportTasksClient) CreateCrashesTaskResponder(resp *http.Response) (result ExportTaskResult, 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 -} - -// CreateErrorsTask creates a task to export errors. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. -func (client ExportTasksClient) CreateErrorsTask(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DateRangeExportTaskParameter) (result ExportTaskResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ContainerURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.StartDate", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.EndDate", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mobileengagement.ExportTasksClient", "CreateErrorsTask", err.Error()) - } - - req, err := client.CreateErrorsTaskPreparer(ctx, resourceGroupName, appCollection, appName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateErrorsTask", nil, "Failure preparing request") - return - } - - resp, err := client.CreateErrorsTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateErrorsTask", resp, "Failure sending request") - return - } - - result, err = client.CreateErrorsTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateErrorsTask", resp, "Failure responding to request") - } - - return -} - -// CreateErrorsTaskPreparer prepares the CreateErrorsTask request. -func (client ExportTasksClient) CreateErrorsTaskPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DateRangeExportTaskParameter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/errors", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateErrorsTaskSender sends the CreateErrorsTask request. The method will close the -// http.Response Body if it receives an error. -func (client ExportTasksClient) CreateErrorsTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateErrorsTaskResponder handles the response to the CreateErrorsTask request. The method always -// closes the http.Response Body. -func (client ExportTasksClient) CreateErrorsTaskResponder(resp *http.Response) (result ExportTaskResult, 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 -} - -// CreateEventsTask creates a task to export events. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. -func (client ExportTasksClient) CreateEventsTask(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DateRangeExportTaskParameter) (result ExportTaskResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ContainerURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.StartDate", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.EndDate", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mobileengagement.ExportTasksClient", "CreateEventsTask", err.Error()) - } - - req, err := client.CreateEventsTaskPreparer(ctx, resourceGroupName, appCollection, appName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateEventsTask", nil, "Failure preparing request") - return - } - - resp, err := client.CreateEventsTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateEventsTask", resp, "Failure sending request") - return - } - - result, err = client.CreateEventsTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateEventsTask", resp, "Failure responding to request") - } - - return -} - -// CreateEventsTaskPreparer prepares the CreateEventsTask request. -func (client ExportTasksClient) CreateEventsTaskPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DateRangeExportTaskParameter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/events", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateEventsTaskSender sends the CreateEventsTask request. The method will close the -// http.Response Body if it receives an error. -func (client ExportTasksClient) CreateEventsTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateEventsTaskResponder handles the response to the CreateEventsTask request. The method always -// closes the http.Response Body. -func (client ExportTasksClient) CreateEventsTaskResponder(resp *http.Response) (result ExportTaskResult, 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 -} - -// CreateFeedbackTaskByCampaign creates a task to export push campaign data for a set of campaigns. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. -func (client ExportTasksClient) CreateFeedbackTaskByCampaign(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters FeedbackByCampaignParameter) (result ExportTaskResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ContainerURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.CampaignIds", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.CampaignIds", Name: validation.MinItems, Rule: 1, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("mobileengagement.ExportTasksClient", "CreateFeedbackTaskByCampaign", err.Error()) - } - - req, err := client.CreateFeedbackTaskByCampaignPreparer(ctx, resourceGroupName, appCollection, appName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateFeedbackTaskByCampaign", nil, "Failure preparing request") - return - } - - resp, err := client.CreateFeedbackTaskByCampaignSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateFeedbackTaskByCampaign", resp, "Failure sending request") - return - } - - result, err = client.CreateFeedbackTaskByCampaignResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateFeedbackTaskByCampaign", resp, "Failure responding to request") - } - - return -} - -// CreateFeedbackTaskByCampaignPreparer prepares the CreateFeedbackTaskByCampaign request. -func (client ExportTasksClient) CreateFeedbackTaskByCampaignPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters FeedbackByCampaignParameter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/feedbackByCampaign", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateFeedbackTaskByCampaignSender sends the CreateFeedbackTaskByCampaign request. The method will close the -// http.Response Body if it receives an error. -func (client ExportTasksClient) CreateFeedbackTaskByCampaignSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateFeedbackTaskByCampaignResponder handles the response to the CreateFeedbackTaskByCampaign request. The method always -// closes the http.Response Body. -func (client ExportTasksClient) CreateFeedbackTaskByCampaignResponder(resp *http.Response) (result ExportTaskResult, 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 -} - -// CreateFeedbackTaskByDateRange creates a task to export push campaign data for a date range. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. -func (client ExportTasksClient) CreateFeedbackTaskByDateRange(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters FeedbackByDateRangeParameter) (result ExportTaskResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ContainerURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.CampaignWindowStart", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.CampaignWindowEnd", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mobileengagement.ExportTasksClient", "CreateFeedbackTaskByDateRange", err.Error()) - } - - req, err := client.CreateFeedbackTaskByDateRangePreparer(ctx, resourceGroupName, appCollection, appName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateFeedbackTaskByDateRange", nil, "Failure preparing request") - return - } - - resp, err := client.CreateFeedbackTaskByDateRangeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateFeedbackTaskByDateRange", resp, "Failure sending request") - return - } - - result, err = client.CreateFeedbackTaskByDateRangeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateFeedbackTaskByDateRange", resp, "Failure responding to request") - } - - return -} - -// CreateFeedbackTaskByDateRangePreparer prepares the CreateFeedbackTaskByDateRange request. -func (client ExportTasksClient) CreateFeedbackTaskByDateRangePreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters FeedbackByDateRangeParameter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/feedbackByDate", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateFeedbackTaskByDateRangeSender sends the CreateFeedbackTaskByDateRange request. The method will close the -// http.Response Body if it receives an error. -func (client ExportTasksClient) CreateFeedbackTaskByDateRangeSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateFeedbackTaskByDateRangeResponder handles the response to the CreateFeedbackTaskByDateRange request. The method always -// closes the http.Response Body. -func (client ExportTasksClient) CreateFeedbackTaskByDateRangeResponder(resp *http.Response) (result ExportTaskResult, 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 -} - -// CreateJobsTask creates a task to export jobs. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. -func (client ExportTasksClient) CreateJobsTask(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DateRangeExportTaskParameter) (result ExportTaskResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ContainerURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.StartDate", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.EndDate", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mobileengagement.ExportTasksClient", "CreateJobsTask", err.Error()) - } - - req, err := client.CreateJobsTaskPreparer(ctx, resourceGroupName, appCollection, appName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateJobsTask", nil, "Failure preparing request") - return - } - - resp, err := client.CreateJobsTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateJobsTask", resp, "Failure sending request") - return - } - - result, err = client.CreateJobsTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateJobsTask", resp, "Failure responding to request") - } - - return -} - -// CreateJobsTaskPreparer prepares the CreateJobsTask request. -func (client ExportTasksClient) CreateJobsTaskPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DateRangeExportTaskParameter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/jobs", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateJobsTaskSender sends the CreateJobsTask request. The method will close the -// http.Response Body if it receives an error. -func (client ExportTasksClient) CreateJobsTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateJobsTaskResponder handles the response to the CreateJobsTask request. The method always -// closes the http.Response Body. -func (client ExportTasksClient) CreateJobsTaskResponder(resp *http.Response) (result ExportTaskResult, 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 -} - -// CreateSessionsTask creates a task to export sessions. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. -func (client ExportTasksClient) CreateSessionsTask(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DateRangeExportTaskParameter) (result ExportTaskResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ContainerURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.StartDate", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.EndDate", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mobileengagement.ExportTasksClient", "CreateSessionsTask", err.Error()) - } - - req, err := client.CreateSessionsTaskPreparer(ctx, resourceGroupName, appCollection, appName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateSessionsTask", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSessionsTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateSessionsTask", resp, "Failure sending request") - return - } - - result, err = client.CreateSessionsTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateSessionsTask", resp, "Failure responding to request") - } - - return -} - -// CreateSessionsTaskPreparer prepares the CreateSessionsTask request. -func (client ExportTasksClient) CreateSessionsTaskPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters DateRangeExportTaskParameter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/sessions", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSessionsTaskSender sends the CreateSessionsTask request. The method will close the -// http.Response Body if it receives an error. -func (client ExportTasksClient) CreateSessionsTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateSessionsTaskResponder handles the response to the CreateSessionsTask request. The method always -// closes the http.Response Body. -func (client ExportTasksClient) CreateSessionsTaskResponder(resp *http.Response) (result ExportTaskResult, 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 -} - -// CreateTagsTask creates a task to export tags. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. -func (client ExportTasksClient) CreateTagsTask(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters ExportTaskParameter) (result ExportTaskResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ContainerURL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mobileengagement.ExportTasksClient", "CreateTagsTask", err.Error()) - } - - req, err := client.CreateTagsTaskPreparer(ctx, resourceGroupName, appCollection, appName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateTagsTask", nil, "Failure preparing request") - return - } - - resp, err := client.CreateTagsTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateTagsTask", resp, "Failure sending request") - return - } - - result, err = client.CreateTagsTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateTagsTask", resp, "Failure responding to request") - } - - return -} - -// CreateTagsTaskPreparer prepares the CreateTagsTask request. -func (client ExportTasksClient) CreateTagsTaskPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters ExportTaskParameter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/tags", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateTagsTaskSender sends the CreateTagsTask request. The method will close the -// http.Response Body if it receives an error. -func (client ExportTasksClient) CreateTagsTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateTagsTaskResponder handles the response to the CreateTagsTask request. The method always -// closes the http.Response Body. -func (client ExportTasksClient) CreateTagsTaskResponder(resp *http.Response) (result ExportTaskResult, 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 -} - -// CreateTokensTask creates a task to export tags. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. -func (client ExportTasksClient) CreateTokensTask(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters ExportTaskParameter) (result ExportTaskResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ContainerURL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mobileengagement.ExportTasksClient", "CreateTokensTask", err.Error()) - } - - req, err := client.CreateTokensTaskPreparer(ctx, resourceGroupName, appCollection, appName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateTokensTask", nil, "Failure preparing request") - return - } - - resp, err := client.CreateTokensTaskSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateTokensTask", resp, "Failure sending request") - return - } - - result, err = client.CreateTokensTaskResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateTokensTask", resp, "Failure responding to request") - } - - return -} - -// CreateTokensTaskPreparer prepares the CreateTokensTask request. -func (client ExportTasksClient) CreateTokensTaskPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters ExportTaskParameter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/tokens", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateTokensTaskSender sends the CreateTokensTask request. The method will close the -// http.Response Body if it receives an error. -func (client ExportTasksClient) CreateTokensTaskSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateTokensTaskResponder handles the response to the CreateTokensTask request. The method always -// closes the http.Response Body. -func (client ExportTasksClient) CreateTokensTaskResponder(resp *http.Response) (result ExportTaskResult, 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 retrieves information about a previously created export task. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. ID is export task identifier. -func (client ExportTasksClient) Get(ctx context.Context, resourceGroupName string, appCollection string, appName string, ID string) (result ExportTaskResult, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, appCollection, appName, ID) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExportTasksClient) GetPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, ID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "id": autorest.Encode("path", ID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/{id}", 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 ExportTasksClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExportTasksClient) GetResponder(resp *http.Response) (result ExportTaskResult, 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 get the list of export tasks. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. skip is control paging of export tasks, start results at the given offset, defaults -// to 0 (1st page of data). top is control paging of export tasks, number of export tasks to return with each call. -// By default, it returns all export tasks with a default paging of 20. -// The response contains a `nextLink` property describing the path to get the next page if there are more results. -// The maximum paging limit for $top is 40. orderby is sort results by an expression which looks like -// `$orderby=taskId asc` (default when not specified). -// The syntax is orderby={property} {direction} or just orderby={property}. -// Properties that can be specified for sorting: taskId, errorDetails, dateCreated, taskStatus, and dateCreated. -// The available directions are asc (for ascending order) and desc (for descending order). -// When not specified the asc direction is used. -// Only one orderby property can be specified. -func (client ExportTasksClient) List(ctx context.Context, resourceGroupName string, appCollection string, appName string, skip *int32, top *int32, orderby string) (result ExportTaskListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 40, Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("mobileengagement.ExportTasksClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, appCollection, appName, skip, top, orderby) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.etlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "List", resp, "Failure sending request") - return - } - - result.etlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ExportTasksClient) ListPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, skip *int32, top *int32, orderby string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["$skip"] = autorest.Encode("query", 0) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } else { - queryParameters["$top"] = autorest.Encode("query", 20) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks", 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 ExportTasksClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExportTasksClient) ListResponder(resp *http.Response) (result ExportTaskListResult, 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 ExportTasksClient) listNextResults(lastResults ExportTaskListResult) (result ExportTaskListResult, err error) { - req, err := lastResults.exportTaskListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "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, "mobileengagement.ExportTasksClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExportTasksClient) ListComplete(ctx context.Context, resourceGroupName string, appCollection string, appName string, skip *int32, top *int32, orderby string) (result ExportTaskListResultIterator, err error) { - result.page, err = client.List(ctx, resourceGroupName, appCollection, appName, skip, top, orderby) - return -} diff --git a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/importtasks.go b/services/mobileengagement/mgmt/2014-12-01/mobileengagement/importtasks.go deleted file mode 100644 index 3c0a99b40185..000000000000 --- a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/importtasks.go +++ /dev/null @@ -1,311 +0,0 @@ -package mobileengagement - -// 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" - "net/http" -) - -// ImportTasksClient is the microsoft Azure Mobile Engagement REST APIs. -type ImportTasksClient struct { - BaseClient -} - -// NewImportTasksClient creates an instance of the ImportTasksClient client. -func NewImportTasksClient(subscriptionID string) ImportTasksClient { - return NewImportTasksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewImportTasksClientWithBaseURI creates an instance of the ImportTasksClient client. -func NewImportTasksClientWithBaseURI(baseURI string, subscriptionID string) ImportTasksClient { - return ImportTasksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates a job to import the specified data to a storageUrl. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. -func (client ImportTasksClient) Create(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters ImportTask) (result ImportTaskResult, err error) { - req, err := client.CreatePreparer(ctx, resourceGroupName, appCollection, appName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "Create", resp, "Failure responding to request") - } - - return -} - -// CreatePreparer prepares the Create request. -func (client ImportTasksClient) CreatePreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, parameters ImportTask) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/importTasks", 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 ImportTasksClient) CreateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client ImportTasksClient) CreateResponder(resp *http.Response) (result ImportTaskResult, 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 -} - -// Get the Get import job operation retrieves information about a previously created import job. -// -// ID is import job identifier. resourceGroupName is the name of the resource group. appCollection is application -// collection. appName is application resource name. -func (client ImportTasksClient) Get(ctx context.Context, ID string, resourceGroupName string, appCollection string, appName string) (result ImportTaskResult, err error) { - req, err := client.GetPreparer(ctx, ID, resourceGroupName, appCollection, appName) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ImportTasksClient) GetPreparer(ctx context.Context, ID string, resourceGroupName string, appCollection string, appName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "id": autorest.Encode("path", ID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/importTasks/{id}", 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 ImportTasksClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ImportTasksClient) GetResponder(resp *http.Response) (result ImportTaskResult, 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 get the list of import jobs. -// -// resourceGroupName is the name of the resource group. appCollection is application collection. appName is -// application resource name. skip is control paging of import jobs, start results at the given offset, defaults to -// 0 (1st page of data). top is control paging of import jobs, number of import jobs to return with each call. By -// default, it returns all import jobs with a default paging of 20. -// The response contains a `nextLink` property describing the path to get the next page if there are more results. -// The maximum paging limit for $top is 40. orderby is sort results by an expression which looks like -// `$orderby=jobId asc` (default when not specified). -// The syntax is orderby={property} {direction} or just orderby={property}. -// Properties that can be specified for sorting: jobId, errorDetails, dateCreated, jobStatus, and dateCreated. -// The available directions are asc (for ascending order) and desc (for descending order). -// When not specified the asc direction is used. -// Only one orderby property can be specified. -func (client ImportTasksClient) List(ctx context.Context, resourceGroupName string, appCollection string, appName string, skip *int32, top *int32, orderby string) (result ImportTaskListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 40, Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("mobileengagement.ImportTasksClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, appCollection, appName, skip, top, orderby) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.itlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "List", resp, "Failure sending request") - return - } - - result.itlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ImportTasksClient) ListPreparer(ctx context.Context, resourceGroupName string, appCollection string, appName string, skip *int32, top *int32, orderby string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appCollection": autorest.Encode("path", appCollection), - "appName": autorest.Encode("path", appName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } else { - queryParameters["$skip"] = autorest.Encode("query", 0) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } else { - queryParameters["$top"] = autorest.Encode("query", 20) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/importTasks", 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 ImportTasksClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ImportTasksClient) ListResponder(resp *http.Response) (result ImportTaskListResult, 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 ImportTasksClient) listNextResults(lastResults ImportTaskListResult) (result ImportTaskListResult, err error) { - req, err := lastResults.importTaskListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "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, "mobileengagement.ImportTasksClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ImportTasksClient) ListComplete(ctx context.Context, resourceGroupName string, appCollection string, appName string, skip *int32, top *int32, orderby string) (result ImportTaskListResultIterator, err error) { - result.page, err = client.List(ctx, resourceGroupName, appCollection, appName, skip, top, orderby) - return -} diff --git a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/models.go b/services/mobileengagement/mgmt/2014-12-01/mobileengagement/models.go deleted file mode 100644 index b43297c14d8c..000000000000 --- a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/models.go +++ /dev/null @@ -1,5874 +0,0 @@ -package mobileengagement - -// 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" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "net/http" -) - -// AudienceOperators enumerates the values for audience operators. -type AudienceOperators string - -const ( - // EQ ... - EQ AudienceOperators = "EQ" - // GE ... - GE AudienceOperators = "GE" - // GT ... - GT AudienceOperators = "GT" - // LE ... - LE AudienceOperators = "LE" - // LT ... - LT AudienceOperators = "LT" -) - -// PossibleAudienceOperatorsValues returns an array of possible values for the AudienceOperators const type. -func PossibleAudienceOperatorsValues() []AudienceOperators { - return []AudienceOperators{EQ, GE, GT, LE, LT} -} - -// CampaignFeedbacks enumerates the values for campaign feedbacks. -type CampaignFeedbacks string - -const ( - // Actioned ... - Actioned CampaignFeedbacks = "actioned" - // Exited ... - Exited CampaignFeedbacks = "exited" - // Pushed ... - Pushed CampaignFeedbacks = "pushed" - // Replied ... - Replied CampaignFeedbacks = "replied" -) - -// PossibleCampaignFeedbacksValues returns an array of possible values for the CampaignFeedbacks const type. -func PossibleCampaignFeedbacksValues() []CampaignFeedbacks { - return []CampaignFeedbacks{Actioned, Exited, Pushed, Replied} -} - -// CampaignKinds enumerates the values for campaign kinds. -type CampaignKinds string - -const ( - // Announcements ... - Announcements CampaignKinds = "announcements" - // DataPushes ... - DataPushes CampaignKinds = "dataPushes" - // NativePushes ... - NativePushes CampaignKinds = "nativePushes" - // Polls ... - Polls CampaignKinds = "polls" -) - -// PossibleCampaignKindsValues returns an array of possible values for the CampaignKinds const type. -func PossibleCampaignKindsValues() []CampaignKinds { - return []CampaignKinds{Announcements, DataPushes, NativePushes, Polls} -} - -// CampaignStates enumerates the values for campaign states. -type CampaignStates string - -const ( - // Draft ... - Draft CampaignStates = "draft" - // Finished ... - Finished CampaignStates = "finished" - // InProgress ... - InProgress CampaignStates = "in-progress" - // Queued ... - Queued CampaignStates = "queued" - // Scheduled ... - Scheduled CampaignStates = "scheduled" -) - -// PossibleCampaignStatesValues returns an array of possible values for the CampaignStates const type. -func PossibleCampaignStatesValues() []CampaignStates { - return []CampaignStates{Draft, Finished, InProgress, Queued, Scheduled} -} - -// CampaignType enumerates the values for campaign type. -type CampaignType string - -const ( - // Announcement ... - Announcement CampaignType = "Announcement" - // DataPush ... - DataPush CampaignType = "DataPush" - // NativePush ... - NativePush CampaignType = "NativePush" - // Poll ... - Poll CampaignType = "Poll" -) - -// PossibleCampaignTypeValues returns an array of possible values for the CampaignType const type. -func PossibleCampaignTypeValues() []CampaignType { - return []CampaignType{Announcement, DataPush, NativePush, Poll} -} - -// CampaignTypes enumerates the values for campaign types. -type CampaignTypes string - -const ( - // OnlyNotif ... - OnlyNotif CampaignTypes = "only_notif" - // Textbase64 ... - Textbase64 CampaignTypes = "text/base64" - // Texthtml ... - Texthtml CampaignTypes = "text/html" - // Textplain ... - Textplain CampaignTypes = "text/plain" -) - -// PossibleCampaignTypesValues returns an array of possible values for the CampaignTypes const type. -func PossibleCampaignTypesValues() []CampaignTypes { - return []CampaignTypes{OnlyNotif, Textbase64, Texthtml, Textplain} -} - -// DeliveryTimes enumerates the values for delivery times. -type DeliveryTimes string - -const ( - // Any ... - Any DeliveryTimes = "any" - // Background ... - Background DeliveryTimes = "background" - // Session ... - Session DeliveryTimes = "session" -) - -// PossibleDeliveryTimesValues returns an array of possible values for the DeliveryTimes const type. -func PossibleDeliveryTimesValues() []DeliveryTimes { - return []DeliveryTimes{Any, Background, Session} -} - -// ExportFormat enumerates the values for export format. -type ExportFormat string - -const ( - // CsvBlob ... - CsvBlob ExportFormat = "CsvBlob" - // JSONBlob ... - JSONBlob ExportFormat = "JsonBlob" -) - -// PossibleExportFormatValues returns an array of possible values for the ExportFormat const type. -func PossibleExportFormatValues() []ExportFormat { - return []ExportFormat{CsvBlob, JSONBlob} -} - -// ExportState enumerates the values for export state. -type ExportState string - -const ( - // ExportStateFailed ... - ExportStateFailed ExportState = "Failed" - // ExportStateQueued ... - ExportStateQueued ExportState = "Queued" - // ExportStateStarted ... - ExportStateStarted ExportState = "Started" - // ExportStateSucceeded ... - ExportStateSucceeded ExportState = "Succeeded" -) - -// PossibleExportStateValues returns an array of possible values for the ExportState const type. -func PossibleExportStateValues() []ExportState { - return []ExportState{ExportStateFailed, ExportStateQueued, ExportStateStarted, ExportStateSucceeded} -} - -// ExportType enumerates the values for export type. -type ExportType string - -const ( - // ExportTypeActivity ... - ExportTypeActivity ExportType = "Activity" - // ExportTypeCrash ... - ExportTypeCrash ExportType = "Crash" - // ExportTypeError ... - ExportTypeError ExportType = "Error" - // ExportTypeEvent ... - ExportTypeEvent ExportType = "Event" - // ExportTypeJob ... - ExportTypeJob ExportType = "Job" - // ExportTypePush ... - ExportTypePush ExportType = "Push" - // ExportTypeSession ... - ExportTypeSession ExportType = "Session" - // ExportTypeTag ... - ExportTypeTag ExportType = "Tag" - // ExportTypeToken ... - ExportTypeToken ExportType = "Token" -) - -// PossibleExportTypeValues returns an array of possible values for the ExportType const type. -func PossibleExportTypeValues() []ExportType { - return []ExportType{ExportTypeActivity, ExportTypeCrash, ExportTypeError, ExportTypeEvent, ExportTypeJob, ExportTypePush, ExportTypeSession, ExportTypeTag, ExportTypeToken} -} - -// JobStates enumerates the values for job states. -type JobStates string - -const ( - // JobStatesFailed ... - JobStatesFailed JobStates = "Failed" - // JobStatesQueued ... - JobStatesQueued JobStates = "Queued" - // JobStatesStarted ... - JobStatesStarted JobStates = "Started" - // JobStatesSucceeded ... - JobStatesSucceeded JobStates = "Succeeded" -) - -// PossibleJobStatesValues returns an array of possible values for the JobStates const type. -func PossibleJobStatesValues() []JobStates { - return []JobStates{JobStatesFailed, JobStatesQueued, JobStatesStarted, JobStatesSucceeded} -} - -// NotificationTypes enumerates the values for notification types. -type NotificationTypes string - -const ( - // Popup ... - Popup NotificationTypes = "popup" - // System ... - System NotificationTypes = "system" -) - -// PossibleNotificationTypesValues returns an array of possible values for the NotificationTypes const type. -func PossibleNotificationTypesValues() []NotificationTypes { - return []NotificationTypes{Popup, System} -} - -// ProvisioningStates enumerates the values for provisioning states. -type ProvisioningStates string - -const ( - // Creating ... - Creating ProvisioningStates = "Creating" - // Succeeded ... - Succeeded ProvisioningStates = "Succeeded" -) - -// PossibleProvisioningStatesValues returns an array of possible values for the ProvisioningStates const type. -func PossibleProvisioningStatesValues() []ProvisioningStates { - return []ProvisioningStates{Creating, Succeeded} -} - -// PushModes enumerates the values for push modes. -type PushModes string - -const ( - // Manual ... - Manual PushModes = "manual" - // OneShot ... - OneShot PushModes = "one-shot" - // RealTime ... - RealTime PushModes = "real-time" -) - -// PossiblePushModesValues returns an array of possible values for the PushModes const type. -func PossiblePushModesValues() []PushModes { - return []PushModes{Manual, OneShot, RealTime} -} - -// Type enumerates the values for type. -type Type string - -const ( - // TypeAnnouncementFeedback ... - TypeAnnouncementFeedback Type = "announcement-feedback" - // TypeApplicationVersion ... - TypeApplicationVersion Type = "application-version" - // TypeBooleanTag ... - TypeBooleanTag Type = "boolean-tag" - // TypeCarrierCountry ... - TypeCarrierCountry Type = "carrier-country" - // TypeCarrierName ... - TypeCarrierName Type = "carrier-name" - // TypeCriterion ... - TypeCriterion Type = "Criterion" - // TypeDatapushFeedback ... - TypeDatapushFeedback Type = "datapush-feedback" - // TypeDateTag ... - TypeDateTag Type = "date-tag" - // TypeDeviceManufacturer ... - TypeDeviceManufacturer Type = "device-manufacturer" - // TypeDeviceModel ... - TypeDeviceModel Type = "device-model" - // TypeFirmwareVersion ... - TypeFirmwareVersion Type = "firmware-version" - // TypeGeoFencing ... - TypeGeoFencing Type = "geo-fencing" - // TypeIntegerTag ... - TypeIntegerTag Type = "integer-tag" - // TypeLanguage ... - TypeLanguage Type = "language" - // TypeLocation ... - TypeLocation Type = "location" - // TypeNetworkType ... - TypeNetworkType Type = "network-type" - // TypePollAnswerFeedback ... - TypePollAnswerFeedback Type = "poll-answer-feedback" - // TypePollFeedback ... - TypePollFeedback Type = "poll-feedback" - // TypeScreenSize ... - TypeScreenSize Type = "screen-size" - // TypeSegment ... - TypeSegment Type = "segment" - // TypeStringTag ... - TypeStringTag Type = "string-tag" -) - -// PossibleTypeValues returns an array of possible values for the Type const type. -func PossibleTypeValues() []Type { - return []Type{TypeAnnouncementFeedback, TypeApplicationVersion, TypeBooleanTag, TypeCarrierCountry, TypeCarrierName, TypeCriterion, TypeDatapushFeedback, TypeDateTag, TypeDeviceManufacturer, TypeDeviceModel, TypeFirmwareVersion, TypeGeoFencing, TypeIntegerTag, TypeLanguage, TypeLocation, TypeNetworkType, TypePollAnswerFeedback, TypePollFeedback, TypeScreenSize, TypeSegment, TypeStringTag} -} - -// TypeBasicFilter enumerates the values for type basic filter. -type TypeBasicFilter string - -const ( - // TypeAppInfo ... - TypeAppInfo TypeBasicFilter = "app-info" - // TypeEngageActiveUsers ... - TypeEngageActiveUsers TypeBasicFilter = "engage-active-users" - // TypeEngageIdleUsers ... - TypeEngageIdleUsers TypeBasicFilter = "engage-idle-users" - // TypeEngageNewUsers ... - TypeEngageNewUsers TypeBasicFilter = "engage-new-users" - // TypeEngageOldUsers ... - TypeEngageOldUsers TypeBasicFilter = "engage-old-users" - // TypeEngageSubset ... - TypeEngageSubset TypeBasicFilter = "engage-subset" - // TypeFilter ... - TypeFilter TypeBasicFilter = "Filter" - // TypeNativePushEnabled ... - TypeNativePushEnabled TypeBasicFilter = "native-push-enabled" - // TypePushQuota ... - TypePushQuota TypeBasicFilter = "push-quota" -) - -// PossibleTypeBasicFilterValues returns an array of possible values for the TypeBasicFilter const type. -func PossibleTypeBasicFilterValues() []TypeBasicFilter { - return []TypeBasicFilter{TypeAppInfo, TypeEngageActiveUsers, TypeEngageIdleUsers, TypeEngageNewUsers, TypeEngageOldUsers, TypeEngageSubset, TypeFilter, TypeNativePushEnabled, TypePushQuota} -} - -// AnnouncementFeedbackCriterion used to target devices who received an announcement. -type AnnouncementFeedbackCriterion struct { - // ContentID - The unique identifier of the announcement. - ContentID *int32 `json:"content-id,omitempty"` - // Action - Action that was performed on the announcement. Possible values include: 'Pushed', 'Replied', 'Actioned', 'Exited' - Action CampaignFeedbacks `json:"action,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) MarshalJSON() ([]byte, error) { - afc.Type = TypeAnnouncementFeedback - objectMap := make(map[string]interface{}) - if afc.ContentID != nil { - objectMap["content-id"] = afc.ContentID - } - if afc.Action != "" { - objectMap["action"] = afc.Action - } - if afc.Type != "" { - objectMap["type"] = afc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return &afc, true -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion. -func (afc AnnouncementFeedbackCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &afc, true -} - -// APIError ... -type APIError struct { - Error *APIErrorError `json:"error,omitempty"` -} - -// APIErrorError ... -type APIErrorError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` -} - -// App the Mobile Engagement App resource. -type App struct { - *AppProperties `json:"properties,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - 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 App. -func (a App) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if a.AppProperties != nil { - objectMap["properties"] = a.AppProperties - } - if a.ID != nil { - objectMap["id"] = a.ID - } - if a.Name != nil { - objectMap["name"] = a.Name - } - if a.Type != nil { - objectMap["type"] = a.Type - } - if a.Location != nil { - objectMap["location"] = a.Location - } - if a.Tags != nil { - objectMap["tags"] = a.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for App struct. -func (a *App) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var appProperties AppProperties - err = json.Unmarshal(*v, &appProperties) - if err != nil { - return err - } - a.AppProperties = &appProperties - } - 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 - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - a.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - a.Tags = tags - } - } - } - - return nil -} - -// AppCollection the AppCollection resource. -type AppCollection struct { - *AppCollectionProperties `json:"properties,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - 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 AppCollection. -func (ac AppCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ac.AppCollectionProperties != nil { - objectMap["properties"] = ac.AppCollectionProperties - } - if ac.ID != nil { - objectMap["id"] = ac.ID - } - if ac.Name != nil { - objectMap["name"] = ac.Name - } - if ac.Type != nil { - objectMap["type"] = ac.Type - } - if ac.Location != nil { - objectMap["location"] = ac.Location - } - if ac.Tags != nil { - objectMap["tags"] = ac.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AppCollection struct. -func (ac *AppCollection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var appCollectionProperties AppCollectionProperties - err = json.Unmarshal(*v, &appCollectionProperties) - if err != nil { - return err - } - ac.AppCollectionProperties = &appCollectionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ac.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ac.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ac.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ac.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ac.Tags = tags - } - } - } - - return nil -} - -// AppCollectionListResult the list AppCollections operation response. -type AppCollectionListResult struct { - autorest.Response `json:"-"` - // Value - The list of AppCollections and their properties. - Value *[]AppCollection `json:"value,omitempty"` - // NextLink - When the results are paged, the nextLink is the URI for the next page of results. This property is empty when there are no additional pages. - NextLink *string `json:"nextLink,omitempty"` -} - -// AppCollectionListResultIterator provides access to a complete listing of AppCollection values. -type AppCollectionListResultIterator struct { - i int - page AppCollectionListResultPage -} - -// Next 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 *AppCollectionListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AppCollectionListResultIterator) 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 AppCollectionListResultIterator) Response() AppCollectionListResult { - 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 AppCollectionListResultIterator) Value() AppCollection { - if !iter.page.NotDone() { - return AppCollection{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (aclr AppCollectionListResult) IsEmpty() bool { - return aclr.Value == nil || len(*aclr.Value) == 0 -} - -// appCollectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (aclr AppCollectionListResult) appCollectionListResultPreparer() (*http.Request, error) { - if aclr.NextLink == nil || len(to.String(aclr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(aclr.NextLink))) -} - -// AppCollectionListResultPage contains a page of AppCollection values. -type AppCollectionListResultPage struct { - fn func(AppCollectionListResult) (AppCollectionListResult, error) - aclr AppCollectionListResult -} - -// 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. -func (page *AppCollectionListResultPage) Next() error { - next, err := page.fn(page.aclr) - if err != nil { - return err - } - page.aclr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AppCollectionListResultPage) NotDone() bool { - return !page.aclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AppCollectionListResultPage) Response() AppCollectionListResult { - return page.aclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AppCollectionListResultPage) Values() []AppCollection { - if page.aclr.IsEmpty() { - return nil - } - return *page.aclr.Value -} - -// AppCollectionNameAvailability ... -type AppCollectionNameAvailability struct { - autorest.Response `json:"-"` - // Name - Name. - Name *string `json:"name,omitempty"` - // Available - Available. - Available *bool `json:"available,omitempty"` - // UnavailabilityReason - UnavailabilityReason. - UnavailabilityReason *string `json:"unavailabilityReason,omitempty"` -} - -// AppCollectionProperties ... -type AppCollectionProperties struct { - // ProvisioningState - Mobile Engagement AppCollection Properties. Possible values include: 'Creating', 'Succeeded' - ProvisioningState ProvisioningStates `json:"provisioningState,omitempty"` -} - -// AppInfoFilter send only to users who have some app info set. This is a special filter that is automatically -// added if your campaign contains appInfo parameters. It is not intended to be public and should not be used as it -// could be removed or replaced by the API. -type AppInfoFilter struct { - // AppInfo - An array containing all the required appInfo. - AppInfo *[]string `json:"appInfo,omitempty"` - // Type - Possible values include: 'TypeFilter', 'TypeEngageSubset', 'TypeEngageOldUsers', 'TypeEngageNewUsers', 'TypeEngageActiveUsers', 'TypeEngageIdleUsers', 'TypeNativePushEnabled', 'TypePushQuota', 'TypeAppInfo' - Type TypeBasicFilter `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for AppInfoFilter. -func (aif AppInfoFilter) MarshalJSON() ([]byte, error) { - aif.Type = TypeAppInfo - objectMap := make(map[string]interface{}) - if aif.AppInfo != nil { - objectMap["appInfo"] = aif.AppInfo - } - if aif.Type != "" { - objectMap["type"] = aif.Type - } - return json.Marshal(objectMap) -} - -// AsEngageSubsetFilter is the BasicFilter implementation for AppInfoFilter. -func (aif AppInfoFilter) AsEngageSubsetFilter() (*EngageSubsetFilter, bool) { - return nil, false -} - -// AsEngageOldUsersFilter is the BasicFilter implementation for AppInfoFilter. -func (aif AppInfoFilter) AsEngageOldUsersFilter() (*EngageOldUsersFilter, bool) { - return nil, false -} - -// AsEngageNewUsersFilter is the BasicFilter implementation for AppInfoFilter. -func (aif AppInfoFilter) AsEngageNewUsersFilter() (*EngageNewUsersFilter, bool) { - return nil, false -} - -// AsEngageActiveUsersFilter is the BasicFilter implementation for AppInfoFilter. -func (aif AppInfoFilter) AsEngageActiveUsersFilter() (*EngageActiveUsersFilter, bool) { - return nil, false -} - -// AsEngageIdleUsersFilter is the BasicFilter implementation for AppInfoFilter. -func (aif AppInfoFilter) AsEngageIdleUsersFilter() (*EngageIdleUsersFilter, bool) { - return nil, false -} - -// AsNativePushEnabledFilter is the BasicFilter implementation for AppInfoFilter. -func (aif AppInfoFilter) AsNativePushEnabledFilter() (*NativePushEnabledFilter, bool) { - return nil, false -} - -// AsPushQuotaFilter is the BasicFilter implementation for AppInfoFilter. -func (aif AppInfoFilter) AsPushQuotaFilter() (*PushQuotaFilter, bool) { - return nil, false -} - -// AsAppInfoFilter is the BasicFilter implementation for AppInfoFilter. -func (aif AppInfoFilter) AsAppInfoFilter() (*AppInfoFilter, bool) { - return &aif, true -} - -// AsFilter is the BasicFilter implementation for AppInfoFilter. -func (aif AppInfoFilter) AsFilter() (*Filter, bool) { - return nil, false -} - -// AsBasicFilter is the BasicFilter implementation for AppInfoFilter. -func (aif AppInfoFilter) AsBasicFilter() (BasicFilter, bool) { - return &aif, true -} - -// ApplicationVersionCriterion used to target devices based on the version of the application they are using. -type ApplicationVersionCriterion struct { - // Name - The application version. - Name *string `json:"name,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) MarshalJSON() ([]byte, error) { - avc.Type = TypeApplicationVersion - objectMap := make(map[string]interface{}) - if avc.Name != nil { - objectMap["name"] = avc.Name - } - if avc.Type != "" { - objectMap["type"] = avc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return &avc, true -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for ApplicationVersionCriterion. -func (avc ApplicationVersionCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &avc, true -} - -// AppListResult the list Apps operation response. -type AppListResult struct { - autorest.Response `json:"-"` - // Value - The list of Apps and their properties. - Value *[]App `json:"value,omitempty"` - // NextLink - When the results are paged, the nextLink is the URI for the next page of results. This property is empty when there are no additional pages. - NextLink *string `json:"nextLink,omitempty"` -} - -// AppListResultIterator provides access to a complete listing of App values. -type AppListResultIterator struct { - i int - page AppListResultPage -} - -// Next 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 *AppListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AppListResultIterator) 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 AppListResultIterator) Response() AppListResult { - 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 AppListResultIterator) Value() App { - if !iter.page.NotDone() { - return App{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (alr AppListResult) IsEmpty() bool { - return alr.Value == nil || len(*alr.Value) == 0 -} - -// appListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alr AppListResult) appListResultPreparer() (*http.Request, error) { - if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alr.NextLink))) -} - -// AppListResultPage contains a page of App values. -type AppListResultPage struct { - fn func(AppListResult) (AppListResult, error) - alr AppListResult -} - -// 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. -func (page *AppListResultPage) Next() error { - next, err := page.fn(page.alr) - if err != nil { - return err - } - page.alr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AppListResultPage) NotDone() bool { - return !page.alr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AppListResultPage) Response() AppListResult { - return page.alr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AppListResultPage) Values() []App { - if page.alr.IsEmpty() { - return nil - } - return *page.alr.Value -} - -// AppProperties ... -type AppProperties struct { - // BackendID - The application unique identifier. - BackendID *string `json:"backendId,omitempty"` - // Platform - The platform of the app. - Platform *string `json:"platform,omitempty"` - // AppState - The state of the application. - AppState *string `json:"appState,omitempty"` -} - -// BooleanTagCriterion target devices based on a boolean tag value. -type BooleanTagCriterion struct { - // Name - The name of the custom tag. - Name *string `json:"name,omitempty"` - // Value - A custom boolean value to match. - Value *bool `json:"value,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for BooleanTagCriterion. -func (btc BooleanTagCriterion) MarshalJSON() ([]byte, error) { - btc.Type = TypeBooleanTag - objectMap := make(map[string]interface{}) - if btc.Name != nil { - objectMap["name"] = btc.Name - } - if btc.Value != nil { - objectMap["value"] = btc.Value - } - if btc.Type != "" { - objectMap["type"] = btc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return &btc, true -} - -// AsCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for BooleanTagCriterion. -func (btc BooleanTagCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &btc, true -} - -// Campaign ... -type Campaign struct { - // Name - Unique name of the campaign. - Name *string `json:"name,omitempty"` - // Audience - Specify which users will be targeted by this campaign. By default, all users will be targeted. If you set `pushMode` property to `manual`, the only thing you can specify in the audience is the push quota filter. An audience is a boolean expression made of criteria (variables) operators (`not`, `and` or `or`) and parenthesis. Additionally, a set of filters can be added to an audience. 65535 bytes max as per JSON encoding. - Audience *CampaignAudience `json:"audience,omitempty"` - // Category - Category of the campaign. Categories can be used on the application side to customize campaigns. - Category *string `json:"category,omitempty"` - // PushMode - Announcements/polls only. Defines how the campaign is pushed. Valid values are: * `real-time`: Never ending campaign, the campaign will be delivered to your existing users and also to your new users. * `one-shot`: In this mode, the campaign will be delivered only to your existing users (campaign will stop after that). * `manual`: In this mode, the campaign will not be pushed automatically to devices. You will have to use the Push campaign command to push the campaign to your end-users. Campaigns can be pushed multiple times to the same device. - // . Possible values include: 'RealTime', 'OneShot', 'Manual' - PushMode PushModes `json:"pushMode,omitempty"` - // Type - Applicable only to announcements and data pushes. Type of announcement. Valid values are: * `text/plain`: Text-only announcement: `body` property should only contain plain text. * `text/html`: HTML announcement: `body` attribute can contain HTML code. * `only_notif`: Notification-only announcement. With this kind of announcements, the `body`, `title`, `actionButtonText` and `exitButtonText` are ignored. Type of data push. Valid values are: * `text/plain`: Text only data push: `body` property must be plain text. * `text/base64`: Base 64 data push: `body` property must be encoded in base 64. - // . Possible values include: 'Textplain', 'Texthtml', 'OnlyNotif', 'Textbase64' - Type CampaignTypes `json:"type,omitempty"` - // DeliveryTime - Announcements/polls only. Defines when the campaign should be delivered. Valid values are: * `any`: Campaign will be delivered as soon as possible. * `background`: iOS only. Campaign will be only delivered when the application is in background (out of app). * `session`: Campaign will be delivered when the application is running. - // . Possible values include: 'Any', 'Background', 'Session' - DeliveryTime DeliveryTimes `json:"deliveryTime,omitempty"` - // DeliveryActivities - Announcements/polls only. Array containing the list of activities in which the campaign can be delivered. deliveryTime must be set to session. If the platform is iOS, this option can also be set if deliveryTime is set to any. In that case, if the campaign is received when the application is launched, it will be delivered only in the specified list of activities. - DeliveryActivities *[]string `json:"deliveryActivities,omitempty"` - // StartTime - The date at which the campaign should be started. The date shall conform to the following format: `yyyy-MM-ddTHH:mm:ssZ`. * If you set pushMode property to manual, this attribute will be ignored. * If you set pushMode property to one-shot, then the timezone attribute must be specified. Example: `2011-11-21 15:23Z` - StartTime *string `json:"startTime,omitempty"` - // EndTime - The date at which the campaign should be finished. The date shall conform to the following format: `yyyy-MM-ddTHH:mm:ssZ`. Example: `2011-11-21 15:23Z` - EndTime *string `json:"endTime,omitempty"` - // Timezone - The id of the time zone to use for the startTime and endTime dates. If not provided, the two date attributes will be expressed using the device timezone. Example: America/Los_Angeles - Timezone *string `json:"timezone,omitempty"` - // NotificationType - Android only. Defines how the notification should be displayed. Valid values are: * `system`: Display the notification using a standard system notification. * `popup`: Display the notification using a in-app banner notification. - // . Possible values include: 'System', 'Popup' - NotificationType NotificationTypes `json:"notificationType,omitempty"` - // NotificationIcon - A flag indicating whether or not you want to display the resource icon in notification content. - NotificationIcon *bool `json:"notificationIcon,omitempty"` - // NotificationCloseable - A flag indicating whether or not you want the notification to be closeable. - NotificationCloseable *bool `json:"notificationCloseable,omitempty"` - // NotificationVibrate - Android only. A flag indicating whether or not you want the system notification to make a vibration. The notificationType property must be set to system. - NotificationVibrate *bool `json:"notificationVibrate,omitempty"` - // NotificationSound - * `Android`: A flag indicating whether or not you want the system notification to make a sound. The `notificationType` property must be set to `system`. * `iOS`: A flag indicating whether or not you want the native Apple Push notification to make a sound. The `deliveryTime` property must be set to `any` or `background`. This will play the 'default' sound. If you want to play a custom sound, see the `notificationOptions` property. * `Windows`: A flag indicating whether or not you want the native Windows Notification Service to make a sound. The `deliveryTime` property must be set to `any`. - NotificationSound *bool `json:"notificationSound,omitempty"` - // NotificationBadge - A flag indicating whether or not you want the native Apple Push notification to update the badge icon to the number of unread messages. The `deliveryTime` property must be set to `any` or `background`. - NotificationBadge *bool `json:"notificationBadge,omitempty"` - // Localization - Push campaigns can be localized using an optional JSON object. The JSON key is a two-character language code as specified by the ISO 639-1 standard. The corresponding value is an object containing the localizable properties. - Localization map[string]*CampaignLocalization `json:"localization"` - // Questions - Poll questions. - Questions *[]PollQuestion `json:"questions,omitempty"` - // NotificationTitle - Title of the notification. This field supports appInfo markers. - NotificationTitle *string `json:"notificationTitle,omitempty"` - // NotificationMessage - Message of the notification. This field supports appInfo markers. - NotificationMessage *string `json:"notificationMessage,omitempty"` - // NotificationImage - Optional image encoded in base 64. Usually included in the right part of in app notifications (or as a banner if there is neither text nor content icon). For Android system notifications, the image is used as the large icon (displayed only on Android 3+). - NotificationImage *[]byte `json:"notificationImage,omitempty"` - // NotificationOptions - Additional platform specific options. - NotificationOptions *NotificationOptions `json:"notificationOptions,omitempty"` - // Title - Title of the announcement or poll. This field supports appInfo markers. - Title *string `json:"title,omitempty"` - // Body - Body of the text/web announcement, poll or data push. This field supports appInfo markers. - Body *string `json:"body,omitempty"` - // ActionButtonText - Text of the action button for text/web announcements and polls (answer button). - ActionButtonText *string `json:"actionButtonText,omitempty"` - // ExitButtonText - Text of the exit button for text/web announcements and polls. - ExitButtonText *string `json:"exitButtonText,omitempty"` - // ActionURL - URL to launch when the announcement is actioned. - ActionURL *string `json:"actionUrl,omitempty"` - // Payload - Native push payload. - Payload interface{} `json:"payload,omitempty"` -} - -// MarshalJSON is the custom marshaler for Campaign. -func (c Campaign) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.Name != nil { - objectMap["name"] = c.Name - } - if c.Audience != nil { - objectMap["audience"] = c.Audience - } - if c.Category != nil { - objectMap["category"] = c.Category - } - if c.PushMode != "" { - objectMap["pushMode"] = c.PushMode - } - if c.Type != "" { - objectMap["type"] = c.Type - } - if c.DeliveryTime != "" { - objectMap["deliveryTime"] = c.DeliveryTime - } - if c.DeliveryActivities != nil { - objectMap["deliveryActivities"] = c.DeliveryActivities - } - if c.StartTime != nil { - objectMap["startTime"] = c.StartTime - } - if c.EndTime != nil { - objectMap["endTime"] = c.EndTime - } - if c.Timezone != nil { - objectMap["timezone"] = c.Timezone - } - if c.NotificationType != "" { - objectMap["notificationType"] = c.NotificationType - } - if c.NotificationIcon != nil { - objectMap["notificationIcon"] = c.NotificationIcon - } - if c.NotificationCloseable != nil { - objectMap["notificationCloseable"] = c.NotificationCloseable - } - if c.NotificationVibrate != nil { - objectMap["notificationVibrate"] = c.NotificationVibrate - } - if c.NotificationSound != nil { - objectMap["notificationSound"] = c.NotificationSound - } - if c.NotificationBadge != nil { - objectMap["notificationBadge"] = c.NotificationBadge - } - if c.Localization != nil { - objectMap["localization"] = c.Localization - } - if c.Questions != nil { - objectMap["questions"] = c.Questions - } - if c.NotificationTitle != nil { - objectMap["notificationTitle"] = c.NotificationTitle - } - if c.NotificationMessage != nil { - objectMap["notificationMessage"] = c.NotificationMessage - } - if c.NotificationImage != nil { - objectMap["notificationImage"] = c.NotificationImage - } - if c.NotificationOptions != nil { - objectMap["notificationOptions"] = c.NotificationOptions - } - if c.Title != nil { - objectMap["title"] = c.Title - } - if c.Body != nil { - objectMap["body"] = c.Body - } - if c.ActionButtonText != nil { - objectMap["actionButtonText"] = c.ActionButtonText - } - if c.ExitButtonText != nil { - objectMap["exitButtonText"] = c.ExitButtonText - } - if c.ActionURL != nil { - objectMap["actionUrl"] = c.ActionURL - } - objectMap["payload"] = c.Payload - return json.Marshal(objectMap) -} - -// CampaignAudience specify which users will be targeted by this campaign. By default, all users will be targeted. -// If you set `pushMode` property to `manual`, the only thing you can specify in the audience is the push quota -// filter. An audience is a boolean expression made of criteria (variables) operators (`not`, `and` or `or`) and -// parenthesis. Additionally, a set of filters can be added to an audience. 65535 bytes max as per JSON encoding. -type CampaignAudience struct { - // Expression - Boolean expression made of criteria (variables) operators (`not`, `and` or `or`) and parenthesis. Criterion names in the audience expression must start with a capital letter and can only contain alphanumeric (A-Z,a-z,0-9) and underscore (_) characters. - Expression *string `json:"expression,omitempty"` - // Criteria - Criteria by name. - Criteria map[string]*Criterion `json:"criteria"` - // Filters - Global filters applied to all devices. - Filters *[]BasicFilter `json:"filters,omitempty"` -} - -// MarshalJSON is the custom marshaler for CampaignAudience. -func (c CampaignAudience) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.Expression != nil { - objectMap["expression"] = c.Expression - } - if c.Criteria != nil { - objectMap["criteria"] = c.Criteria - } - if c.Filters != nil { - objectMap["filters"] = c.Filters - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CampaignAudience struct. -func (c *CampaignAudience) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "expression": - if v != nil { - var expression string - err = json.Unmarshal(*v, &expression) - if err != nil { - return err - } - c.Expression = &expression - } - case "criteria": - if v != nil { - var criteria map[string]*Criterion - err = json.Unmarshal(*v, &criteria) - if err != nil { - return err - } - c.Criteria = criteria - } - case "filters": - if v != nil { - filters, err := unmarshalBasicFilterArray(*v) - if err != nil { - return err - } - c.Filters = &filters - } - } - } - - return nil -} - -// CampaignListResult ... -type CampaignListResult struct { - // Name - Name of the campaign. - Name *string `json:"name,omitempty"` - // ActivatedDate - The date at which the campaign was activated (Not present if not yet activated). The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. - ActivatedDate *date.Time `json:"activatedDate,omitempty"` - // FinishedDate - The date at which the campaign was finished (Not present if not yet finished). The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. - FinishedDate *date.Time `json:"finishedDate,omitempty"` - // StartTime - The date at which the campaign should be started if specified. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. Applicable only to announcements and polls. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The date at which the campaign should be finished if specified. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. Applicable only to announcements and polls. - EndTime *date.Time `json:"endTime,omitempty"` - // Timezone - The id of the time zone to use for the `startTime` and `endTime` dates. If not provided, the two date attributes are referencing to the device timezone. Applicable only to announcements and polls. - Timezone *string `json:"timezone,omitempty"` - // ID - Campaign identifier. - ID *int32 `json:"id,omitempty"` - // State - State of the campaign, or 'queued' when testing a campaign. Possible values include: 'Draft', 'Scheduled', 'InProgress', 'Finished', 'Queued' - State CampaignStates `json:"state,omitempty"` -} - -// CampaignLocalization ... -type CampaignLocalization struct { - // NotificationTitle - Title of the notification. This field supports appInfo markers. - NotificationTitle *string `json:"notificationTitle,omitempty"` - // NotificationMessage - Message of the notification. This field supports appInfo markers. - NotificationMessage *string `json:"notificationMessage,omitempty"` - // NotificationImage - Optional image encoded in base 64. Usually included in the right part of in app notifications (or as a banner if there is neither text nor content icon). For Android system notifications, the image is used as the large icon (displayed only on Android 3+). - NotificationImage *[]byte `json:"notificationImage,omitempty"` - // NotificationOptions - Additional platform specific options. - NotificationOptions *NotificationOptions `json:"notificationOptions,omitempty"` - // Title - Title of the announcement or poll. This field supports appInfo markers. - Title *string `json:"title,omitempty"` - // Body - Body of the text/web announcement, poll or data push. This field supports appInfo markers. - Body *string `json:"body,omitempty"` - // ActionButtonText - Text of the action button for text/web announcements and polls (answer button). - ActionButtonText *string `json:"actionButtonText,omitempty"` - // ExitButtonText - Text of the exit button for text/web announcements and polls. - ExitButtonText *string `json:"exitButtonText,omitempty"` - // ActionURL - URL to launch when the announcement is actioned. - ActionURL *string `json:"actionUrl,omitempty"` - // Payload - Native push payload. - Payload interface{} `json:"payload,omitempty"` -} - -// CampaignPushParameters ... -type CampaignPushParameters struct { - // DeviceIds - Device identifiers to push as a JSON array of strings. Note that if you want to push the same campaign several times to the same device, you need to make several API calls. - DeviceIds *[]string `json:"deviceIds,omitempty"` - // Data - Alternative campaign's content to use instead of the referenced campaign. All campaign's properties can be overridden except for the following: `name`, `manualPush`, `audience`, `startTime` and `timezone`. `endTime` can be overridden while keeping original `timezone` parameter. The effect is to change the client side expiration of the received campaign for the specific devices. If your campaign is a *poll*, the provided data should contain the same number of questions and choices that the one you created with the create command. Please note that all the push messages created using this parameter will expire after 4 weeks at maximum (`endTime` property of the campaign will be used if lower than 4 weeks in the future). - Data *Campaign `json:"data,omitempty"` -} - -// CampaignPushResult ... -type CampaignPushResult struct { - autorest.Response `json:"-"` - // InvalidDeviceIds - A JSON array containing all identifiers that have been rejected. A device can be rejected for the following reasons: * The device hasn’t reported any session yet. * The device is over quota (if a push quota filter is applied on your campaign). Please note that if the request parameters are valid but all the specified devices are rejected, the status code is still `200` with a response including all the devices as being rejected. - InvalidDeviceIds *[]string `json:"invalidDeviceIds,omitempty"` -} - -// CampaignResult ... -type CampaignResult struct { - autorest.Response `json:"-"` - // ID - Campaign identifier. - ID *int32 `json:"id,omitempty"` - // State - State of the campaign, or 'queued' when testing a campaign. Possible values include: 'Draft', 'Scheduled', 'InProgress', 'Finished', 'Queued' - State CampaignStates `json:"state,omitempty"` - // ActivatedDate - The date at which the campaign was activated (Not present if not yet activated). The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. - ActivatedDate *date.Time `json:"activatedDate,omitempty"` - // FinishedDate - The date at which the campaign was finished (Not present if not yet finished). The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. - FinishedDate *date.Time `json:"finishedDate,omitempty"` - // Name - Unique name of the campaign. - Name *string `json:"name,omitempty"` - // Audience - Specify which users will be targeted by this campaign. By default, all users will be targeted. If you set `pushMode` property to `manual`, the only thing you can specify in the audience is the push quota filter. An audience is a boolean expression made of criteria (variables) operators (`not`, `and` or `or`) and parenthesis. Additionally, a set of filters can be added to an audience. 65535 bytes max as per JSON encoding. - Audience *CampaignAudience `json:"audience,omitempty"` - // Category - Category of the campaign. Categories can be used on the application side to customize campaigns. - Category *string `json:"category,omitempty"` - // PushMode - Announcements/polls only. Defines how the campaign is pushed. Valid values are: * `real-time`: Never ending campaign, the campaign will be delivered to your existing users and also to your new users. * `one-shot`: In this mode, the campaign will be delivered only to your existing users (campaign will stop after that). * `manual`: In this mode, the campaign will not be pushed automatically to devices. You will have to use the Push campaign command to push the campaign to your end-users. Campaigns can be pushed multiple times to the same device. - // . Possible values include: 'RealTime', 'OneShot', 'Manual' - PushMode PushModes `json:"pushMode,omitempty"` - // Type - Applicable only to announcements and data pushes. Type of announcement. Valid values are: * `text/plain`: Text-only announcement: `body` property should only contain plain text. * `text/html`: HTML announcement: `body` attribute can contain HTML code. * `only_notif`: Notification-only announcement. With this kind of announcements, the `body`, `title`, `actionButtonText` and `exitButtonText` are ignored. Type of data push. Valid values are: * `text/plain`: Text only data push: `body` property must be plain text. * `text/base64`: Base 64 data push: `body` property must be encoded in base 64. - // . Possible values include: 'Textplain', 'Texthtml', 'OnlyNotif', 'Textbase64' - Type CampaignTypes `json:"type,omitempty"` - // DeliveryTime - Announcements/polls only. Defines when the campaign should be delivered. Valid values are: * `any`: Campaign will be delivered as soon as possible. * `background`: iOS only. Campaign will be only delivered when the application is in background (out of app). * `session`: Campaign will be delivered when the application is running. - // . Possible values include: 'Any', 'Background', 'Session' - DeliveryTime DeliveryTimes `json:"deliveryTime,omitempty"` - // DeliveryActivities - Announcements/polls only. Array containing the list of activities in which the campaign can be delivered. deliveryTime must be set to session. If the platform is iOS, this option can also be set if deliveryTime is set to any. In that case, if the campaign is received when the application is launched, it will be delivered only in the specified list of activities. - DeliveryActivities *[]string `json:"deliveryActivities,omitempty"` - // StartTime - The date at which the campaign should be started. The date shall conform to the following format: `yyyy-MM-ddTHH:mm:ssZ`. * If you set pushMode property to manual, this attribute will be ignored. * If you set pushMode property to one-shot, then the timezone attribute must be specified. Example: `2011-11-21 15:23Z` - StartTime *string `json:"startTime,omitempty"` - // EndTime - The date at which the campaign should be finished. The date shall conform to the following format: `yyyy-MM-ddTHH:mm:ssZ`. Example: `2011-11-21 15:23Z` - EndTime *string `json:"endTime,omitempty"` - // Timezone - The id of the time zone to use for the startTime and endTime dates. If not provided, the two date attributes will be expressed using the device timezone. Example: America/Los_Angeles - Timezone *string `json:"timezone,omitempty"` - // NotificationType - Android only. Defines how the notification should be displayed. Valid values are: * `system`: Display the notification using a standard system notification. * `popup`: Display the notification using a in-app banner notification. - // . Possible values include: 'System', 'Popup' - NotificationType NotificationTypes `json:"notificationType,omitempty"` - // NotificationIcon - A flag indicating whether or not you want to display the resource icon in notification content. - NotificationIcon *bool `json:"notificationIcon,omitempty"` - // NotificationCloseable - A flag indicating whether or not you want the notification to be closeable. - NotificationCloseable *bool `json:"notificationCloseable,omitempty"` - // NotificationVibrate - Android only. A flag indicating whether or not you want the system notification to make a vibration. The notificationType property must be set to system. - NotificationVibrate *bool `json:"notificationVibrate,omitempty"` - // NotificationSound - * `Android`: A flag indicating whether or not you want the system notification to make a sound. The `notificationType` property must be set to `system`. * `iOS`: A flag indicating whether or not you want the native Apple Push notification to make a sound. The `deliveryTime` property must be set to `any` or `background`. This will play the 'default' sound. If you want to play a custom sound, see the `notificationOptions` property. * `Windows`: A flag indicating whether or not you want the native Windows Notification Service to make a sound. The `deliveryTime` property must be set to `any`. - NotificationSound *bool `json:"notificationSound,omitempty"` - // NotificationBadge - A flag indicating whether or not you want the native Apple Push notification to update the badge icon to the number of unread messages. The `deliveryTime` property must be set to `any` or `background`. - NotificationBadge *bool `json:"notificationBadge,omitempty"` - // Localization - Push campaigns can be localized using an optional JSON object. The JSON key is a two-character language code as specified by the ISO 639-1 standard. The corresponding value is an object containing the localizable properties. - Localization map[string]*CampaignLocalization `json:"localization"` - // Questions - Poll questions. - Questions *[]PollQuestion `json:"questions,omitempty"` - // NotificationTitle - Title of the notification. This field supports appInfo markers. - NotificationTitle *string `json:"notificationTitle,omitempty"` - // NotificationMessage - Message of the notification. This field supports appInfo markers. - NotificationMessage *string `json:"notificationMessage,omitempty"` - // NotificationImage - Optional image encoded in base 64. Usually included in the right part of in app notifications (or as a banner if there is neither text nor content icon). For Android system notifications, the image is used as the large icon (displayed only on Android 3+). - NotificationImage *[]byte `json:"notificationImage,omitempty"` - // NotificationOptions - Additional platform specific options. - NotificationOptions *NotificationOptions `json:"notificationOptions,omitempty"` - // Title - Title of the announcement or poll. This field supports appInfo markers. - Title *string `json:"title,omitempty"` - // Body - Body of the text/web announcement, poll or data push. This field supports appInfo markers. - Body *string `json:"body,omitempty"` - // ActionButtonText - Text of the action button for text/web announcements and polls (answer button). - ActionButtonText *string `json:"actionButtonText,omitempty"` - // ExitButtonText - Text of the exit button for text/web announcements and polls. - ExitButtonText *string `json:"exitButtonText,omitempty"` - // ActionURL - URL to launch when the announcement is actioned. - ActionURL *string `json:"actionUrl,omitempty"` - // Payload - Native push payload. - Payload interface{} `json:"payload,omitempty"` -} - -// MarshalJSON is the custom marshaler for CampaignResult. -func (cr CampaignResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cr.ID != nil { - objectMap["id"] = cr.ID - } - if cr.State != "" { - objectMap["state"] = cr.State - } - if cr.ActivatedDate != nil { - objectMap["activatedDate"] = cr.ActivatedDate - } - if cr.FinishedDate != nil { - objectMap["finishedDate"] = cr.FinishedDate - } - if cr.Name != nil { - objectMap["name"] = cr.Name - } - if cr.Audience != nil { - objectMap["audience"] = cr.Audience - } - if cr.Category != nil { - objectMap["category"] = cr.Category - } - if cr.PushMode != "" { - objectMap["pushMode"] = cr.PushMode - } - if cr.Type != "" { - objectMap["type"] = cr.Type - } - if cr.DeliveryTime != "" { - objectMap["deliveryTime"] = cr.DeliveryTime - } - if cr.DeliveryActivities != nil { - objectMap["deliveryActivities"] = cr.DeliveryActivities - } - if cr.StartTime != nil { - objectMap["startTime"] = cr.StartTime - } - if cr.EndTime != nil { - objectMap["endTime"] = cr.EndTime - } - if cr.Timezone != nil { - objectMap["timezone"] = cr.Timezone - } - if cr.NotificationType != "" { - objectMap["notificationType"] = cr.NotificationType - } - if cr.NotificationIcon != nil { - objectMap["notificationIcon"] = cr.NotificationIcon - } - if cr.NotificationCloseable != nil { - objectMap["notificationCloseable"] = cr.NotificationCloseable - } - if cr.NotificationVibrate != nil { - objectMap["notificationVibrate"] = cr.NotificationVibrate - } - if cr.NotificationSound != nil { - objectMap["notificationSound"] = cr.NotificationSound - } - if cr.NotificationBadge != nil { - objectMap["notificationBadge"] = cr.NotificationBadge - } - if cr.Localization != nil { - objectMap["localization"] = cr.Localization - } - if cr.Questions != nil { - objectMap["questions"] = cr.Questions - } - if cr.NotificationTitle != nil { - objectMap["notificationTitle"] = cr.NotificationTitle - } - if cr.NotificationMessage != nil { - objectMap["notificationMessage"] = cr.NotificationMessage - } - if cr.NotificationImage != nil { - objectMap["notificationImage"] = cr.NotificationImage - } - if cr.NotificationOptions != nil { - objectMap["notificationOptions"] = cr.NotificationOptions - } - if cr.Title != nil { - objectMap["title"] = cr.Title - } - if cr.Body != nil { - objectMap["body"] = cr.Body - } - if cr.ActionButtonText != nil { - objectMap["actionButtonText"] = cr.ActionButtonText - } - if cr.ExitButtonText != nil { - objectMap["exitButtonText"] = cr.ExitButtonText - } - if cr.ActionURL != nil { - objectMap["actionUrl"] = cr.ActionURL - } - objectMap["payload"] = cr.Payload - return json.Marshal(objectMap) -} - -// CampaignsListResult the campaigns list result. -type CampaignsListResult struct { - autorest.Response `json:"-"` - // Value - The list of campaigns. - Value *[]CampaignListResult `json:"value,omitempty"` - // NextLink - When using `top` parameter and if partial results are returned, this property describes a URI path to get the next results. This property is not set when reaching the last page. - NextLink *string `json:"nextLink,omitempty"` -} - -// CampaignsListResultIterator provides access to a complete listing of CampaignListResult values. -type CampaignsListResultIterator struct { - i int - page CampaignsListResultPage -} - -// Next 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 *CampaignsListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CampaignsListResultIterator) 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 CampaignsListResultIterator) Response() CampaignsListResult { - 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 CampaignsListResultIterator) Value() CampaignListResult { - if !iter.page.NotDone() { - return CampaignListResult{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (clr CampaignsListResult) IsEmpty() bool { - return clr.Value == nil || len(*clr.Value) == 0 -} - -// campaignsListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (clr CampaignsListResult) campaignsListResultPreparer() (*http.Request, error) { - if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(clr.NextLink))) -} - -// CampaignsListResultPage contains a page of CampaignListResult values. -type CampaignsListResultPage struct { - fn func(CampaignsListResult) (CampaignsListResult, error) - clr CampaignsListResult -} - -// 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. -func (page *CampaignsListResultPage) Next() error { - next, err := page.fn(page.clr) - if err != nil { - return err - } - page.clr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CampaignsListResultPage) NotDone() bool { - return !page.clr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CampaignsListResultPage) Response() CampaignsListResult { - return page.clr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CampaignsListResultPage) Values() []CampaignListResult { - if page.clr.IsEmpty() { - return nil - } - return *page.clr.Value -} - -// CampaignState ... -type CampaignState struct { - autorest.Response `json:"-"` - // State - State of the campaign, or 'queued' when testing a campaign. Possible values include: 'Draft', 'Scheduled', 'InProgress', 'Finished', 'Queued' - State CampaignStates `json:"state,omitempty"` -} - -// CampaignStateResult ... -type CampaignStateResult struct { - autorest.Response `json:"-"` - // ID - Campaign identifier. - ID *int32 `json:"id,omitempty"` - // State - State of the campaign, or 'queued' when testing a campaign. Possible values include: 'Draft', 'Scheduled', 'InProgress', 'Finished', 'Queued' - State CampaignStates `json:"state,omitempty"` -} - -// CampaignStatisticsResult ... -type CampaignStatisticsResult struct { - autorest.Response `json:"-"` - // Queued - Number of times the campaign was registered to be pushed. - Queued *int32 `json:"queued,omitempty"` - // Pushed - Number of pushes performed. - Pushed *int32 `json:"pushed,omitempty"` - // PushedNative - Total number of native pushes. Information only available on Android, iOS, Windows Phone and Windows applications. - PushedNative *int32 `json:"pushed-native,omitempty"` - // PushedNativeGoogle - Number of C2DM/GCM pushes (available only on Android applications). - PushedNativeGoogle *int32 `json:"pushed-native-google,omitempty"` - // PushedNativeAdm - Number of ADM pushes (available only on Android applications). - PushedNativeAdm *int32 `json:"pushed-native-adm,omitempty"` - // Delivered - Number of times the campaign was received by the application (Not present in case of a native-push). - Delivered *int32 `json:"delivered,omitempty"` - // Dropped - Number of times the campaign was dropped by the application. It can happen if the SDK failed to parse the campaign payload or if an error occurred while trying to notify the end-user (Not present in case of a native-push). - Dropped *int32 `json:"dropped,omitempty"` - // SystemNotificationDisplayed - Number of times the system notification was displayed (Not present in case of a data-push or a native-push). On Android it corresponds to a status bar notification. - SystemNotificationDisplayed *int32 `json:"system-notification-displayed,omitempty"` - // InAppNotificationDisplayed - Number of times the in-app notification was displayed (Not present in case of a data-push or a native-push). - InAppNotificationDisplayed *int32 `json:"in-app-notification-displayed,omitempty"` - // ContentDisplayed - Number of times the campaign’s content view was displayed (Not present in case of a notification-only announcement, a data-push or a native-push). - ContentDisplayed *int32 `json:"content-displayed,omitempty"` - // SystemNotificationActioned - Number of times the system notification (On Android it corresponds to a status bar notification. On iOS, it is the Apple Push notification) was actioned. - SystemNotificationActioned *int32 `json:"system-notification-actioned,omitempty"` - // SystemNotificationExited - Number of times the system notification was exited (Not present in case of a data-push or a native-push). - SystemNotificationExited *int32 `json:"system-notification-exited,omitempty"` - // InAppNotificationActioned - Number of times the in-app notification was actioned (Not present in case of a data-push or a native-push). - InAppNotificationActioned *int32 `json:"in-app-notification-actioned,omitempty"` - // InAppNotificationExited - Number of times the in-app notification was exited (Not present in case of a data-push or a native-push). - InAppNotificationExited *int32 `json:"in-app-notification-exited,omitempty"` - // ContentActioned - Number of times the campaign’s content view was actioned (Not present in case of a notification-only announcement or a native-push). - ContentActioned *int32 `json:"content-actioned,omitempty"` - // ContentExited - Number of times the campaign’s content view was exited (Not present in case of a notification-only announcement or a native-push). - ContentExited *int32 `json:"content-exited,omitempty"` - // Answers - Poll specific statistics. - Answers map[string]interface{} `json:"answers"` -} - -// MarshalJSON is the custom marshaler for CampaignStatisticsResult. -func (csr CampaignStatisticsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csr.Queued != nil { - objectMap["queued"] = csr.Queued - } - if csr.Pushed != nil { - objectMap["pushed"] = csr.Pushed - } - if csr.PushedNative != nil { - objectMap["pushed-native"] = csr.PushedNative - } - if csr.PushedNativeGoogle != nil { - objectMap["pushed-native-google"] = csr.PushedNativeGoogle - } - if csr.PushedNativeAdm != nil { - objectMap["pushed-native-adm"] = csr.PushedNativeAdm - } - if csr.Delivered != nil { - objectMap["delivered"] = csr.Delivered - } - if csr.Dropped != nil { - objectMap["dropped"] = csr.Dropped - } - if csr.SystemNotificationDisplayed != nil { - objectMap["system-notification-displayed"] = csr.SystemNotificationDisplayed - } - if csr.InAppNotificationDisplayed != nil { - objectMap["in-app-notification-displayed"] = csr.InAppNotificationDisplayed - } - if csr.ContentDisplayed != nil { - objectMap["content-displayed"] = csr.ContentDisplayed - } - if csr.SystemNotificationActioned != nil { - objectMap["system-notification-actioned"] = csr.SystemNotificationActioned - } - if csr.SystemNotificationExited != nil { - objectMap["system-notification-exited"] = csr.SystemNotificationExited - } - if csr.InAppNotificationActioned != nil { - objectMap["in-app-notification-actioned"] = csr.InAppNotificationActioned - } - if csr.InAppNotificationExited != nil { - objectMap["in-app-notification-exited"] = csr.InAppNotificationExited - } - if csr.ContentActioned != nil { - objectMap["content-actioned"] = csr.ContentActioned - } - if csr.ContentExited != nil { - objectMap["content-exited"] = csr.ContentExited - } - if csr.Answers != nil { - objectMap["answers"] = csr.Answers - } - return json.Marshal(objectMap) -} - -// CampaignTestNewParameters ... -type CampaignTestNewParameters struct { - Data *Campaign `json:"data,omitempty"` - // DeviceID - Device identifier (as returned by the SDK). - DeviceID *string `json:"deviceId,omitempty"` - // Lang - The language to test expressed using ISO 639-1 code. The default language of the campaign will be used if the parameter is not provided. - Lang *string `json:"lang,omitempty"` -} - -// CampaignTestSavedParameters ... -type CampaignTestSavedParameters struct { - // DeviceID - Device identifier (as returned by the SDK). - DeviceID *string `json:"deviceId,omitempty"` - // Lang - The language to test expressed using ISO 639-1 code. The default language of the campaign will be used if the parameter is not provided. - Lang *string `json:"lang,omitempty"` -} - -// CarrierCountryCriterion used to target devices based on their carrier country. -type CarrierCountryCriterion struct { - // Name - Two-characters country code (ISO 3166-1). - Name *string `json:"name,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) MarshalJSON() ([]byte, error) { - ccc.Type = TypeCarrierCountry - objectMap := make(map[string]interface{}) - if ccc.Name != nil { - objectMap["name"] = ccc.Name - } - if ccc.Type != "" { - objectMap["type"] = ccc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return &ccc, true -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for CarrierCountryCriterion. -func (ccc CarrierCountryCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &ccc, true -} - -// CarrierNameCriterion used to target devices based on their carrier name. -type CarrierNameCriterion struct { - // Name - Carrier name value. - Name *string `json:"name,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for CarrierNameCriterion. -func (cnc CarrierNameCriterion) MarshalJSON() ([]byte, error) { - cnc.Type = TypeCarrierName - objectMap := make(map[string]interface{}) - if cnc.Name != nil { - objectMap["name"] = cnc.Name - } - if cnc.Type != "" { - objectMap["type"] = cnc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return &cnc, true -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for CarrierNameCriterion. -func (cnc CarrierNameCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &cnc, true -} - -// BasicCriterion ... -type BasicCriterion interface { - AsCarrierNameCriterion() (*CarrierNameCriterion, bool) - AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) - AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) - AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) - AsDeviceModelCriterion() (*DeviceModelCriterion, bool) - AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) - AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) - AsLanguageCriterion() (*LanguageCriterion, bool) - AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) - AsLocationCriterion() (*LocationCriterion, bool) - AsGeoFencingCriterion() (*GeoFencingCriterion, bool) - AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) - AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) - AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) - AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) - AsSegmentCriterion() (*SegmentCriterion, bool) - AsStringTagCriterion() (*StringTagCriterion, bool) - AsDateTagCriterion() (*DateTagCriterion, bool) - AsIntegerTagCriterion() (*IntegerTagCriterion, bool) - AsBooleanTagCriterion() (*BooleanTagCriterion, bool) - AsCriterion() (*Criterion, bool) -} - -// Criterion ... -type Criterion struct { - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -func unmarshalBasicCriterion(body []byte) (BasicCriterion, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["type"] { - case string(TypeCarrierName): - var cnc CarrierNameCriterion - err := json.Unmarshal(body, &cnc) - return cnc, err - case string(TypeCarrierCountry): - var ccc CarrierCountryCriterion - err := json.Unmarshal(body, &ccc) - return ccc, err - case string(TypeFirmwareVersion): - var fvc FirmwareVersionCriterion - err := json.Unmarshal(body, &fvc) - return fvc, err - case string(TypeDeviceManufacturer): - var dmc DeviceManufacturerCriterion - err := json.Unmarshal(body, &dmc) - return dmc, err - case string(TypeDeviceModel): - var dmc DeviceModelCriterion - err := json.Unmarshal(body, &dmc) - return dmc, err - case string(TypeApplicationVersion): - var avc ApplicationVersionCriterion - err := json.Unmarshal(body, &avc) - return avc, err - case string(TypeNetworkType): - var ntc NetworkTypeCriterion - err := json.Unmarshal(body, &ntc) - return ntc, err - case string(TypeLanguage): - var lc LanguageCriterion - err := json.Unmarshal(body, &lc) - return lc, err - case string(TypeScreenSize): - var ssc ScreenSizeCriterion - err := json.Unmarshal(body, &ssc) - return ssc, err - case string(TypeLocation): - var lc LocationCriterion - err := json.Unmarshal(body, &lc) - return lc, err - case string(TypeGeoFencing): - var gfc GeoFencingCriterion - err := json.Unmarshal(body, &gfc) - return gfc, err - case string(TypeAnnouncementFeedback): - var afc AnnouncementFeedbackCriterion - err := json.Unmarshal(body, &afc) - return afc, err - case string(TypePollFeedback): - var pfc PollFeedbackCriterion - err := json.Unmarshal(body, &pfc) - return pfc, err - case string(TypePollAnswerFeedback): - var pafc PollAnswerFeedbackCriterion - err := json.Unmarshal(body, &pafc) - return pafc, err - case string(TypeDatapushFeedback): - var dfc DatapushFeedbackCriterion - err := json.Unmarshal(body, &dfc) - return dfc, err - case string(TypeSegment): - var sc SegmentCriterion - err := json.Unmarshal(body, &sc) - return sc, err - case string(TypeStringTag): - var stc StringTagCriterion - err := json.Unmarshal(body, &stc) - return stc, err - case string(TypeDateTag): - var dtc DateTagCriterion - err := json.Unmarshal(body, &dtc) - return dtc, err - case string(TypeIntegerTag): - var itc IntegerTagCriterion - err := json.Unmarshal(body, &itc) - return itc, err - case string(TypeBooleanTag): - var btc BooleanTagCriterion - err := json.Unmarshal(body, &btc) - return btc, err - default: - var c Criterion - err := json.Unmarshal(body, &c) - return c, err - } -} -func unmarshalBasicCriterionArray(body []byte) ([]BasicCriterion, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - cArray := make([]BasicCriterion, len(rawMessages)) - - for index, rawMessage := range rawMessages { - c, err := unmarshalBasicCriterion(*rawMessage) - if err != nil { - return nil, err - } - cArray[index] = c - } - return cArray, nil -} - -// MarshalJSON is the custom marshaler for Criterion. -func (c Criterion) MarshalJSON() ([]byte, error) { - c.Type = TypeCriterion - objectMap := make(map[string]interface{}) - if c.Type != "" { - objectMap["type"] = c.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsCriterion() (*Criterion, bool) { - return &c, true -} - -// AsBasicCriterion is the BasicCriterion implementation for Criterion. -func (c Criterion) AsBasicCriterion() (BasicCriterion, bool) { - return &c, true -} - -// DatapushFeedbackCriterion used to target devices who received a data push. -type DatapushFeedbackCriterion struct { - // ContentID - The unique identifier of the data push. - ContentID *int32 `json:"content-id,omitempty"` - // Action - Action that was performed on the data push (action depends on the return value in the callbacks you declared in the client code). - // . Possible values include: 'Pushed', 'Replied', 'Actioned', 'Exited' - Action CampaignFeedbacks `json:"action,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) MarshalJSON() ([]byte, error) { - dfc.Type = TypeDatapushFeedback - objectMap := make(map[string]interface{}) - if dfc.ContentID != nil { - objectMap["content-id"] = dfc.ContentID - } - if dfc.Action != "" { - objectMap["action"] = dfc.Action - } - if dfc.Type != "" { - objectMap["type"] = dfc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return &dfc, true -} - -// AsSegmentCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for DatapushFeedbackCriterion. -func (dfc DatapushFeedbackCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &dfc, true -} - -// DateRangeExportTaskParameter ... -type DateRangeExportTaskParameter struct { - ContainerURL *string `json:"containerUrl,omitempty"` - // Description - A description of the export task. - Description *string `json:"description,omitempty"` - // StartDate - The RFC3339 full-date of the start of the period for which data is exported. - StartDate *date.Date `json:"startDate,omitempty"` - // EndDate - The RFC3339 full-date of the end of the period for which data is exported. - EndDate *date.Date `json:"endDate,omitempty"` - // ExportFormat - The format of the exported data. Possible values include: 'JSONBlob', 'CsvBlob' - ExportFormat ExportFormat `json:"exportFormat,omitempty"` -} - -// DateTagCriterion target devices based on a date tag value. -type DateTagCriterion struct { - // Name - The name of the custom tag. - Name *string `json:"name,omitempty"` - // Value - It can be either: * an absolute date using yyyy-MM-dd format (e.g. 1969-12-07 stands for 7 Dec 1969). * an offset in days relative to the current day (`TODAY` + `value`). - Value *date.Date `json:"value,omitempty"` - // Op - comparison operator: `EQ` (equal to), `LT` (less than), `GT` (greater than), `LE` (less than or equal to) or `GE` (greater than or equal to). Possible values include: 'EQ', 'LT', 'GT', 'LE', 'GE' - Op AudienceOperators `json:"op,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DateTagCriterion. -func (dtc DateTagCriterion) MarshalJSON() ([]byte, error) { - dtc.Type = TypeDateTag - objectMap := make(map[string]interface{}) - if dtc.Name != nil { - objectMap["name"] = dtc.Name - } - if dtc.Value != nil { - objectMap["value"] = dtc.Value - } - if dtc.Op != "" { - objectMap["op"] = dtc.Op - } - if dtc.Type != "" { - objectMap["type"] = dtc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return &dtc, true -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for DateTagCriterion. -func (dtc DateTagCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &dtc, true -} - -// Device ... -type Device struct { - autorest.Response `json:"-"` - // DeviceID - The device result. - DeviceID *string `json:"deviceId,omitempty"` - // Meta - Application usage data. - Meta *DeviceMeta `json:"meta,omitempty"` - // Info - Last technical data received (concerning device, system, network and application identification). - Info *DeviceInfo `json:"info,omitempty"` - // Location - Last geo-location data received. - Location *DeviceLocation `json:"location,omitempty"` - // AppInfo - Also known as tags, a key-value set as a JSON object. - AppInfo map[string]*string `json:"appInfo"` -} - -// MarshalJSON is the custom marshaler for Device. -func (d Device) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if d.DeviceID != nil { - objectMap["deviceId"] = d.DeviceID - } - if d.Meta != nil { - objectMap["meta"] = d.Meta - } - if d.Info != nil { - objectMap["info"] = d.Info - } - if d.Location != nil { - objectMap["location"] = d.Location - } - if d.AppInfo != nil { - objectMap["appInfo"] = d.AppInfo - } - return json.Marshal(objectMap) -} - -// DeviceInfo ... -type DeviceInfo struct { - // PhoneModel - Phone model. - PhoneModel *string `json:"phoneModel,omitempty"` - // PhoneManufacturer - Phone manufacturer - PhoneManufacturer *string `json:"phoneManufacturer,omitempty"` - // FirmwareVersion - Firmware version. - FirmwareVersion *string `json:"firmwareVersion,omitempty"` - // FirmwareName - Firmware name. - FirmwareName *string `json:"firmwareName,omitempty"` - // AndroidAPILevel - Android API level. - AndroidAPILevel *int32 `json:"androidAPILevel,omitempty"` - // CarrierCountry - Carrier country. - CarrierCountry *string `json:"carrierCountry,omitempty"` - // Locale - Locale code. - Locale *string `json:"locale,omitempty"` - // CarrierName - Carrier name. - CarrierName *string `json:"carrierName,omitempty"` - // NetworkType - Network type. - NetworkType *string `json:"networkType,omitempty"` - // NetworkSubtype - Network sub-type. - NetworkSubtype *string `json:"networkSubtype,omitempty"` - // ApplicationVersionName - Application version name. - ApplicationVersionName *string `json:"applicationVersionName,omitempty"` - // ApplicationVersionCode - Application version code. - ApplicationVersionCode *int32 `json:"applicationVersionCode,omitempty"` - // TimeZoneOffset - The offset in minutes from UTC for the device time zone, including daylight savings time. - TimeZoneOffset *int32 `json:"timeZoneOffset,omitempty"` - // ServiceVersion - SDK version. - ServiceVersion *string `json:"serviceVersion,omitempty"` -} - -// DeviceLocation ... -type DeviceLocation struct { - // Countrycode - The ISO 3166 two-letter country code. - Countrycode *string `json:"countrycode,omitempty"` - // Region - An administrative region of the nation, such as a state or province. - Region *string `json:"region,omitempty"` - // Locality - A locality within the administrative region, such as a town or city. - Locality *string `json:"locality,omitempty"` -} - -// DeviceManufacturerCriterion used to target devices based on the device manufacturer. -type DeviceManufacturerCriterion struct { - // Name - The device manufacturer. - Name *string `json:"name,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) MarshalJSON() ([]byte, error) { - dmc.Type = TypeDeviceManufacturer - objectMap := make(map[string]interface{}) - if dmc.Name != nil { - objectMap["name"] = dmc.Name - } - if dmc.Type != "" { - objectMap["type"] = dmc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return &dmc, true -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for DeviceManufacturerCriterion. -func (dmc DeviceManufacturerCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &dmc, true -} - -// DeviceMeta ... -type DeviceMeta struct { - // FirstSeen - First time the device used the application in milliseconds since January 1st, 1970 UTC. - FirstSeen *int64 `json:"firstSeen,omitempty"` - // LastSeen - Last time the device used the application in milliseconds since January 1st, 1970 UTC. - LastSeen *int64 `json:"lastSeen,omitempty"` - // LastInfo - Timestamp corresponding to the info object in milliseconds since January 1st, 1970 UTC. - LastInfo *int64 `json:"lastInfo,omitempty"` - // LastLocation - Timestamp corresponding to the location object in milliseconds since January 1st, 1970 UTC. - LastLocation *int64 `json:"lastLocation,omitempty"` - // NativePushEnabled - Boolean indicating if native push notifications (like Android’s GCM or Apple’s APNS) are enabled for the application. This boolean is set to true when the application registers successfully to the native push service, and set to false when the native push service reports to Mobile Engagement that the application can no longer be pushed (which means that it has been uninstalled). This report is performed a few hours after Mobile Engagement has tried to perform a native push to a device on which the application has been uninstalled. - NativePushEnabled *bool `json:"nativePushEnabled,omitempty"` -} - -// DeviceModelCriterion used to target devices based on the device model. -type DeviceModelCriterion struct { - // Name - The device model. - Name *string `json:"name,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DeviceModelCriterion. -func (dmc DeviceModelCriterion) MarshalJSON() ([]byte, error) { - dmc.Type = TypeDeviceModel - objectMap := make(map[string]interface{}) - if dmc.Name != nil { - objectMap["name"] = dmc.Name - } - if dmc.Type != "" { - objectMap["type"] = dmc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return &dmc, true -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for DeviceModelCriterion. -func (dmc DeviceModelCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &dmc, true -} - -// DeviceQueryResult ... -type DeviceQueryResult struct { - // DeviceID - The device result. - DeviceID *string `json:"deviceId,omitempty"` - // Meta - Application usage data. - Meta *DeviceMeta `json:"meta,omitempty"` - // AppInfo - Also known as tags, a key-value set as a JSON object. - AppInfo map[string]*string `json:"appInfo"` -} - -// MarshalJSON is the custom marshaler for DeviceQueryResult. -func (dqr DeviceQueryResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dqr.DeviceID != nil { - objectMap["deviceId"] = dqr.DeviceID - } - if dqr.Meta != nil { - objectMap["meta"] = dqr.Meta - } - if dqr.AppInfo != nil { - objectMap["appInfo"] = dqr.AppInfo - } - return json.Marshal(objectMap) -} - -// DevicesQueryResult the campaigns list result. -type DevicesQueryResult struct { - autorest.Response `json:"-"` - // Value - The list of devices. - Value *[]DeviceQueryResult `json:"value,omitempty"` - // NextLink - If partial results are returned, this property describes a URI path to get the next result page. - NextLink *string `json:"nextLink,omitempty"` -} - -// DevicesQueryResultIterator provides access to a complete listing of DeviceQueryResult values. -type DevicesQueryResultIterator struct { - i int - page DevicesQueryResultPage -} - -// Next 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 *DevicesQueryResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DevicesQueryResultIterator) 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 DevicesQueryResultIterator) Response() DevicesQueryResult { - 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 DevicesQueryResultIterator) Value() DeviceQueryResult { - if !iter.page.NotDone() { - return DeviceQueryResult{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (dqr DevicesQueryResult) IsEmpty() bool { - return dqr.Value == nil || len(*dqr.Value) == 0 -} - -// devicesQueryResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dqr DevicesQueryResult) devicesQueryResultPreparer() (*http.Request, error) { - if dqr.NextLink == nil || len(to.String(dqr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dqr.NextLink))) -} - -// DevicesQueryResultPage contains a page of DeviceQueryResult values. -type DevicesQueryResultPage struct { - fn func(DevicesQueryResult) (DevicesQueryResult, error) - dqr DevicesQueryResult -} - -// 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. -func (page *DevicesQueryResultPage) Next() error { - next, err := page.fn(page.dqr) - if err != nil { - return err - } - page.dqr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DevicesQueryResultPage) NotDone() bool { - return !page.dqr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DevicesQueryResultPage) Response() DevicesQueryResult { - return page.dqr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DevicesQueryResultPage) Values() []DeviceQueryResult { - if page.dqr.IsEmpty() { - return nil - } - return *page.dqr.Value -} - -// DeviceTagsParameters ... -type DeviceTagsParameters struct { - // Tags - A JSON object describing the set of tags to record for a set of users. Each key is a device/user identifier, each value is itself a key/value set: the tags to set for the specified device/user identifier. - Tags map[string]map[string]*string `json:"tags"` - // DeleteOnNull - If this parameter is `true`, tags with a null value will be deleted. - DeleteOnNull *bool `json:"deleteOnNull,omitempty"` -} - -// MarshalJSON is the custom marshaler for DeviceTagsParameters. -func (dtp DeviceTagsParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dtp.Tags != nil { - objectMap["tags"] = dtp.Tags - } - if dtp.DeleteOnNull != nil { - objectMap["deleteOnNull"] = dtp.DeleteOnNull - } - return json.Marshal(objectMap) -} - -// DeviceTagsResult ... -type DeviceTagsResult struct { - autorest.Response `json:"-"` - // InvalidIds - A JSON array containing all identifiers that have been rejected. Please note that if the request parameters are valid but all the specified devices are rejected, the status code is still `200` with a response including all the devices as being rejected. - InvalidIds *[]string `json:"invalidIds,omitempty"` -} - -// EngageActiveUsersFilter send only to users who have used the app in the last {threshold} days. -type EngageActiveUsersFilter struct { - // Threshold - An integer value representing the threshold to apply on this filter. - Threshold *int32 `json:"threshold,omitempty"` - // Type - Possible values include: 'TypeFilter', 'TypeEngageSubset', 'TypeEngageOldUsers', 'TypeEngageNewUsers', 'TypeEngageActiveUsers', 'TypeEngageIdleUsers', 'TypeNativePushEnabled', 'TypePushQuota', 'TypeAppInfo' - Type TypeBasicFilter `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EngageActiveUsersFilter. -func (eauf EngageActiveUsersFilter) MarshalJSON() ([]byte, error) { - eauf.Type = TypeEngageActiveUsers - objectMap := make(map[string]interface{}) - if eauf.Threshold != nil { - objectMap["threshold"] = eauf.Threshold - } - if eauf.Type != "" { - objectMap["type"] = eauf.Type - } - return json.Marshal(objectMap) -} - -// AsEngageSubsetFilter is the BasicFilter implementation for EngageActiveUsersFilter. -func (eauf EngageActiveUsersFilter) AsEngageSubsetFilter() (*EngageSubsetFilter, bool) { - return nil, false -} - -// AsEngageOldUsersFilter is the BasicFilter implementation for EngageActiveUsersFilter. -func (eauf EngageActiveUsersFilter) AsEngageOldUsersFilter() (*EngageOldUsersFilter, bool) { - return nil, false -} - -// AsEngageNewUsersFilter is the BasicFilter implementation for EngageActiveUsersFilter. -func (eauf EngageActiveUsersFilter) AsEngageNewUsersFilter() (*EngageNewUsersFilter, bool) { - return nil, false -} - -// AsEngageActiveUsersFilter is the BasicFilter implementation for EngageActiveUsersFilter. -func (eauf EngageActiveUsersFilter) AsEngageActiveUsersFilter() (*EngageActiveUsersFilter, bool) { - return &eauf, true -} - -// AsEngageIdleUsersFilter is the BasicFilter implementation for EngageActiveUsersFilter. -func (eauf EngageActiveUsersFilter) AsEngageIdleUsersFilter() (*EngageIdleUsersFilter, bool) { - return nil, false -} - -// AsNativePushEnabledFilter is the BasicFilter implementation for EngageActiveUsersFilter. -func (eauf EngageActiveUsersFilter) AsNativePushEnabledFilter() (*NativePushEnabledFilter, bool) { - return nil, false -} - -// AsPushQuotaFilter is the BasicFilter implementation for EngageActiveUsersFilter. -func (eauf EngageActiveUsersFilter) AsPushQuotaFilter() (*PushQuotaFilter, bool) { - return nil, false -} - -// AsAppInfoFilter is the BasicFilter implementation for EngageActiveUsersFilter. -func (eauf EngageActiveUsersFilter) AsAppInfoFilter() (*AppInfoFilter, bool) { - return nil, false -} - -// AsFilter is the BasicFilter implementation for EngageActiveUsersFilter. -func (eauf EngageActiveUsersFilter) AsFilter() (*Filter, bool) { - return nil, false -} - -// AsBasicFilter is the BasicFilter implementation for EngageActiveUsersFilter. -func (eauf EngageActiveUsersFilter) AsBasicFilter() (BasicFilter, bool) { - return &eauf, true -} - -// EngageIdleUsersFilter send only to users who haven't used the app in the last {threshold} days. -type EngageIdleUsersFilter struct { - // Threshold - An integer value representing the threshold to apply on this filter. - Threshold *int32 `json:"threshold,omitempty"` - // Type - Possible values include: 'TypeFilter', 'TypeEngageSubset', 'TypeEngageOldUsers', 'TypeEngageNewUsers', 'TypeEngageActiveUsers', 'TypeEngageIdleUsers', 'TypeNativePushEnabled', 'TypePushQuota', 'TypeAppInfo' - Type TypeBasicFilter `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EngageIdleUsersFilter. -func (eiuf EngageIdleUsersFilter) MarshalJSON() ([]byte, error) { - eiuf.Type = TypeEngageIdleUsers - objectMap := make(map[string]interface{}) - if eiuf.Threshold != nil { - objectMap["threshold"] = eiuf.Threshold - } - if eiuf.Type != "" { - objectMap["type"] = eiuf.Type - } - return json.Marshal(objectMap) -} - -// AsEngageSubsetFilter is the BasicFilter implementation for EngageIdleUsersFilter. -func (eiuf EngageIdleUsersFilter) AsEngageSubsetFilter() (*EngageSubsetFilter, bool) { - return nil, false -} - -// AsEngageOldUsersFilter is the BasicFilter implementation for EngageIdleUsersFilter. -func (eiuf EngageIdleUsersFilter) AsEngageOldUsersFilter() (*EngageOldUsersFilter, bool) { - return nil, false -} - -// AsEngageNewUsersFilter is the BasicFilter implementation for EngageIdleUsersFilter. -func (eiuf EngageIdleUsersFilter) AsEngageNewUsersFilter() (*EngageNewUsersFilter, bool) { - return nil, false -} - -// AsEngageActiveUsersFilter is the BasicFilter implementation for EngageIdleUsersFilter. -func (eiuf EngageIdleUsersFilter) AsEngageActiveUsersFilter() (*EngageActiveUsersFilter, bool) { - return nil, false -} - -// AsEngageIdleUsersFilter is the BasicFilter implementation for EngageIdleUsersFilter. -func (eiuf EngageIdleUsersFilter) AsEngageIdleUsersFilter() (*EngageIdleUsersFilter, bool) { - return &eiuf, true -} - -// AsNativePushEnabledFilter is the BasicFilter implementation for EngageIdleUsersFilter. -func (eiuf EngageIdleUsersFilter) AsNativePushEnabledFilter() (*NativePushEnabledFilter, bool) { - return nil, false -} - -// AsPushQuotaFilter is the BasicFilter implementation for EngageIdleUsersFilter. -func (eiuf EngageIdleUsersFilter) AsPushQuotaFilter() (*PushQuotaFilter, bool) { - return nil, false -} - -// AsAppInfoFilter is the BasicFilter implementation for EngageIdleUsersFilter. -func (eiuf EngageIdleUsersFilter) AsAppInfoFilter() (*AppInfoFilter, bool) { - return nil, false -} - -// AsFilter is the BasicFilter implementation for EngageIdleUsersFilter. -func (eiuf EngageIdleUsersFilter) AsFilter() (*Filter, bool) { - return nil, false -} - -// AsBasicFilter is the BasicFilter implementation for EngageIdleUsersFilter. -func (eiuf EngageIdleUsersFilter) AsBasicFilter() (BasicFilter, bool) { - return &eiuf, true -} - -// EngageNewUsersFilter send only to users whose first app use is less than {threshold} days old. -type EngageNewUsersFilter struct { - // Threshold - An integer value representing the threshold to apply on this filter. - Threshold *int32 `json:"threshold,omitempty"` - // Type - Possible values include: 'TypeFilter', 'TypeEngageSubset', 'TypeEngageOldUsers', 'TypeEngageNewUsers', 'TypeEngageActiveUsers', 'TypeEngageIdleUsers', 'TypeNativePushEnabled', 'TypePushQuota', 'TypeAppInfo' - Type TypeBasicFilter `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EngageNewUsersFilter. -func (enuf EngageNewUsersFilter) MarshalJSON() ([]byte, error) { - enuf.Type = TypeEngageNewUsers - objectMap := make(map[string]interface{}) - if enuf.Threshold != nil { - objectMap["threshold"] = enuf.Threshold - } - if enuf.Type != "" { - objectMap["type"] = enuf.Type - } - return json.Marshal(objectMap) -} - -// AsEngageSubsetFilter is the BasicFilter implementation for EngageNewUsersFilter. -func (enuf EngageNewUsersFilter) AsEngageSubsetFilter() (*EngageSubsetFilter, bool) { - return nil, false -} - -// AsEngageOldUsersFilter is the BasicFilter implementation for EngageNewUsersFilter. -func (enuf EngageNewUsersFilter) AsEngageOldUsersFilter() (*EngageOldUsersFilter, bool) { - return nil, false -} - -// AsEngageNewUsersFilter is the BasicFilter implementation for EngageNewUsersFilter. -func (enuf EngageNewUsersFilter) AsEngageNewUsersFilter() (*EngageNewUsersFilter, bool) { - return &enuf, true -} - -// AsEngageActiveUsersFilter is the BasicFilter implementation for EngageNewUsersFilter. -func (enuf EngageNewUsersFilter) AsEngageActiveUsersFilter() (*EngageActiveUsersFilter, bool) { - return nil, false -} - -// AsEngageIdleUsersFilter is the BasicFilter implementation for EngageNewUsersFilter. -func (enuf EngageNewUsersFilter) AsEngageIdleUsersFilter() (*EngageIdleUsersFilter, bool) { - return nil, false -} - -// AsNativePushEnabledFilter is the BasicFilter implementation for EngageNewUsersFilter. -func (enuf EngageNewUsersFilter) AsNativePushEnabledFilter() (*NativePushEnabledFilter, bool) { - return nil, false -} - -// AsPushQuotaFilter is the BasicFilter implementation for EngageNewUsersFilter. -func (enuf EngageNewUsersFilter) AsPushQuotaFilter() (*PushQuotaFilter, bool) { - return nil, false -} - -// AsAppInfoFilter is the BasicFilter implementation for EngageNewUsersFilter. -func (enuf EngageNewUsersFilter) AsAppInfoFilter() (*AppInfoFilter, bool) { - return nil, false -} - -// AsFilter is the BasicFilter implementation for EngageNewUsersFilter. -func (enuf EngageNewUsersFilter) AsFilter() (*Filter, bool) { - return nil, false -} - -// AsBasicFilter is the BasicFilter implementation for EngageNewUsersFilter. -func (enuf EngageNewUsersFilter) AsBasicFilter() (BasicFilter, bool) { - return &enuf, true -} - -// EngageOldUsersFilter send only to users whose first app use is more than {threshold} days old. -type EngageOldUsersFilter struct { - // Threshold - An integer value representing the threshold to apply on this filter. - Threshold *int32 `json:"threshold,omitempty"` - // Type - Possible values include: 'TypeFilter', 'TypeEngageSubset', 'TypeEngageOldUsers', 'TypeEngageNewUsers', 'TypeEngageActiveUsers', 'TypeEngageIdleUsers', 'TypeNativePushEnabled', 'TypePushQuota', 'TypeAppInfo' - Type TypeBasicFilter `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EngageOldUsersFilter. -func (eouf EngageOldUsersFilter) MarshalJSON() ([]byte, error) { - eouf.Type = TypeEngageOldUsers - objectMap := make(map[string]interface{}) - if eouf.Threshold != nil { - objectMap["threshold"] = eouf.Threshold - } - if eouf.Type != "" { - objectMap["type"] = eouf.Type - } - return json.Marshal(objectMap) -} - -// AsEngageSubsetFilter is the BasicFilter implementation for EngageOldUsersFilter. -func (eouf EngageOldUsersFilter) AsEngageSubsetFilter() (*EngageSubsetFilter, bool) { - return nil, false -} - -// AsEngageOldUsersFilter is the BasicFilter implementation for EngageOldUsersFilter. -func (eouf EngageOldUsersFilter) AsEngageOldUsersFilter() (*EngageOldUsersFilter, bool) { - return &eouf, true -} - -// AsEngageNewUsersFilter is the BasicFilter implementation for EngageOldUsersFilter. -func (eouf EngageOldUsersFilter) AsEngageNewUsersFilter() (*EngageNewUsersFilter, bool) { - return nil, false -} - -// AsEngageActiveUsersFilter is the BasicFilter implementation for EngageOldUsersFilter. -func (eouf EngageOldUsersFilter) AsEngageActiveUsersFilter() (*EngageActiveUsersFilter, bool) { - return nil, false -} - -// AsEngageIdleUsersFilter is the BasicFilter implementation for EngageOldUsersFilter. -func (eouf EngageOldUsersFilter) AsEngageIdleUsersFilter() (*EngageIdleUsersFilter, bool) { - return nil, false -} - -// AsNativePushEnabledFilter is the BasicFilter implementation for EngageOldUsersFilter. -func (eouf EngageOldUsersFilter) AsNativePushEnabledFilter() (*NativePushEnabledFilter, bool) { - return nil, false -} - -// AsPushQuotaFilter is the BasicFilter implementation for EngageOldUsersFilter. -func (eouf EngageOldUsersFilter) AsPushQuotaFilter() (*PushQuotaFilter, bool) { - return nil, false -} - -// AsAppInfoFilter is the BasicFilter implementation for EngageOldUsersFilter. -func (eouf EngageOldUsersFilter) AsAppInfoFilter() (*AppInfoFilter, bool) { - return nil, false -} - -// AsFilter is the BasicFilter implementation for EngageOldUsersFilter. -func (eouf EngageOldUsersFilter) AsFilter() (*Filter, bool) { - return nil, false -} - -// AsBasicFilter is the BasicFilter implementation for EngageOldUsersFilter. -func (eouf EngageOldUsersFilter) AsBasicFilter() (BasicFilter, bool) { - return &eouf, true -} - -// EngageSubsetFilter send only to a maximum of max users. -type EngageSubsetFilter struct { - // Max - An integer value representing the maximum users that should be pushed. - Max *int32 `json:"max,omitempty"` - // Type - Possible values include: 'TypeFilter', 'TypeEngageSubset', 'TypeEngageOldUsers', 'TypeEngageNewUsers', 'TypeEngageActiveUsers', 'TypeEngageIdleUsers', 'TypeNativePushEnabled', 'TypePushQuota', 'TypeAppInfo' - Type TypeBasicFilter `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EngageSubsetFilter. -func (esf EngageSubsetFilter) MarshalJSON() ([]byte, error) { - esf.Type = TypeEngageSubset - objectMap := make(map[string]interface{}) - if esf.Max != nil { - objectMap["max"] = esf.Max - } - if esf.Type != "" { - objectMap["type"] = esf.Type - } - return json.Marshal(objectMap) -} - -// AsEngageSubsetFilter is the BasicFilter implementation for EngageSubsetFilter. -func (esf EngageSubsetFilter) AsEngageSubsetFilter() (*EngageSubsetFilter, bool) { - return &esf, true -} - -// AsEngageOldUsersFilter is the BasicFilter implementation for EngageSubsetFilter. -func (esf EngageSubsetFilter) AsEngageOldUsersFilter() (*EngageOldUsersFilter, bool) { - return nil, false -} - -// AsEngageNewUsersFilter is the BasicFilter implementation for EngageSubsetFilter. -func (esf EngageSubsetFilter) AsEngageNewUsersFilter() (*EngageNewUsersFilter, bool) { - return nil, false -} - -// AsEngageActiveUsersFilter is the BasicFilter implementation for EngageSubsetFilter. -func (esf EngageSubsetFilter) AsEngageActiveUsersFilter() (*EngageActiveUsersFilter, bool) { - return nil, false -} - -// AsEngageIdleUsersFilter is the BasicFilter implementation for EngageSubsetFilter. -func (esf EngageSubsetFilter) AsEngageIdleUsersFilter() (*EngageIdleUsersFilter, bool) { - return nil, false -} - -// AsNativePushEnabledFilter is the BasicFilter implementation for EngageSubsetFilter. -func (esf EngageSubsetFilter) AsNativePushEnabledFilter() (*NativePushEnabledFilter, bool) { - return nil, false -} - -// AsPushQuotaFilter is the BasicFilter implementation for EngageSubsetFilter. -func (esf EngageSubsetFilter) AsPushQuotaFilter() (*PushQuotaFilter, bool) { - return nil, false -} - -// AsAppInfoFilter is the BasicFilter implementation for EngageSubsetFilter. -func (esf EngageSubsetFilter) AsAppInfoFilter() (*AppInfoFilter, bool) { - return nil, false -} - -// AsFilter is the BasicFilter implementation for EngageSubsetFilter. -func (esf EngageSubsetFilter) AsFilter() (*Filter, bool) { - return nil, false -} - -// AsBasicFilter is the BasicFilter implementation for EngageSubsetFilter. -func (esf EngageSubsetFilter) AsBasicFilter() (BasicFilter, bool) { - return &esf, true -} - -// ExportOptions options to control export generation. -type ExportOptions struct { - ExportUserID *bool `json:"exportUserId,omitempty"` -} - -// ExportTaskListResult gets a paged list of ExportTasks. -type ExportTaskListResult struct { - autorest.Response `json:"-"` - // Value - The list of export tasks. - Value *[]ExportTaskResult `json:"value,omitempty"` - // NextLink - When the results are paged, the nextLink is the URI for the next page of results. This property is empty when there are no additional pages. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExportTaskListResultIterator provides access to a complete listing of ExportTaskResult values. -type ExportTaskListResultIterator struct { - i int - page ExportTaskListResultPage -} - -// Next 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 *ExportTaskListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExportTaskListResultIterator) 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 ExportTaskListResultIterator) Response() ExportTaskListResult { - 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 ExportTaskListResultIterator) Value() ExportTaskResult { - if !iter.page.NotDone() { - return ExportTaskResult{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (etlr ExportTaskListResult) IsEmpty() bool { - return etlr.Value == nil || len(*etlr.Value) == 0 -} - -// exportTaskListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (etlr ExportTaskListResult) exportTaskListResultPreparer() (*http.Request, error) { - if etlr.NextLink == nil || len(to.String(etlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(etlr.NextLink))) -} - -// ExportTaskListResultPage contains a page of ExportTaskResult values. -type ExportTaskListResultPage struct { - fn func(ExportTaskListResult) (ExportTaskListResult, error) - etlr ExportTaskListResult -} - -// 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. -func (page *ExportTaskListResultPage) Next() error { - next, err := page.fn(page.etlr) - if err != nil { - return err - } - page.etlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExportTaskListResultPage) NotDone() bool { - return !page.etlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExportTaskListResultPage) Response() ExportTaskListResult { - return page.etlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExportTaskListResultPage) Values() []ExportTaskResult { - if page.etlr.IsEmpty() { - return nil - } - return *page.etlr.Value -} - -// ExportTaskParameter ... -type ExportTaskParameter struct { - ContainerURL *string `json:"containerUrl,omitempty"` - // Description - A description of the export task. - Description *string `json:"description,omitempty"` - // ExportFormat - The format of the exported data. Possible values include: 'JSONBlob', 'CsvBlob' - ExportFormat ExportFormat `json:"exportFormat,omitempty"` -} - -// ExportTaskResult ... -type ExportTaskResult struct { - autorest.Response `json:"-"` - // ID - Unique identifier of the export task. - ID *string `json:"id,omitempty"` - // Description - A description of the export task. - Description *string `json:"description,omitempty"` - // State - Possible values include: 'ExportStateQueued', 'ExportStateStarted', 'ExportStateSucceeded', 'ExportStateFailed' - State ExportState `json:"state,omitempty"` - // DateCreated - The RFC3339 date-time the export task was created. - DateCreated *date.Time `json:"dateCreated,omitempty"` - // DateCompleted - The RFC3339 date-time the export task was completed. - DateCompleted *date.Time `json:"dateCompleted,omitempty"` - // ExportType - Possible values include: 'ExportTypeActivity', 'ExportTypeTag', 'ExportTypeCrash', 'ExportTypeError', 'ExportTypeEvent', 'ExportTypeJob', 'ExportTypeSession', 'ExportTypeToken', 'ExportTypePush' - ExportType ExportType `json:"exportType,omitempty"` - // ErrorDetails - Details of errors encountered during the export, if any. - ErrorDetails *string `json:"errorDetails,omitempty"` -} - -// FeedbackByCampaignParameter ... -type FeedbackByCampaignParameter struct { - ContainerURL *string `json:"containerUrl,omitempty"` - // Description - A description of the export task. - Description *string `json:"description,omitempty"` - // CampaignType - Possible values include: 'Announcement', 'DataPush', 'NativePush', 'Poll' - CampaignType CampaignType `json:"campaignType,omitempty"` - // CampaignIds - A list of campaign identifiers. - CampaignIds *[]int32 `json:"campaignIds,omitempty"` - // ExportFormat - The format of the exported data. Possible values include: 'JSONBlob', 'CsvBlob' - ExportFormat ExportFormat `json:"exportFormat,omitempty"` -} - -// FeedbackByDateRangeParameter ... -type FeedbackByDateRangeParameter struct { - ContainerURL *string `json:"containerUrl,omitempty"` - // Description - A description of the export task. - Description *string `json:"description,omitempty"` - // CampaignType - Possible values include: 'Announcement', 'DataPush', 'NativePush', 'Poll' - CampaignType CampaignType `json:"campaignType,omitempty"` - // CampaignWindowStart - The RFC3339 date-time start of the period for inclusion of active campaigns. - CampaignWindowStart *date.Time `json:"campaignWindowStart,omitempty"` - // CampaignWindowEnd - The RFC3339 date-time end of the period for inclusion of active campaigns. - CampaignWindowEnd *date.Time `json:"campaignWindowEnd,omitempty"` - // ExportFormat - The format of the exported data. Possible values include: 'JSONBlob', 'CsvBlob' - ExportFormat ExportFormat `json:"exportFormat,omitempty"` -} - -// BasicFilter ... -type BasicFilter interface { - AsEngageSubsetFilter() (*EngageSubsetFilter, bool) - AsEngageOldUsersFilter() (*EngageOldUsersFilter, bool) - AsEngageNewUsersFilter() (*EngageNewUsersFilter, bool) - AsEngageActiveUsersFilter() (*EngageActiveUsersFilter, bool) - AsEngageIdleUsersFilter() (*EngageIdleUsersFilter, bool) - AsNativePushEnabledFilter() (*NativePushEnabledFilter, bool) - AsPushQuotaFilter() (*PushQuotaFilter, bool) - AsAppInfoFilter() (*AppInfoFilter, bool) - AsFilter() (*Filter, bool) -} - -// Filter ... -type Filter struct { - // Type - Possible values include: 'TypeFilter', 'TypeEngageSubset', 'TypeEngageOldUsers', 'TypeEngageNewUsers', 'TypeEngageActiveUsers', 'TypeEngageIdleUsers', 'TypeNativePushEnabled', 'TypePushQuota', 'TypeAppInfo' - Type TypeBasicFilter `json:"type,omitempty"` -} - -func unmarshalBasicFilter(body []byte) (BasicFilter, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["type"] { - case string(TypeEngageSubset): - var esf EngageSubsetFilter - err := json.Unmarshal(body, &esf) - return esf, err - case string(TypeEngageOldUsers): - var eouf EngageOldUsersFilter - err := json.Unmarshal(body, &eouf) - return eouf, err - case string(TypeEngageNewUsers): - var enuf EngageNewUsersFilter - err := json.Unmarshal(body, &enuf) - return enuf, err - case string(TypeEngageActiveUsers): - var eauf EngageActiveUsersFilter - err := json.Unmarshal(body, &eauf) - return eauf, err - case string(TypeEngageIdleUsers): - var eiuf EngageIdleUsersFilter - err := json.Unmarshal(body, &eiuf) - return eiuf, err - case string(TypeNativePushEnabled): - var npef NativePushEnabledFilter - err := json.Unmarshal(body, &npef) - return npef, err - case string(TypePushQuota): - var pqf PushQuotaFilter - err := json.Unmarshal(body, &pqf) - return pqf, err - case string(TypeAppInfo): - var aif AppInfoFilter - err := json.Unmarshal(body, &aif) - return aif, err - default: - var f Filter - err := json.Unmarshal(body, &f) - return f, err - } -} -func unmarshalBasicFilterArray(body []byte) ([]BasicFilter, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - fArray := make([]BasicFilter, len(rawMessages)) - - for index, rawMessage := range rawMessages { - f, err := unmarshalBasicFilter(*rawMessage) - if err != nil { - return nil, err - } - fArray[index] = f - } - return fArray, nil -} - -// MarshalJSON is the custom marshaler for Filter. -func (f Filter) MarshalJSON() ([]byte, error) { - f.Type = TypeFilter - objectMap := make(map[string]interface{}) - if f.Type != "" { - objectMap["type"] = f.Type - } - return json.Marshal(objectMap) -} - -// AsEngageSubsetFilter is the BasicFilter implementation for Filter. -func (f Filter) AsEngageSubsetFilter() (*EngageSubsetFilter, bool) { - return nil, false -} - -// AsEngageOldUsersFilter is the BasicFilter implementation for Filter. -func (f Filter) AsEngageOldUsersFilter() (*EngageOldUsersFilter, bool) { - return nil, false -} - -// AsEngageNewUsersFilter is the BasicFilter implementation for Filter. -func (f Filter) AsEngageNewUsersFilter() (*EngageNewUsersFilter, bool) { - return nil, false -} - -// AsEngageActiveUsersFilter is the BasicFilter implementation for Filter. -func (f Filter) AsEngageActiveUsersFilter() (*EngageActiveUsersFilter, bool) { - return nil, false -} - -// AsEngageIdleUsersFilter is the BasicFilter implementation for Filter. -func (f Filter) AsEngageIdleUsersFilter() (*EngageIdleUsersFilter, bool) { - return nil, false -} - -// AsNativePushEnabledFilter is the BasicFilter implementation for Filter. -func (f Filter) AsNativePushEnabledFilter() (*NativePushEnabledFilter, bool) { - return nil, false -} - -// AsPushQuotaFilter is the BasicFilter implementation for Filter. -func (f Filter) AsPushQuotaFilter() (*PushQuotaFilter, bool) { - return nil, false -} - -// AsAppInfoFilter is the BasicFilter implementation for Filter. -func (f Filter) AsAppInfoFilter() (*AppInfoFilter, bool) { - return nil, false -} - -// AsFilter is the BasicFilter implementation for Filter. -func (f Filter) AsFilter() (*Filter, bool) { - return &f, true -} - -// AsBasicFilter is the BasicFilter implementation for Filter. -func (f Filter) AsBasicFilter() (BasicFilter, bool) { - return &f, true -} - -// FirmwareVersionCriterion used to target devices based on their firmware version. -type FirmwareVersionCriterion struct { - // Name - Firmware version. - Name *string `json:"name,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) MarshalJSON() ([]byte, error) { - fvc.Type = TypeFirmwareVersion - objectMap := make(map[string]interface{}) - if fvc.Name != nil { - objectMap["name"] = fvc.Name - } - if fvc.Type != "" { - objectMap["type"] = fvc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return &fvc, true -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for FirmwareVersionCriterion. -func (fvc FirmwareVersionCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &fvc, true -} - -// GeoFencingCriterion used to target devices based on a specific region. A center point (defined by a latitude and -// longitude) and a radius form the boundary for the region. This criterion will be met when the user crosses the -// boundaries of the region. -type GeoFencingCriterion struct { - // Lat - The latitude of the central point of the region. - Lat *float64 `json:"lat,omitempty"` - // Lon - The longitude of the central point of the region. - Lon *float64 `json:"lon,omitempty"` - // Radius - The radius of the central point of the region, in meters. - Radius *int32 `json:"radius,omitempty"` - // Expiration - Number of minutes before device location is considered to be expired. - Expiration *int32 `json:"expiration,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for GeoFencingCriterion. -func (gfc GeoFencingCriterion) MarshalJSON() ([]byte, error) { - gfc.Type = TypeGeoFencing - objectMap := make(map[string]interface{}) - if gfc.Lat != nil { - objectMap["lat"] = gfc.Lat - } - if gfc.Lon != nil { - objectMap["lon"] = gfc.Lon - } - if gfc.Radius != nil { - objectMap["radius"] = gfc.Radius - } - if gfc.Expiration != nil { - objectMap["expiration"] = gfc.Expiration - } - if gfc.Type != "" { - objectMap["type"] = gfc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return &gfc, true -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for GeoFencingCriterion. -func (gfc GeoFencingCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &gfc, true -} - -// ImportTask ... -type ImportTask struct { - // StorageURL - A shared Access Signature (SAS) Storage URI where the job results will be retrieved from. - StorageURL *string `json:"storageUrl,omitempty"` -} - -// ImportTaskListResult gets a paged list of import tasks. -type ImportTaskListResult struct { - autorest.Response `json:"-"` - // Value - The list of import task. - Value *[]ImportTaskResult `json:"value,omitempty"` - // NextLink - When the results are paged, the nextLink is the URI for the next page of results. This property is empty when there are no additional pages. - NextLink *string `json:"nextLink,omitempty"` -} - -// ImportTaskListResultIterator provides access to a complete listing of ImportTaskResult values. -type ImportTaskListResultIterator struct { - i int - page ImportTaskListResultPage -} - -// Next 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 *ImportTaskListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ImportTaskListResultIterator) 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 ImportTaskListResultIterator) Response() ImportTaskListResult { - 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 ImportTaskListResultIterator) Value() ImportTaskResult { - if !iter.page.NotDone() { - return ImportTaskResult{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (itlr ImportTaskListResult) IsEmpty() bool { - return itlr.Value == nil || len(*itlr.Value) == 0 -} - -// importTaskListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (itlr ImportTaskListResult) importTaskListResultPreparer() (*http.Request, error) { - if itlr.NextLink == nil || len(to.String(itlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(itlr.NextLink))) -} - -// ImportTaskListResultPage contains a page of ImportTaskResult values. -type ImportTaskListResultPage struct { - fn func(ImportTaskListResult) (ImportTaskListResult, error) - itlr ImportTaskListResult -} - -// 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. -func (page *ImportTaskListResultPage) Next() error { - next, err := page.fn(page.itlr) - if err != nil { - return err - } - page.itlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ImportTaskListResultPage) NotDone() bool { - return !page.itlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ImportTaskListResultPage) Response() ImportTaskListResult { - return page.itlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ImportTaskListResultPage) Values() []ImportTaskResult { - if page.itlr.IsEmpty() { - return nil - } - return *page.itlr.Value -} - -// ImportTaskResult ... -type ImportTaskResult struct { - autorest.Response `json:"-"` - // ID - Unique identifier of the import task. - ID *string `json:"id,omitempty"` - // State - The current state of the import task. Possible values include: 'JobStatesQueued', 'JobStatesStarted', 'JobStatesSucceeded', 'JobStatesFailed' - State JobStates `json:"state,omitempty"` - // DateCreated - The date at which the import job was created. - // The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. - DateCreated *date.Time `json:"dateCreated,omitempty"` - // DateCompleted - The date at which the import job completed (Not present if not yet completed). - // The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. - DateCompleted *date.Time `json:"dateCompleted,omitempty"` - // ErrorDetails - Details of any errors encountered during the import, if any. - ErrorDetails *string `json:"errorDetails,omitempty"` - // StorageURL - A shared Access Signature (SAS) Storage URI where the job results will be retrieved from. - StorageURL *string `json:"storageUrl,omitempty"` -} - -// IntegerTagCriterion target devices based on an integer tag value. -type IntegerTagCriterion struct { - // Name - The name of the custom tag. - Name *string `json:"name,omitempty"` - // Value - A custom integer value to match. - Value *int32 `json:"value,omitempty"` - // Op - comparison operator: `EQ` (equal to), `LT` (less than), `GT` (greater than), `LE` (less than or equal to) or `GE` (greater than or equal to). Possible values include: 'EQ', 'LT', 'GT', 'LE', 'GE' - Op AudienceOperators `json:"op,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for IntegerTagCriterion. -func (itc IntegerTagCriterion) MarshalJSON() ([]byte, error) { - itc.Type = TypeIntegerTag - objectMap := make(map[string]interface{}) - if itc.Name != nil { - objectMap["name"] = itc.Name - } - if itc.Value != nil { - objectMap["value"] = itc.Value - } - if itc.Op != "" { - objectMap["op"] = itc.Op - } - if itc.Type != "" { - objectMap["type"] = itc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return &itc, true -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for IntegerTagCriterion. -func (itc IntegerTagCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &itc, true -} - -// LanguageCriterion used to target devices based on the language of their device. -type LanguageCriterion struct { - // Name - Two character language code (ISO 639-1). - Name *string `json:"name,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for LanguageCriterion. -func (lc LanguageCriterion) MarshalJSON() ([]byte, error) { - lc.Type = TypeLanguage - objectMap := make(map[string]interface{}) - if lc.Name != nil { - objectMap["name"] = lc.Name - } - if lc.Type != "" { - objectMap["type"] = lc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return &lc, true -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for LanguageCriterion. -func (lc LanguageCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &lc, true -} - -// LocationCriterion used to target devices based on their last know area. -type LocationCriterion struct { - // Country - Two character country code where the user is located (ISO 3166-1). - Country *string `json:"country,omitempty"` - // Region - An administrative region of the country, such as a state or province. - Region *string `json:"region,omitempty"` - // Locality - A locality within the administrative region, such as a town or city. - Locality *string `json:"locality,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for LocationCriterion. -func (lc LocationCriterion) MarshalJSON() ([]byte, error) { - lc.Type = TypeLocation - objectMap := make(map[string]interface{}) - if lc.Country != nil { - objectMap["country"] = lc.Country - } - if lc.Region != nil { - objectMap["region"] = lc.Region - } - if lc.Locality != nil { - objectMap["locality"] = lc.Locality - } - if lc.Type != "" { - objectMap["type"] = lc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return &lc, true -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for LocationCriterion. -func (lc LocationCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &lc, true -} - -// NativePushEnabledFilter engage only users with native push enabled. -type NativePushEnabledFilter struct { - // Type - Possible values include: 'TypeFilter', 'TypeEngageSubset', 'TypeEngageOldUsers', 'TypeEngageNewUsers', 'TypeEngageActiveUsers', 'TypeEngageIdleUsers', 'TypeNativePushEnabled', 'TypePushQuota', 'TypeAppInfo' - Type TypeBasicFilter `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for NativePushEnabledFilter. -func (npef NativePushEnabledFilter) MarshalJSON() ([]byte, error) { - npef.Type = TypeNativePushEnabled - objectMap := make(map[string]interface{}) - if npef.Type != "" { - objectMap["type"] = npef.Type - } - return json.Marshal(objectMap) -} - -// AsEngageSubsetFilter is the BasicFilter implementation for NativePushEnabledFilter. -func (npef NativePushEnabledFilter) AsEngageSubsetFilter() (*EngageSubsetFilter, bool) { - return nil, false -} - -// AsEngageOldUsersFilter is the BasicFilter implementation for NativePushEnabledFilter. -func (npef NativePushEnabledFilter) AsEngageOldUsersFilter() (*EngageOldUsersFilter, bool) { - return nil, false -} - -// AsEngageNewUsersFilter is the BasicFilter implementation for NativePushEnabledFilter. -func (npef NativePushEnabledFilter) AsEngageNewUsersFilter() (*EngageNewUsersFilter, bool) { - return nil, false -} - -// AsEngageActiveUsersFilter is the BasicFilter implementation for NativePushEnabledFilter. -func (npef NativePushEnabledFilter) AsEngageActiveUsersFilter() (*EngageActiveUsersFilter, bool) { - return nil, false -} - -// AsEngageIdleUsersFilter is the BasicFilter implementation for NativePushEnabledFilter. -func (npef NativePushEnabledFilter) AsEngageIdleUsersFilter() (*EngageIdleUsersFilter, bool) { - return nil, false -} - -// AsNativePushEnabledFilter is the BasicFilter implementation for NativePushEnabledFilter. -func (npef NativePushEnabledFilter) AsNativePushEnabledFilter() (*NativePushEnabledFilter, bool) { - return &npef, true -} - -// AsPushQuotaFilter is the BasicFilter implementation for NativePushEnabledFilter. -func (npef NativePushEnabledFilter) AsPushQuotaFilter() (*PushQuotaFilter, bool) { - return nil, false -} - -// AsAppInfoFilter is the BasicFilter implementation for NativePushEnabledFilter. -func (npef NativePushEnabledFilter) AsAppInfoFilter() (*AppInfoFilter, bool) { - return nil, false -} - -// AsFilter is the BasicFilter implementation for NativePushEnabledFilter. -func (npef NativePushEnabledFilter) AsFilter() (*Filter, bool) { - return nil, false -} - -// AsBasicFilter is the BasicFilter implementation for NativePushEnabledFilter. -func (npef NativePushEnabledFilter) AsBasicFilter() (BasicFilter, bool) { - return &npef, true -} - -// NetworkTypeCriterion used to target devices based their network type. -type NetworkTypeCriterion struct { - // Name - The network type (Wifi, Mobile...). - Name *string `json:"name,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) MarshalJSON() ([]byte, error) { - ntc.Type = TypeNetworkType - objectMap := make(map[string]interface{}) - if ntc.Name != nil { - objectMap["name"] = ntc.Name - } - if ntc.Type != "" { - objectMap["type"] = ntc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return &ntc, true -} - -// AsLanguageCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for NetworkTypeCriterion. -func (ntc NetworkTypeCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &ntc, true -} - -// NotificationOptions ... -type NotificationOptions struct { - // BigText - Android 4.1+ only. Multi line message shown in expanded notifications on Android 4.1+ devices. The `notificationType` property must be set to `system`. - BigText *string `json:"bigText,omitempty"` - // BigPicture - URL of a remote image displayed in expanded notifications on - // Android 4.1+ devices with the following constraints: - // * The URL length is limited to 2000 characters. - // * The image size must be less than 4 MiB. - // * The following MIME types are supported: - // ** image/png - // ** image/jpeg - // ** image/gif - // ** image/webp - // ** image/bmp - // ** image/x-bmp - // ** image/x-ms-bmp - // * URL scheme must be HTTP or HTTPS (with valid SSL certificate). - // * Incompatible with `bigText`, only one of the fields can be set. - // * The `notificationType` property must be set to `system`. - BigPicture *string `json:"bigPicture,omitempty"` - // Sound - iOS only. The name of a sound file in the application bundle. The sound in this file is played as an alert. If the sound file doesn’t exist or default is specified as the value, the default alert sound is played. The audio must be in one of the audio data formats that are compatible with system sounds. The `deliveryTime` property must be set to `any` or `background`. - Sound *string `json:"sound,omitempty"` - // ActionText - The action text is the title of the right button of the alert or the value of the unlock slider, where the value replaces 'unlock' in 'slide to unlock'. 'View' (localized to the preferred language) is used as the default value. The `deliveryTime` property must be set to `any` or `background`. - ActionText *string `json:"actionText,omitempty"` -} - -// PollAnswerFeedbackCriterion used to target devices who answered X to a given question. -type PollAnswerFeedbackCriterion struct { - // ContentID - The unique identifier of the poll. - ContentID *int32 `json:"content-id,omitempty"` - // ChoiceID - The unique identifier of the choice. - ChoiceID *int32 `json:"choice-id,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) MarshalJSON() ([]byte, error) { - pafc.Type = TypePollAnswerFeedback - objectMap := make(map[string]interface{}) - if pafc.ContentID != nil { - objectMap["content-id"] = pafc.ContentID - } - if pafc.ChoiceID != nil { - objectMap["choice-id"] = pafc.ChoiceID - } - if pafc.Type != "" { - objectMap["type"] = pafc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return &pafc, true -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for PollAnswerFeedbackCriterion. -func (pafc PollAnswerFeedbackCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &pafc, true -} - -// PollFeedbackCriterion used to target devices who received a poll. -type PollFeedbackCriterion struct { - // ContentID - The unique identifier of the poll. - ContentID *int32 `json:"content-id,omitempty"` - // Action - Action that was performed on the poll. Possible values include: 'Pushed', 'Replied', 'Actioned', 'Exited' - Action CampaignFeedbacks `json:"action,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) MarshalJSON() ([]byte, error) { - pfc.Type = TypePollFeedback - objectMap := make(map[string]interface{}) - if pfc.ContentID != nil { - objectMap["content-id"] = pfc.ContentID - } - if pfc.Action != "" { - objectMap["action"] = pfc.Action - } - if pfc.Type != "" { - objectMap["type"] = pfc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return &pfc, true -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for PollFeedbackCriterion. -func (pfc PollFeedbackCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &pfc, true -} - -// PollQuestion ... -type PollQuestion struct { - // ID - Unique identifier of the question. - ID *int32 `json:"id,omitempty"` - // Localization - Poll questions can be localized using an optional JSON object. The JSON key is a two-character language code as specified by the ISO 639-1 standard. The corresponding value is an object containing the localizable property title. - Localization map[string]*PollQuestionLocalization `json:"localization"` - // Choices - List of possible choices for this question. - Choices *[]PollQuestionChoice `json:"choices,omitempty"` - // Title - Title of the question. - Title *string `json:"title,omitempty"` -} - -// MarshalJSON is the custom marshaler for PollQuestion. -func (pq PollQuestion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pq.ID != nil { - objectMap["id"] = pq.ID - } - if pq.Localization != nil { - objectMap["localization"] = pq.Localization - } - if pq.Choices != nil { - objectMap["choices"] = pq.Choices - } - if pq.Title != nil { - objectMap["title"] = pq.Title - } - return json.Marshal(objectMap) -} - -// PollQuestionChoice ... -type PollQuestionChoice struct { - // ID - Unique identifier of the choice. - ID *int32 `json:"id,omitempty"` - // Localization - Poll choices can be localized using an optional JSON object. The JSON key is a two-character language code as specified by the ISO 639-1 standard. The corresponding value is an object containing the localizable property title. - Localization map[string]*PollQuestionChoiceLocalization `json:"localization"` - // IsDefault - A flag indicating if this choice is the default choice for the associated question. Only one choice in the array can have this value set to true. - IsDefault *bool `json:"isDefault,omitempty"` - // Title - Title of the choice. - Title *string `json:"title,omitempty"` -} - -// MarshalJSON is the custom marshaler for PollQuestionChoice. -func (pqc PollQuestionChoice) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pqc.ID != nil { - objectMap["id"] = pqc.ID - } - if pqc.Localization != nil { - objectMap["localization"] = pqc.Localization - } - if pqc.IsDefault != nil { - objectMap["isDefault"] = pqc.IsDefault - } - if pqc.Title != nil { - objectMap["title"] = pqc.Title - } - return json.Marshal(objectMap) -} - -// PollQuestionChoiceLocalization ... -type PollQuestionChoiceLocalization struct { - // Title - Title of the choice. - Title *string `json:"title,omitempty"` -} - -// PollQuestionLocalization ... -type PollQuestionLocalization struct { - // Title - Title of the question. - Title *string `json:"title,omitempty"` -} - -// PushQuotaFilter engage only users for whom the push quota is not reached. -type PushQuotaFilter struct { - // Type - Possible values include: 'TypeFilter', 'TypeEngageSubset', 'TypeEngageOldUsers', 'TypeEngageNewUsers', 'TypeEngageActiveUsers', 'TypeEngageIdleUsers', 'TypeNativePushEnabled', 'TypePushQuota', 'TypeAppInfo' - Type TypeBasicFilter `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PushQuotaFilter. -func (pqf PushQuotaFilter) MarshalJSON() ([]byte, error) { - pqf.Type = TypePushQuota - objectMap := make(map[string]interface{}) - if pqf.Type != "" { - objectMap["type"] = pqf.Type - } - return json.Marshal(objectMap) -} - -// AsEngageSubsetFilter is the BasicFilter implementation for PushQuotaFilter. -func (pqf PushQuotaFilter) AsEngageSubsetFilter() (*EngageSubsetFilter, bool) { - return nil, false -} - -// AsEngageOldUsersFilter is the BasicFilter implementation for PushQuotaFilter. -func (pqf PushQuotaFilter) AsEngageOldUsersFilter() (*EngageOldUsersFilter, bool) { - return nil, false -} - -// AsEngageNewUsersFilter is the BasicFilter implementation for PushQuotaFilter. -func (pqf PushQuotaFilter) AsEngageNewUsersFilter() (*EngageNewUsersFilter, bool) { - return nil, false -} - -// AsEngageActiveUsersFilter is the BasicFilter implementation for PushQuotaFilter. -func (pqf PushQuotaFilter) AsEngageActiveUsersFilter() (*EngageActiveUsersFilter, bool) { - return nil, false -} - -// AsEngageIdleUsersFilter is the BasicFilter implementation for PushQuotaFilter. -func (pqf PushQuotaFilter) AsEngageIdleUsersFilter() (*EngageIdleUsersFilter, bool) { - return nil, false -} - -// AsNativePushEnabledFilter is the BasicFilter implementation for PushQuotaFilter. -func (pqf PushQuotaFilter) AsNativePushEnabledFilter() (*NativePushEnabledFilter, bool) { - return nil, false -} - -// AsPushQuotaFilter is the BasicFilter implementation for PushQuotaFilter. -func (pqf PushQuotaFilter) AsPushQuotaFilter() (*PushQuotaFilter, bool) { - return &pqf, true -} - -// AsAppInfoFilter is the BasicFilter implementation for PushQuotaFilter. -func (pqf PushQuotaFilter) AsAppInfoFilter() (*AppInfoFilter, bool) { - return nil, false -} - -// AsFilter is the BasicFilter implementation for PushQuotaFilter. -func (pqf PushQuotaFilter) AsFilter() (*Filter, bool) { - return nil, false -} - -// AsBasicFilter is the BasicFilter implementation for PushQuotaFilter. -func (pqf PushQuotaFilter) AsBasicFilter() (BasicFilter, bool) { - return &pqf, true -} - -// Resource ... -type Resource struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - 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.ID != nil { - objectMap["id"] = r.ID - } - if r.Name != nil { - objectMap["name"] = r.Name - } - if r.Type != nil { - objectMap["type"] = r.Type - } - if r.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } - return json.Marshal(objectMap) -} - -// ScreenSizeCriterion used to target devices based on the screen resolution of their device. -type ScreenSizeCriterion struct { - // Name - Screen size using the following format WIDTH**x**HEIGHT. - Name *string `json:"name,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) MarshalJSON() ([]byte, error) { - ssc.Type = TypeScreenSize - objectMap := make(map[string]interface{}) - if ssc.Name != nil { - objectMap["name"] = ssc.Name - } - if ssc.Type != "" { - objectMap["type"] = ssc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return &ssc, true -} - -// AsLocationCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for ScreenSizeCriterion. -func (ssc ScreenSizeCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &ssc, true -} - -// SegmentCriterion target devices based on an existing segment. -type SegmentCriterion struct { - // ID - Segment identifier. - ID *int32 `json:"id,omitempty"` - // Exclude - If value is true, the criterion will target users that are NOT part of the segment. - Exclude *bool `json:"exclude,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for SegmentCriterion. -func (sc SegmentCriterion) MarshalJSON() ([]byte, error) { - sc.Type = TypeSegment - objectMap := make(map[string]interface{}) - if sc.ID != nil { - objectMap["id"] = sc.ID - } - if sc.Exclude != nil { - objectMap["exclude"] = sc.Exclude - } - if sc.Type != "" { - objectMap["type"] = sc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return &sc, true -} - -// AsStringTagCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return nil, false -} - -// AsDateTagCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for SegmentCriterion. -func (sc SegmentCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &sc, true -} - -// StringTagCriterion target devices based on a string tag value. -type StringTagCriterion struct { - // Name - The name of the custom tag. - Name *string `json:"name,omitempty"` - // Value - A custom string to match for tag value (? and * characters can be used to perform wildcard matching). - Value *string `json:"value,omitempty"` - // Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag' - Type Type `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for StringTagCriterion. -func (stc StringTagCriterion) MarshalJSON() ([]byte, error) { - stc.Type = TypeStringTag - objectMap := make(map[string]interface{}) - if stc.Name != nil { - objectMap["name"] = stc.Name - } - if stc.Value != nil { - objectMap["value"] = stc.Value - } - if stc.Type != "" { - objectMap["type"] = stc.Type - } - return json.Marshal(objectMap) -} - -// AsCarrierNameCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) { - return nil, false -} - -// AsCarrierCountryCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) { - return nil, false -} - -// AsFirmwareVersionCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) { - return nil, false -} - -// AsDeviceManufacturerCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) { - return nil, false -} - -// AsDeviceModelCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) { - return nil, false -} - -// AsApplicationVersionCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) { - return nil, false -} - -// AsNetworkTypeCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) { - return nil, false -} - -// AsLanguageCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) { - return nil, false -} - -// AsScreenSizeCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) { - return nil, false -} - -// AsLocationCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsLocationCriterion() (*LocationCriterion, bool) { - return nil, false -} - -// AsGeoFencingCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) { - return nil, false -} - -// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) { - return nil, false -} - -// AsPollFeedbackCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) { - return nil, false -} - -// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) { - return nil, false -} - -// AsDatapushFeedbackCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) { - return nil, false -} - -// AsSegmentCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) { - return nil, false -} - -// AsStringTagCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) { - return &stc, true -} - -// AsDateTagCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) { - return nil, false -} - -// AsIntegerTagCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) { - return nil, false -} - -// AsBooleanTagCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) { - return nil, false -} - -// AsCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsCriterion() (*Criterion, bool) { - return nil, false -} - -// AsBasicCriterion is the BasicCriterion implementation for StringTagCriterion. -func (stc StringTagCriterion) AsBasicCriterion() (BasicCriterion, bool) { - return &stc, true -} - -// SupportedPlatformsListResult ... -type SupportedPlatformsListResult struct { - autorest.Response `json:"-"` - // Platforms - List of supported platforms. - Platforms *[]string `json:"platforms,omitempty"` -} diff --git a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/supportedplatforms.go b/services/mobileengagement/mgmt/2014-12-01/mobileengagement/supportedplatforms.go deleted file mode 100644 index 43721ba84489..000000000000 --- a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/supportedplatforms.go +++ /dev/null @@ -1,102 +0,0 @@ -package mobileengagement - -// 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" - "net/http" -) - -// SupportedPlatformsClient is the microsoft Azure Mobile Engagement REST APIs. -type SupportedPlatformsClient struct { - BaseClient -} - -// NewSupportedPlatformsClient creates an instance of the SupportedPlatformsClient client. -func NewSupportedPlatformsClient(subscriptionID string) SupportedPlatformsClient { - return NewSupportedPlatformsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSupportedPlatformsClientWithBaseURI creates an instance of the SupportedPlatformsClient client. -func NewSupportedPlatformsClientWithBaseURI(baseURI string, subscriptionID string) SupportedPlatformsClient { - return SupportedPlatformsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists supported platforms for Engagement applications. -func (client SupportedPlatformsClient) List(ctx context.Context) (result SupportedPlatformsListResult, err error) { - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.SupportedPlatformsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mobileengagement.SupportedPlatformsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mobileengagement.SupportedPlatformsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client SupportedPlatformsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MobileEngagement/supportedPlatforms", 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 SupportedPlatformsClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SupportedPlatformsClient) ListResponder(resp *http.Response) (result SupportedPlatformsListResult, 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/mobileengagement/mgmt/2014-12-01/mobileengagement/version.go b/services/mobileengagement/mgmt/2014-12-01/mobileengagement/version.go deleted file mode 100644 index fbf5ae0f930c..000000000000 --- a/services/mobileengagement/mgmt/2014-12-01/mobileengagement/version.go +++ /dev/null @@ -1,30 +0,0 @@ -package mobileengagement - -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.Number + " mobileengagement/2014-12-01" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/services/network/mgmt/2018-07-01/network/models.go b/services/network/mgmt/2018-07-01/network/models.go index 4280b942f451..06df04000084 100644 --- a/services/network/mgmt/2018-07-01/network/models.go +++ b/services/network/mgmt/2018-07-01/network/models.go @@ -5404,6 +5404,8 @@ type BackendAddressPoolPropertiesFormat struct { LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` // OutboundRule - READ-ONLY; Gets outbound rules that use this backend address pool. OutboundRule *SubResource `json:"outboundRule,omitempty"` + // OutboundRules - READ-ONLY; Gets outbound rules that use this backend address pool. + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` // ProvisioningState - Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. ProvisioningState *string `json:"provisioningState,omitempty"` } @@ -13524,7 +13526,7 @@ type OperationPropertiesFormatServiceSpecification struct { LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` } -// OutboundRule outbound pool of the load balancer. +// OutboundRule outbound rule of the load balancer. type OutboundRule struct { // OutboundRulePropertiesFormat - Properties of load balancer outbound rule. *OutboundRulePropertiesFormat `json:"properties,omitempty"` @@ -13605,7 +13607,7 @@ func (or *OutboundRule) UnmarshalJSON(body []byte) error { return nil } -// OutboundRulePropertiesFormat outbound pool of the load balancer. +// OutboundRulePropertiesFormat outbound rule of the load balancer. type OutboundRulePropertiesFormat struct { // AllocatedOutboundPorts - The number of outbound ports to be used for NAT. AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` diff --git a/services/network/mgmt/2018-08-01/network/models.go b/services/network/mgmt/2018-08-01/network/models.go index 93528ce26775..d875b8aba3d0 100644 --- a/services/network/mgmt/2018-08-01/network/models.go +++ b/services/network/mgmt/2018-08-01/network/models.go @@ -6236,6 +6236,8 @@ type BackendAddressPoolPropertiesFormat struct { LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` // OutboundRule - READ-ONLY; Gets outbound rules that use this backend address pool. OutboundRule *SubResource `json:"outboundRule,omitempty"` + // OutboundRules - READ-ONLY; Gets outbound rules that use this backend address pool. + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` // ProvisioningState - Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. ProvisioningState *string `json:"provisioningState,omitempty"` } @@ -17148,7 +17150,7 @@ type OperationPropertiesFormatServiceSpecification struct { LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` } -// OutboundRule outbound pool of the load balancer. +// OutboundRule outbound rule of the load balancer. type OutboundRule struct { autorest.Response `json:"-"` // OutboundRulePropertiesFormat - Properties of load balancer outbound rule. @@ -17230,7 +17232,7 @@ func (or *OutboundRule) UnmarshalJSON(body []byte) error { return nil } -// OutboundRulePropertiesFormat outbound pool of the load balancer. +// OutboundRulePropertiesFormat outbound rule of the load balancer. type OutboundRulePropertiesFormat struct { // AllocatedOutboundPorts - The number of outbound ports to be used for NAT. AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` diff --git a/services/network/mgmt/2018-10-01/network/models.go b/services/network/mgmt/2018-10-01/network/models.go index f23b3e99fba5..279622c6b0ce 100644 --- a/services/network/mgmt/2018-10-01/network/models.go +++ b/services/network/mgmt/2018-10-01/network/models.go @@ -6402,6 +6402,8 @@ type BackendAddressPoolPropertiesFormat struct { LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` // OutboundRule - READ-ONLY; Gets outbound rules that use this backend address pool. OutboundRule *SubResource `json:"outboundRule,omitempty"` + // OutboundRules - READ-ONLY; Gets outbound rules that use this backend address pool. + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` // ProvisioningState - Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. ProvisioningState *string `json:"provisioningState,omitempty"` } @@ -17503,7 +17505,7 @@ type OperationPropertiesFormatServiceSpecification struct { LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` } -// OutboundRule outbound pool of the load balancer. +// OutboundRule outbound rule of the load balancer. type OutboundRule struct { autorest.Response `json:"-"` // OutboundRulePropertiesFormat - Properties of load balancer outbound rule. @@ -17585,7 +17587,7 @@ func (or *OutboundRule) UnmarshalJSON(body []byte) error { return nil } -// OutboundRulePropertiesFormat outbound pool of the load balancer. +// OutboundRulePropertiesFormat outbound rule of the load balancer. type OutboundRulePropertiesFormat struct { // AllocatedOutboundPorts - The number of outbound ports to be used for NAT. AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` diff --git a/services/network/mgmt/2018-11-01/network/models.go b/services/network/mgmt/2018-11-01/network/models.go index 7694128c6daa..4c72f7b0d62f 100644 --- a/services/network/mgmt/2018-11-01/network/models.go +++ b/services/network/mgmt/2018-11-01/network/models.go @@ -6485,6 +6485,8 @@ type BackendAddressPoolPropertiesFormat struct { LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` // OutboundRule - READ-ONLY; Gets outbound rules that use this backend address pool. OutboundRule *SubResource `json:"outboundRule,omitempty"` + // OutboundRules - READ-ONLY; Gets outbound rules that use this backend address pool. + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` // ProvisioningState - Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. ProvisioningState *string `json:"provisioningState,omitempty"` } @@ -17855,7 +17857,7 @@ type OperationPropertiesFormatServiceSpecification struct { LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` } -// OutboundRule outbound pool of the load balancer. +// OutboundRule outbound rule of the load balancer. type OutboundRule struct { autorest.Response `json:"-"` // OutboundRulePropertiesFormat - Properties of load balancer outbound rule. @@ -17937,7 +17939,7 @@ func (or *OutboundRule) UnmarshalJSON(body []byte) error { return nil } -// OutboundRulePropertiesFormat outbound pool of the load balancer. +// OutboundRulePropertiesFormat outbound rule of the load balancer. type OutboundRulePropertiesFormat struct { // AllocatedOutboundPorts - The number of outbound ports to be used for NAT. AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` diff --git a/services/network/mgmt/2018-12-01/network/models.go b/services/network/mgmt/2018-12-01/network/models.go index d5ffe92ada2c..58a5955cd2ac 100644 --- a/services/network/mgmt/2018-12-01/network/models.go +++ b/services/network/mgmt/2018-12-01/network/models.go @@ -6695,6 +6695,8 @@ type BackendAddressPoolPropertiesFormat struct { LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` // OutboundRule - READ-ONLY; Gets outbound rules that use this backend address pool. OutboundRule *SubResource `json:"outboundRule,omitempty"` + // OutboundRules - READ-ONLY; Gets outbound rules that use this backend address pool. + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` // ProvisioningState - Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. ProvisioningState *string `json:"provisioningState,omitempty"` } @@ -18132,7 +18134,7 @@ type OperationPropertiesFormatServiceSpecification struct { LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` } -// OutboundRule outbound pool of the load balancer. +// OutboundRule outbound rule of the load balancer. type OutboundRule struct { autorest.Response `json:"-"` // OutboundRulePropertiesFormat - Properties of load balancer outbound rule. @@ -18214,7 +18216,7 @@ func (or *OutboundRule) UnmarshalJSON(body []byte) error { return nil } -// OutboundRulePropertiesFormat outbound pool of the load balancer. +// OutboundRulePropertiesFormat outbound rule of the load balancer. type OutboundRulePropertiesFormat struct { // AllocatedOutboundPorts - The number of outbound ports to be used for NAT. AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` diff --git a/services/network/mgmt/2019-02-01/network/models.go b/services/network/mgmt/2019-02-01/network/models.go index 8c789a21518e..49eb537d081a 100644 --- a/services/network/mgmt/2019-02-01/network/models.go +++ b/services/network/mgmt/2019-02-01/network/models.go @@ -6797,6 +6797,8 @@ type BackendAddressPoolPropertiesFormat struct { LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` // OutboundRule - READ-ONLY; Gets outbound rules that use this backend address pool. OutboundRule *SubResource `json:"outboundRule,omitempty"` + // OutboundRules - READ-ONLY; Gets outbound rules that use this backend address pool. + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` // ProvisioningState - Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. ProvisioningState *string `json:"provisioningState,omitempty"` } @@ -18624,7 +18626,7 @@ type OperationPropertiesFormatServiceSpecification struct { LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` } -// OutboundRule outbound pool of the load balancer. +// OutboundRule outbound rule of the load balancer. type OutboundRule struct { autorest.Response `json:"-"` // OutboundRulePropertiesFormat - Properties of load balancer outbound rule. @@ -18706,7 +18708,7 @@ func (or *OutboundRule) UnmarshalJSON(body []byte) error { return nil } -// OutboundRulePropertiesFormat outbound pool of the load balancer. +// OutboundRulePropertiesFormat outbound rule of the load balancer. type OutboundRulePropertiesFormat struct { // AllocatedOutboundPorts - The number of outbound ports to be used for NAT. AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` diff --git a/services/network/mgmt/2019-04-01/network/models.go b/services/network/mgmt/2019-04-01/network/models.go index 042b85a49b10..8aa70030b245 100644 --- a/services/network/mgmt/2019-04-01/network/models.go +++ b/services/network/mgmt/2019-04-01/network/models.go @@ -7126,6 +7126,8 @@ type BackendAddressPoolPropertiesFormat struct { LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` // OutboundRule - READ-ONLY; Gets outbound rules that use this backend address pool. OutboundRule *SubResource `json:"outboundRule,omitempty"` + // OutboundRules - READ-ONLY; Gets outbound rules that use this backend address pool. + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` // ProvisioningState - Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. ProvisioningState *string `json:"provisioningState,omitempty"` } @@ -19095,7 +19097,7 @@ type OperationPropertiesFormatServiceSpecification struct { LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` } -// OutboundRule outbound pool of the load balancer. +// OutboundRule outbound rule of the load balancer. type OutboundRule struct { autorest.Response `json:"-"` // OutboundRulePropertiesFormat - Properties of load balancer outbound rule. @@ -19177,7 +19179,7 @@ func (or *OutboundRule) UnmarshalJSON(body []byte) error { return nil } -// OutboundRulePropertiesFormat outbound pool of the load balancer. +// OutboundRulePropertiesFormat outbound rule of the load balancer. type OutboundRulePropertiesFormat struct { // AllocatedOutboundPorts - The number of outbound ports to be used for NAT. AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` @@ -20754,7 +20756,7 @@ type PrivateEndpoint struct { autorest.Response `json:"-"` // PrivateEndpointProperties - Properties of the private endpoint. *PrivateEndpointProperties `json:"properties,omitempty"` - // Etag - Gets a unique read-only string that changes whenever the resource is updated. + // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` @@ -20874,6 +20876,10 @@ type PrivateEndpointConnection struct { *PrivateEndpointConnectionProperties `json:"properties,omitempty"` // Name - 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; The resource type. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` } @@ -20920,6 +20926,24 @@ func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { } pec.Name = &name } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + pec.Etag = &etag + } case "id": if v != nil { var ID string @@ -20941,6 +20965,8 @@ type PrivateEndpointConnectionProperties struct { PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider. PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the private endpoint connection. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } // PrivateEndpointListResult response for the ListPrivateEndpoints API service call. @@ -21095,8 +21121,8 @@ type PrivateEndpointProperties struct { Subnet *Subnet `json:"subnet,omitempty"` // NetworkInterfaces - READ-ONLY; Gets an array of references to the network interfaces created for this private endpoint. NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the private endpoint. Possible values are: 'Updating', 'Deleting', and 'Failed'. - ProvisioningState *string `json:"provisioningState,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the private endpoint. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // PrivateLinkServiceConnections - A grouping of information about the connection to the remote resource. PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` // ManualPrivateLinkServiceConnections - A grouping of information about the connection to the remote resource. Used when the network admin does not have access to approve connections to the remote resource. @@ -21160,7 +21186,7 @@ type PrivateLinkService struct { autorest.Response `json:"-"` // PrivateLinkServiceProperties - Properties of the private link service. *PrivateLinkServiceProperties `json:"properties,omitempty"` - // Etag - Gets a unique read-only string that changes whenever the resource is updated. + // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` @@ -21279,6 +21305,10 @@ type PrivateLinkServiceConnection struct { *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` // Name - 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; The resource type. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` } @@ -21325,6 +21355,24 @@ func (plsc *PrivateLinkServiceConnection) UnmarshalJSON(body []byte) error { } plsc.Name = &name } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plsc.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + plsc.Etag = &etag + } case "id": if v != nil { var ID string @@ -21342,6 +21390,8 @@ func (plsc *PrivateLinkServiceConnection) UnmarshalJSON(body []byte) error { // PrivateLinkServiceConnectionProperties properties of the PrivateLinkServiceConnection. type PrivateLinkServiceConnectionProperties struct { + // ProvisioningState - READ-ONLY; The provisioning state of the private link service connection. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // PrivateLinkServiceID - The resource id of private link service. PrivateLinkServiceID *string `json:"privateLinkServiceId,omitempty"` // GroupIds - The ID(s) of the group(s) obtained from the remote resource that this private endpoint should connect to. @@ -21369,6 +21419,12 @@ type PrivateLinkServiceIPConfiguration struct { *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` // Name - The name of private link service ip configuration. Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // MarshalJSON is the custom marshaler for PrivateLinkServiceIPConfiguration. @@ -21380,6 +21436,9 @@ func (plsic PrivateLinkServiceIPConfiguration) MarshalJSON() ([]byte, error) { if plsic.Name != nil { objectMap["name"] = plsic.Name } + if plsic.ID != nil { + objectMap["id"] = plsic.ID + } return json.Marshal(objectMap) } @@ -21410,6 +21469,33 @@ func (plsic *PrivateLinkServiceIPConfiguration) UnmarshalJSON(body []byte) error } plsic.Name = &name } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + plsic.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plsic.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plsic.ID = &ID + } } } @@ -21424,10 +21510,10 @@ type PrivateLinkServiceIPConfigurationProperties struct { PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` // Subnet - The reference of the subnet resource. Subnet *Subnet `json:"subnet,omitempty"` - // PublicIPAddress - The reference of the public IP resource. - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - ProvisioningState *string `json:"provisioningState,omitempty"` + // Primary - Whether the ip configuration is primary or not. + Primary *bool `json:"primary,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the private link service ip configuration. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // PrivateIPAddressVersion - Available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values include: 'IPv4', 'IPv6' PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` } @@ -21586,8 +21672,8 @@ type PrivateLinkServiceProperties struct { IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` // NetworkInterfaces - READ-ONLY; Gets an array of references to the network interfaces created for this private link service. NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the private link service. Possible values are: 'Updating', 'Succeeded', and 'Failed'. - ProvisioningState *string `json:"provisioningState,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the private link service. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // PrivateEndpointConnections - An array of list about connections to the private endpoint. PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` // Visibility - The visibility list of the private link service. diff --git a/services/network/mgmt/2019-04-01/network/privateendpoints.go b/services/network/mgmt/2019-04-01/network/privateendpoints.go index db6516d7b5fb..6a5d5aed1857 100644 --- a/services/network/mgmt/2019-04-01/network/privateendpoints.go +++ b/services/network/mgmt/2019-04-01/network/privateendpoints.go @@ -44,7 +44,7 @@ func NewPrivateEndpointsClientWithBaseURI(baseURI string, subscriptionID string) // Parameters: // resourceGroupName - the name of the resource group. // privateEndpointName - the name of the private endpoint. -// parameters - parameters supplied to the create or update private endpoint operation +// parameters - parameters supplied to the create or update private endpoint operation. func (client PrivateEndpointsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, parameters PrivateEndpoint) (result PrivateEndpointsCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.CreateOrUpdate") diff --git a/services/network/mgmt/2019-04-01/network/privatelinkservices.go b/services/network/mgmt/2019-04-01/network/privatelinkservices.go index 2ac430bd5eb2..22603fa59204 100644 --- a/services/network/mgmt/2019-04-01/network/privatelinkservices.go +++ b/services/network/mgmt/2019-04-01/network/privatelinkservices.go @@ -202,7 +202,7 @@ func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResou // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the private link service. -// parameters - parameters supplied to the create or update private link service operation +// parameters - parameters supplied to the create or update private link service operation. func (client PrivateLinkServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService) (result PrivateLinkServicesCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.CreateOrUpdate") @@ -1019,6 +1019,8 @@ func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionPreparer( "api-version": APIVersion, } + parameters.Type = nil + parameters.Etag = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), diff --git a/services/preview/README.md b/services/preview/README.md deleted file mode 100644 index 7cffc92a4273..000000000000 --- a/services/preview/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Azure SDK for Go Preview Packages - -The packages in this directory are pre-release and thus are subject to change. -Also note that due to their preview nature breaking changes can be introduced outside -major version revisions of the SDK. diff --git a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/appconfigurationapi/interfaces.go b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/appconfigurationapi/interfaces.go index 972cd50887f0..b09e153e4a30 100644 --- a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/appconfigurationapi/interfaces.go +++ b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/appconfigurationapi/interfaces.go @@ -30,6 +30,7 @@ type ConfigurationStoresClientAPI interface { List(ctx context.Context, skipToken string) (result appconfiguration.ConfigurationStoreListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, skipToken string) (result appconfiguration.ConfigurationStoreListResultPage, err error) ListKeys(ctx context.Context, resourceGroupName string, configStoreName string, skipToken string) (result appconfiguration.APIKeyListResultPage, err error) + ListKeyValue(ctx context.Context, resourceGroupName string, configStoreName string, listKeyValueParameters appconfiguration.ListKeyValueParameters) (result appconfiguration.KeyValue, err error) RegenerateKey(ctx context.Context, resourceGroupName string, configStoreName string, regenerateKeyParameters appconfiguration.RegenerateKeyParameters) (result appconfiguration.APIKey, err error) Update(ctx context.Context, resourceGroupName string, configStoreName string, configStoreUpdateParameters appconfiguration.ConfigurationStoreUpdateParameters) (result appconfiguration.ConfigurationStoresUpdateFuture, err error) } diff --git a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go index 2549bf8c8d47..d5263579ac0c 100644 --- a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go +++ b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go @@ -663,6 +663,96 @@ func (client ConfigurationStoresClient) ListKeysComplete(ctx context.Context, re return } +// ListKeyValue lists a configuration store key-value. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// configStoreName - the name of the configuration store. +// listKeyValueParameters - the parameters for retrieving a key-value. +func (client ConfigurationStoresClient) ListKeyValue(ctx context.Context, resourceGroupName string, configStoreName string, listKeyValueParameters ListKeyValueParameters) (result KeyValue, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.ListKeyValue") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: configStoreName, + Constraints: []validation.Constraint{{Target: "configStoreName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "configStoreName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "configStoreName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_-]*$`, Chain: nil}}}, + {TargetValue: listKeyValueParameters, + Constraints: []validation.Constraint{{Target: "listKeyValueParameters.Key", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("appconfiguration.ConfigurationStoresClient", "ListKeyValue", err.Error()) + } + + req, err := client.ListKeyValuePreparer(ctx, resourceGroupName, configStoreName, listKeyValueParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeyValueSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", resp, "Failure sending request") + return + } + + result, err = client.ListKeyValueResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", resp, "Failure responding to request") + } + + return +} + +// ListKeyValuePreparer prepares the ListKeyValue request. +func (client ConfigurationStoresClient) ListKeyValuePreparer(ctx context.Context, resourceGroupName string, configStoreName string, listKeyValueParameters ListKeyValueParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configStoreName": autorest.Encode("path", configStoreName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-02-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.AppConfiguration/configurationStores/{configStoreName}/listKeyValue", pathParameters), + autorest.WithJSON(listKeyValueParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeyValueSender sends the ListKeyValue request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationStoresClient) ListKeyValueSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListKeyValueResponder handles the response to the ListKeyValue request. The method always +// closes the http.Response Body. +func (client ConfigurationStoresClient) ListKeyValueResponder(resp *http.Response) (result KeyValue, 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 regenerates an access key for the specified configuration store. // Parameters: // resourceGroupName - the name of the resource group to which the container registry belongs. diff --git a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/models.go b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/models.go index 0eee8a1b5870..f3fffbdde3f9 100644 --- a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/models.go +++ b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/models.go @@ -592,6 +592,45 @@ type Error struct { Message *string `json:"message,omitempty"` } +// KeyValue the result of a request to retrieve a key-value from the specified configuration store. +type KeyValue struct { + autorest.Response `json:"-"` + // Key - READ-ONLY; The primary identifier of a key-value. + // The key is used in unison with the label to uniquely identify a key-value. + Key *string `json:"key,omitempty"` + // Label - READ-ONLY; A value used to group key-values. + // The label is used in unison with the key to uniquely identify a key-value. + Label *string `json:"label,omitempty"` + // Value - READ-ONLY; The value of the key-value. + Value *string `json:"value,omitempty"` + // ContentType - READ-ONLY; The content type of the key-value's value. + // Providing a proper content-type can enable transformations of values when they are retrieved by applications. + ContentType *string `json:"contentType,omitempty"` + // ETag - READ-ONLY; An ETag indicating the state of a key-value within a configuration store. + ETag *string `json:"eTag,omitempty"` + // LastModified - READ-ONLY; The last time a modifying operation was performed on the given key-value. + LastModified *date.Time `json:"lastModified,omitempty"` + // Locked - READ-ONLY; A value indicating whether the key-value is locked. + // A locked key-value may not be modified until it is unlocked. + Locked *bool `json:"locked,omitempty"` + // Tags - READ-ONLY; A dictionary of tags that can help identify what a key-value may be applicable for. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for KeyValue. +func (kv KeyValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ListKeyValueParameters the parameters used to list a configuration store key-value +type ListKeyValueParameters struct { + // Key - The key to retrieve. + Key *string `json:"key,omitempty"` + // Label - The label of the key. + Label *string `json:"label,omitempty"` +} + // NameAvailabilityStatus the result of a request to check the availability of a resource name. type NameAvailabilityStatus struct { autorest.Response `json:"-"` diff --git a/services/preview/automation/mgmt/2017-05-15-preview/automation/dsccompilationjob.go b/services/preview/automation/mgmt/2017-05-15-preview/automation/dsccompilationjob.go index 239c0926be96..d82bca52bb16 100644 --- a/services/preview/automation/mgmt/2017-05-15-preview/automation/dsccompilationjob.go +++ b/services/preview/automation/mgmt/2017-05-15-preview/automation/dsccompilationjob.go @@ -46,7 +46,7 @@ func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string // Parameters: // resourceGroupName - name of an Azure Resource group. // automationAccountName - the name of the automation account. -// compilationJobID - the the DSC configuration Id. +// compilationJobID - the DSC configuration Id. // parameters - the parameters supplied to the create compilation job operation. func (client DscCompilationJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID, parameters DscCompilationJobCreateParameters) (result DscCompilationJob, err error) { if tracing.IsEnabled() { diff --git a/services/preview/automation/mgmt/2017-05-15-preview/automation/dscconfiguration.go b/services/preview/automation/mgmt/2017-05-15-preview/automation/dscconfiguration.go index 1336ef9e640c..1adb2650c6d0 100644 --- a/services/preview/automation/mgmt/2017-05-15-preview/automation/dscconfiguration.go +++ b/services/preview/automation/mgmt/2017-05-15-preview/automation/dscconfiguration.go @@ -405,7 +405,7 @@ func (client DscConfigurationClient) GetContentResponder(resp *http.Response) (r // automationAccountName - the name of the automation account. // filter - the filter to apply on the operation. // skip - the number of rows to skip. -// top - the the number of rows to take. +// top - the number of rows to take. // inlinecount - return total rows. func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultPage, err error) { if tracing.IsEnabled() { diff --git a/services/preview/automation/mgmt/2018-01-15-preview/automation/dsccompilationjob.go b/services/preview/automation/mgmt/2018-01-15-preview/automation/dsccompilationjob.go index 3fe70fe3f431..910535ed3316 100644 --- a/services/preview/automation/mgmt/2018-01-15-preview/automation/dsccompilationjob.go +++ b/services/preview/automation/mgmt/2018-01-15-preview/automation/dsccompilationjob.go @@ -46,7 +46,7 @@ func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string // Parameters: // resourceGroupName - name of an Azure Resource group. // automationAccountName - the name of the automation account. -// compilationJobName - the the DSC configuration Id. +// compilationJobName - the DSC configuration Id. // parameters - the parameters supplied to the create compilation job operation. func (client DscCompilationJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string, parameters DscCompilationJobCreateParameters) (result DscCompilationJobCreateFuture, err error) { if tracing.IsEnabled() { @@ -139,7 +139,7 @@ func (client DscCompilationJobClient) CreateResponder(resp *http.Response) (resu // Parameters: // resourceGroupName - name of an Azure Resource group. // automationAccountName - the name of the automation account. -// compilationJobName - the the DSC configuration Id. +// compilationJobName - the DSC configuration Id. func (client DscCompilationJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string) (result DscCompilationJob, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobClient.Get") diff --git a/services/preview/automation/mgmt/2018-01-15-preview/automation/dscconfiguration.go b/services/preview/automation/mgmt/2018-01-15-preview/automation/dscconfiguration.go index 1336ef9e640c..1adb2650c6d0 100644 --- a/services/preview/automation/mgmt/2018-01-15-preview/automation/dscconfiguration.go +++ b/services/preview/automation/mgmt/2018-01-15-preview/automation/dscconfiguration.go @@ -405,7 +405,7 @@ func (client DscConfigurationClient) GetContentResponder(resp *http.Response) (r // automationAccountName - the name of the automation account. // filter - the filter to apply on the operation. // skip - the number of rows to skip. -// top - the the number of rows to take. +// top - the number of rows to take. // inlinecount - return total rows. func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultPage, err error) { if tracing.IsEnabled() { diff --git a/services/preview/automation/mgmt/2018-01-15-preview/automation/dscnode.go b/services/preview/automation/mgmt/2018-01-15-preview/automation/dscnode.go index 2a0123d1dad2..bca9fe56e034 100644 --- a/services/preview/automation/mgmt/2018-01-15-preview/automation/dscnode.go +++ b/services/preview/automation/mgmt/2018-01-15-preview/automation/dscnode.go @@ -221,7 +221,7 @@ func (client DscNodeClient) GetResponder(resp *http.Response) (result DscNode, e // automationAccountName - the name of the automation account. // filter - the filter to apply on the operation. // skip - the number of rows to skip. -// top - the the number of rows to take. +// top - the number of rows to take. // inlinecount - return total rows. func (client DscNodeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeListResultPage, err error) { if tracing.IsEnabled() { diff --git a/services/preview/automation/mgmt/2018-01-15-preview/automation/dscnodeconfiguration.go b/services/preview/automation/mgmt/2018-01-15-preview/automation/dscnodeconfiguration.go index fd68d07a16c8..8ad905e7abf0 100644 --- a/services/preview/automation/mgmt/2018-01-15-preview/automation/dscnodeconfiguration.go +++ b/services/preview/automation/mgmt/2018-01-15-preview/automation/dscnodeconfiguration.go @@ -320,7 +320,7 @@ func (client DscNodeConfigurationClient) GetResponder(resp *http.Response) (resu // automationAccountName - the name of the automation account. // filter - the filter to apply on the operation. // skip - the number of rows to skip. -// top - the the number of rows to take. +// top - the number of rows to take. // inlinecount - return total rows. func (client DscNodeConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeConfigurationListResultPage, err error) { if tracing.IsEnabled() { diff --git a/services/preview/automation/mgmt/2018-06-30-preview/automation/dsccompilationjob.go b/services/preview/automation/mgmt/2018-06-30-preview/automation/dsccompilationjob.go index 3fe70fe3f431..910535ed3316 100644 --- a/services/preview/automation/mgmt/2018-06-30-preview/automation/dsccompilationjob.go +++ b/services/preview/automation/mgmt/2018-06-30-preview/automation/dsccompilationjob.go @@ -46,7 +46,7 @@ func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string // Parameters: // resourceGroupName - name of an Azure Resource group. // automationAccountName - the name of the automation account. -// compilationJobName - the the DSC configuration Id. +// compilationJobName - the DSC configuration Id. // parameters - the parameters supplied to the create compilation job operation. func (client DscCompilationJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string, parameters DscCompilationJobCreateParameters) (result DscCompilationJobCreateFuture, err error) { if tracing.IsEnabled() { @@ -139,7 +139,7 @@ func (client DscCompilationJobClient) CreateResponder(resp *http.Response) (resu // Parameters: // resourceGroupName - name of an Azure Resource group. // automationAccountName - the name of the automation account. -// compilationJobName - the the DSC configuration Id. +// compilationJobName - the DSC configuration Id. func (client DscCompilationJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string) (result DscCompilationJob, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobClient.Get") diff --git a/services/preview/automation/mgmt/2018-06-30-preview/automation/dscconfiguration.go b/services/preview/automation/mgmt/2018-06-30-preview/automation/dscconfiguration.go index 1336ef9e640c..1adb2650c6d0 100644 --- a/services/preview/automation/mgmt/2018-06-30-preview/automation/dscconfiguration.go +++ b/services/preview/automation/mgmt/2018-06-30-preview/automation/dscconfiguration.go @@ -405,7 +405,7 @@ func (client DscConfigurationClient) GetContentResponder(resp *http.Response) (r // automationAccountName - the name of the automation account. // filter - the filter to apply on the operation. // skip - the number of rows to skip. -// top - the the number of rows to take. +// top - the number of rows to take. // inlinecount - return total rows. func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultPage, err error) { if tracing.IsEnabled() { diff --git a/services/preview/automation/mgmt/2018-06-30-preview/automation/dscnode.go b/services/preview/automation/mgmt/2018-06-30-preview/automation/dscnode.go index 2a0123d1dad2..bca9fe56e034 100644 --- a/services/preview/automation/mgmt/2018-06-30-preview/automation/dscnode.go +++ b/services/preview/automation/mgmt/2018-06-30-preview/automation/dscnode.go @@ -221,7 +221,7 @@ func (client DscNodeClient) GetResponder(resp *http.Response) (result DscNode, e // automationAccountName - the name of the automation account. // filter - the filter to apply on the operation. // skip - the number of rows to skip. -// top - the the number of rows to take. +// top - the number of rows to take. // inlinecount - return total rows. func (client DscNodeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeListResultPage, err error) { if tracing.IsEnabled() { diff --git a/services/preview/automation/mgmt/2018-06-30-preview/automation/dscnodeconfiguration.go b/services/preview/automation/mgmt/2018-06-30-preview/automation/dscnodeconfiguration.go index fd68d07a16c8..8ad905e7abf0 100644 --- a/services/preview/automation/mgmt/2018-06-30-preview/automation/dscnodeconfiguration.go +++ b/services/preview/automation/mgmt/2018-06-30-preview/automation/dscnodeconfiguration.go @@ -320,7 +320,7 @@ func (client DscNodeConfigurationClient) GetResponder(resp *http.Response) (resu // automationAccountName - the name of the automation account. // filter - the filter to apply on the operation. // skip - the number of rows to skip. -// top - the the number of rows to take. +// top - the number of rows to take. // inlinecount - return total rows. func (client DscNodeConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeConfigurationListResultPage, err error) { if tracing.IsEnabled() { diff --git a/services/preview/datalake/analytics/2015-10-01-preview/catalog/models.go b/services/preview/datalake/analytics/2015-10-01-preview/catalog/models.go index 90897d0db4ed..419cfca27e7f 100644 --- a/services/preview/datalake/analytics/2015-10-01-preview/catalog/models.go +++ b/services/preview/datalake/analytics/2015-10-01-preview/catalog/models.go @@ -153,9 +153,9 @@ type USQLAssemblyDependencyInfo struct { type USQLAssemblyFileInfo struct { // Type - the assembly file type. Possible values include: 'Assembly', 'Resource' Type FileType `json:"type,omitempty"` - // OriginalPath - the the original path to the assembly file. + // OriginalPath - The original path to the assembly file. OriginalPath *string `json:"originalPath,omitempty"` - // ContentPath - the the content path to the assembly file. + // ContentPath - The content path to the assembly file. ContentPath *string `json:"contentPath,omitempty"` } @@ -1748,15 +1748,15 @@ type USQLTableType struct { SchemaID *int32 `json:"schemaId,omitempty"` // PrincipalID - the principal ID for this type. PrincipalID *int32 `json:"principalId,omitempty"` - // IsNullable - the the switch indicating if this type is nullable. + // IsNullable - The switch indicating if this type is nullable. IsNullable *bool `json:"isNullable,omitempty"` - // IsUserDefined - the the switch indicating if this type is user defined. + // IsUserDefined - The switch indicating if this type is user defined. IsUserDefined *bool `json:"isUserDefined,omitempty"` - // IsAssemblyType - the the switch indicating if this type is an assembly type. + // IsAssemblyType - The switch indicating if this type is an assembly type. IsAssemblyType *bool `json:"isAssemblyType,omitempty"` - // IsTableType - the the switch indicating if this type is a table type. + // IsTableType - The switch indicating if this type is a table type. IsTableType *bool `json:"isTableType,omitempty"` - // IsComplexType - the the switch indicating if this type is a complex type. + // IsComplexType - The switch indicating if this type is a complex type. IsComplexType *bool `json:"isComplexType,omitempty"` // ComputeAccountName - the name of the Data Lake Analytics account. ComputeAccountName *string `json:"computeAccountName,omitempty"` @@ -2100,15 +2100,15 @@ type USQLType struct { SchemaID *int32 `json:"schemaId,omitempty"` // PrincipalID - the principal ID for this type. PrincipalID *int32 `json:"principalId,omitempty"` - // IsNullable - the the switch indicating if this type is nullable. + // IsNullable - The switch indicating if this type is nullable. IsNullable *bool `json:"isNullable,omitempty"` - // IsUserDefined - the the switch indicating if this type is user defined. + // IsUserDefined - The switch indicating if this type is user defined. IsUserDefined *bool `json:"isUserDefined,omitempty"` - // IsAssemblyType - the the switch indicating if this type is an assembly type. + // IsAssemblyType - The switch indicating if this type is an assembly type. IsAssemblyType *bool `json:"isAssemblyType,omitempty"` - // IsTableType - the the switch indicating if this type is a table type. + // IsTableType - The switch indicating if this type is a table type. IsTableType *bool `json:"isTableType,omitempty"` - // IsComplexType - the the switch indicating if this type is a complex type. + // IsComplexType - The switch indicating if this type is a complex type. IsComplexType *bool `json:"isComplexType,omitempty"` // ComputeAccountName - the name of the Data Lake Analytics account. ComputeAccountName *string `json:"computeAccountName,omitempty"` diff --git a/services/preview/datamigration/mgmt/2018-03-31-preview/datamigration/models.go b/services/preview/datamigration/mgmt/2018-03-31-preview/datamigration/models.go index 121897b88103..64e306e05826 100644 --- a/services/preview/datamigration/mgmt/2018-03-31-preview/datamigration/models.go +++ b/services/preview/datamigration/mgmt/2018-03-31-preview/datamigration/models.go @@ -2994,8 +2994,8 @@ type MigrateSQLServerSQLServerDatabaseInput struct { // MigrationEligibilityInfo information about migration eligibility of a server object type MigrationEligibilityInfo struct { - // IsEligibileForMigration - READ-ONLY; Whether object is eligible for migration or not. - IsEligibileForMigration *bool `json:"isEligibileForMigration,omitempty"` + // IsEligibleForMigration - READ-ONLY; Whether object is eligible for migration or not. + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` // ValidationMessages - READ-ONLY; Information about eligibility failure for the server object. ValidationMessages *[]string `json:"validationMessages,omitempty"` } diff --git a/services/preview/datamigration/mgmt/2018-07-15-preview/datamigration/models.go b/services/preview/datamigration/mgmt/2018-07-15-preview/datamigration/models.go index 372a4c7410d1..5298bffc29ba 100644 --- a/services/preview/datamigration/mgmt/2018-07-15-preview/datamigration/models.go +++ b/services/preview/datamigration/mgmt/2018-07-15-preview/datamigration/models.go @@ -14590,6 +14590,8 @@ type MigrateSQLServerSQLMITaskInput struct { BackupBlobShare *BlobShare `json:"backupBlobShare,omitempty"` // BackupMode - Backup Mode to specify whether to use existing backup or create new backup. If using existing backups, backup file paths are required to be provided in selectedDatabases. Possible values include: 'CreateBackup', 'ExistingBackup' BackupMode BackupMode `json:"backupMode,omitempty"` + // AadDomainName - Azure Active Directory domain name in the format of 'contoso.com' for federated Azure AD or 'contoso.onmicrosoft.com' for managed domain, required if and only if Windows logins are selected + AadDomainName *string `json:"aadDomainName,omitempty"` // SourceConnectionInfo - Information for connecting to source SourceConnectionInfo *SQLConnectionInfo `json:"sourceConnectionInfo,omitempty"` // TargetConnectionInfo - Information for connecting to target @@ -15962,8 +15964,8 @@ func (msccp MigrateSyncCompleteCommandProperties) AsBasicCommandProperties() (Ba // MigrationEligibilityInfo information about migration eligibility of a server object type MigrationEligibilityInfo struct { - // IsEligibileForMigration - READ-ONLY; Whether object is eligible for migration or not. - IsEligibileForMigration *bool `json:"isEligibileForMigration,omitempty"` + // IsEligibleForMigration - READ-ONLY; Whether object is eligible for migration or not. + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` // ValidationMessages - READ-ONLY; Information about eligibility failure for the server object. ValidationMessages *[]string `json:"validationMessages,omitempty"` } diff --git a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/models.go b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/models.go index 213e08d61209..8fd86e2e13ae 100644 --- a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/models.go +++ b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/models.go @@ -66,11 +66,15 @@ const ( BlobFolder DataSetType = "BlobFolder" // Container ... Container DataSetType = "Container" + // SQLDBTable ... + SQLDBTable DataSetType = "SqlDBTable" + // SQLDWTable ... + SQLDWTable DataSetType = "SqlDWTable" ) // PossibleDataSetTypeValues returns an array of possible values for the DataSetType const type. func PossibleDataSetTypeValues() []DataSetType { - return []DataSetType{AdlsGen1File, AdlsGen1Folder, AdlsGen2File, AdlsGen2FileSystem, AdlsGen2Folder, Blob, BlobFolder, Container} + return []DataSetType{AdlsGen1File, AdlsGen1Folder, AdlsGen2File, AdlsGen2FileSystem, AdlsGen2Folder, Blob, BlobFolder, Container, SQLDBTable, SQLDWTable} } // InvitationStatus enumerates the values for invitation status. @@ -114,11 +118,15 @@ const ( KindContainer Kind = "Container" // KindDataSet ... KindDataSet Kind = "DataSet" + // KindSQLDBTable ... + KindSQLDBTable Kind = "SqlDBTable" + // KindSQLDWTable ... + KindSQLDWTable Kind = "SqlDWTable" ) // PossibleKindValues returns an array of possible values for the Kind const type. func PossibleKindValues() []Kind { - return []Kind{KindAdlsGen1File, KindAdlsGen1Folder, KindAdlsGen2File, KindAdlsGen2FileSystem, KindAdlsGen2Folder, KindBlob, KindBlobFolder, KindContainer, KindDataSet} + return []Kind{KindAdlsGen1File, KindAdlsGen1Folder, KindAdlsGen2File, KindAdlsGen2FileSystem, KindAdlsGen2Folder, KindBlob, KindBlobFolder, KindContainer, KindDataSet, KindSQLDBTable, KindSQLDWTable} } // KindBasicDataSetMapping enumerates the values for kind basic data set mapping. @@ -139,11 +147,15 @@ const ( KindBasicDataSetMappingKindContainer KindBasicDataSetMapping = "Container" // KindBasicDataSetMappingKindDataSetMapping ... KindBasicDataSetMappingKindDataSetMapping KindBasicDataSetMapping = "DataSetMapping" + // KindBasicDataSetMappingKindSQLDBTable ... + KindBasicDataSetMappingKindSQLDBTable KindBasicDataSetMapping = "SqlDBTable" + // KindBasicDataSetMappingKindSQLDWTable ... + KindBasicDataSetMappingKindSQLDWTable KindBasicDataSetMapping = "SqlDWTable" ) // PossibleKindBasicDataSetMappingValues returns an array of possible values for the KindBasicDataSetMapping const type. func PossibleKindBasicDataSetMappingValues() []KindBasicDataSetMapping { - return []KindBasicDataSetMapping{KindBasicDataSetMappingKindAdlsGen2File, KindBasicDataSetMappingKindAdlsGen2FileSystem, KindBasicDataSetMappingKindAdlsGen2Folder, KindBasicDataSetMappingKindBlob, KindBasicDataSetMappingKindBlobFolder, KindBasicDataSetMappingKindContainer, KindBasicDataSetMappingKindDataSetMapping} + return []KindBasicDataSetMapping{KindBasicDataSetMappingKindAdlsGen2File, KindBasicDataSetMappingKindAdlsGen2FileSystem, KindBasicDataSetMappingKindAdlsGen2Folder, KindBasicDataSetMappingKindBlob, KindBasicDataSetMappingKindBlobFolder, KindBasicDataSetMappingKindContainer, KindBasicDataSetMappingKindDataSetMapping, KindBasicDataSetMappingKindSQLDBTable, KindBasicDataSetMappingKindSQLDWTable} } // KindBasicSourceShareSynchronizationSetting enumerates the values for kind basic source share synchronization @@ -192,6 +204,21 @@ func PossibleKindBasicTriggerValues() []KindBasicTrigger { return []KindBasicTrigger{KindBasicTriggerKindScheduleBased, KindBasicTriggerKindTrigger} } +// OutputType enumerates the values for output type. +type OutputType string + +const ( + // Csv ... + Csv OutputType = "Csv" + // Parquet ... + Parquet OutputType = "Parquet" +) + +// PossibleOutputTypeValues returns an array of possible values for the OutputType const type. +func PossibleOutputTypeValues() []OutputType { + return []OutputType{Csv, Parquet} +} + // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -682,7 +709,7 @@ type ADLSGen1FileDataSet struct { Name *string `json:"name,omitempty"` // Type - READ-ONLY; Type of the azure resource Type *string `json:"type,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` } @@ -739,6 +766,16 @@ func (ag1fds ADLSGen1FileDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, return &ag1fds, true } +// AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + // AsDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. func (ag1fds ADLSGen1FileDataSet) AsDataSet() (*DataSet, bool) { return nil, false @@ -813,7 +850,7 @@ func (ag1fds *ADLSGen1FileDataSet) UnmarshalJSON(body []byte) error { type ADLSGen1FileProperties struct { // AccountName - The ADLS account name. AccountName *string `json:"accountName,omitempty"` - // DataSetID - READ-ONLY; Unique DataSet id. + // DataSetID - READ-ONLY; Unique id for identifying a data set resource DataSetID *string `json:"dataSetId,omitempty"` // FileName - The file name in the ADLS account. FileName *string `json:"fileName,omitempty"` @@ -829,7 +866,7 @@ type ADLSGen1FileProperties struct { type ADLSGen1FolderDataSet struct { // ADLSGen1FolderProperties - ADLS Gen 1 folder dataset properties. *ADLSGen1FolderProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -892,6 +929,16 @@ func (ag1fds ADLSGen1FolderDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSe return nil, false } +// AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + // AsDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. func (ag1fds ADLSGen1FolderDataSet) AsDataSet() (*DataSet, bool) { return nil, false @@ -966,7 +1013,7 @@ func (ag1fds *ADLSGen1FolderDataSet) UnmarshalJSON(body []byte) error { type ADLSGen1FolderProperties struct { // AccountName - The ADLS account name. AccountName *string `json:"accountName,omitempty"` - // DataSetID - READ-ONLY; Unique DataSet id. + // DataSetID - READ-ONLY; Unique id for identifying a data set resource DataSetID *string `json:"dataSetId,omitempty"` // FolderPath - The folder path within the ADLS account. FolderPath *string `json:"folderPath,omitempty"` @@ -980,7 +1027,7 @@ type ADLSGen1FolderProperties struct { type ADLSGen2FileDataSet struct { // ADLSGen2FileProperties - ADLS Gen 2 file dataset properties. *ADLSGen2FileProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -1043,6 +1090,16 @@ func (ag2fds ADLSGen2FileDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, return nil, false } +// AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + // AsDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. func (ag2fds ADLSGen2FileDataSet) AsDataSet() (*DataSet, bool) { return nil, false @@ -1123,7 +1180,7 @@ type ADLSGen2FileDataSetMapping struct { Name *string `json:"name,omitempty"` // Type - READ-ONLY; Type of the azure resource Type *string `json:"type,omitempty"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` } @@ -1170,6 +1227,16 @@ func (ag2fdsm ADLSGen2FileDataSetMapping) AsADLSGen2FileSystemDataSetMapping() ( return nil, false } +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + // AsDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. func (ag2fdsm ADLSGen2FileDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { return nil, false @@ -1250,6 +1317,8 @@ type ADLSGen2FileDataSetMappingProperties struct { FilePath *string `json:"filePath,omitempty"` // FileSystem - File system to which the file belongs. FileSystem *string `json:"fileSystem,omitempty"` + // OutputType - Type of output file. Possible values include: 'Csv', 'Parquet' + OutputType OutputType `json:"outputType,omitempty"` // ResourceGroup - Resource group of storage account. ResourceGroup *string `json:"resourceGroup,omitempty"` // StorageAccountName - Storage account name of the source data set. @@ -1260,7 +1329,7 @@ type ADLSGen2FileDataSetMappingProperties struct { // ADLSGen2FileProperties properties of the ADLS Gen2 file data set. type ADLSGen2FileProperties struct { - // DataSetID - READ-ONLY; Unique DataSet id. + // DataSetID - READ-ONLY; Unique id for identifying a data set resource DataSetID *string `json:"dataSetId,omitempty"` // FilePath - File path within the file system. FilePath *string `json:"filePath,omitempty"` @@ -1278,7 +1347,7 @@ type ADLSGen2FileProperties struct { type ADLSGen2FileSystemDataSet struct { // ADLSGen2FileSystemProperties - ADLS Gen 2 file system dataset properties. *ADLSGen2FileSystemProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -1341,6 +1410,16 @@ func (ag2fsds ADLSGen2FileSystemDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileD return nil, false } +// AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + // AsDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. func (ag2fsds ADLSGen2FileSystemDataSet) AsDataSet() (*DataSet, bool) { return nil, false @@ -1415,7 +1494,7 @@ func (ag2fsds *ADLSGen2FileSystemDataSet) UnmarshalJSON(body []byte) error { type ADLSGen2FileSystemDataSetMapping struct { // ADLSGen2FileSystemDataSetMappingProperties - ADLS Gen2 file system dataset mapping properties. *ADLSGen2FileSystemDataSetMappingProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -1468,6 +1547,16 @@ func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsADLSGen2FileSystemDataSetMapp return &ag2fsdsm, true } +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + // AsDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { return nil, false @@ -1556,7 +1645,7 @@ type ADLSGen2FileSystemDataSetMappingProperties struct { // ADLSGen2FileSystemProperties properties of the ADLS Gen2 file system data set. type ADLSGen2FileSystemProperties struct { - // DataSetID - READ-ONLY; Unique DataSet id. + // DataSetID - READ-ONLY; Unique id for identifying a data set resource DataSetID *string `json:"dataSetId,omitempty"` // FileSystem - The file system name. FileSystem *string `json:"fileSystem,omitempty"` @@ -1572,7 +1661,7 @@ type ADLSGen2FileSystemProperties struct { type ADLSGen2FolderDataSet struct { // ADLSGen2FolderProperties - ADLS Gen 2 folder dataset properties. *ADLSGen2FolderProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -1635,6 +1724,16 @@ func (ag2fds ADLSGen2FolderDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSe return nil, false } +// AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + // AsDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. func (ag2fds ADLSGen2FolderDataSet) AsDataSet() (*DataSet, bool) { return nil, false @@ -1709,7 +1808,7 @@ func (ag2fds *ADLSGen2FolderDataSet) UnmarshalJSON(body []byte) error { type ADLSGen2FolderDataSetMapping struct { // ADLSGen2FolderDataSetMappingProperties - ADLS Gen2 folder dataset mapping properties. *ADLSGen2FolderDataSetMappingProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -1762,6 +1861,16 @@ func (ag2fdsm ADLSGen2FolderDataSetMapping) AsADLSGen2FileSystemDataSetMapping() return nil, false } +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + // AsDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. func (ag2fdsm ADLSGen2FolderDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { return nil, false @@ -1852,7 +1961,7 @@ type ADLSGen2FolderDataSetMappingProperties struct { // ADLSGen2FolderProperties properties of the ADLS Gen2 folder data set. type ADLSGen2FolderProperties struct { - // DataSetID - READ-ONLY; Unique DataSet id. + // DataSetID - READ-ONLY; Unique id for identifying a data set resource DataSetID *string `json:"dataSetId,omitempty"` // FileSystem - File system to which the folder belongs. FileSystem *string `json:"fileSystem,omitempty"` @@ -1870,7 +1979,7 @@ type ADLSGen2FolderProperties struct { type BlobContainerDataSet struct { // BlobContainerProperties - Blob container dataset properties. *BlobContainerProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -1933,6 +2042,16 @@ func (bcds BlobContainerDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, return nil, false } +// AsSQLDWTableDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + // AsDataSet is the BasicDataSet implementation for BlobContainerDataSet. func (bcds BlobContainerDataSet) AsDataSet() (*DataSet, bool) { return nil, false @@ -2007,7 +2126,7 @@ func (bcds *BlobContainerDataSet) UnmarshalJSON(body []byte) error { type BlobContainerDataSetMapping struct { // BlobContainerMappingProperties - Blob container dataset mapping properties. *BlobContainerMappingProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -2060,6 +2179,16 @@ func (bcdsm BlobContainerDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (* return nil, false } +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + // AsDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. func (bcdsm BlobContainerDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { return nil, false @@ -2150,7 +2279,7 @@ type BlobContainerMappingProperties struct { type BlobContainerProperties struct { // ContainerName - BLOB Container name. ContainerName *string `json:"containerName,omitempty"` - // DataSetID - READ-ONLY; Unique DataSet id. + // DataSetID - READ-ONLY; Unique id for identifying a data set resource DataSetID *string `json:"dataSetId,omitempty"` // ResourceGroup - Resource group of storage account ResourceGroup *string `json:"resourceGroup,omitempty"` @@ -2164,7 +2293,7 @@ type BlobContainerProperties struct { type BlobDataSet struct { // BlobProperties - Blob dataset properties. *BlobProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -2227,6 +2356,16 @@ func (bds BlobDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { return nil, false } +// AsSQLDWTableDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + // AsDataSet is the BasicDataSet implementation for BlobDataSet. func (bds BlobDataSet) AsDataSet() (*DataSet, bool) { return nil, false @@ -2301,7 +2440,7 @@ func (bds *BlobDataSet) UnmarshalJSON(body []byte) error { type BlobDataSetMapping struct { // BlobMappingProperties - Blob dataset mapping properties. *BlobMappingProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -2354,6 +2493,16 @@ func (bdsm BlobDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2Fi return nil, false } +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + // AsDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. func (bdsm BlobDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { return nil, false @@ -2428,7 +2577,7 @@ func (bdsm *BlobDataSetMapping) UnmarshalJSON(body []byte) error { type BlobFolderDataSet struct { // BlobFolderProperties - Blob folder dataset properties. *BlobFolderProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -2491,6 +2640,16 @@ func (bfds BlobFolderDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, boo return nil, false } +// AsSQLDWTableDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + // AsDataSet is the BasicDataSet implementation for BlobFolderDataSet. func (bfds BlobFolderDataSet) AsDataSet() (*DataSet, bool) { return nil, false @@ -2565,7 +2724,7 @@ func (bfds *BlobFolderDataSet) UnmarshalJSON(body []byte) error { type BlobFolderDataSetMapping struct { // BlobFolderMappingProperties - Blob folder dataset mapping properties. *BlobFolderMappingProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -2618,6 +2777,16 @@ func (bfdsm BlobFolderDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADL return nil, false } +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + // AsDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. func (bfdsm BlobFolderDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { return nil, false @@ -2710,7 +2879,7 @@ type BlobFolderMappingProperties struct { type BlobFolderProperties struct { // ContainerName - Container that has the file path. ContainerName *string `json:"containerName,omitempty"` - // DataSetID - READ-ONLY; Unique DataSet id. + // DataSetID - READ-ONLY; Unique id for identifying a data set resource DataSetID *string `json:"dataSetId,omitempty"` // Prefix - Prefix for blob folder Prefix *string `json:"prefix,omitempty"` @@ -2732,6 +2901,8 @@ type BlobMappingProperties struct { DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` // FilePath - File path within the source data set FilePath *string `json:"filePath,omitempty"` + // OutputType - File output type. Possible values include: 'Csv', 'Parquet' + OutputType OutputType `json:"outputType,omitempty"` // ResourceGroup - Resource group of storage account. ResourceGroup *string `json:"resourceGroup,omitempty"` // StorageAccountName - Storage account name of the source data set. @@ -2744,7 +2915,7 @@ type BlobMappingProperties struct { type BlobProperties struct { // ContainerName - Container that has the file path. ContainerName *string `json:"containerName,omitempty"` - // DataSetID - READ-ONLY; Unique DataSet id. + // DataSetID - READ-ONLY; Unique id for identifying a data set resource DataSetID *string `json:"dataSetId,omitempty"` // FilePath - File path within the source data set FilePath *string `json:"filePath,omitempty"` @@ -3225,7 +3396,7 @@ type ConsumerSourceDataSetProperties struct { DataSetID *string `json:"dataSetId,omitempty"` // DataSetName - READ-ONLY; DataSet name DataSetName *string `json:"dataSetName,omitempty"` - // DataSetType - READ-ONLY; Type of dataSet. Possible values include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File' + // DataSetType - READ-ONLY; Type of dataSet. Possible values include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'SQLDBTable', 'SQLDWTable' DataSetType DataSetType `json:"dataSetType,omitempty"` } @@ -3239,13 +3410,15 @@ type BasicDataSet interface { AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) + AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) + AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) AsDataSet() (*DataSet, bool) } // DataSet a DataSet data transfer object. type DataSet struct { autorest.Response `json:"-"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -3295,6 +3468,14 @@ func unmarshalBasicDataSet(body []byte) (BasicDataSet, error) { var ag1fds ADLSGen1FileDataSet err := json.Unmarshal(body, &ag1fds) return ag1fds, err + case string(KindSQLDWTable): + var sdtds SQLDWTableDataSet + err := json.Unmarshal(body, &sdtds) + return sdtds, err + case string(KindSQLDBTable): + var sdtds SQLDBTableDataSet + err := json.Unmarshal(body, &sdtds) + return sdtds, err default: var ds DataSet err := json.Unmarshal(body, &ds) @@ -3370,6 +3551,16 @@ func (ds DataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { return nil, false } +// AsSQLDWTableDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + // AsDataSet is the BasicDataSet implementation for DataSet. func (ds DataSet) AsDataSet() (*DataSet, bool) { return &ds, true @@ -3566,13 +3757,15 @@ type BasicDataSetMapping interface { AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) + AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) + AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) AsDataSetMapping() (*DataSetMapping, bool) } // DataSetMapping a dataset mapping data transfer object. type DataSetMapping struct { autorest.Response `json:"-"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -3614,6 +3807,14 @@ func unmarshalBasicDataSetMapping(body []byte) (BasicDataSetMapping, error) { var ag2fsdsm ADLSGen2FileSystemDataSetMapping err := json.Unmarshal(body, &ag2fsdsm) return ag2fsdsm, err + case string(KindBasicDataSetMappingKindSQLDWTable): + var sdtdsm SQLDWTableDataSetMapping + err := json.Unmarshal(body, &sdtdsm) + return sdtdsm, err + case string(KindBasicDataSetMappingKindSQLDBTable): + var sdtdsm SQLDBTableDataSetMapping + err := json.Unmarshal(body, &sdtdsm) + return sdtdsm, err default: var dsm DataSetMapping err := json.Unmarshal(body, &dsm) @@ -3679,6 +3880,16 @@ func (dsm DataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSys return nil, false } +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + // AsDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. func (dsm DataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { return &dsm, true @@ -6276,11 +6487,631 @@ func NewSourceShareSynchronizationSettingListPage(getNextPage func(context.Conte return SourceShareSynchronizationSettingListPage{fn: getNextPage} } +// SQLDBTableDataSet a SQL DB table dataset. +type SQLDBTableDataSet struct { + // SQLDBTableProperties - SQL DB table dataset properties. + *SQLDBTableProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) MarshalJSON() ([]byte, error) { + sdtds.Kind = KindSQLDBTable + objectMap := make(map[string]interface{}) + if sdtds.SQLDBTableProperties != nil { + objectMap["properties"] = sdtds.SQLDBTableProperties + } + if sdtds.Kind != "" { + objectMap["kind"] = sdtds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return &sdtds, true +} + +// AsDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &sdtds, true +} + +// UnmarshalJSON is the custom unmarshaler for SQLDBTableDataSet struct. +func (sdtds *SQLDBTableDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sQLDBTableProperties SQLDBTableProperties + err = json.Unmarshal(*v, &sQLDBTableProperties) + if err != nil { + return err + } + sdtds.SQLDBTableProperties = &sQLDBTableProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sdtds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sdtds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sdtds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sdtds.Type = &typeVar + } + } + } + + return nil +} + +// SQLDBTableDataSetMapping a SQL DB Table dataset mapping. +type SQLDBTableDataSetMapping struct { + // SQLDBTableDataSetMappingProperties - Sql DB dataset mapping properties. + *SQLDBTableDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + Kind KindBasicDataSetMapping `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) MarshalJSON() ([]byte, error) { + sdtdsm.Kind = KindBasicDataSetMappingKindSQLDBTable + objectMap := make(map[string]interface{}) + if sdtdsm.SQLDBTableDataSetMappingProperties != nil { + objectMap["properties"] = sdtdsm.SQLDBTableDataSetMappingProperties + } + if sdtdsm.Kind != "" { + objectMap["kind"] = sdtdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return &sdtdsm, true +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &sdtdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for SQLDBTableDataSetMapping struct. +func (sdtdsm *SQLDBTableDataSetMapping) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sQLDBTableDataSetMappingProperties SQLDBTableDataSetMappingProperties + err = json.Unmarshal(*v, &sQLDBTableDataSetMappingProperties) + if err != nil { + return err + } + sdtdsm.SQLDBTableDataSetMappingProperties = &sQLDBTableDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sdtdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sdtdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sdtdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sdtdsm.Type = &typeVar + } + } + } + + return nil +} + +// SQLDBTableDataSetMappingProperties properties of the SQL DB table data set mapping. +type SQLDBTableDataSetMappingProperties struct { + // DatabaseName - DatabaseName name of the sink data set + DatabaseName *string `json:"databaseName,omitempty"` + // DataSetID - Gets the id of source dataset. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // SQLServerResourceID - Resource id of SQL server + SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"` + // TableName - SQL DB table name. + TableName *string `json:"tableName,omitempty"` +} + +// SQLDBTableProperties properties of the SQL DB table data set. +type SQLDBTableProperties struct { + // DatabaseName - Database name of the source data set + DatabaseName *string `json:"databaseName,omitempty"` + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // SQLServerResourceID - Resource id of SQL server + SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"` + // TableName - SQL DB table name. + TableName *string `json:"tableName,omitempty"` +} + +// SQLDWTableDataSet a SQL DW table dataset. +type SQLDWTableDataSet struct { + // SQLDWTableProperties - SQL DW table dataset properties. + *SQLDWTableProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) MarshalJSON() ([]byte, error) { + sdtds.Kind = KindSQLDWTable + objectMap := make(map[string]interface{}) + if sdtds.SQLDWTableProperties != nil { + objectMap["properties"] = sdtds.SQLDWTableProperties + } + if sdtds.Kind != "" { + objectMap["kind"] = sdtds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return &sdtds, true +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &sdtds, true +} + +// UnmarshalJSON is the custom unmarshaler for SQLDWTableDataSet struct. +func (sdtds *SQLDWTableDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sQLDWTableProperties SQLDWTableProperties + err = json.Unmarshal(*v, &sQLDWTableProperties) + if err != nil { + return err + } + sdtds.SQLDWTableProperties = &sQLDWTableProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sdtds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sdtds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sdtds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sdtds.Type = &typeVar + } + } + } + + return nil +} + +// SQLDWTableDataSetMapping a SQL DW Table dataset mapping. +type SQLDWTableDataSetMapping struct { + // SQLDWTableDataSetMappingProperties - Sql DW dataset mapping properties. + *SQLDWTableDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + Kind KindBasicDataSetMapping `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) MarshalJSON() ([]byte, error) { + sdtdsm.Kind = KindBasicDataSetMappingKindSQLDWTable + objectMap := make(map[string]interface{}) + if sdtdsm.SQLDWTableDataSetMappingProperties != nil { + objectMap["properties"] = sdtdsm.SQLDWTableDataSetMappingProperties + } + if sdtdsm.Kind != "" { + objectMap["kind"] = sdtdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return &sdtdsm, true +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &sdtdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for SQLDWTableDataSetMapping struct. +func (sdtdsm *SQLDWTableDataSetMapping) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sQLDWTableDataSetMappingProperties SQLDWTableDataSetMappingProperties + err = json.Unmarshal(*v, &sQLDWTableDataSetMappingProperties) + if err != nil { + return err + } + sdtdsm.SQLDWTableDataSetMappingProperties = &sQLDWTableDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sdtdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sdtdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sdtdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sdtdsm.Type = &typeVar + } + } + } + + return nil +} + +// SQLDWTableDataSetMappingProperties properties of the SQL DW table data set mapping. +type SQLDWTableDataSetMappingProperties struct { + // DataSetID - Gets the id of source dataset. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // DataWarehouseName - DataWarehouse name of the source data set + DataWarehouseName *string `json:"dataWarehouseName,omitempty"` + // SQLServerResourceID - Resource id of SQL server + SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"` + // TableName - SQL DW table name. + TableName *string `json:"tableName,omitempty"` +} + +// SQLDWTableProperties properties of the SQL DW table data set. +type SQLDWTableProperties struct { + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // DataWarehouseName - DataWarehouse name of the source data set + DataWarehouseName *string `json:"dataWarehouseName,omitempty"` + // SQLServerResourceID - Resource id of SQL server + SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"` + // TableName - SQL DW table name. + TableName *string `json:"tableName,omitempty"` +} + // SynchronizationDetails synchronization details at dataset level type SynchronizationDetails struct { // DataSetID - READ-ONLY; id of dataSet DataSetID *string `json:"dataSetId,omitempty"` - // DataSetType - READ-ONLY; type of DataSet. Possible values include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File' + // DataSetType - READ-ONLY; type of DataSet. Possible values include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'SQLDBTable', 'SQLDWTable' DataSetType DataSetType `json:"dataSetType,omitempty"` // DurationMs - READ-ONLY; duration of dataset level copy DurationMs *int32 `json:"durationMs,omitempty"` @@ -6294,6 +7125,10 @@ type SynchronizationDetails struct { Message *string `json:"message,omitempty"` // Name - READ-ONLY; name of dataSet Name *string `json:"name,omitempty"` + // RowsCopied - READ-ONLY; The number of files copied into the sink dataset. + RowsCopied *int64 `json:"rowsCopied,omitempty"` + // RowsRead - READ-ONLY; The number of rows read from the source dataset. + RowsRead *int64 `json:"rowsRead,omitempty"` // SizeRead - READ-ONLY; The size of the data read from the source dataset in bytes. SizeRead *int64 `json:"sizeRead,omitempty"` // SizeWritten - READ-ONLY; The size of the data written into the sink dataset in bytes. diff --git a/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/containerhostmappings.go b/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/containerhostmappings.go deleted file mode 100644 index 66ea116b045f..000000000000 --- a/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/containerhostmappings.go +++ /dev/null @@ -1,118 +0,0 @@ -package devspaces - -// 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" -) - -// ContainerHostMappingsClient is the dev Spaces Client -type ContainerHostMappingsClient struct { - BaseClient -} - -// NewContainerHostMappingsClient creates an instance of the ContainerHostMappingsClient client. -func NewContainerHostMappingsClient(subscriptionID string) ContainerHostMappingsClient { - return NewContainerHostMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewContainerHostMappingsClientWithBaseURI creates an instance of the ContainerHostMappingsClient client. -func NewContainerHostMappingsClientWithBaseURI(baseURI string, subscriptionID string) ContainerHostMappingsClient { - return ContainerHostMappingsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// GetContainerHostMapping sends the get container host mapping request. -// Parameters: -// location - location of the container host. -func (client ContainerHostMappingsClient) GetContainerHostMapping(ctx context.Context, containerHostMapping ContainerHostMapping, location string) (result SetObject, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerHostMappingsClient.GetContainerHostMapping") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetContainerHostMappingPreparer(ctx, containerHostMapping, location) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ContainerHostMappingsClient", "GetContainerHostMapping", nil, "Failure preparing request") - return - } - - resp, err := client.GetContainerHostMappingSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ContainerHostMappingsClient", "GetContainerHostMapping", resp, "Failure sending request") - return - } - - result, err = client.GetContainerHostMappingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ContainerHostMappingsClient", "GetContainerHostMapping", resp, "Failure responding to request") - } - - return -} - -// GetContainerHostMappingPreparer prepares the GetContainerHostMapping request. -func (client ContainerHostMappingsClient) GetContainerHostMappingPreparer(ctx context.Context, containerHostMapping ContainerHostMapping, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - } - - const APIVersion = "2018-06-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - containerHostMapping.MappedControllerResourceID = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.DevSpaces/locations/{location}/checkContainerHostMapping", pathParameters), - autorest.WithJSON(containerHostMapping), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetContainerHostMappingSender sends the GetContainerHostMapping request. The method will close the -// http.Response Body if it receives an error. -func (client ContainerHostMappingsClient) GetContainerHostMappingSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetContainerHostMappingResponder handles the response to the GetContainerHostMapping request. The method always -// closes the http.Response Body. -func (client ContainerHostMappingsClient) GetContainerHostMappingResponder(resp *http.Response) (result SetObject, 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/devspaces/mgmt/2018-06-01-preview/devspaces/controllers.go b/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/controllers.go deleted file mode 100644 index 54c5c82c72ea..000000000000 --- a/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/controllers.go +++ /dev/null @@ -1,727 +0,0 @@ -package devspaces - -// 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" -) - -// ControllersClient is the dev Spaces Client -type ControllersClient struct { - BaseClient -} - -// NewControllersClient creates an instance of the ControllersClient client. -func NewControllersClient(subscriptionID string) ControllersClient { - return NewControllersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewControllersClientWithBaseURI creates an instance of the ControllersClient client. -func NewControllersClientWithBaseURI(baseURI string, subscriptionID string) ControllersClient { - return ControllersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates an Azure Dev Spaces Controller with the specified create parameters. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -// controller - controller create parameters. -func (client ControllersClient) Create(ctx context.Context, resourceGroupName string, name string, controller Controller) (result ControllersCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.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}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}, - {TargetValue: controller, - Constraints: []validation.Constraint{{Target: "controller.ControllerProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "controller.ControllerProperties.HostSuffix", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "controller.ControllerProperties.TargetContainerHostResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "controller.ControllerProperties.TargetContainerHostCredentialsBase64", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "controller.Sku", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "controller.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, name, controller) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client ControllersClient) CreatePreparer(ctx context.Context, resourceGroupName string, name string, controller Controller) (*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 = "2018-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.DevSpaces/controllers/{name}", pathParameters), - autorest.WithJSON(controller), - 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 ControllersClient) CreateSender(req *http.Request) (future ControllersCreateFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, 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 ControllersClient) CreateResponder(resp *http.Response) (result Controller, 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 Azure Dev Spaces Controller. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -func (client ControllersClient) Delete(ctx context.Context, resourceGroupName string, name string) (result ControllersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.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}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, name) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ControllersClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-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.DevSpaces/controllers/{name}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ControllersClient) DeleteSender(req *http.Request) (future ControllersDeleteFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, 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 ControllersClient) 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 for an Azure Dev Spaces Controller. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -func (client ControllersClient) Get(ctx context.Context, resourceGroupName string, name string) (result Controller, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.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}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, name) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ControllersClient) GetPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-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.DevSpaces/controllers/{name}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ControllersClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ControllersClient) GetResponder(resp *http.Response) (result Controller, 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 Azure Dev Spaces Controllers with their properties in the subscription. -func (client ControllersClient) List(ctx context.Context) (result ControllerListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.List") - defer func() { - sc := -1 - if result.cl.Response.Response != nil { - sc = result.cl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "List", resp, "Failure sending request") - return - } - - result.cl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ControllersClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-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.DevSpaces/controllers", 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 ControllersClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ControllersClient) ListResponder(resp *http.Response) (result ControllerList, 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 ControllersClient) listNextResults(ctx context.Context, lastResults ControllerList) (result ControllerList, err error) { - req, err := lastResults.controllerListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "devspaces.ControllersClient", "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, "devspaces.ControllersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ControllersClient) ListComplete(ctx context.Context) (result ControllerListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the Azure Dev Spaces Controllers with their properties in the specified resource group -// and subscription. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -func (client ControllersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ControllerListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.cl.Response.Response != nil { - sc = result.cl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "ListByResourceGroup", err.Error()) - } - - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.cl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.cl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListByResourceGroup", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ControllersClient) 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 = "2018-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.DevSpaces/controllers", 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 ControllersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ControllersClient) ListByResourceGroupResponder(resp *http.Response) (result ControllerList, 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 ControllersClient) listByResourceGroupNextResults(ctx context.Context, lastResults ControllerList) (result ControllerList, err error) { - req, err := lastResults.controllerListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "devspaces.ControllersClient", "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, "devspaces.ControllersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ControllersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ControllerListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.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 -} - -// ListConnectionDetails lists connection details for the underlying container resources of an Azure Dev Spaces -// Controller. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -func (client ControllersClient) ListConnectionDetails(ctx context.Context, resourceGroupName string, name string) (result ControllerConnectionDetailsList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.ListConnectionDetails") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "ListConnectionDetails", err.Error()) - } - - req, err := client.ListConnectionDetailsPreparer(ctx, resourceGroupName, name) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListConnectionDetails", nil, "Failure preparing request") - return - } - - resp, err := client.ListConnectionDetailsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListConnectionDetails", resp, "Failure sending request") - return - } - - result, err = client.ListConnectionDetailsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListConnectionDetails", resp, "Failure responding to request") - } - - return -} - -// ListConnectionDetailsPreparer prepares the ListConnectionDetails request. -func (client ControllersClient) ListConnectionDetailsPreparer(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 = "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.DevSpaces/controllers/{name}/listConnectionDetails", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListConnectionDetailsSender sends the ListConnectionDetails request. The method will close the -// http.Response Body if it receives an error. -func (client ControllersClient) ListConnectionDetailsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListConnectionDetailsResponder handles the response to the ListConnectionDetails request. The method always -// closes the http.Response Body. -func (client ControllersClient) ListConnectionDetailsResponder(resp *http.Response) (result ControllerConnectionDetailsList, 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 properties of an existing Azure Dev Spaces Controller with the specified update parameters. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -// controllerUpdateParameters - parameters for updating the Azure Dev Spaces Controller. -func (client ControllersClient) Update(ctx context.Context, resourceGroupName string, name string, controllerUpdateParameters ControllerUpdateParameters) (result Controller, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.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}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, name, controllerUpdateParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ControllersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, controllerUpdateParameters ControllerUpdateParameters) (*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 = "2018-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.DevSpaces/controllers/{name}", pathParameters), - autorest.WithJSON(controllerUpdateParameters), - 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 ControllersClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ControllersClient) UpdateResponder(resp *http.Response) (result Controller, 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/devspaces/mgmt/2018-06-01-preview/devspaces/devspacesapi/interfaces.go b/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/devspacesapi/interfaces.go deleted file mode 100644 index 3b6dd07c028b..000000000000 --- a/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/devspacesapi/interfaces.go +++ /dev/null @@ -1,50 +0,0 @@ -package devspacesapi - -// 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/devspaces/mgmt/2018-06-01-preview/devspaces" -) - -// ContainerHostMappingsClientAPI contains the set of methods on the ContainerHostMappingsClient type. -type ContainerHostMappingsClientAPI interface { - GetContainerHostMapping(ctx context.Context, containerHostMapping devspaces.ContainerHostMapping, location string) (result devspaces.SetObject, err error) -} - -var _ ContainerHostMappingsClientAPI = (*devspaces.ContainerHostMappingsClient)(nil) - -// ControllersClientAPI contains the set of methods on the ControllersClient type. -type ControllersClientAPI interface { - Create(ctx context.Context, resourceGroupName string, name string, controller devspaces.Controller) (result devspaces.ControllersCreateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, name string) (result devspaces.ControllersDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, name string) (result devspaces.Controller, err error) - List(ctx context.Context) (result devspaces.ControllerListPage, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string) (result devspaces.ControllerListPage, err error) - ListConnectionDetails(ctx context.Context, resourceGroupName string, name string) (result devspaces.ControllerConnectionDetailsList, err error) - Update(ctx context.Context, resourceGroupName string, name string, controllerUpdateParameters devspaces.ControllerUpdateParameters) (result devspaces.Controller, err error) -} - -var _ ControllersClientAPI = (*devspaces.ControllersClient)(nil) - -// OperationsClientAPI contains the set of methods on the OperationsClient type. -type OperationsClientAPI interface { - List(ctx context.Context) (result devspaces.ResourceProviderOperationListPage, err error) -} - -var _ OperationsClientAPI = (*devspaces.OperationsClient)(nil) diff --git a/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/models.go b/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/models.go deleted file mode 100644 index f097aca4b00c..000000000000 --- a/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/models.go +++ /dev/null @@ -1,846 +0,0 @@ -package devspaces - -// 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/devspaces/mgmt/2018-06-01-preview/devspaces" - -// InstanceType enumerates the values for instance type. -type InstanceType string - -const ( - // InstanceTypeKubernetes ... - InstanceTypeKubernetes InstanceType = "Kubernetes" - // InstanceTypeOrchestratorSpecificConnectionDetails ... - InstanceTypeOrchestratorSpecificConnectionDetails InstanceType = "OrchestratorSpecificConnectionDetails" -) - -// PossibleInstanceTypeValues returns an array of possible values for the InstanceType const type. -func PossibleInstanceTypeValues() []InstanceType { - return []InstanceType{InstanceTypeKubernetes, InstanceTypeOrchestratorSpecificConnectionDetails} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // Canceled ... - Canceled ProvisioningState = "Canceled" - // Creating ... - Creating ProvisioningState = "Creating" - // Deleted ... - Deleted ProvisioningState = "Deleted" - // 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{Canceled, Creating, Deleted, Deleting, Failed, Succeeded, Updating} -} - -// SkuTier enumerates the values for sku tier. -type SkuTier string - -const ( - // Standard ... - Standard SkuTier = "Standard" -) - -// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. -func PossibleSkuTierValues() []SkuTier { - return []SkuTier{Standard} -} - -// ContainerHostMapping container host mapping object specifying the Container host resource ID and its -// associated Controller resource. -type ContainerHostMapping struct { - // ContainerHostResourceID - ARM ID of the Container Host resource - ContainerHostResourceID *string `json:"containerHostResourceId,omitempty"` - // MappedControllerResourceID - READ-ONLY; ARM ID of the mapped Controller resource - MappedControllerResourceID *string `json:"mappedControllerResourceId,omitempty"` -} - -// Controller ... -type Controller struct { - autorest.Response `json:"-"` - *ControllerProperties `json:"properties,omitempty"` - Sku *Sku `json:"sku,omitempty"` - // Tags - Tags for the Azure resource. - Tags map[string]*string `json:"tags"` - // Location - Region where the Azure resource is located. - Location *string `json:"location,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. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Controller. -func (c Controller) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ControllerProperties != nil { - objectMap["properties"] = c.ControllerProperties - } - if c.Sku != nil { - objectMap["sku"] = c.Sku - } - 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 Controller struct. -func (c *Controller) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var controllerProperties ControllerProperties - err = json.Unmarshal(*v, &controllerProperties) - if err != nil { - return err - } - c.ControllerProperties = &controllerProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - c.Sku = &sku - } - 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 -} - -// ControllerConnectionDetails ... -type ControllerConnectionDetails struct { - // AuthKey - READ-ONLY; Authentication key for communicating with services. - AuthKey *string `json:"authKey,omitempty"` - // WorkspaceStorageAccountName - READ-ONLY; Workspace storage account name. - WorkspaceStorageAccountName *string `json:"workspaceStorageAccountName,omitempty"` - // WorkspaceStorageSasToken - READ-ONLY; Workspace storage account SAS token. - WorkspaceStorageSasToken *string `json:"workspaceStorageSasToken,omitempty"` - OrchestratorSpecificConnectionDetails BasicOrchestratorSpecificConnectionDetails `json:"orchestratorSpecificConnectionDetails,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for ControllerConnectionDetails struct. -func (ccd *ControllerConnectionDetails) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "authKey": - if v != nil { - var authKey string - err = json.Unmarshal(*v, &authKey) - if err != nil { - return err - } - ccd.AuthKey = &authKey - } - case "workspaceStorageAccountName": - if v != nil { - var workspaceStorageAccountName string - err = json.Unmarshal(*v, &workspaceStorageAccountName) - if err != nil { - return err - } - ccd.WorkspaceStorageAccountName = &workspaceStorageAccountName - } - case "workspaceStorageSasToken": - if v != nil { - var workspaceStorageSasToken string - err = json.Unmarshal(*v, &workspaceStorageSasToken) - if err != nil { - return err - } - ccd.WorkspaceStorageSasToken = &workspaceStorageSasToken - } - case "orchestratorSpecificConnectionDetails": - if v != nil { - orchestratorSpecificConnectionDetails, err := unmarshalBasicOrchestratorSpecificConnectionDetails(*v) - if err != nil { - return err - } - ccd.OrchestratorSpecificConnectionDetails = orchestratorSpecificConnectionDetails - } - } - } - - return nil -} - -// ControllerConnectionDetailsList ... -type ControllerConnectionDetailsList struct { - autorest.Response `json:"-"` - // ConnectionDetailsList - List of Azure Dev Spaces Controller connection details. - ConnectionDetailsList *[]ControllerConnectionDetails `json:"connectionDetailsList,omitempty"` -} - -// ControllerList ... -type ControllerList struct { - autorest.Response `json:"-"` - // Value - List of Azure Dev Spaces Controllers. - Value *[]Controller `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI that can be used to request the next page for list of Azure Dev Spaces Controllers. - NextLink *string `json:"nextLink,omitempty"` -} - -// ControllerListIterator provides access to a complete listing of Controller values. -type ControllerListIterator struct { - i int - page ControllerListPage -} - -// 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 *ControllerListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllerListIterator.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 *ControllerListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ControllerListIterator) 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 ControllerListIterator) Response() ControllerList { - 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 ControllerListIterator) Value() Controller { - if !iter.page.NotDone() { - return Controller{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ControllerListIterator type. -func NewControllerListIterator(page ControllerListPage) ControllerListIterator { - return ControllerListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cl ControllerList) IsEmpty() bool { - return cl.Value == nil || len(*cl.Value) == 0 -} - -// controllerListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cl ControllerList) controllerListPreparer(ctx context.Context) (*http.Request, error) { - if cl.NextLink == nil || len(to.String(cl.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cl.NextLink))) -} - -// ControllerListPage contains a page of Controller values. -type ControllerListPage struct { - fn func(context.Context, ControllerList) (ControllerList, error) - cl ControllerList -} - -// 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 *ControllerListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllerListPage.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.cl) - if err != nil { - return err - } - page.cl = 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 *ControllerListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ControllerListPage) NotDone() bool { - return !page.cl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ControllerListPage) Response() ControllerList { - return page.cl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ControllerListPage) Values() []Controller { - if page.cl.IsEmpty() { - return nil - } - return *page.cl.Value -} - -// Creates a new instance of the ControllerListPage type. -func NewControllerListPage(getNextPage func(context.Context, ControllerList) (ControllerList, error)) ControllerListPage { - return ControllerListPage{fn: getNextPage} -} - -// ControllerProperties ... -type ControllerProperties struct { - // ProvisioningState - READ-ONLY; Provisioning state of the Azure Dev Spaces Controller. Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating', 'Deleting', 'Deleted' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // HostSuffix - DNS suffix for public endpoints running in the Azure Dev Spaces Controller. - HostSuffix *string `json:"hostSuffix,omitempty"` - // DataPlaneFqdn - READ-ONLY; DNS name for accessing DataPlane services - DataPlaneFqdn *string `json:"dataPlaneFqdn,omitempty"` - // TargetContainerHostResourceID - Resource ID of the target container host - TargetContainerHostResourceID *string `json:"targetContainerHostResourceId,omitempty"` - // TargetContainerHostCredentialsBase64 - Credentials of the target container host (base64). - TargetContainerHostCredentialsBase64 *string `json:"targetContainerHostCredentialsBase64,omitempty"` -} - -// ControllersCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ControllersCreateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ControllersCreateFuture) Result(client ControllersClient) (c Controller, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("devspaces.ControllersCreateFuture") - 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.CreateResponder(c.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersCreateFuture", "Result", c.Response.Response, "Failure responding to request") - } - } - return -} - -// ControllersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ControllersDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ControllersDeleteFuture) Result(client ControllersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("devspaces.ControllersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ControllerUpdateParameters parameters for updating an Azure Dev Spaces Controller. -type ControllerUpdateParameters struct { - // Tags - Tags for the Azure Dev Spaces Controller. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ControllerUpdateParameters. -func (cup ControllerUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cup.Tags != nil { - objectMap["tags"] = cup.Tags - } - return json.Marshal(objectMap) -} - -// ErrorDetails ... -type ErrorDetails struct { - // Code - READ-ONLY; Status code for the error. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; Error message describing the error in detail. - 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"` -} - -// KubernetesConnectionDetails contains information used to connect to a Kubernetes cluster -type KubernetesConnectionDetails struct { - // KubeConfig - Gets the kubeconfig for the cluster. - KubeConfig *string `json:"kubeConfig,omitempty"` - // InstanceType - Possible values include: 'InstanceTypeOrchestratorSpecificConnectionDetails', 'InstanceTypeKubernetes' - InstanceType InstanceType `json:"instanceType,omitempty"` -} - -// MarshalJSON is the custom marshaler for KubernetesConnectionDetails. -func (kcd KubernetesConnectionDetails) MarshalJSON() ([]byte, error) { - kcd.InstanceType = InstanceTypeKubernetes - objectMap := make(map[string]interface{}) - if kcd.KubeConfig != nil { - objectMap["kubeConfig"] = kcd.KubeConfig - } - if kcd.InstanceType != "" { - objectMap["instanceType"] = kcd.InstanceType - } - return json.Marshal(objectMap) -} - -// AsKubernetesConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for KubernetesConnectionDetails. -func (kcd KubernetesConnectionDetails) AsKubernetesConnectionDetails() (*KubernetesConnectionDetails, bool) { - return &kcd, true -} - -// AsOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for KubernetesConnectionDetails. -func (kcd KubernetesConnectionDetails) AsOrchestratorSpecificConnectionDetails() (*OrchestratorSpecificConnectionDetails, bool) { - return nil, false -} - -// AsBasicOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for KubernetesConnectionDetails. -func (kcd KubernetesConnectionDetails) AsBasicOrchestratorSpecificConnectionDetails() (BasicOrchestratorSpecificConnectionDetails, bool) { - return &kcd, true -} - -// BasicOrchestratorSpecificConnectionDetails base class for types that supply values used to connect to container -// orchestrators -type BasicOrchestratorSpecificConnectionDetails interface { - AsKubernetesConnectionDetails() (*KubernetesConnectionDetails, bool) - AsOrchestratorSpecificConnectionDetails() (*OrchestratorSpecificConnectionDetails, bool) -} - -// OrchestratorSpecificConnectionDetails base class for types that supply values used to connect to container -// orchestrators -type OrchestratorSpecificConnectionDetails struct { - // InstanceType - Possible values include: 'InstanceTypeOrchestratorSpecificConnectionDetails', 'InstanceTypeKubernetes' - InstanceType InstanceType `json:"instanceType,omitempty"` -} - -func unmarshalBasicOrchestratorSpecificConnectionDetails(body []byte) (BasicOrchestratorSpecificConnectionDetails, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["instanceType"] { - case string(InstanceTypeKubernetes): - var kcd KubernetesConnectionDetails - err := json.Unmarshal(body, &kcd) - return kcd, err - default: - var oscd OrchestratorSpecificConnectionDetails - err := json.Unmarshal(body, &oscd) - return oscd, err - } -} -func unmarshalBasicOrchestratorSpecificConnectionDetailsArray(body []byte) ([]BasicOrchestratorSpecificConnectionDetails, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - oscdArray := make([]BasicOrchestratorSpecificConnectionDetails, len(rawMessages)) - - for index, rawMessage := range rawMessages { - oscd, err := unmarshalBasicOrchestratorSpecificConnectionDetails(*rawMessage) - if err != nil { - return nil, err - } - oscdArray[index] = oscd - } - return oscdArray, nil -} - -// MarshalJSON is the custom marshaler for OrchestratorSpecificConnectionDetails. -func (oscd OrchestratorSpecificConnectionDetails) MarshalJSON() ([]byte, error) { - oscd.InstanceType = InstanceTypeOrchestratorSpecificConnectionDetails - objectMap := make(map[string]interface{}) - if oscd.InstanceType != "" { - objectMap["instanceType"] = oscd.InstanceType - } - return json.Marshal(objectMap) -} - -// AsKubernetesConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for OrchestratorSpecificConnectionDetails. -func (oscd OrchestratorSpecificConnectionDetails) AsKubernetesConnectionDetails() (*KubernetesConnectionDetails, bool) { - return nil, false -} - -// AsOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for OrchestratorSpecificConnectionDetails. -func (oscd OrchestratorSpecificConnectionDetails) AsOrchestratorSpecificConnectionDetails() (*OrchestratorSpecificConnectionDetails, bool) { - return &oscd, true -} - -// AsBasicOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for OrchestratorSpecificConnectionDetails. -func (oscd OrchestratorSpecificConnectionDetails) AsBasicOrchestratorSpecificConnectionDetails() (BasicOrchestratorSpecificConnectionDetails, bool) { - return &oscd, true -} - -// Resource an Azure resource. -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. - Type *string `json:"type,omitempty"` -} - -// ResourceProviderOperationDefinition ... -type ResourceProviderOperationDefinition struct { - // Name - Resource provider operation name. - Name *string `json:"name,omitempty"` - Display *ResourceProviderOperationDisplay `json:"display,omitempty"` -} - -// ResourceProviderOperationDisplay ... -type ResourceProviderOperationDisplay struct { - // Provider - Name of the resource provider. - Provider *string `json:"provider,omitempty"` - // Resource - Name of the resource type. - Resource *string `json:"resource,omitempty"` - // Operation - Name of the resource provider operation. - Operation *string `json:"operation,omitempty"` - // Description - Description of the resource provider operation. - Description *string `json:"description,omitempty"` -} - -// ResourceProviderOperationList ... -type ResourceProviderOperationList struct { - autorest.Response `json:"-"` - // Value - Resource provider operations list. - Value *[]ResourceProviderOperationDefinition `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI that can be used to request the next page for list of Azure operations. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResourceProviderOperationListIterator provides access to a complete listing of -// ResourceProviderOperationDefinition values. -type ResourceProviderOperationListIterator struct { - i int - page ResourceProviderOperationListPage -} - -// 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 *ResourceProviderOperationListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceProviderOperationListIterator.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 *ResourceProviderOperationListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResourceProviderOperationListIterator) 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 ResourceProviderOperationListIterator) Response() ResourceProviderOperationList { - 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 ResourceProviderOperationListIterator) Value() ResourceProviderOperationDefinition { - if !iter.page.NotDone() { - return ResourceProviderOperationDefinition{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResourceProviderOperationListIterator type. -func NewResourceProviderOperationListIterator(page ResourceProviderOperationListPage) ResourceProviderOperationListIterator { - return ResourceProviderOperationListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rpol ResourceProviderOperationList) IsEmpty() bool { - return rpol.Value == nil || len(*rpol.Value) == 0 -} - -// resourceProviderOperationListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rpol ResourceProviderOperationList) resourceProviderOperationListPreparer(ctx context.Context) (*http.Request, error) { - if rpol.NextLink == nil || len(to.String(rpol.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rpol.NextLink))) -} - -// ResourceProviderOperationListPage contains a page of ResourceProviderOperationDefinition values. -type ResourceProviderOperationListPage struct { - fn func(context.Context, ResourceProviderOperationList) (ResourceProviderOperationList, error) - rpol ResourceProviderOperationList -} - -// 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 *ResourceProviderOperationListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceProviderOperationListPage.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.rpol) - if err != nil { - return err - } - page.rpol = 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 *ResourceProviderOperationListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResourceProviderOperationListPage) NotDone() bool { - return !page.rpol.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResourceProviderOperationListPage) Response() ResourceProviderOperationList { - return page.rpol -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResourceProviderOperationListPage) Values() []ResourceProviderOperationDefinition { - if page.rpol.IsEmpty() { - return nil - } - return *page.rpol.Value -} - -// Creates a new instance of the ResourceProviderOperationListPage type. -func NewResourceProviderOperationListPage(getNextPage func(context.Context, ResourceProviderOperationList) (ResourceProviderOperationList, error)) ResourceProviderOperationListPage { - return ResourceProviderOperationListPage{fn: getNextPage} -} - -// SetObject ... -type SetObject struct { - autorest.Response `json:"-"` - Value interface{} `json:"value,omitempty"` -} - -// Sku model representing SKU for Azure Dev Spaces Controller. -type Sku struct { - // Name - The name of the SKU for Azure Dev Spaces Controller. - Name *string `json:"name,omitempty"` - // Tier - The tier of the SKU for Azure Dev Spaces Controller. Possible values include: 'Standard' - Tier SkuTier `json:"tier,omitempty"` -} - -// TrackedResource the resource model definition for a ARM tracked top level resource. -type TrackedResource struct { - // Tags - Tags for the Azure resource. - Tags map[string]*string `json:"tags"` - // Location - Region where the Azure resource is located. - Location *string `json:"location,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. - 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/devspaces/mgmt/2018-06-01-preview/devspaces/operations.go b/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/operations.go deleted file mode 100644 index 1bc1a485fe14..000000000000 --- a/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/operations.go +++ /dev/null @@ -1,147 +0,0 @@ -package devspaces - -// 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 dev Spaces 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. -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. -func (client OperationsClient) List(ctx context.Context) (result ResourceProviderOperationListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.rpol.Response.Response != nil { - sc = result.rpol.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rpol.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.OperationsClient", "List", resp, "Failure sending request") - return - } - - result.rpol, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.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 = "2018-06-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.DevSpaces/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 autorest.SendWithSender(client, 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 -} - -// listNextResults retrieves the next set of results, if any. -func (client OperationsClient) listNextResults(ctx context.Context, lastResults ResourceProviderOperationList) (result ResourceProviderOperationList, err error) { - req, err := lastResults.resourceProviderOperationListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "devspaces.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, "devspaces.OperationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.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 ResourceProviderOperationListIterator, 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/devspaces/mgmt/2018-06-01-preview/devspaces/version.go b/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/version.go deleted file mode 100644 index 4185bde52c4e..000000000000 --- a/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/version.go +++ /dev/null @@ -1,30 +0,0 @@ -package devspaces - -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.Number + " devspaces/2018-06-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/devspaces/mgmt/2019-01-01-preview/devspaces/containerhostmappings.go b/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/containerhostmappings.go deleted file mode 100644 index 0b12bd671b5e..000000000000 --- a/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/containerhostmappings.go +++ /dev/null @@ -1,129 +0,0 @@ -package devspaces - -// 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" -) - -// ContainerHostMappingsClient is the dev Spaces Client -type ContainerHostMappingsClient struct { - BaseClient -} - -// NewContainerHostMappingsClient creates an instance of the ContainerHostMappingsClient client. -func NewContainerHostMappingsClient(subscriptionID string) ContainerHostMappingsClient { - return NewContainerHostMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewContainerHostMappingsClientWithBaseURI creates an instance of the ContainerHostMappingsClient client. -func NewContainerHostMappingsClientWithBaseURI(baseURI string, subscriptionID string) ContainerHostMappingsClient { - return ContainerHostMappingsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// GetContainerHostMapping sends the get container host mapping request. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// location - location of the container host. -func (client ContainerHostMappingsClient) GetContainerHostMapping(ctx context.Context, containerHostMapping ContainerHostMapping, resourceGroupName string, location string) (result SetObject, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerHostMappingsClient.GetContainerHostMapping") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ContainerHostMappingsClient", "GetContainerHostMapping", err.Error()) - } - - req, err := client.GetContainerHostMappingPreparer(ctx, containerHostMapping, resourceGroupName, location) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ContainerHostMappingsClient", "GetContainerHostMapping", nil, "Failure preparing request") - return - } - - resp, err := client.GetContainerHostMappingSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ContainerHostMappingsClient", "GetContainerHostMapping", resp, "Failure sending request") - return - } - - result, err = client.GetContainerHostMappingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ContainerHostMappingsClient", "GetContainerHostMapping", resp, "Failure responding to request") - } - - return -} - -// GetContainerHostMappingPreparer prepares the GetContainerHostMapping request. -func (client ContainerHostMappingsClient) GetContainerHostMappingPreparer(ctx context.Context, containerHostMapping ContainerHostMapping, resourceGroupName string, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - containerHostMapping.MappedControllerResourceID = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/locations/{location}/checkContainerHostMapping", pathParameters), - autorest.WithJSON(containerHostMapping), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetContainerHostMappingSender sends the GetContainerHostMapping request. The method will close the -// http.Response Body if it receives an error. -func (client ContainerHostMappingsClient) GetContainerHostMappingSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetContainerHostMappingResponder handles the response to the GetContainerHostMapping request. The method always -// closes the http.Response Body. -func (client ContainerHostMappingsClient) GetContainerHostMappingResponder(resp *http.Response) (result SetObject, 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/devspaces/mgmt/2019-01-01-preview/devspaces/controllers.go b/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/controllers.go deleted file mode 100644 index e6c46e58c03e..000000000000 --- a/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/controllers.go +++ /dev/null @@ -1,726 +0,0 @@ -package devspaces - -// 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" -) - -// ControllersClient is the dev Spaces Client -type ControllersClient struct { - BaseClient -} - -// NewControllersClient creates an instance of the ControllersClient client. -func NewControllersClient(subscriptionID string) ControllersClient { - return NewControllersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewControllersClientWithBaseURI creates an instance of the ControllersClient client. -func NewControllersClientWithBaseURI(baseURI string, subscriptionID string) ControllersClient { - return ControllersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates an Azure Dev Spaces Controller with the specified create parameters. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -// controller - controller create parameters. -func (client ControllersClient) Create(ctx context.Context, resourceGroupName string, name string, controller Controller) (result ControllersCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.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}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}, - {TargetValue: controller, - Constraints: []validation.Constraint{{Target: "controller.ControllerProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "controller.ControllerProperties.TargetContainerHostResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "controller.ControllerProperties.TargetContainerHostCredentialsBase64", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "controller.Sku", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "controller.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, name, controller) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client ControllersClient) CreatePreparer(ctx context.Context, resourceGroupName string, name string, controller Controller) (*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-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", pathParameters), - autorest.WithJSON(controller), - 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 ControllersClient) CreateSender(req *http.Request) (future ControllersCreateFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, 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 ControllersClient) CreateResponder(resp *http.Response) (result Controller, 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 Azure Dev Spaces Controller. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -func (client ControllersClient) Delete(ctx context.Context, resourceGroupName string, name string) (result ControllersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.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}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, name) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ControllersClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "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/Microsoft.DevSpaces/controllers/{name}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ControllersClient) DeleteSender(req *http.Request) (future ControllersDeleteFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, 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 ControllersClient) 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 for an Azure Dev Spaces Controller. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -func (client ControllersClient) Get(ctx context.Context, resourceGroupName string, name string) (result Controller, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.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}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, name) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ControllersClient) GetPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "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/Microsoft.DevSpaces/controllers/{name}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ControllersClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ControllersClient) GetResponder(resp *http.Response) (result Controller, 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 Azure Dev Spaces Controllers with their properties in the subscription. -func (client ControllersClient) List(ctx context.Context) (result ControllerListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.List") - defer func() { - sc := -1 - if result.cl.Response.Response != nil { - sc = result.cl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "List", resp, "Failure sending request") - return - } - - result.cl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ControllersClient) ListPreparer(ctx context.Context) (*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, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers", 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 ControllersClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ControllersClient) ListResponder(resp *http.Response) (result ControllerList, 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 ControllersClient) listNextResults(ctx context.Context, lastResults ControllerList) (result ControllerList, err error) { - req, err := lastResults.controllerListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "devspaces.ControllersClient", "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, "devspaces.ControllersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ControllersClient) ListComplete(ctx context.Context) (result ControllerListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the Azure Dev Spaces Controllers with their properties in the specified resource group -// and subscription. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -func (client ControllersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ControllerListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.cl.Response.Response != nil { - sc = result.cl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "ListByResourceGroup", err.Error()) - } - - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.cl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.cl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListByResourceGroup", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ControllersClient) 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-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/Microsoft.DevSpaces/controllers", 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 ControllersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ControllersClient) ListByResourceGroupResponder(resp *http.Response) (result ControllerList, 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 ControllersClient) listByResourceGroupNextResults(ctx context.Context, lastResults ControllerList) (result ControllerList, err error) { - req, err := lastResults.controllerListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "devspaces.ControllersClient", "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, "devspaces.ControllersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ControllersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ControllerListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.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 -} - -// ListConnectionDetails lists connection details for the underlying container resources of an Azure Dev Spaces -// Controller. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -func (client ControllersClient) ListConnectionDetails(ctx context.Context, resourceGroupName string, name string) (result ControllerConnectionDetailsList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.ListConnectionDetails") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "ListConnectionDetails", err.Error()) - } - - req, err := client.ListConnectionDetailsPreparer(ctx, resourceGroupName, name) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListConnectionDetails", nil, "Failure preparing request") - return - } - - resp, err := client.ListConnectionDetailsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListConnectionDetails", resp, "Failure sending request") - return - } - - result, err = client.ListConnectionDetailsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListConnectionDetails", resp, "Failure responding to request") - } - - return -} - -// ListConnectionDetailsPreparer prepares the ListConnectionDetails request. -func (client ControllersClient) ListConnectionDetailsPreparer(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-01-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.DevSpaces/controllers/{name}/listConnectionDetails", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListConnectionDetailsSender sends the ListConnectionDetails request. The method will close the -// http.Response Body if it receives an error. -func (client ControllersClient) ListConnectionDetailsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListConnectionDetailsResponder handles the response to the ListConnectionDetails request. The method always -// closes the http.Response Body. -func (client ControllersClient) ListConnectionDetailsResponder(resp *http.Response) (result ControllerConnectionDetailsList, 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 properties of an existing Azure Dev Spaces Controller with the specified update parameters. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -// controllerUpdateParameters - parameters for updating the Azure Dev Spaces Controller. -func (client ControllersClient) Update(ctx context.Context, resourceGroupName string, name string, controllerUpdateParameters ControllerUpdateParameters) (result Controller, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.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}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, name, controllerUpdateParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ControllersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, controllerUpdateParameters ControllerUpdateParameters) (*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-01-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.DevSpaces/controllers/{name}", pathParameters), - autorest.WithJSON(controllerUpdateParameters), - 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 ControllersClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ControllersClient) UpdateResponder(resp *http.Response) (result Controller, 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/devspaces/mgmt/2019-01-01-preview/devspaces/devspacesapi/interfaces.go b/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/devspacesapi/interfaces.go deleted file mode 100644 index 21c795f2492a..000000000000 --- a/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/devspacesapi/interfaces.go +++ /dev/null @@ -1,50 +0,0 @@ -package devspacesapi - -// 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/devspaces/mgmt/2019-01-01-preview/devspaces" -) - -// ContainerHostMappingsClientAPI contains the set of methods on the ContainerHostMappingsClient type. -type ContainerHostMappingsClientAPI interface { - GetContainerHostMapping(ctx context.Context, containerHostMapping devspaces.ContainerHostMapping, resourceGroupName string, location string) (result devspaces.SetObject, err error) -} - -var _ ContainerHostMappingsClientAPI = (*devspaces.ContainerHostMappingsClient)(nil) - -// OperationsClientAPI contains the set of methods on the OperationsClient type. -type OperationsClientAPI interface { - List(ctx context.Context) (result devspaces.ResourceProviderOperationListPage, err error) -} - -var _ OperationsClientAPI = (*devspaces.OperationsClient)(nil) - -// ControllersClientAPI contains the set of methods on the ControllersClient type. -type ControllersClientAPI interface { - Create(ctx context.Context, resourceGroupName string, name string, controller devspaces.Controller) (result devspaces.ControllersCreateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, name string) (result devspaces.ControllersDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, name string) (result devspaces.Controller, err error) - List(ctx context.Context) (result devspaces.ControllerListPage, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string) (result devspaces.ControllerListPage, err error) - ListConnectionDetails(ctx context.Context, resourceGroupName string, name string) (result devspaces.ControllerConnectionDetailsList, err error) - Update(ctx context.Context, resourceGroupName string, name string, controllerUpdateParameters devspaces.ControllerUpdateParameters) (result devspaces.Controller, err error) -} - -var _ ControllersClientAPI = (*devspaces.ControllersClient)(nil) diff --git a/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/models.go b/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/models.go deleted file mode 100644 index 4573ad038441..000000000000 --- a/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/models.go +++ /dev/null @@ -1,824 +0,0 @@ -package devspaces - -// 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/devspaces/mgmt/2019-01-01-preview/devspaces" - -// InstanceType enumerates the values for instance type. -type InstanceType string - -const ( - // InstanceTypeKubernetes ... - InstanceTypeKubernetes InstanceType = "Kubernetes" - // InstanceTypeOrchestratorSpecificConnectionDetails ... - InstanceTypeOrchestratorSpecificConnectionDetails InstanceType = "OrchestratorSpecificConnectionDetails" -) - -// PossibleInstanceTypeValues returns an array of possible values for the InstanceType const type. -func PossibleInstanceTypeValues() []InstanceType { - return []InstanceType{InstanceTypeKubernetes, InstanceTypeOrchestratorSpecificConnectionDetails} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // Canceled ... - Canceled ProvisioningState = "Canceled" - // Creating ... - Creating ProvisioningState = "Creating" - // Deleted ... - Deleted ProvisioningState = "Deleted" - // 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{Canceled, Creating, Deleted, Deleting, Failed, Succeeded, Updating} -} - -// SkuTier enumerates the values for sku tier. -type SkuTier string - -const ( - // Standard ... - Standard SkuTier = "Standard" -) - -// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. -func PossibleSkuTierValues() []SkuTier { - return []SkuTier{Standard} -} - -// ContainerHostMapping container host mapping object specifying the Container host resource ID and its -// associated Controller resource. -type ContainerHostMapping struct { - // ContainerHostResourceID - ARM ID of the Container Host resource - ContainerHostResourceID *string `json:"containerHostResourceId,omitempty"` - // MappedControllerResourceID - READ-ONLY; ARM ID of the mapped Controller resource - MappedControllerResourceID *string `json:"mappedControllerResourceId,omitempty"` -} - -// Controller ... -type Controller struct { - autorest.Response `json:"-"` - *ControllerProperties `json:"properties,omitempty"` - Sku *Sku `json:"sku,omitempty"` - // Tags - Tags for the Azure resource. - Tags map[string]*string `json:"tags"` - // Location - Region where the Azure resource is located. - Location *string `json:"location,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. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Controller. -func (c Controller) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ControllerProperties != nil { - objectMap["properties"] = c.ControllerProperties - } - if c.Sku != nil { - objectMap["sku"] = c.Sku - } - 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 Controller struct. -func (c *Controller) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var controllerProperties ControllerProperties - err = json.Unmarshal(*v, &controllerProperties) - if err != nil { - return err - } - c.ControllerProperties = &controllerProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - c.Sku = &sku - } - 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 -} - -// ControllerConnectionDetails ... -type ControllerConnectionDetails struct { - // AuthKey - READ-ONLY; Authentication key for communicating with services. - AuthKey *string `json:"authKey,omitempty"` - OrchestratorSpecificConnectionDetails BasicOrchestratorSpecificConnectionDetails `json:"orchestratorSpecificConnectionDetails,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for ControllerConnectionDetails struct. -func (ccd *ControllerConnectionDetails) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "authKey": - if v != nil { - var authKey string - err = json.Unmarshal(*v, &authKey) - if err != nil { - return err - } - ccd.AuthKey = &authKey - } - case "orchestratorSpecificConnectionDetails": - if v != nil { - orchestratorSpecificConnectionDetails, err := unmarshalBasicOrchestratorSpecificConnectionDetails(*v) - if err != nil { - return err - } - ccd.OrchestratorSpecificConnectionDetails = orchestratorSpecificConnectionDetails - } - } - } - - return nil -} - -// ControllerConnectionDetailsList ... -type ControllerConnectionDetailsList struct { - autorest.Response `json:"-"` - // ConnectionDetailsList - List of Azure Dev Spaces Controller connection details. - ConnectionDetailsList *[]ControllerConnectionDetails `json:"connectionDetailsList,omitempty"` -} - -// ControllerList ... -type ControllerList struct { - autorest.Response `json:"-"` - // Value - List of Azure Dev Spaces Controllers. - Value *[]Controller `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI that can be used to request the next page for list of Azure Dev Spaces Controllers. - NextLink *string `json:"nextLink,omitempty"` -} - -// ControllerListIterator provides access to a complete listing of Controller values. -type ControllerListIterator struct { - i int - page ControllerListPage -} - -// 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 *ControllerListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllerListIterator.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 *ControllerListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ControllerListIterator) 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 ControllerListIterator) Response() ControllerList { - 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 ControllerListIterator) Value() Controller { - if !iter.page.NotDone() { - return Controller{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ControllerListIterator type. -func NewControllerListIterator(page ControllerListPage) ControllerListIterator { - return ControllerListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cl ControllerList) IsEmpty() bool { - return cl.Value == nil || len(*cl.Value) == 0 -} - -// controllerListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cl ControllerList) controllerListPreparer(ctx context.Context) (*http.Request, error) { - if cl.NextLink == nil || len(to.String(cl.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cl.NextLink))) -} - -// ControllerListPage contains a page of Controller values. -type ControllerListPage struct { - fn func(context.Context, ControllerList) (ControllerList, error) - cl ControllerList -} - -// 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 *ControllerListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllerListPage.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.cl) - if err != nil { - return err - } - page.cl = 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 *ControllerListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ControllerListPage) NotDone() bool { - return !page.cl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ControllerListPage) Response() ControllerList { - return page.cl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ControllerListPage) Values() []Controller { - if page.cl.IsEmpty() { - return nil - } - return *page.cl.Value -} - -// Creates a new instance of the ControllerListPage type. -func NewControllerListPage(getNextPage func(context.Context, ControllerList) (ControllerList, error)) ControllerListPage { - return ControllerListPage{fn: getNextPage} -} - -// ControllerProperties ... -type ControllerProperties struct { - // ProvisioningState - READ-ONLY; Provisioning state of the Azure Dev Spaces Controller. Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating', 'Deleting', 'Deleted' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // HostSuffix - READ-ONLY; DNS suffix for public endpoints running in the Azure Dev Spaces Controller. - HostSuffix *string `json:"hostSuffix,omitempty"` - // DataPlaneFqdn - READ-ONLY; DNS name for accessing DataPlane services - DataPlaneFqdn *string `json:"dataPlaneFqdn,omitempty"` - // TargetContainerHostResourceID - Resource ID of the target container host - TargetContainerHostResourceID *string `json:"targetContainerHostResourceId,omitempty"` - // TargetContainerHostCredentialsBase64 - Credentials of the target container host (base64). - TargetContainerHostCredentialsBase64 *string `json:"targetContainerHostCredentialsBase64,omitempty"` -} - -// ControllersCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ControllersCreateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ControllersCreateFuture) Result(client ControllersClient) (c Controller, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("devspaces.ControllersCreateFuture") - 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.CreateResponder(c.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersCreateFuture", "Result", c.Response.Response, "Failure responding to request") - } - } - return -} - -// ControllersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ControllersDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ControllersDeleteFuture) Result(client ControllersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("devspaces.ControllersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ControllerUpdateParameters parameters for updating an Azure Dev Spaces Controller. -type ControllerUpdateParameters struct { - // Tags - Tags for the Azure Dev Spaces Controller. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ControllerUpdateParameters. -func (cup ControllerUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cup.Tags != nil { - objectMap["tags"] = cup.Tags - } - return json.Marshal(objectMap) -} - -// ErrorDetails ... -type ErrorDetails struct { - // Code - READ-ONLY; Status code for the error. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; Error message describing the error in detail. - 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"` -} - -// KubernetesConnectionDetails contains information used to connect to a Kubernetes cluster -type KubernetesConnectionDetails struct { - // KubeConfig - Gets the kubeconfig for the cluster. - KubeConfig *string `json:"kubeConfig,omitempty"` - // InstanceType - Possible values include: 'InstanceTypeOrchestratorSpecificConnectionDetails', 'InstanceTypeKubernetes' - InstanceType InstanceType `json:"instanceType,omitempty"` -} - -// MarshalJSON is the custom marshaler for KubernetesConnectionDetails. -func (kcd KubernetesConnectionDetails) MarshalJSON() ([]byte, error) { - kcd.InstanceType = InstanceTypeKubernetes - objectMap := make(map[string]interface{}) - if kcd.KubeConfig != nil { - objectMap["kubeConfig"] = kcd.KubeConfig - } - if kcd.InstanceType != "" { - objectMap["instanceType"] = kcd.InstanceType - } - return json.Marshal(objectMap) -} - -// AsKubernetesConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for KubernetesConnectionDetails. -func (kcd KubernetesConnectionDetails) AsKubernetesConnectionDetails() (*KubernetesConnectionDetails, bool) { - return &kcd, true -} - -// AsOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for KubernetesConnectionDetails. -func (kcd KubernetesConnectionDetails) AsOrchestratorSpecificConnectionDetails() (*OrchestratorSpecificConnectionDetails, bool) { - return nil, false -} - -// AsBasicOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for KubernetesConnectionDetails. -func (kcd KubernetesConnectionDetails) AsBasicOrchestratorSpecificConnectionDetails() (BasicOrchestratorSpecificConnectionDetails, bool) { - return &kcd, true -} - -// BasicOrchestratorSpecificConnectionDetails base class for types that supply values used to connect to container -// orchestrators -type BasicOrchestratorSpecificConnectionDetails interface { - AsKubernetesConnectionDetails() (*KubernetesConnectionDetails, bool) - AsOrchestratorSpecificConnectionDetails() (*OrchestratorSpecificConnectionDetails, bool) -} - -// OrchestratorSpecificConnectionDetails base class for types that supply values used to connect to container -// orchestrators -type OrchestratorSpecificConnectionDetails struct { - // InstanceType - Possible values include: 'InstanceTypeOrchestratorSpecificConnectionDetails', 'InstanceTypeKubernetes' - InstanceType InstanceType `json:"instanceType,omitempty"` -} - -func unmarshalBasicOrchestratorSpecificConnectionDetails(body []byte) (BasicOrchestratorSpecificConnectionDetails, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["instanceType"] { - case string(InstanceTypeKubernetes): - var kcd KubernetesConnectionDetails - err := json.Unmarshal(body, &kcd) - return kcd, err - default: - var oscd OrchestratorSpecificConnectionDetails - err := json.Unmarshal(body, &oscd) - return oscd, err - } -} -func unmarshalBasicOrchestratorSpecificConnectionDetailsArray(body []byte) ([]BasicOrchestratorSpecificConnectionDetails, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - oscdArray := make([]BasicOrchestratorSpecificConnectionDetails, len(rawMessages)) - - for index, rawMessage := range rawMessages { - oscd, err := unmarshalBasicOrchestratorSpecificConnectionDetails(*rawMessage) - if err != nil { - return nil, err - } - oscdArray[index] = oscd - } - return oscdArray, nil -} - -// MarshalJSON is the custom marshaler for OrchestratorSpecificConnectionDetails. -func (oscd OrchestratorSpecificConnectionDetails) MarshalJSON() ([]byte, error) { - oscd.InstanceType = InstanceTypeOrchestratorSpecificConnectionDetails - objectMap := make(map[string]interface{}) - if oscd.InstanceType != "" { - objectMap["instanceType"] = oscd.InstanceType - } - return json.Marshal(objectMap) -} - -// AsKubernetesConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for OrchestratorSpecificConnectionDetails. -func (oscd OrchestratorSpecificConnectionDetails) AsKubernetesConnectionDetails() (*KubernetesConnectionDetails, bool) { - return nil, false -} - -// AsOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for OrchestratorSpecificConnectionDetails. -func (oscd OrchestratorSpecificConnectionDetails) AsOrchestratorSpecificConnectionDetails() (*OrchestratorSpecificConnectionDetails, bool) { - return &oscd, true -} - -// AsBasicOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for OrchestratorSpecificConnectionDetails. -func (oscd OrchestratorSpecificConnectionDetails) AsBasicOrchestratorSpecificConnectionDetails() (BasicOrchestratorSpecificConnectionDetails, bool) { - return &oscd, true -} - -// Resource an Azure resource. -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. - Type *string `json:"type,omitempty"` -} - -// ResourceProviderOperationDefinition ... -type ResourceProviderOperationDefinition struct { - // Name - Resource provider operation name. - Name *string `json:"name,omitempty"` - Display *ResourceProviderOperationDisplay `json:"display,omitempty"` -} - -// ResourceProviderOperationDisplay ... -type ResourceProviderOperationDisplay struct { - // Provider - Name of the resource provider. - Provider *string `json:"provider,omitempty"` - // Resource - Name of the resource type. - Resource *string `json:"resource,omitempty"` - // Operation - Name of the resource provider operation. - Operation *string `json:"operation,omitempty"` - // Description - Description of the resource provider operation. - Description *string `json:"description,omitempty"` -} - -// ResourceProviderOperationList ... -type ResourceProviderOperationList struct { - autorest.Response `json:"-"` - // Value - Resource provider operations list. - Value *[]ResourceProviderOperationDefinition `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI that can be used to request the next page for list of Azure operations. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResourceProviderOperationListIterator provides access to a complete listing of -// ResourceProviderOperationDefinition values. -type ResourceProviderOperationListIterator struct { - i int - page ResourceProviderOperationListPage -} - -// 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 *ResourceProviderOperationListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceProviderOperationListIterator.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 *ResourceProviderOperationListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResourceProviderOperationListIterator) 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 ResourceProviderOperationListIterator) Response() ResourceProviderOperationList { - 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 ResourceProviderOperationListIterator) Value() ResourceProviderOperationDefinition { - if !iter.page.NotDone() { - return ResourceProviderOperationDefinition{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResourceProviderOperationListIterator type. -func NewResourceProviderOperationListIterator(page ResourceProviderOperationListPage) ResourceProviderOperationListIterator { - return ResourceProviderOperationListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rpol ResourceProviderOperationList) IsEmpty() bool { - return rpol.Value == nil || len(*rpol.Value) == 0 -} - -// resourceProviderOperationListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rpol ResourceProviderOperationList) resourceProviderOperationListPreparer(ctx context.Context) (*http.Request, error) { - if rpol.NextLink == nil || len(to.String(rpol.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rpol.NextLink))) -} - -// ResourceProviderOperationListPage contains a page of ResourceProviderOperationDefinition values. -type ResourceProviderOperationListPage struct { - fn func(context.Context, ResourceProviderOperationList) (ResourceProviderOperationList, error) - rpol ResourceProviderOperationList -} - -// 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 *ResourceProviderOperationListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceProviderOperationListPage.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.rpol) - if err != nil { - return err - } - page.rpol = 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 *ResourceProviderOperationListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResourceProviderOperationListPage) NotDone() bool { - return !page.rpol.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResourceProviderOperationListPage) Response() ResourceProviderOperationList { - return page.rpol -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResourceProviderOperationListPage) Values() []ResourceProviderOperationDefinition { - if page.rpol.IsEmpty() { - return nil - } - return *page.rpol.Value -} - -// Creates a new instance of the ResourceProviderOperationListPage type. -func NewResourceProviderOperationListPage(getNextPage func(context.Context, ResourceProviderOperationList) (ResourceProviderOperationList, error)) ResourceProviderOperationListPage { - return ResourceProviderOperationListPage{fn: getNextPage} -} - -// SetObject ... -type SetObject struct { - autorest.Response `json:"-"` - Value interface{} `json:"value,omitempty"` -} - -// Sku model representing SKU for Azure Dev Spaces Controller. -type Sku struct { - // Name - The name of the SKU for Azure Dev Spaces Controller. - Name *string `json:"name,omitempty"` - // Tier - The tier of the SKU for Azure Dev Spaces Controller. Possible values include: 'Standard' - Tier SkuTier `json:"tier,omitempty"` -} - -// TrackedResource the resource model definition for a ARM tracked top level resource. -type TrackedResource struct { - // Tags - Tags for the Azure resource. - Tags map[string]*string `json:"tags"` - // Location - Region where the Azure resource is located. - Location *string `json:"location,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. - 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/devspaces/mgmt/2019-01-01-preview/devspaces/version.go b/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/version.go deleted file mode 100644 index 216ba778a9c2..000000000000 --- a/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/version.go +++ /dev/null @@ -1,30 +0,0 @@ -package devspaces - -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.Number + " devspaces/2019-01-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/frontdoor/mgmt/2018-08-01-preview/frontdoor/backendpools.go b/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/backendpools.go deleted file mode 100644 index bca95d6524a1..000000000000 --- a/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/backendpools.go +++ /dev/null @@ -1,457 +0,0 @@ -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" -) - -// BackendPoolsClient is the frontDoor Client -type BackendPoolsClient struct { - BaseClient -} - -// NewBackendPoolsClient creates an instance of the BackendPoolsClient client. -func NewBackendPoolsClient(subscriptionID string) BackendPoolsClient { - return NewBackendPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewBackendPoolsClientWithBaseURI creates an instance of the BackendPoolsClient client. -func NewBackendPoolsClientWithBaseURI(baseURI string, subscriptionID string) BackendPoolsClient { - return BackendPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a new Backend Pool with the specified Pool 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. -// backendPoolName - name of the Backend Pool which is unique within the Front Door. -// backendPoolParameters - backend Pool properties needed to create a new Pool. -func (client BackendPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string, backendPoolParameters BackendPool) (result BackendPoolsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.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: backendPoolName, - Constraints: []validation.Constraint{{Target: "backendPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "backendPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendPoolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.BackendPoolsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, backendPoolName, backendPoolParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client BackendPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string, backendPoolParameters BackendPool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendPoolName": autorest.Encode("path", backendPoolName), - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - backendPoolParameters.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.Network/frontDoors/{frontDoorName}/backendPools/{backendPoolName}", pathParameters), - autorest.WithJSON(backendPoolParameters), - 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 BackendPoolsClient) CreateOrUpdateSender(req *http.Request) (future BackendPoolsCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 BackendPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result BackendPool, 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 Backend Pool 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. -// backendPoolName - name of the Backend Pool which is unique within the Front Door. -func (client BackendPoolsClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (result BackendPoolsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.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: backendPoolName, - Constraints: []validation.Constraint{{Target: "backendPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "backendPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendPoolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.BackendPoolsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, backendPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client BackendPoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendPoolName": autorest.Encode("path", backendPoolName), - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-08-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}/backendPools/{backendPoolName}", 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 BackendPoolsClient) DeleteSender(req *http.Request) (future BackendPoolsDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 BackendPoolsClient) 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 Backend Pool with the specified Pool 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. -// backendPoolName - name of the Backend Pool which is unique within the Front Door. -func (client BackendPoolsClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (result BackendPool, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.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: backendPoolName, - Constraints: []validation.Constraint{{Target: "backendPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "backendPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendPoolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.BackendPoolsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, backendPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "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.BackendPoolsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client BackendPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendPoolName": autorest.Encode("path", backendPoolName), - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-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.Network/frontDoors/{frontDoorName}/backendPools/{backendPoolName}", 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 BackendPoolsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client BackendPoolsClient) GetResponder(resp *http.Response) (result BackendPool, 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 Backend Pools 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 BackendPoolsClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result BackendPoolListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.ListByFrontDoor") - defer func() { - sc := -1 - if result.bplr.Response.Response != nil { - sc = result.bplr.Response.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.BackendPoolsClient", "ListByFrontDoor", err.Error()) - } - - result.fn = client.listByFrontDoorNextResults - req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "ListByFrontDoor", nil, "Failure preparing request") - return - } - - resp, err := client.ListByFrontDoorSender(req) - if err != nil { - result.bplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "ListByFrontDoor", resp, "Failure sending request") - return - } - - result.bplr, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "ListByFrontDoor", resp, "Failure responding to request") - } - - return -} - -// ListByFrontDoorPreparer prepares the ListByFrontDoor request. -func (client BackendPoolsClient) 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 = "2018-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.Network/frontDoors/{frontDoorName}/backendPools", 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 BackendPoolsClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always -// closes the http.Response Body. -func (client BackendPoolsClient) ListByFrontDoorResponder(resp *http.Response) (result BackendPoolListResult, 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 BackendPoolsClient) listByFrontDoorNextResults(ctx context.Context, lastResults BackendPoolListResult) (result BackendPoolListResult, err error) { - req, err := lastResults.backendPoolListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "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.BackendPoolsClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. -func (client BackendPoolsClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result BackendPoolListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.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/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/frontdoorapi/interfaces.go b/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/frontdoorapi/interfaces.go index 09ff641f78dc..c5c2c2f4be03 100644 --- a/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/frontdoorapi/interfaces.go +++ b/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/frontdoorapi/interfaces.go @@ -42,50 +42,8 @@ type FrontDoorsClientAPI interface { var _ FrontDoorsClientAPI = (*frontdoor.FrontDoorsClient)(nil) -// RoutingRulesClientAPI contains the set of methods on the RoutingRulesClient type. -type RoutingRulesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string, routingRuleParameters frontdoor.RoutingRule) (result frontdoor.RoutingRulesCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (result frontdoor.RoutingRulesDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (result frontdoor.RoutingRule, err error) - ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.RoutingRuleListResultPage, err error) -} - -var _ RoutingRulesClientAPI = (*frontdoor.RoutingRulesClient)(nil) - -// HealthProbeSettingsClientAPI contains the set of methods on the HealthProbeSettingsClient type. -type HealthProbeSettingsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string, healthProbeSettingsParameters frontdoor.HealthProbeSettingsModel) (result frontdoor.HealthProbeSettingsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (result frontdoor.HealthProbeSettingsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (result frontdoor.HealthProbeSettingsModel, err error) - ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.HealthProbeSettingsListResultPage, err error) -} - -var _ HealthProbeSettingsClientAPI = (*frontdoor.HealthProbeSettingsClient)(nil) - -// LoadBalancingSettingsClientAPI contains the set of methods on the LoadBalancingSettingsClient type. -type LoadBalancingSettingsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string, loadBalancingSettingsParameters frontdoor.LoadBalancingSettingsModel) (result frontdoor.LoadBalancingSettingsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (result frontdoor.LoadBalancingSettingsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (result frontdoor.LoadBalancingSettingsModel, err error) - ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.LoadBalancingSettingsListResultPage, err error) -} - -var _ LoadBalancingSettingsClientAPI = (*frontdoor.LoadBalancingSettingsClient)(nil) - -// BackendPoolsClientAPI contains the set of methods on the BackendPoolsClient type. -type BackendPoolsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string, backendPoolParameters frontdoor.BackendPool) (result frontdoor.BackendPoolsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (result frontdoor.BackendPoolsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (result frontdoor.BackendPool, err error) - ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.BackendPoolListResultPage, err error) -} - -var _ BackendPoolsClientAPI = (*frontdoor.BackendPoolsClient)(nil) - // FrontendEndpointsClientAPI contains the set of methods on the FrontendEndpointsClient type. type FrontendEndpointsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, frontendEndpointParameters frontdoor.FrontendEndpoint) (result frontdoor.FrontendEndpointsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (result frontdoor.FrontendEndpointsDeleteFuture, err error) 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) diff --git a/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/frontendendpoints.go b/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/frontendendpoints.go index cbb3626a5a78..227ccc3cd765 100644 --- a/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/frontendendpoints.go +++ b/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/frontendendpoints.go @@ -41,199 +41,6 @@ func NewFrontendEndpointsClientWithBaseURI(baseURI string, subscriptionID string return FrontendEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates a new frontend endpoint with the specified host 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. -// frontendEndpointParameters - frontend endpoint properties needed to create a new endpoint. -func (client FrontendEndpointsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, frontendEndpointParameters FrontendEndpoint) (result FrontendEndpointsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.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: 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", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, frontendEndpointName, frontendEndpointParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client FrontendEndpointsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, frontendEndpointParameters FrontendEndpoint) (*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 = "2018-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - frontendEndpointParameters.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.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}", pathParameters), - autorest.WithJSON(frontendEndpointParameters), - 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 FrontendEndpointsClient) CreateOrUpdateSender(req *http.Request) (future FrontendEndpointsCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 FrontendEndpointsClient) CreateOrUpdateResponder(resp *http.Response) (result FrontendEndpoint, 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 frontend endpoint 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. -// frontendEndpointName - name of the Frontend endpoint which is unique within the Front Door. -func (client FrontendEndpointsClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (result FrontendEndpointsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.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: 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", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, frontendEndpointName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client FrontendEndpointsClient) DeletePreparer(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 = "2018-08-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}/frontendEndpoints/{frontendEndpointName}", 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 FrontendEndpointsClient) DeleteSender(req *http.Request) (future FrontendEndpointsDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 FrontendEndpointsClient) 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 -} - // DisableHTTPS disables a frontendEndpoint for HTTPS traffic // Parameters: // resourceGroupName - name of the Resource group within the Azure subscription. diff --git a/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/healthprobesettings.go b/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/healthprobesettings.go deleted file mode 100644 index 125f175b7947..000000000000 --- a/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/healthprobesettings.go +++ /dev/null @@ -1,457 +0,0 @@ -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" -) - -// HealthProbeSettingsClient is the frontDoor Client -type HealthProbeSettingsClient struct { - BaseClient -} - -// NewHealthProbeSettingsClient creates an instance of the HealthProbeSettingsClient client. -func NewHealthProbeSettingsClient(subscriptionID string) HealthProbeSettingsClient { - return NewHealthProbeSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewHealthProbeSettingsClientWithBaseURI creates an instance of the HealthProbeSettingsClient client. -func NewHealthProbeSettingsClientWithBaseURI(baseURI string, subscriptionID string) HealthProbeSettingsClient { - return HealthProbeSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a new HealthProbeSettings with the specified Rule 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. -// healthProbeSettingsName - name of the health probe settings which is unique within the Front Door. -// healthProbeSettingsParameters - healthProbeSettings properties needed to create a new Front Door. -func (client HealthProbeSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string, healthProbeSettingsParameters HealthProbeSettingsModel) (result HealthProbeSettingsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.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: healthProbeSettingsName, - Constraints: []validation.Constraint{{Target: "healthProbeSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.HealthProbeSettingsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client HealthProbeSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string, healthProbeSettingsParameters HealthProbeSettingsModel) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "healthProbeSettingsName": autorest.Encode("path", healthProbeSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - healthProbeSettingsParameters.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.Network/frontDoors/{frontDoorName}/healthProbeSettings/{healthProbeSettingsName}", pathParameters), - autorest.WithJSON(healthProbeSettingsParameters), - 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 HealthProbeSettingsClient) CreateOrUpdateSender(req *http.Request) (future HealthProbeSettingsCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 HealthProbeSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result HealthProbeSettingsModel, 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 HealthProbeSettings 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. -// healthProbeSettingsName - name of the health probe settings which is unique within the Front Door. -func (client HealthProbeSettingsClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (result HealthProbeSettingsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.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: healthProbeSettingsName, - Constraints: []validation.Constraint{{Target: "healthProbeSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.HealthProbeSettingsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, healthProbeSettingsName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client HealthProbeSettingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "healthProbeSettingsName": autorest.Encode("path", healthProbeSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-08-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}/healthProbeSettings/{healthProbeSettingsName}", 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 HealthProbeSettingsClient) DeleteSender(req *http.Request) (future HealthProbeSettingsDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 HealthProbeSettingsClient) 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 HealthProbeSettings with the specified Rule 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. -// healthProbeSettingsName - name of the health probe settings which is unique within the Front Door. -func (client HealthProbeSettingsClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (result HealthProbeSettingsModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.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: healthProbeSettingsName, - Constraints: []validation.Constraint{{Target: "healthProbeSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.HealthProbeSettingsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, healthProbeSettingsName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "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.HealthProbeSettingsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client HealthProbeSettingsClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "healthProbeSettingsName": autorest.Encode("path", healthProbeSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-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.Network/frontDoors/{frontDoorName}/healthProbeSettings/{healthProbeSettingsName}", 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 HealthProbeSettingsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client HealthProbeSettingsClient) GetResponder(resp *http.Response) (result HealthProbeSettingsModel, 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 HealthProbeSettings 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 HealthProbeSettingsClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result HealthProbeSettingsListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.ListByFrontDoor") - defer func() { - sc := -1 - if result.hpslr.Response.Response != nil { - sc = result.hpslr.Response.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.HealthProbeSettingsClient", "ListByFrontDoor", err.Error()) - } - - result.fn = client.listByFrontDoorNextResults - req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "ListByFrontDoor", nil, "Failure preparing request") - return - } - - resp, err := client.ListByFrontDoorSender(req) - if err != nil { - result.hpslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "ListByFrontDoor", resp, "Failure sending request") - return - } - - result.hpslr, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "ListByFrontDoor", resp, "Failure responding to request") - } - - return -} - -// ListByFrontDoorPreparer prepares the ListByFrontDoor request. -func (client HealthProbeSettingsClient) 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 = "2018-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.Network/frontDoors/{frontDoorName}/healthProbeSettings", 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 HealthProbeSettingsClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always -// closes the http.Response Body. -func (client HealthProbeSettingsClient) ListByFrontDoorResponder(resp *http.Response) (result HealthProbeSettingsListResult, 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 HealthProbeSettingsClient) listByFrontDoorNextResults(ctx context.Context, lastResults HealthProbeSettingsListResult) (result HealthProbeSettingsListResult, err error) { - req, err := lastResults.healthProbeSettingsListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "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.HealthProbeSettingsClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. -func (client HealthProbeSettingsClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result HealthProbeSettingsListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.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/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/loadbalancingsettings.go b/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/loadbalancingsettings.go deleted file mode 100644 index 87dabd90095d..000000000000 --- a/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/loadbalancingsettings.go +++ /dev/null @@ -1,457 +0,0 @@ -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" -) - -// LoadBalancingSettingsClient is the frontDoor Client -type LoadBalancingSettingsClient struct { - BaseClient -} - -// NewLoadBalancingSettingsClient creates an instance of the LoadBalancingSettingsClient client. -func NewLoadBalancingSettingsClient(subscriptionID string) LoadBalancingSettingsClient { - return NewLoadBalancingSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancingSettingsClientWithBaseURI creates an instance of the LoadBalancingSettingsClient client. -func NewLoadBalancingSettingsClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancingSettingsClient { - return LoadBalancingSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a new LoadBalancingSettings with the specified Rule 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. -// loadBalancingSettingsName - name of the load balancing settings which is unique within the Front Door. -// loadBalancingSettingsParameters - loadBalancingSettings properties needed to create a new Front Door. -func (client LoadBalancingSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string, loadBalancingSettingsParameters LoadBalancingSettingsModel) (result LoadBalancingSettingsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.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: loadBalancingSettingsName, - Constraints: []validation.Constraint{{Target: "loadBalancingSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.LoadBalancingSettingsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client LoadBalancingSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string, loadBalancingSettingsParameters LoadBalancingSettingsModel) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "loadBalancingSettingsName": autorest.Encode("path", loadBalancingSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - loadBalancingSettingsParameters.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.Network/frontDoors/{frontDoorName}/loadBalancingSettings/{loadBalancingSettingsName}", pathParameters), - autorest.WithJSON(loadBalancingSettingsParameters), - 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 LoadBalancingSettingsClient) CreateOrUpdateSender(req *http.Request) (future LoadBalancingSettingsCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 LoadBalancingSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result LoadBalancingSettingsModel, 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 LoadBalancingSettings 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. -// loadBalancingSettingsName - name of the load balancing settings which is unique within the Front Door. -func (client LoadBalancingSettingsClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (result LoadBalancingSettingsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.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: loadBalancingSettingsName, - Constraints: []validation.Constraint{{Target: "loadBalancingSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.LoadBalancingSettingsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, loadBalancingSettingsName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client LoadBalancingSettingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "loadBalancingSettingsName": autorest.Encode("path", loadBalancingSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-08-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}/loadBalancingSettings/{loadBalancingSettingsName}", 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 LoadBalancingSettingsClient) DeleteSender(req *http.Request) (future LoadBalancingSettingsDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 LoadBalancingSettingsClient) 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 LoadBalancingSettings with the specified Rule 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. -// loadBalancingSettingsName - name of the load balancing settings which is unique within the Front Door. -func (client LoadBalancingSettingsClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (result LoadBalancingSettingsModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.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: loadBalancingSettingsName, - Constraints: []validation.Constraint{{Target: "loadBalancingSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.LoadBalancingSettingsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, loadBalancingSettingsName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "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.LoadBalancingSettingsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancingSettingsClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "loadBalancingSettingsName": autorest.Encode("path", loadBalancingSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-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.Network/frontDoors/{frontDoorName}/loadBalancingSettings/{loadBalancingSettingsName}", 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 LoadBalancingSettingsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancingSettingsClient) GetResponder(resp *http.Response) (result LoadBalancingSettingsModel, 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 LoadBalancingSettings 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 LoadBalancingSettingsClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result LoadBalancingSettingsListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.ListByFrontDoor") - defer func() { - sc := -1 - if result.lbslr.Response.Response != nil { - sc = result.lbslr.Response.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.LoadBalancingSettingsClient", "ListByFrontDoor", err.Error()) - } - - result.fn = client.listByFrontDoorNextResults - req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "ListByFrontDoor", nil, "Failure preparing request") - return - } - - resp, err := client.ListByFrontDoorSender(req) - if err != nil { - result.lbslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "ListByFrontDoor", resp, "Failure sending request") - return - } - - result.lbslr, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "ListByFrontDoor", resp, "Failure responding to request") - } - - return -} - -// ListByFrontDoorPreparer prepares the ListByFrontDoor request. -func (client LoadBalancingSettingsClient) 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 = "2018-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.Network/frontDoors/{frontDoorName}/loadBalancingSettings", 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 LoadBalancingSettingsClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always -// closes the http.Response Body. -func (client LoadBalancingSettingsClient) ListByFrontDoorResponder(resp *http.Response) (result LoadBalancingSettingsListResult, 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 LoadBalancingSettingsClient) listByFrontDoorNextResults(ctx context.Context, lastResults LoadBalancingSettingsListResult) (result LoadBalancingSettingsListResult, err error) { - req, err := lastResults.loadBalancingSettingsListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "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.LoadBalancingSettingsClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancingSettingsClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result LoadBalancingSettingsListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.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/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/models.go b/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/models.go index 177f82005ac5..6d3f75d5ba79 100644 --- a/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/models.go +++ b/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/models.go @@ -569,7 +569,6 @@ type Backend struct { // BackendPool a backend pool is a collection of backends that can be routed to. type BackendPool struct { - autorest.Response `json:"-"` // BackendPoolProperties - Properties of the Front Door Backend Pool *BackendPoolProperties `json:"properties,omitempty"` // Name - Resource name. @@ -649,150 +648,12 @@ func (bp *BackendPool) UnmarshalJSON(body []byte) error { // 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 { - autorest.Response `json:"-"` // 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"` } -// BackendPoolListResultIterator provides access to a complete listing of BackendPool values. -type BackendPoolListResultIterator struct { - i int - page BackendPoolListResultPage -} - -// 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 *BackendPoolListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolListResultIterator.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 *BackendPoolListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BackendPoolListResultIterator) 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 BackendPoolListResultIterator) Response() BackendPoolListResult { - 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 BackendPoolListResultIterator) Value() BackendPool { - if !iter.page.NotDone() { - return BackendPool{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BackendPoolListResultIterator type. -func NewBackendPoolListResultIterator(page BackendPoolListResultPage) BackendPoolListResultIterator { - return BackendPoolListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (bplr BackendPoolListResult) IsEmpty() bool { - return bplr.Value == nil || len(*bplr.Value) == 0 -} - -// backendPoolListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (bplr BackendPoolListResult) backendPoolListResultPreparer(ctx context.Context) (*http.Request, error) { - if bplr.NextLink == nil || len(to.String(bplr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(bplr.NextLink))) -} - -// BackendPoolListResultPage contains a page of BackendPool values. -type BackendPoolListResultPage struct { - fn func(context.Context, BackendPoolListResult) (BackendPoolListResult, error) - bplr BackendPoolListResult -} - -// 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 *BackendPoolListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolListResultPage.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.bplr) - if err != nil { - return err - } - page.bplr = 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 *BackendPoolListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BackendPoolListResultPage) NotDone() bool { - return !page.bplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BackendPoolListResultPage) Response() BackendPoolListResult { - return page.bplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BackendPoolListResultPage) Values() []BackendPool { - if page.bplr.IsEmpty() { - return nil - } - return *page.bplr.Value -} - -// Creates a new instance of the BackendPoolListResultPage type. -func NewBackendPoolListResultPage(getNextPage func(context.Context, BackendPoolListResult) (BackendPoolListResult, error)) BackendPoolListResultPage { - return BackendPoolListResultPage{fn: getNextPage} -} - // BackendPoolProperties the JSON object that contains the properties required to create a routing rule. type BackendPoolProperties struct { // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' @@ -805,58 +666,6 @@ type BackendPoolProperties struct { HealthProbeSettings *SubResource `json:"healthProbeSettings,omitempty"` } -// BackendPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type BackendPoolsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *BackendPoolsCreateOrUpdateFuture) Result(client BackendPoolsClient) (bp BackendPool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.BackendPoolsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bp.Response.Response, err = future.GetResult(sender); err == nil && bp.Response.Response.StatusCode != http.StatusNoContent { - bp, err = client.CreateOrUpdateResponder(bp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsCreateOrUpdateFuture", "Result", bp.Response.Response, "Failure responding to request") - } - } - return -} - -// BackendPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type BackendPoolsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *BackendPoolsDeleteFuture) Result(client BackendPoolsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.BackendPoolsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // BackendPoolUpdateParameters a collection of backends that can be routed to. type BackendPoolUpdateParameters struct { // Backends - The set of backends for this pool @@ -1312,58 +1121,6 @@ type FrontendEndpointProperties struct { WebApplicationFirewallPolicyLink *FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` } -// FrontendEndpointsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type FrontendEndpointsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FrontendEndpointsCreateOrUpdateFuture) Result(client FrontendEndpointsClient) (fe FrontendEndpoint, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.FrontendEndpointsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fe.Response.Response, err = future.GetResult(sender); err == nil && fe.Response.Response.StatusCode != http.StatusNoContent { - fe, err = client.CreateOrUpdateResponder(fe.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsCreateOrUpdateFuture", "Result", fe.Response.Response, "Failure responding to request") - } - } - return -} - -// FrontendEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FrontendEndpointsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FrontendEndpointsDeleteFuture) 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.FrontendEndpointsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.FrontendEndpointsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // FrontendEndpointsDisableHTTPSFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type FrontendEndpointsDisableHTTPSFuture struct { @@ -1576,230 +1333,38 @@ type FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink struct { ID *string `json:"id,omitempty"` } -// HealthProbeSettingsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type HealthProbeSettingsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *HealthProbeSettingsCreateOrUpdateFuture) Result(client HealthProbeSettingsClient) (hpsm HealthProbeSettingsModel, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.HealthProbeSettingsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if hpsm.Response.Response, err = future.GetResult(sender); err == nil && hpsm.Response.Response.StatusCode != http.StatusNoContent { - hpsm, err = client.CreateOrUpdateResponder(hpsm.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsCreateOrUpdateFuture", "Result", hpsm.Response.Response, "Failure responding to request") - } - } - return -} - -// HealthProbeSettingsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type HealthProbeSettingsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *HealthProbeSettingsDeleteFuture) Result(client HealthProbeSettingsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.HealthProbeSettingsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // 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 { - autorest.Response `json:"-"` // 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"` } -// HealthProbeSettingsListResultIterator provides access to a complete listing of HealthProbeSettingsModel -// values. -type HealthProbeSettingsListResultIterator struct { - i int - page HealthProbeSettingsListResultPage +// 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"` } -// 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 *HealthProbeSettingsListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() +// 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 } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil + if hpsm.Name != nil { + objectMap["name"] = hpsm.Name } - 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 *HealthProbeSettingsListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter HealthProbeSettingsListResultIterator) 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 HealthProbeSettingsListResultIterator) Response() HealthProbeSettingsListResult { - 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 HealthProbeSettingsListResultIterator) Value() HealthProbeSettingsModel { - if !iter.page.NotDone() { - return HealthProbeSettingsModel{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the HealthProbeSettingsListResultIterator type. -func NewHealthProbeSettingsListResultIterator(page HealthProbeSettingsListResultPage) HealthProbeSettingsListResultIterator { - return HealthProbeSettingsListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (hpslr HealthProbeSettingsListResult) IsEmpty() bool { - return hpslr.Value == nil || len(*hpslr.Value) == 0 -} - -// healthProbeSettingsListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (hpslr HealthProbeSettingsListResult) healthProbeSettingsListResultPreparer(ctx context.Context) (*http.Request, error) { - if hpslr.NextLink == nil || len(to.String(hpslr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(hpslr.NextLink))) -} - -// HealthProbeSettingsListResultPage contains a page of HealthProbeSettingsModel values. -type HealthProbeSettingsListResultPage struct { - fn func(context.Context, HealthProbeSettingsListResult) (HealthProbeSettingsListResult, error) - hpslr HealthProbeSettingsListResult -} - -// 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 *HealthProbeSettingsListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsListResultPage.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.hpslr) - if err != nil { - return err - } - page.hpslr = 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 *HealthProbeSettingsListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page HealthProbeSettingsListResultPage) NotDone() bool { - return !page.hpslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page HealthProbeSettingsListResultPage) Response() HealthProbeSettingsListResult { - return page.hpslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page HealthProbeSettingsListResultPage) Values() []HealthProbeSettingsModel { - if page.hpslr.IsEmpty() { - return nil - } - return *page.hpslr.Value -} - -// Creates a new instance of the HealthProbeSettingsListResultPage type. -func NewHealthProbeSettingsListResultPage(getNextPage func(context.Context, HealthProbeSettingsListResult) (HealthProbeSettingsListResult, error)) HealthProbeSettingsListResultPage { - return HealthProbeSettingsListResultPage{fn: getNextPage} -} - -// HealthProbeSettingsModel load balancing settings for a backend pool -type HealthProbeSettingsModel struct { - autorest.Response `json:"-"` - // 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 + if hpsm.ID != nil { + objectMap["id"] = hpsm.ID } return json.Marshal(objectMap) } @@ -2041,209 +1606,17 @@ func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult return ListResultPage{fn: getNextPage} } -// LoadBalancingSettingsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LoadBalancingSettingsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LoadBalancingSettingsCreateOrUpdateFuture) Result(client LoadBalancingSettingsClient) (lbsm LoadBalancingSettingsModel, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.LoadBalancingSettingsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if lbsm.Response.Response, err = future.GetResult(sender); err == nil && lbsm.Response.Response.StatusCode != http.StatusNoContent { - lbsm, err = client.CreateOrUpdateResponder(lbsm.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsCreateOrUpdateFuture", "Result", lbsm.Response.Response, "Failure responding to request") - } - } - return -} - -// LoadBalancingSettingsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LoadBalancingSettingsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LoadBalancingSettingsDeleteFuture) Result(client LoadBalancingSettingsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.LoadBalancingSettingsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // 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 { - autorest.Response `json:"-"` // 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"` } -// LoadBalancingSettingsListResultIterator provides access to a complete listing of -// LoadBalancingSettingsModel values. -type LoadBalancingSettingsListResultIterator struct { - i int - page LoadBalancingSettingsListResultPage -} - -// 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 *LoadBalancingSettingsListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsListResultIterator.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 *LoadBalancingSettingsListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancingSettingsListResultIterator) 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 LoadBalancingSettingsListResultIterator) Response() LoadBalancingSettingsListResult { - 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 LoadBalancingSettingsListResultIterator) Value() LoadBalancingSettingsModel { - if !iter.page.NotDone() { - return LoadBalancingSettingsModel{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LoadBalancingSettingsListResultIterator type. -func NewLoadBalancingSettingsListResultIterator(page LoadBalancingSettingsListResultPage) LoadBalancingSettingsListResultIterator { - return LoadBalancingSettingsListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lbslr LoadBalancingSettingsListResult) IsEmpty() bool { - return lbslr.Value == nil || len(*lbslr.Value) == 0 -} - -// loadBalancingSettingsListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lbslr LoadBalancingSettingsListResult) loadBalancingSettingsListResultPreparer(ctx context.Context) (*http.Request, error) { - if lbslr.NextLink == nil || len(to.String(lbslr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lbslr.NextLink))) -} - -// LoadBalancingSettingsListResultPage contains a page of LoadBalancingSettingsModel values. -type LoadBalancingSettingsListResultPage struct { - fn func(context.Context, LoadBalancingSettingsListResult) (LoadBalancingSettingsListResult, error) - lbslr LoadBalancingSettingsListResult -} - -// 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 *LoadBalancingSettingsListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsListResultPage.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.lbslr) - if err != nil { - return err - } - page.lbslr = 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 *LoadBalancingSettingsListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancingSettingsListResultPage) NotDone() bool { - return !page.lbslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LoadBalancingSettingsListResultPage) Response() LoadBalancingSettingsListResult { - return page.lbslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancingSettingsListResultPage) Values() []LoadBalancingSettingsModel { - if page.lbslr.IsEmpty() { - return nil - } - return *page.lbslr.Value -} - -// Creates a new instance of the LoadBalancingSettingsListResultPage type. -func NewLoadBalancingSettingsListResultPage(getNextPage func(context.Context, LoadBalancingSettingsListResult) (LoadBalancingSettingsListResult, error)) LoadBalancingSettingsListResultPage { - return LoadBalancingSettingsListResultPage{fn: getNextPage} -} - // LoadBalancingSettingsModel load balancing settings for a backend pool type LoadBalancingSettingsModel struct { - autorest.Response `json:"-"` // LoadBalancingSettingsProperties - Properties of the load balancing settings *LoadBalancingSettingsProperties `json:"properties,omitempty"` // Name - Resource name. @@ -2560,7 +1933,6 @@ func (r Resource) MarshalJSON() ([]byte, error) { // RoutingRule a routing rule represents a specification for traffic to treat and where to send it, along // with health probe information. type RoutingRule struct { - autorest.Response `json:"-"` // RoutingRuleProperties - Properties of the Front Door Routing Rule *RoutingRuleProperties `json:"properties,omitempty"` // Name - Resource name. @@ -2640,150 +2012,12 @@ func (rr *RoutingRule) UnmarshalJSON(body []byte) error { // 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 { - autorest.Response `json:"-"` // 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"` } -// RoutingRuleListResultIterator provides access to a complete listing of RoutingRule values. -type RoutingRuleListResultIterator struct { - i int - page RoutingRuleListResultPage -} - -// 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 *RoutingRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRuleListResultIterator.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 *RoutingRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RoutingRuleListResultIterator) 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 RoutingRuleListResultIterator) Response() RoutingRuleListResult { - 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 RoutingRuleListResultIterator) Value() RoutingRule { - if !iter.page.NotDone() { - return RoutingRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RoutingRuleListResultIterator type. -func NewRoutingRuleListResultIterator(page RoutingRuleListResultPage) RoutingRuleListResultIterator { - return RoutingRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rrlr RoutingRuleListResult) IsEmpty() bool { - return rrlr.Value == nil || len(*rrlr.Value) == 0 -} - -// routingRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rrlr RoutingRuleListResult) routingRuleListResultPreparer(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))) -} - -// RoutingRuleListResultPage contains a page of RoutingRule values. -type RoutingRuleListResultPage struct { - fn func(context.Context, RoutingRuleListResult) (RoutingRuleListResult, error) - rrlr RoutingRuleListResult -} - -// 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 *RoutingRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRuleListResultPage.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 *RoutingRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RoutingRuleListResultPage) NotDone() bool { - return !page.rrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RoutingRuleListResultPage) Response() RoutingRuleListResult { - return page.rrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RoutingRuleListResultPage) Values() []RoutingRule { - if page.rrlr.IsEmpty() { - return nil - } - return *page.rrlr.Value -} - -// Creates a new instance of the RoutingRuleListResultPage type. -func NewRoutingRuleListResultPage(getNextPage func(context.Context, RoutingRuleListResult) (RoutingRuleListResult, error)) RoutingRuleListResultPage { - return RoutingRuleListResultPage{fn: getNextPage} -} - // 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' @@ -2806,58 +2040,6 @@ type RoutingRuleProperties struct { EnabledState EnabledStateEnum `json:"enabledState,omitempty"` } -// RoutingRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type RoutingRulesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RoutingRulesCreateOrUpdateFuture) Result(client RoutingRulesClient) (rr RoutingRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.RoutingRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rr.Response.Response, err = future.GetResult(sender); err == nil && rr.Response.Response.StatusCode != http.StatusNoContent { - rr, err = client.CreateOrUpdateResponder(rr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesCreateOrUpdateFuture", "Result", rr.Response.Response, "Failure responding to request") - } - } - return -} - -// RoutingRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RoutingRulesDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RoutingRulesDeleteFuture) Result(client RoutingRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.RoutingRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // RoutingRuleUpdateParameters routing rules to apply to an endpoint type RoutingRuleUpdateParameters struct { // FrontendEndpoints - Frontend endpoints associated with this rule diff --git a/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/routingrules.go b/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/routingrules.go deleted file mode 100644 index 5d8412852151..000000000000 --- a/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/routingrules.go +++ /dev/null @@ -1,457 +0,0 @@ -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" -) - -// RoutingRulesClient is the frontDoor Client -type RoutingRulesClient struct { - BaseClient -} - -// NewRoutingRulesClient creates an instance of the RoutingRulesClient client. -func NewRoutingRulesClient(subscriptionID string) RoutingRulesClient { - return NewRoutingRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRoutingRulesClientWithBaseURI creates an instance of the RoutingRulesClient client. -func NewRoutingRulesClientWithBaseURI(baseURI string, subscriptionID string) RoutingRulesClient { - return RoutingRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a new Routing Rule with the specified Rule 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. -// routingRuleName - name of the Routing Rule which is unique within the Front Door. -// routingRuleParameters - routing Rule properties needed to create a new Front Door. -func (client RoutingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string, routingRuleParameters RoutingRule) (result RoutingRulesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.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: routingRuleName, - Constraints: []validation.Constraint{{Target: "routingRuleName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "routingRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "routingRuleName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.RoutingRulesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, routingRuleName, routingRuleParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RoutingRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string, routingRuleParameters RoutingRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routingRuleName": autorest.Encode("path", routingRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - routingRuleParameters.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.Network/frontDoors/{frontDoorName}/routingRules/{routingRuleName}", pathParameters), - autorest.WithJSON(routingRuleParameters), - 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 RoutingRulesClient) CreateOrUpdateSender(req *http.Request) (future RoutingRulesCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 RoutingRulesClient) CreateOrUpdateResponder(resp *http.Response) (result RoutingRule, 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 Routing Rule 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. -// routingRuleName - name of the Routing Rule which is unique within the Front Door. -func (client RoutingRulesClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (result RoutingRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.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: routingRuleName, - Constraints: []validation.Constraint{{Target: "routingRuleName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "routingRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "routingRuleName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.RoutingRulesClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, routingRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RoutingRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routingRuleName": autorest.Encode("path", routingRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-08-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}/routingRules/{routingRuleName}", 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 RoutingRulesClient) DeleteSender(req *http.Request) (future RoutingRulesDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 RoutingRulesClient) 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 Routing Rule with the specified Rule 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. -// routingRuleName - name of the Routing Rule which is unique within the Front Door. -func (client RoutingRulesClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (result RoutingRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.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: routingRuleName, - Constraints: []validation.Constraint{{Target: "routingRuleName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "routingRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "routingRuleName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.RoutingRulesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, routingRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "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.RoutingRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client RoutingRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routingRuleName": autorest.Encode("path", routingRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-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.Network/frontDoors/{frontDoorName}/routingRules/{routingRuleName}", 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 RoutingRulesClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RoutingRulesClient) GetResponder(resp *http.Response) (result RoutingRule, 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 Routing Rules 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 RoutingRulesClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result RoutingRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.ListByFrontDoor") - defer func() { - sc := -1 - if result.rrlr.Response.Response != nil { - sc = result.rrlr.Response.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.RoutingRulesClient", "ListByFrontDoor", err.Error()) - } - - result.fn = client.listByFrontDoorNextResults - req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "ListByFrontDoor", nil, "Failure preparing request") - return - } - - resp, err := client.ListByFrontDoorSender(req) - if err != nil { - result.rrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "ListByFrontDoor", resp, "Failure sending request") - return - } - - result.rrlr, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "ListByFrontDoor", resp, "Failure responding to request") - } - - return -} - -// ListByFrontDoorPreparer prepares the ListByFrontDoor request. -func (client RoutingRulesClient) 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 = "2018-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.Network/frontDoors/{frontDoorName}/routingRules", 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 RoutingRulesClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always -// closes the http.Response Body. -func (client RoutingRulesClient) ListByFrontDoorResponder(resp *http.Response) (result RoutingRuleListResult, 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 RoutingRulesClient) listByFrontDoorNextResults(ctx context.Context, lastResults RoutingRuleListResult) (result RoutingRuleListResult, err error) { - req, err := lastResults.routingRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "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.RoutingRulesClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. -func (client RoutingRulesClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result RoutingRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.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/preview/frontdoor/mgmt/2019-04-01/frontdoor/backendpools.go b/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/backendpools.go deleted file mode 100644 index e786cb2bf50a..000000000000 --- a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/backendpools.go +++ /dev/null @@ -1,457 +0,0 @@ -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" -) - -// BackendPoolsClient is the frontDoor Client -type BackendPoolsClient struct { - BaseClient -} - -// NewBackendPoolsClient creates an instance of the BackendPoolsClient client. -func NewBackendPoolsClient(subscriptionID string) BackendPoolsClient { - return NewBackendPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewBackendPoolsClientWithBaseURI creates an instance of the BackendPoolsClient client. -func NewBackendPoolsClientWithBaseURI(baseURI string, subscriptionID string) BackendPoolsClient { - return BackendPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a new Backend Pool with the specified Pool 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. -// backendPoolName - name of the Backend Pool which is unique within the Front Door. -// backendPoolParameters - backend Pool properties needed to create a new Pool. -func (client BackendPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string, backendPoolParameters BackendPool) (result BackendPoolsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.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: backendPoolName, - Constraints: []validation.Constraint{{Target: "backendPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "backendPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendPoolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.BackendPoolsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, backendPoolName, backendPoolParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client BackendPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string, backendPoolParameters BackendPool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendPoolName": autorest.Encode("path", backendPoolName), - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - backendPoolParameters.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.Network/frontDoors/{frontDoorName}/backendPools/{backendPoolName}", pathParameters), - autorest.WithJSON(backendPoolParameters), - 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 BackendPoolsClient) CreateOrUpdateSender(req *http.Request) (future BackendPoolsCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 BackendPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result BackendPool, 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 Backend Pool 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. -// backendPoolName - name of the Backend Pool which is unique within the Front Door. -func (client BackendPoolsClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (result BackendPoolsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.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: backendPoolName, - Constraints: []validation.Constraint{{Target: "backendPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "backendPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendPoolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.BackendPoolsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, backendPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client BackendPoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendPoolName": autorest.Encode("path", backendPoolName), - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/backendPools/{backendPoolName}", 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 BackendPoolsClient) DeleteSender(req *http.Request) (future BackendPoolsDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 BackendPoolsClient) 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 Backend Pool with the specified Pool 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. -// backendPoolName - name of the Backend Pool which is unique within the Front Door. -func (client BackendPoolsClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (result BackendPool, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.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: backendPoolName, - Constraints: []validation.Constraint{{Target: "backendPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "backendPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendPoolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.BackendPoolsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, backendPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "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.BackendPoolsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client BackendPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendPoolName": autorest.Encode("path", backendPoolName), - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/backendPools/{backendPoolName}", 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 BackendPoolsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client BackendPoolsClient) GetResponder(resp *http.Response) (result BackendPool, 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 Backend Pools 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 BackendPoolsClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result BackendPoolListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.ListByFrontDoor") - defer func() { - sc := -1 - if result.bplr.Response.Response != nil { - sc = result.bplr.Response.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.BackendPoolsClient", "ListByFrontDoor", err.Error()) - } - - result.fn = client.listByFrontDoorNextResults - req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "ListByFrontDoor", nil, "Failure preparing request") - return - } - - resp, err := client.ListByFrontDoorSender(req) - if err != nil { - result.bplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "ListByFrontDoor", resp, "Failure sending request") - return - } - - result.bplr, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "ListByFrontDoor", resp, "Failure responding to request") - } - - return -} - -// ListByFrontDoorPreparer prepares the ListByFrontDoor request. -func (client BackendPoolsClient) 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 = "2019-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}/backendPools", 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 BackendPoolsClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always -// closes the http.Response Body. -func (client BackendPoolsClient) ListByFrontDoorResponder(resp *http.Response) (result BackendPoolListResult, 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 BackendPoolsClient) listByFrontDoorNextResults(ctx context.Context, lastResults BackendPoolListResult) (result BackendPoolListResult, err error) { - req, err := lastResults.backendPoolListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "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.BackendPoolsClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. -func (client BackendPoolsClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result BackendPoolListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.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/preview/frontdoor/mgmt/2019-04-01/frontdoor/healthprobesettings.go b/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/healthprobesettings.go deleted file mode 100644 index e8b0c87731b9..000000000000 --- a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/healthprobesettings.go +++ /dev/null @@ -1,457 +0,0 @@ -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" -) - -// HealthProbeSettingsClient is the frontDoor Client -type HealthProbeSettingsClient struct { - BaseClient -} - -// NewHealthProbeSettingsClient creates an instance of the HealthProbeSettingsClient client. -func NewHealthProbeSettingsClient(subscriptionID string) HealthProbeSettingsClient { - return NewHealthProbeSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewHealthProbeSettingsClientWithBaseURI creates an instance of the HealthProbeSettingsClient client. -func NewHealthProbeSettingsClientWithBaseURI(baseURI string, subscriptionID string) HealthProbeSettingsClient { - return HealthProbeSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a new HealthProbeSettings with the specified Rule 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. -// healthProbeSettingsName - name of the health probe settings which is unique within the Front Door. -// healthProbeSettingsParameters - healthProbeSettings properties needed to create a new Front Door. -func (client HealthProbeSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string, healthProbeSettingsParameters HealthProbeSettingsModel) (result HealthProbeSettingsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.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: healthProbeSettingsName, - Constraints: []validation.Constraint{{Target: "healthProbeSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.HealthProbeSettingsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client HealthProbeSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string, healthProbeSettingsParameters HealthProbeSettingsModel) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "healthProbeSettingsName": autorest.Encode("path", healthProbeSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - healthProbeSettingsParameters.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.Network/frontDoors/{frontDoorName}/healthProbeSettings/{healthProbeSettingsName}", pathParameters), - autorest.WithJSON(healthProbeSettingsParameters), - 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 HealthProbeSettingsClient) CreateOrUpdateSender(req *http.Request) (future HealthProbeSettingsCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 HealthProbeSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result HealthProbeSettingsModel, 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 HealthProbeSettings 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. -// healthProbeSettingsName - name of the health probe settings which is unique within the Front Door. -func (client HealthProbeSettingsClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (result HealthProbeSettingsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.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: healthProbeSettingsName, - Constraints: []validation.Constraint{{Target: "healthProbeSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.HealthProbeSettingsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, healthProbeSettingsName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client HealthProbeSettingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "healthProbeSettingsName": autorest.Encode("path", healthProbeSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/healthProbeSettings/{healthProbeSettingsName}", 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 HealthProbeSettingsClient) DeleteSender(req *http.Request) (future HealthProbeSettingsDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 HealthProbeSettingsClient) 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 HealthProbeSettings with the specified Rule 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. -// healthProbeSettingsName - name of the health probe settings which is unique within the Front Door. -func (client HealthProbeSettingsClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (result HealthProbeSettingsModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.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: healthProbeSettingsName, - Constraints: []validation.Constraint{{Target: "healthProbeSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.HealthProbeSettingsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, healthProbeSettingsName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "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.HealthProbeSettingsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client HealthProbeSettingsClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "healthProbeSettingsName": autorest.Encode("path", healthProbeSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/healthProbeSettings/{healthProbeSettingsName}", 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 HealthProbeSettingsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client HealthProbeSettingsClient) GetResponder(resp *http.Response) (result HealthProbeSettingsModel, 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 HealthProbeSettings 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 HealthProbeSettingsClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result HealthProbeSettingsListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.ListByFrontDoor") - defer func() { - sc := -1 - if result.hpslr.Response.Response != nil { - sc = result.hpslr.Response.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.HealthProbeSettingsClient", "ListByFrontDoor", err.Error()) - } - - result.fn = client.listByFrontDoorNextResults - req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "ListByFrontDoor", nil, "Failure preparing request") - return - } - - resp, err := client.ListByFrontDoorSender(req) - if err != nil { - result.hpslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "ListByFrontDoor", resp, "Failure sending request") - return - } - - result.hpslr, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "ListByFrontDoor", resp, "Failure responding to request") - } - - return -} - -// ListByFrontDoorPreparer prepares the ListByFrontDoor request. -func (client HealthProbeSettingsClient) 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 = "2019-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}/healthProbeSettings", 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 HealthProbeSettingsClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always -// closes the http.Response Body. -func (client HealthProbeSettingsClient) ListByFrontDoorResponder(resp *http.Response) (result HealthProbeSettingsListResult, 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 HealthProbeSettingsClient) listByFrontDoorNextResults(ctx context.Context, lastResults HealthProbeSettingsListResult) (result HealthProbeSettingsListResult, err error) { - req, err := lastResults.healthProbeSettingsListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "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.HealthProbeSettingsClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. -func (client HealthProbeSettingsClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result HealthProbeSettingsListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.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/preview/frontdoor/mgmt/2019-04-01/frontdoor/loadbalancingsettings.go b/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/loadbalancingsettings.go deleted file mode 100644 index 040beca88828..000000000000 --- a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/loadbalancingsettings.go +++ /dev/null @@ -1,457 +0,0 @@ -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" -) - -// LoadBalancingSettingsClient is the frontDoor Client -type LoadBalancingSettingsClient struct { - BaseClient -} - -// NewLoadBalancingSettingsClient creates an instance of the LoadBalancingSettingsClient client. -func NewLoadBalancingSettingsClient(subscriptionID string) LoadBalancingSettingsClient { - return NewLoadBalancingSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancingSettingsClientWithBaseURI creates an instance of the LoadBalancingSettingsClient client. -func NewLoadBalancingSettingsClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancingSettingsClient { - return LoadBalancingSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a new LoadBalancingSettings with the specified Rule 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. -// loadBalancingSettingsName - name of the load balancing settings which is unique within the Front Door. -// loadBalancingSettingsParameters - loadBalancingSettings properties needed to create a new Front Door. -func (client LoadBalancingSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string, loadBalancingSettingsParameters LoadBalancingSettingsModel) (result LoadBalancingSettingsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.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: loadBalancingSettingsName, - Constraints: []validation.Constraint{{Target: "loadBalancingSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.LoadBalancingSettingsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client LoadBalancingSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string, loadBalancingSettingsParameters LoadBalancingSettingsModel) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "loadBalancingSettingsName": autorest.Encode("path", loadBalancingSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - loadBalancingSettingsParameters.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.Network/frontDoors/{frontDoorName}/loadBalancingSettings/{loadBalancingSettingsName}", pathParameters), - autorest.WithJSON(loadBalancingSettingsParameters), - 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 LoadBalancingSettingsClient) CreateOrUpdateSender(req *http.Request) (future LoadBalancingSettingsCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 LoadBalancingSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result LoadBalancingSettingsModel, 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 LoadBalancingSettings 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. -// loadBalancingSettingsName - name of the load balancing settings which is unique within the Front Door. -func (client LoadBalancingSettingsClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (result LoadBalancingSettingsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.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: loadBalancingSettingsName, - Constraints: []validation.Constraint{{Target: "loadBalancingSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.LoadBalancingSettingsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, loadBalancingSettingsName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client LoadBalancingSettingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "loadBalancingSettingsName": autorest.Encode("path", loadBalancingSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/loadBalancingSettings/{loadBalancingSettingsName}", 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 LoadBalancingSettingsClient) DeleteSender(req *http.Request) (future LoadBalancingSettingsDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 LoadBalancingSettingsClient) 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 LoadBalancingSettings with the specified Rule 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. -// loadBalancingSettingsName - name of the load balancing settings which is unique within the Front Door. -func (client LoadBalancingSettingsClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (result LoadBalancingSettingsModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.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: loadBalancingSettingsName, - Constraints: []validation.Constraint{{Target: "loadBalancingSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.LoadBalancingSettingsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, loadBalancingSettingsName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "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.LoadBalancingSettingsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancingSettingsClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "loadBalancingSettingsName": autorest.Encode("path", loadBalancingSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/loadBalancingSettings/{loadBalancingSettingsName}", 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 LoadBalancingSettingsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancingSettingsClient) GetResponder(resp *http.Response) (result LoadBalancingSettingsModel, 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 LoadBalancingSettings 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 LoadBalancingSettingsClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result LoadBalancingSettingsListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.ListByFrontDoor") - defer func() { - sc := -1 - if result.lbslr.Response.Response != nil { - sc = result.lbslr.Response.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.LoadBalancingSettingsClient", "ListByFrontDoor", err.Error()) - } - - result.fn = client.listByFrontDoorNextResults - req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "ListByFrontDoor", nil, "Failure preparing request") - return - } - - resp, err := client.ListByFrontDoorSender(req) - if err != nil { - result.lbslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "ListByFrontDoor", resp, "Failure sending request") - return - } - - result.lbslr, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "ListByFrontDoor", resp, "Failure responding to request") - } - - return -} - -// ListByFrontDoorPreparer prepares the ListByFrontDoor request. -func (client LoadBalancingSettingsClient) 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 = "2019-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}/loadBalancingSettings", 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 LoadBalancingSettingsClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always -// closes the http.Response Body. -func (client LoadBalancingSettingsClient) ListByFrontDoorResponder(resp *http.Response) (result LoadBalancingSettingsListResult, 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 LoadBalancingSettingsClient) listByFrontDoorNextResults(ctx context.Context, lastResults LoadBalancingSettingsListResult) (result LoadBalancingSettingsListResult, err error) { - req, err := lastResults.loadBalancingSettingsListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "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.LoadBalancingSettingsClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancingSettingsClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result LoadBalancingSettingsListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.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/preview/frontdoor/mgmt/2019-04-01/frontdoor/routingrules.go b/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/routingrules.go deleted file mode 100644 index 5ca30f744308..000000000000 --- a/services/preview/frontdoor/mgmt/2019-04-01/frontdoor/routingrules.go +++ /dev/null @@ -1,457 +0,0 @@ -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" -) - -// RoutingRulesClient is the frontDoor Client -type RoutingRulesClient struct { - BaseClient -} - -// NewRoutingRulesClient creates an instance of the RoutingRulesClient client. -func NewRoutingRulesClient(subscriptionID string) RoutingRulesClient { - return NewRoutingRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRoutingRulesClientWithBaseURI creates an instance of the RoutingRulesClient client. -func NewRoutingRulesClientWithBaseURI(baseURI string, subscriptionID string) RoutingRulesClient { - return RoutingRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a new Routing Rule with the specified Rule 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. -// routingRuleName - name of the Routing Rule which is unique within the Front Door. -// routingRuleParameters - routing Rule properties needed to create a new Front Door. -func (client RoutingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string, routingRuleParameters RoutingRule) (result RoutingRulesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.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: routingRuleName, - Constraints: []validation.Constraint{{Target: "routingRuleName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "routingRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "routingRuleName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.RoutingRulesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, routingRuleName, routingRuleParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RoutingRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string, routingRuleParameters RoutingRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routingRuleName": autorest.Encode("path", routingRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - routingRuleParameters.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.Network/frontDoors/{frontDoorName}/routingRules/{routingRuleName}", pathParameters), - autorest.WithJSON(routingRuleParameters), - 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 RoutingRulesClient) CreateOrUpdateSender(req *http.Request) (future RoutingRulesCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 RoutingRulesClient) CreateOrUpdateResponder(resp *http.Response) (result RoutingRule, 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 Routing Rule 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. -// routingRuleName - name of the Routing Rule which is unique within the Front Door. -func (client RoutingRulesClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (result RoutingRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.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: routingRuleName, - Constraints: []validation.Constraint{{Target: "routingRuleName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "routingRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "routingRuleName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.RoutingRulesClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, routingRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RoutingRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routingRuleName": autorest.Encode("path", routingRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/routingRules/{routingRuleName}", 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 RoutingRulesClient) DeleteSender(req *http.Request) (future RoutingRulesDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 RoutingRulesClient) 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 Routing Rule with the specified Rule 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. -// routingRuleName - name of the Routing Rule which is unique within the Front Door. -func (client RoutingRulesClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (result RoutingRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.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: routingRuleName, - Constraints: []validation.Constraint{{Target: "routingRuleName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "routingRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "routingRuleName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.RoutingRulesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, routingRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "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.RoutingRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client RoutingRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routingRuleName": autorest.Encode("path", routingRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/routingRules/{routingRuleName}", 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 RoutingRulesClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RoutingRulesClient) GetResponder(resp *http.Response) (result RoutingRule, 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 Routing Rules 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 RoutingRulesClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result RoutingRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.ListByFrontDoor") - defer func() { - sc := -1 - if result.rrlr.Response.Response != nil { - sc = result.rrlr.Response.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.RoutingRulesClient", "ListByFrontDoor", err.Error()) - } - - result.fn = client.listByFrontDoorNextResults - req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "ListByFrontDoor", nil, "Failure preparing request") - return - } - - resp, err := client.ListByFrontDoorSender(req) - if err != nil { - result.rrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "ListByFrontDoor", resp, "Failure sending request") - return - } - - result.rrlr, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "ListByFrontDoor", resp, "Failure responding to request") - } - - return -} - -// ListByFrontDoorPreparer prepares the ListByFrontDoor request. -func (client RoutingRulesClient) 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 = "2019-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}/routingRules", 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 RoutingRulesClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always -// closes the http.Response Body. -func (client RoutingRulesClient) ListByFrontDoorResponder(resp *http.Response) (result RoutingRuleListResult, 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 RoutingRulesClient) listByFrontDoorNextResults(ctx context.Context, lastResults RoutingRuleListResult) (result RoutingRuleListResult, err error) { - req, err := lastResults.routingRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "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.RoutingRulesClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. -func (client RoutingRulesClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result RoutingRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.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/preview/frontdoor/mgmt/2019-05-01/frontdoor/backendpools.go b/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/backendpools.go deleted file mode 100644 index e31544da40d5..000000000000 --- a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/backendpools.go +++ /dev/null @@ -1,457 +0,0 @@ -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" -) - -// BackendPoolsClient is the frontDoor Client -type BackendPoolsClient struct { - BaseClient -} - -// NewBackendPoolsClient creates an instance of the BackendPoolsClient client. -func NewBackendPoolsClient(subscriptionID string) BackendPoolsClient { - return NewBackendPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewBackendPoolsClientWithBaseURI creates an instance of the BackendPoolsClient client. -func NewBackendPoolsClientWithBaseURI(baseURI string, subscriptionID string) BackendPoolsClient { - return BackendPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a new Backend Pool with the specified Pool 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. -// backendPoolName - name of the Backend Pool which is unique within the Front Door. -// backendPoolParameters - backend Pool properties needed to create a new Pool. -func (client BackendPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string, backendPoolParameters BackendPool) (result BackendPoolsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.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: backendPoolName, - Constraints: []validation.Constraint{{Target: "backendPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "backendPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendPoolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.BackendPoolsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, backendPoolName, backendPoolParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client BackendPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string, backendPoolParameters BackendPool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendPoolName": autorest.Encode("path", backendPoolName), - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - backendPoolParameters.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.Network/frontDoors/{frontDoorName}/backendPools/{backendPoolName}", pathParameters), - autorest.WithJSON(backendPoolParameters), - 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 BackendPoolsClient) CreateOrUpdateSender(req *http.Request) (future BackendPoolsCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 BackendPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result BackendPool, 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 Backend Pool 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. -// backendPoolName - name of the Backend Pool which is unique within the Front Door. -func (client BackendPoolsClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (result BackendPoolsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.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: backendPoolName, - Constraints: []validation.Constraint{{Target: "backendPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "backendPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendPoolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.BackendPoolsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, backendPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client BackendPoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendPoolName": autorest.Encode("path", backendPoolName), - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/backendPools/{backendPoolName}", 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 BackendPoolsClient) DeleteSender(req *http.Request) (future BackendPoolsDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 BackendPoolsClient) 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 Backend Pool with the specified Pool 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. -// backendPoolName - name of the Backend Pool which is unique within the Front Door. -func (client BackendPoolsClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (result BackendPool, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.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: backendPoolName, - Constraints: []validation.Constraint{{Target: "backendPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "backendPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendPoolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.BackendPoolsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, backendPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "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.BackendPoolsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client BackendPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, backendPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendPoolName": autorest.Encode("path", backendPoolName), - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/backendPools/{backendPoolName}", 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 BackendPoolsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client BackendPoolsClient) GetResponder(resp *http.Response) (result BackendPool, 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 Backend Pools 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 BackendPoolsClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result BackendPoolListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.ListByFrontDoor") - defer func() { - sc := -1 - if result.bplr.Response.Response != nil { - sc = result.bplr.Response.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.BackendPoolsClient", "ListByFrontDoor", err.Error()) - } - - result.fn = client.listByFrontDoorNextResults - req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "ListByFrontDoor", nil, "Failure preparing request") - return - } - - resp, err := client.ListByFrontDoorSender(req) - if err != nil { - result.bplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "ListByFrontDoor", resp, "Failure sending request") - return - } - - result.bplr, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "ListByFrontDoor", resp, "Failure responding to request") - } - - return -} - -// ListByFrontDoorPreparer prepares the ListByFrontDoor request. -func (client BackendPoolsClient) 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 = "2019-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}/backendPools", 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 BackendPoolsClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always -// closes the http.Response Body. -func (client BackendPoolsClient) ListByFrontDoorResponder(resp *http.Response) (result BackendPoolListResult, 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 BackendPoolsClient) listByFrontDoorNextResults(ctx context.Context, lastResults BackendPoolListResult) (result BackendPoolListResult, err error) { - req, err := lastResults.backendPoolListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "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.BackendPoolsClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.BackendPoolsClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. -func (client BackendPoolsClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result BackendPoolListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackendPoolsClient.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/preview/frontdoor/mgmt/2019-05-01/frontdoor/healthprobesettings.go b/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/healthprobesettings.go deleted file mode 100644 index 3174cd47a673..000000000000 --- a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/healthprobesettings.go +++ /dev/null @@ -1,457 +0,0 @@ -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" -) - -// HealthProbeSettingsClient is the frontDoor Client -type HealthProbeSettingsClient struct { - BaseClient -} - -// NewHealthProbeSettingsClient creates an instance of the HealthProbeSettingsClient client. -func NewHealthProbeSettingsClient(subscriptionID string) HealthProbeSettingsClient { - return NewHealthProbeSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewHealthProbeSettingsClientWithBaseURI creates an instance of the HealthProbeSettingsClient client. -func NewHealthProbeSettingsClientWithBaseURI(baseURI string, subscriptionID string) HealthProbeSettingsClient { - return HealthProbeSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a new HealthProbeSettings with the specified Rule 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. -// healthProbeSettingsName - name of the health probe settings which is unique within the Front Door. -// healthProbeSettingsParameters - healthProbeSettings properties needed to create a new Front Door. -func (client HealthProbeSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string, healthProbeSettingsParameters HealthProbeSettingsModel) (result HealthProbeSettingsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.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: healthProbeSettingsName, - Constraints: []validation.Constraint{{Target: "healthProbeSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.HealthProbeSettingsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client HealthProbeSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string, healthProbeSettingsParameters HealthProbeSettingsModel) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "healthProbeSettingsName": autorest.Encode("path", healthProbeSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - healthProbeSettingsParameters.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.Network/frontDoors/{frontDoorName}/healthProbeSettings/{healthProbeSettingsName}", pathParameters), - autorest.WithJSON(healthProbeSettingsParameters), - 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 HealthProbeSettingsClient) CreateOrUpdateSender(req *http.Request) (future HealthProbeSettingsCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 HealthProbeSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result HealthProbeSettingsModel, 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 HealthProbeSettings 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. -// healthProbeSettingsName - name of the health probe settings which is unique within the Front Door. -func (client HealthProbeSettingsClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (result HealthProbeSettingsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.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: healthProbeSettingsName, - Constraints: []validation.Constraint{{Target: "healthProbeSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.HealthProbeSettingsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, healthProbeSettingsName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client HealthProbeSettingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "healthProbeSettingsName": autorest.Encode("path", healthProbeSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/healthProbeSettings/{healthProbeSettingsName}", 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 HealthProbeSettingsClient) DeleteSender(req *http.Request) (future HealthProbeSettingsDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 HealthProbeSettingsClient) 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 HealthProbeSettings with the specified Rule 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. -// healthProbeSettingsName - name of the health probe settings which is unique within the Front Door. -func (client HealthProbeSettingsClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (result HealthProbeSettingsModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.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: healthProbeSettingsName, - Constraints: []validation.Constraint{{Target: "healthProbeSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "healthProbeSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.HealthProbeSettingsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, healthProbeSettingsName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "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.HealthProbeSettingsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client HealthProbeSettingsClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, healthProbeSettingsName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "healthProbeSettingsName": autorest.Encode("path", healthProbeSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/healthProbeSettings/{healthProbeSettingsName}", 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 HealthProbeSettingsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client HealthProbeSettingsClient) GetResponder(resp *http.Response) (result HealthProbeSettingsModel, 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 HealthProbeSettings 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 HealthProbeSettingsClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result HealthProbeSettingsListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.ListByFrontDoor") - defer func() { - sc := -1 - if result.hpslr.Response.Response != nil { - sc = result.hpslr.Response.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.HealthProbeSettingsClient", "ListByFrontDoor", err.Error()) - } - - result.fn = client.listByFrontDoorNextResults - req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "ListByFrontDoor", nil, "Failure preparing request") - return - } - - resp, err := client.ListByFrontDoorSender(req) - if err != nil { - result.hpslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "ListByFrontDoor", resp, "Failure sending request") - return - } - - result.hpslr, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "ListByFrontDoor", resp, "Failure responding to request") - } - - return -} - -// ListByFrontDoorPreparer prepares the ListByFrontDoor request. -func (client HealthProbeSettingsClient) 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 = "2019-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}/healthProbeSettings", 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 HealthProbeSettingsClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always -// closes the http.Response Body. -func (client HealthProbeSettingsClient) ListByFrontDoorResponder(resp *http.Response) (result HealthProbeSettingsListResult, 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 HealthProbeSettingsClient) listByFrontDoorNextResults(ctx context.Context, lastResults HealthProbeSettingsListResult) (result HealthProbeSettingsListResult, err error) { - req, err := lastResults.healthProbeSettingsListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "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.HealthProbeSettingsClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.HealthProbeSettingsClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. -func (client HealthProbeSettingsClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result HealthProbeSettingsListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HealthProbeSettingsClient.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/preview/frontdoor/mgmt/2019-05-01/frontdoor/loadbalancingsettings.go b/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/loadbalancingsettings.go deleted file mode 100644 index 7068baf3e4f3..000000000000 --- a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/loadbalancingsettings.go +++ /dev/null @@ -1,457 +0,0 @@ -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" -) - -// LoadBalancingSettingsClient is the frontDoor Client -type LoadBalancingSettingsClient struct { - BaseClient -} - -// NewLoadBalancingSettingsClient creates an instance of the LoadBalancingSettingsClient client. -func NewLoadBalancingSettingsClient(subscriptionID string) LoadBalancingSettingsClient { - return NewLoadBalancingSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancingSettingsClientWithBaseURI creates an instance of the LoadBalancingSettingsClient client. -func NewLoadBalancingSettingsClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancingSettingsClient { - return LoadBalancingSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a new LoadBalancingSettings with the specified Rule 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. -// loadBalancingSettingsName - name of the load balancing settings which is unique within the Front Door. -// loadBalancingSettingsParameters - loadBalancingSettings properties needed to create a new Front Door. -func (client LoadBalancingSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string, loadBalancingSettingsParameters LoadBalancingSettingsModel) (result LoadBalancingSettingsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.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: loadBalancingSettingsName, - Constraints: []validation.Constraint{{Target: "loadBalancingSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.LoadBalancingSettingsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client LoadBalancingSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string, loadBalancingSettingsParameters LoadBalancingSettingsModel) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "loadBalancingSettingsName": autorest.Encode("path", loadBalancingSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - loadBalancingSettingsParameters.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.Network/frontDoors/{frontDoorName}/loadBalancingSettings/{loadBalancingSettingsName}", pathParameters), - autorest.WithJSON(loadBalancingSettingsParameters), - 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 LoadBalancingSettingsClient) CreateOrUpdateSender(req *http.Request) (future LoadBalancingSettingsCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 LoadBalancingSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result LoadBalancingSettingsModel, 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 LoadBalancingSettings 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. -// loadBalancingSettingsName - name of the load balancing settings which is unique within the Front Door. -func (client LoadBalancingSettingsClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (result LoadBalancingSettingsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.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: loadBalancingSettingsName, - Constraints: []validation.Constraint{{Target: "loadBalancingSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.LoadBalancingSettingsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, loadBalancingSettingsName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client LoadBalancingSettingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "loadBalancingSettingsName": autorest.Encode("path", loadBalancingSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/loadBalancingSettings/{loadBalancingSettingsName}", 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 LoadBalancingSettingsClient) DeleteSender(req *http.Request) (future LoadBalancingSettingsDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 LoadBalancingSettingsClient) 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 LoadBalancingSettings with the specified Rule 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. -// loadBalancingSettingsName - name of the load balancing settings which is unique within the Front Door. -func (client LoadBalancingSettingsClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (result LoadBalancingSettingsModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.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: loadBalancingSettingsName, - Constraints: []validation.Constraint{{Target: "loadBalancingSettingsName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "loadBalancingSettingsName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.LoadBalancingSettingsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, loadBalancingSettingsName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "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.LoadBalancingSettingsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancingSettingsClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, loadBalancingSettingsName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "loadBalancingSettingsName": autorest.Encode("path", loadBalancingSettingsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/loadBalancingSettings/{loadBalancingSettingsName}", 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 LoadBalancingSettingsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancingSettingsClient) GetResponder(resp *http.Response) (result LoadBalancingSettingsModel, 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 LoadBalancingSettings 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 LoadBalancingSettingsClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result LoadBalancingSettingsListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.ListByFrontDoor") - defer func() { - sc := -1 - if result.lbslr.Response.Response != nil { - sc = result.lbslr.Response.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.LoadBalancingSettingsClient", "ListByFrontDoor", err.Error()) - } - - result.fn = client.listByFrontDoorNextResults - req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "ListByFrontDoor", nil, "Failure preparing request") - return - } - - resp, err := client.ListByFrontDoorSender(req) - if err != nil { - result.lbslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "ListByFrontDoor", resp, "Failure sending request") - return - } - - result.lbslr, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "ListByFrontDoor", resp, "Failure responding to request") - } - - return -} - -// ListByFrontDoorPreparer prepares the ListByFrontDoor request. -func (client LoadBalancingSettingsClient) 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 = "2019-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}/loadBalancingSettings", 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 LoadBalancingSettingsClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always -// closes the http.Response Body. -func (client LoadBalancingSettingsClient) ListByFrontDoorResponder(resp *http.Response) (result LoadBalancingSettingsListResult, 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 LoadBalancingSettingsClient) listByFrontDoorNextResults(ctx context.Context, lastResults LoadBalancingSettingsListResult) (result LoadBalancingSettingsListResult, err error) { - req, err := lastResults.loadBalancingSettingsListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "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.LoadBalancingSettingsClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.LoadBalancingSettingsClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancingSettingsClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result LoadBalancingSettingsListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancingSettingsClient.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/preview/frontdoor/mgmt/2019-05-01/frontdoor/routingrules.go b/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/routingrules.go deleted file mode 100644 index bdba08555973..000000000000 --- a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/routingrules.go +++ /dev/null @@ -1,457 +0,0 @@ -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" -) - -// RoutingRulesClient is the frontDoor Client -type RoutingRulesClient struct { - BaseClient -} - -// NewRoutingRulesClient creates an instance of the RoutingRulesClient client. -func NewRoutingRulesClient(subscriptionID string) RoutingRulesClient { - return NewRoutingRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRoutingRulesClientWithBaseURI creates an instance of the RoutingRulesClient client. -func NewRoutingRulesClientWithBaseURI(baseURI string, subscriptionID string) RoutingRulesClient { - return RoutingRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a new Routing Rule with the specified Rule 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. -// routingRuleName - name of the Routing Rule which is unique within the Front Door. -// routingRuleParameters - routing Rule properties needed to create a new Front Door. -func (client RoutingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string, routingRuleParameters RoutingRule) (result RoutingRulesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.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: routingRuleName, - Constraints: []validation.Constraint{{Target: "routingRuleName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "routingRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "routingRuleName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.RoutingRulesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, routingRuleName, routingRuleParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RoutingRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string, routingRuleParameters RoutingRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routingRuleName": autorest.Encode("path", routingRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - routingRuleParameters.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.Network/frontDoors/{frontDoorName}/routingRules/{routingRuleName}", pathParameters), - autorest.WithJSON(routingRuleParameters), - 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 RoutingRulesClient) CreateOrUpdateSender(req *http.Request) (future RoutingRulesCreateOrUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 RoutingRulesClient) CreateOrUpdateResponder(resp *http.Response) (result RoutingRule, 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 Routing Rule 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. -// routingRuleName - name of the Routing Rule which is unique within the Front Door. -func (client RoutingRulesClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (result RoutingRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.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: routingRuleName, - Constraints: []validation.Constraint{{Target: "routingRuleName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "routingRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "routingRuleName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.RoutingRulesClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, routingRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RoutingRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routingRuleName": autorest.Encode("path", routingRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/routingRules/{routingRuleName}", 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 RoutingRulesClient) DeleteSender(req *http.Request) (future RoutingRulesDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 RoutingRulesClient) 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 Routing Rule with the specified Rule 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. -// routingRuleName - name of the Routing Rule which is unique within the Front Door. -func (client RoutingRulesClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (result RoutingRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.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: routingRuleName, - Constraints: []validation.Constraint{{Target: "routingRuleName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "routingRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "routingRuleName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("frontdoor.RoutingRulesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, routingRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "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.RoutingRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client RoutingRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, routingRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontDoorName": autorest.Encode("path", frontDoorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routingRuleName": autorest.Encode("path", routingRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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}/routingRules/{routingRuleName}", 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 RoutingRulesClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RoutingRulesClient) GetResponder(resp *http.Response) (result RoutingRule, 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 Routing Rules 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 RoutingRulesClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result RoutingRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.ListByFrontDoor") - defer func() { - sc := -1 - if result.rrlr.Response.Response != nil { - sc = result.rrlr.Response.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.RoutingRulesClient", "ListByFrontDoor", err.Error()) - } - - result.fn = client.listByFrontDoorNextResults - req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "ListByFrontDoor", nil, "Failure preparing request") - return - } - - resp, err := client.ListByFrontDoorSender(req) - if err != nil { - result.rrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "ListByFrontDoor", resp, "Failure sending request") - return - } - - result.rrlr, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "ListByFrontDoor", resp, "Failure responding to request") - } - - return -} - -// ListByFrontDoorPreparer prepares the ListByFrontDoor request. -func (client RoutingRulesClient) 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 = "2019-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}/routingRules", 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 RoutingRulesClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always -// closes the http.Response Body. -func (client RoutingRulesClient) ListByFrontDoorResponder(resp *http.Response) (result RoutingRuleListResult, 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 RoutingRulesClient) listByFrontDoorNextResults(ctx context.Context, lastResults RoutingRuleListResult) (result RoutingRuleListResult, err error) { - req, err := lastResults.routingRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "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.RoutingRulesClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByFrontDoorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.RoutingRulesClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. -func (client RoutingRulesClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result RoutingRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingRulesClient.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/preview/portal/mgmt/2015-11-01-preview/portal/client.go b/services/preview/logic/mgmt/2019-05-01/logic/client.go similarity index 83% rename from services/preview/portal/mgmt/2015-11-01-preview/portal/client.go rename to services/preview/logic/mgmt/2019-05-01/logic/client.go index 80937e565568..4266e5986969 100644 --- a/services/preview/portal/mgmt/2015-11-01-preview/portal/client.go +++ b/services/preview/logic/mgmt/2019-05-01/logic/client.go @@ -1,7 +1,7 @@ -// Package portal implements the Azure ARM Portal service API version 2015-11-01-preview. +// Package logic implements the Azure ARM Logic service API version 2019-05-01. // -// Allows creation and deletion of Azure Shared Dashboards. -package portal +// REST API for Azure Logic Apps. +package logic // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,11 +25,11 @@ import ( ) const ( - // DefaultBaseURI is the default URI used for the service Portal + // DefaultBaseURI is the default URI used for the service Logic DefaultBaseURI = "https://management.azure.com" ) -// BaseClient is the base client for Portal. +// BaseClient is the base client for Logic. type BaseClient struct { autorest.Client BaseURI string diff --git a/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountagreements.go b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountagreements.go new file mode 100644 index 000000000000..374a72298509 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountagreements.go @@ -0,0 +1,921 @@ +package logic + +// 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" +) + +// IntegrationAccountAgreementsClient is the REST API for Azure Logic Apps. +type IntegrationAccountAgreementsClient struct { + BaseClient +} + +// NewIntegrationAccountAgreementsClient creates an instance of the IntegrationAccountAgreementsClient client. +func NewIntegrationAccountAgreementsClient(subscriptionID string) IntegrationAccountAgreementsClient { + return NewIntegrationAccountAgreementsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationAccountAgreementsClientWithBaseURI creates an instance of the IntegrationAccountAgreementsClient +// client. +func NewIntegrationAccountAgreementsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountAgreementsClient { + return IntegrationAccountAgreementsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an integration account agreement. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// agreementName - the integration account agreement name. +// agreement - the integration account agreement. +func (client IntegrationAccountAgreementsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, agreementName string, agreement IntegrationAccountAgreement) (result IntegrationAccountAgreement, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountAgreementsClient.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: agreement, + Constraints: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.HostPartner", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.GuestPartner", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.HostIdentity", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.HostIdentity.Qualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.HostIdentity.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.GuestIdentity", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.GuestIdentity.Qualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.GuestIdentity.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.SenderBusinessIdentity", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.SenderBusinessIdentity.Qualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.SenderBusinessIdentity.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ReceiverBusinessIdentity", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ReceiverBusinessIdentity.Qualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ReceiverBusinessIdentity.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.MessageConnectionSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.MessageConnectionSettings.IgnoreCertificateNameMismatch", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.MessageConnectionSettings.SupportHTTPStatusCodeContinue", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.MessageConnectionSettings.KeepHTTPConnectionAlive", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.MessageConnectionSettings.UnfoldHTTPHeaders", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.AcknowledgementConnectionSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.AcknowledgementConnectionSettings.IgnoreCertificateNameMismatch", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.AcknowledgementConnectionSettings.SupportHTTPStatusCodeContinue", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.AcknowledgementConnectionSettings.KeepHTTPConnectionAlive", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.AcknowledgementConnectionSettings.UnfoldHTTPHeaders", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.MdnSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.MdnSettings.NeedMDN", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.MdnSettings.SignMDN", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.MdnSettings.SendMDNAsynchronously", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.MdnSettings.SignOutboundMDNIfOptional", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.MdnSettings.SendInboundMDNToMessageBox", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.SecuritySettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.SecuritySettings.OverrideGroupSigningCertificate", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.SecuritySettings.EnableNRRForInboundEncodedMessages", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.SecuritySettings.EnableNRRForInboundDecodedMessages", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.SecuritySettings.EnableNRRForOutboundMDN", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.SecuritySettings.EnableNRRForOutboundEncodedMessages", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.SecuritySettings.EnableNRRForOutboundDecodedMessages", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.SecuritySettings.EnableNRRForInboundMDN", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.ValidationSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.ValidationSettings.OverrideMessageProperties", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.ValidationSettings.EncryptMessage", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.ValidationSettings.SignMessage", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.ValidationSettings.CompressMessage", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.ValidationSettings.CheckDuplicateMessage", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.ValidationSettings.InterchangeDuplicatesValidityDays", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.ValidationSettings.CheckCertificateRevocationListOnSend", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.ValidationSettings.CheckCertificateRevocationListOnReceive", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.EnvelopeSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.MessageContentType", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.TransmitFileNameInMimeHeader", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.FileNameTemplate", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.SuspendMessageOnFileNameGenerationError", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.AutogenerateFileName", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.ErrorSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.ErrorSettings.SuspendDuplicateMessage", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.ReceiveAgreement.ProtocolSettings.ErrorSettings.ResendIfMDNNotReceived", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.SenderBusinessIdentity", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.SenderBusinessIdentity.Qualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.SenderBusinessIdentity.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ReceiverBusinessIdentity", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ReceiverBusinessIdentity.Qualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ReceiverBusinessIdentity.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.MessageConnectionSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.MessageConnectionSettings.IgnoreCertificateNameMismatch", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.MessageConnectionSettings.SupportHTTPStatusCodeContinue", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.MessageConnectionSettings.KeepHTTPConnectionAlive", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.MessageConnectionSettings.UnfoldHTTPHeaders", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.AcknowledgementConnectionSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.AcknowledgementConnectionSettings.IgnoreCertificateNameMismatch", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.AcknowledgementConnectionSettings.SupportHTTPStatusCodeContinue", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.AcknowledgementConnectionSettings.KeepHTTPConnectionAlive", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.AcknowledgementConnectionSettings.UnfoldHTTPHeaders", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.MdnSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.MdnSettings.NeedMDN", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.MdnSettings.SignMDN", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.MdnSettings.SendMDNAsynchronously", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.MdnSettings.SignOutboundMDNIfOptional", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.MdnSettings.SendInboundMDNToMessageBox", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.SecuritySettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.SecuritySettings.OverrideGroupSigningCertificate", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.SecuritySettings.EnableNRRForInboundEncodedMessages", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.SecuritySettings.EnableNRRForInboundDecodedMessages", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.SecuritySettings.EnableNRRForOutboundMDN", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.SecuritySettings.EnableNRRForOutboundEncodedMessages", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.SecuritySettings.EnableNRRForOutboundDecodedMessages", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.SecuritySettings.EnableNRRForInboundMDN", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.ValidationSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.ValidationSettings.OverrideMessageProperties", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.ValidationSettings.EncryptMessage", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.ValidationSettings.SignMessage", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.ValidationSettings.CompressMessage", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.ValidationSettings.CheckDuplicateMessage", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.ValidationSettings.InterchangeDuplicatesValidityDays", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.ValidationSettings.CheckCertificateRevocationListOnSend", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.ValidationSettings.CheckCertificateRevocationListOnReceive", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.EnvelopeSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.EnvelopeSettings.MessageContentType", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.EnvelopeSettings.TransmitFileNameInMimeHeader", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.EnvelopeSettings.FileNameTemplate", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.EnvelopeSettings.SuspendMessageOnFileNameGenerationError", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.EnvelopeSettings.AutogenerateFileName", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.ErrorSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.ErrorSettings.SuspendDuplicateMessage", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.AS2.SendAgreement.ProtocolSettings.ErrorSettings.ResendIfMDNNotReceived", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.SenderBusinessIdentity", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.SenderBusinessIdentity.Qualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.SenderBusinessIdentity.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ReceiverBusinessIdentity", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ReceiverBusinessIdentity.Qualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ReceiverBusinessIdentity.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ValidationSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ValidationSettings.ValidateCharacterSet", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ValidationSettings.CheckDuplicateInterchangeControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ValidationSettings.InterchangeControlNumberValidityDays", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ValidationSettings.CheckDuplicateGroupControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ValidationSettings.CheckDuplicateTransactionSetControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ValidationSettings.ValidateEDITypes", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ValidationSettings.ValidateXSDTypes", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ValidationSettings.AllowLeadingAndTrailingSpacesAndZeroes", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ValidationSettings.TrimLeadingAndTrailingSpacesAndZeroes", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.FramingSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.FramingSettings.DataElementSeparator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.FramingSettings.ComponentSeparator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.FramingSettings.ReplaceSeparatorsInPayload", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.FramingSettings.ReplaceCharacter", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.FramingSettings.SegmentTerminator", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.ControlStandardsID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.UseControlStandardsIDAsRepetitionCharacter", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.SenderApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.ReceiverApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.ControlVersionNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.InterchangeControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.InterchangeControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.RolloverInterchangeControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.EnableDefaultGroupHeaders", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.GroupControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.GroupControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.RolloverGroupControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.GroupHeaderAgencyCode", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.GroupHeaderVersion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.TransactionSetControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.TransactionSetControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.RolloverTransactionSetControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.OverwriteExistingTransactionSetControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.NeedTechnicalAcknowledgement", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.BatchTechnicalAcknowledgements", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.NeedFunctionalAcknowledgement", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.BatchFunctionalAcknowledgements", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.NeedImplementationAcknowledgement", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.BatchImplementationAcknowledgements", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.NeedLoopForValidMessages", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.SendSynchronousAcknowledgement", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.AcknowledgementControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.AcknowledgementControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.RolloverAcknowledgementControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.MessageFilter", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.SecuritySettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.SecuritySettings.AuthorizationQualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.SecuritySettings.SecurityQualifier", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ProcessingSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ProcessingSettings.MaskSecurityInfo", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ProcessingSettings.ConvertImpliedDecimal", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ProcessingSettings.PreserveInterchange", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ProcessingSettings.SuspendInterchangeOnError", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ProcessingSettings.CreateEmptyXMLTagsForTrailingSeparators", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.ProcessingSettings.UseDotAsDecimalSeparator", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.ReceiveAgreement.ProtocolSettings.SchemaReferences", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.SenderBusinessIdentity", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.SenderBusinessIdentity.Qualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.SenderBusinessIdentity.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ReceiverBusinessIdentity", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ReceiverBusinessIdentity.Qualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ReceiverBusinessIdentity.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ValidationSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ValidationSettings.ValidateCharacterSet", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ValidationSettings.CheckDuplicateInterchangeControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ValidationSettings.InterchangeControlNumberValidityDays", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ValidationSettings.CheckDuplicateGroupControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ValidationSettings.CheckDuplicateTransactionSetControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ValidationSettings.ValidateEDITypes", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ValidationSettings.ValidateXSDTypes", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ValidationSettings.AllowLeadingAndTrailingSpacesAndZeroes", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ValidationSettings.TrimLeadingAndTrailingSpacesAndZeroes", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.FramingSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.FramingSettings.DataElementSeparator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.FramingSettings.ComponentSeparator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.FramingSettings.ReplaceSeparatorsInPayload", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.FramingSettings.ReplaceCharacter", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.FramingSettings.SegmentTerminator", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.ControlStandardsID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.UseControlStandardsIDAsRepetitionCharacter", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.SenderApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.ReceiverApplicationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.ControlVersionNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.InterchangeControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.InterchangeControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.RolloverInterchangeControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.EnableDefaultGroupHeaders", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.GroupControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.GroupControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.RolloverGroupControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.GroupHeaderAgencyCode", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.GroupHeaderVersion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.TransactionSetControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.TransactionSetControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.RolloverTransactionSetControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.EnvelopeSettings.OverwriteExistingTransactionSetControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.AcknowledgementSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.AcknowledgementSettings.NeedTechnicalAcknowledgement", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.AcknowledgementSettings.BatchTechnicalAcknowledgements", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.AcknowledgementSettings.NeedFunctionalAcknowledgement", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.AcknowledgementSettings.BatchFunctionalAcknowledgements", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.AcknowledgementSettings.NeedImplementationAcknowledgement", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.AcknowledgementSettings.BatchImplementationAcknowledgements", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.AcknowledgementSettings.NeedLoopForValidMessages", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.AcknowledgementSettings.SendSynchronousAcknowledgement", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.AcknowledgementSettings.AcknowledgementControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.AcknowledgementSettings.AcknowledgementControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.AcknowledgementSettings.RolloverAcknowledgementControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.MessageFilter", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.SecuritySettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.SecuritySettings.AuthorizationQualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.SecuritySettings.SecurityQualifier", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ProcessingSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ProcessingSettings.MaskSecurityInfo", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ProcessingSettings.ConvertImpliedDecimal", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ProcessingSettings.PreserveInterchange", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ProcessingSettings.SuspendInterchangeOnError", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ProcessingSettings.CreateEmptyXMLTagsForTrailingSeparators", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.ProcessingSettings.UseDotAsDecimalSeparator", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.X12.SendAgreement.ProtocolSettings.SchemaReferences", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.SenderBusinessIdentity", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.SenderBusinessIdentity.Qualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.SenderBusinessIdentity.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ReceiverBusinessIdentity", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ReceiverBusinessIdentity.Qualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ReceiverBusinessIdentity.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ValidationSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ValidationSettings.ValidateCharacterSet", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ValidationSettings.CheckDuplicateInterchangeControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ValidationSettings.InterchangeControlNumberValidityDays", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ValidationSettings.CheckDuplicateGroupControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ValidationSettings.CheckDuplicateTransactionSetControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ValidationSettings.ValidateEDITypes", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ValidationSettings.ValidateXSDTypes", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ValidationSettings.AllowLeadingAndTrailingSpacesAndZeroes", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ValidationSettings.TrimLeadingAndTrailingSpacesAndZeroes", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.FramingSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.FramingSettings.ProtocolVersion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.FramingSettings.DataElementSeparator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.FramingSettings.ComponentSeparator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.FramingSettings.SegmentTerminator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.FramingSettings.ReleaseIndicator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.FramingSettings.RepetitionSeparator", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.ApplyDelimiterStringAdvice", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.CreateGroupingSegments", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.EnableDefaultGroupHeaders", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.InterchangeControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.InterchangeControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.RolloverInterchangeControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.GroupControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.GroupControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.RolloverGroupControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.OverwriteExistingTransactionSetControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.TransactionSetControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.TransactionSetControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.RolloverTransactionSetControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.EnvelopeSettings.IsTestInterchange", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.NeedTechnicalAcknowledgement", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.BatchTechnicalAcknowledgements", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.NeedFunctionalAcknowledgement", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.BatchFunctionalAcknowledgements", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.NeedLoopForValidMessages", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.SendSynchronousAcknowledgement", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.AcknowledgementControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.AcknowledgementControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.AcknowledgementSettings.RolloverAcknowledgementControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.MessageFilter", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ProcessingSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ProcessingSettings.MaskSecurityInfo", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ProcessingSettings.PreserveInterchange", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ProcessingSettings.SuspendInterchangeOnError", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ProcessingSettings.CreateEmptyXMLTagsForTrailingSeparators", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.ProcessingSettings.UseDotAsDecimalSeparator", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.ReceiveAgreement.ProtocolSettings.SchemaReferences", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.SenderBusinessIdentity", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.SenderBusinessIdentity.Qualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.SenderBusinessIdentity.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ReceiverBusinessIdentity", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ReceiverBusinessIdentity.Qualifier", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ReceiverBusinessIdentity.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ValidationSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ValidationSettings.ValidateCharacterSet", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ValidationSettings.CheckDuplicateInterchangeControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ValidationSettings.InterchangeControlNumberValidityDays", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ValidationSettings.CheckDuplicateGroupControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ValidationSettings.CheckDuplicateTransactionSetControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ValidationSettings.ValidateEDITypes", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ValidationSettings.ValidateXSDTypes", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ValidationSettings.AllowLeadingAndTrailingSpacesAndZeroes", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ValidationSettings.TrimLeadingAndTrailingSpacesAndZeroes", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.FramingSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.FramingSettings.ProtocolVersion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.FramingSettings.DataElementSeparator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.FramingSettings.ComponentSeparator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.FramingSettings.SegmentTerminator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.FramingSettings.ReleaseIndicator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.FramingSettings.RepetitionSeparator", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings.ApplyDelimiterStringAdvice", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings.CreateGroupingSegments", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings.EnableDefaultGroupHeaders", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings.InterchangeControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings.InterchangeControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings.RolloverInterchangeControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings.GroupControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings.GroupControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings.RolloverGroupControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings.OverwriteExistingTransactionSetControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings.TransactionSetControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings.TransactionSetControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings.RolloverTransactionSetControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.EnvelopeSettings.IsTestInterchange", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.AcknowledgementSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.AcknowledgementSettings.NeedTechnicalAcknowledgement", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.AcknowledgementSettings.BatchTechnicalAcknowledgements", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.AcknowledgementSettings.NeedFunctionalAcknowledgement", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.AcknowledgementSettings.BatchFunctionalAcknowledgements", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.AcknowledgementSettings.NeedLoopForValidMessages", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.AcknowledgementSettings.SendSynchronousAcknowledgement", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.AcknowledgementSettings.AcknowledgementControlNumberLowerBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.AcknowledgementSettings.AcknowledgementControlNumberUpperBound", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.AcknowledgementSettings.RolloverAcknowledgementControlNumber", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.MessageFilter", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ProcessingSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ProcessingSettings.MaskSecurityInfo", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ProcessingSettings.PreserveInterchange", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ProcessingSettings.SuspendInterchangeOnError", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ProcessingSettings.CreateEmptyXMLTagsForTrailingSeparators", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.ProcessingSettings.UseDotAsDecimalSeparator", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "agreement.IntegrationAccountAgreementProperties.Content.Edifact.SendAgreement.ProtocolSettings.SchemaReferences", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("logic.IntegrationAccountAgreementsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, integrationAccountName, agreementName, agreement) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IntegrationAccountAgreementsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, agreementName string, agreement IntegrationAccountAgreement) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agreementName": autorest.Encode("path", agreementName), + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}", pathParameters), + autorest.WithJSON(agreement), + 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 IntegrationAccountAgreementsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IntegrationAccountAgreementsClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationAccountAgreement, 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 integration account agreement. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// agreementName - the integration account agreement name. +func (client IntegrationAccountAgreementsClient) Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, agreementName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountAgreementsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, integrationAccountName, agreementName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationAccountAgreementsClient) DeletePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, agreementName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agreementName": autorest.Encode("path", agreementName), + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}", 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 IntegrationAccountAgreementsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IntegrationAccountAgreementsClient) 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 integration account agreement. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// agreementName - the integration account agreement name. +func (client IntegrationAccountAgreementsClient) Get(ctx context.Context, resourceGroupName string, integrationAccountName string, agreementName string) (result IntegrationAccountAgreement, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountAgreementsClient.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, integrationAccountName, agreementName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationAccountAgreementsClient) GetPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, agreementName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agreementName": autorest.Encode("path", agreementName), + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/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 IntegrationAccountAgreementsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IntegrationAccountAgreementsClient) GetResponder(resp *http.Response) (result IntegrationAccountAgreement, 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 integration account agreements. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// top - the number of items to be included in the result. +// filter - the filter to apply on the operation. Options for filters include: AgreementType. +func (client IntegrationAccountAgreementsClient) List(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountAgreementListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountAgreementsClient.List") + defer func() { + sc := -1 + if result.iaalr.Response.Response != nil { + sc = result.iaalr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, integrationAccountName, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.iaalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "List", resp, "Failure sending request") + return + } + + result.iaalr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IntegrationAccountAgreementsClient) ListPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + 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.Logic/integrationAccounts/{integrationAccountName}/agreements", 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 IntegrationAccountAgreementsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IntegrationAccountAgreementsClient) ListResponder(resp *http.Response) (result IntegrationAccountAgreementListResult, 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 IntegrationAccountAgreementsClient) listNextResults(ctx context.Context, lastResults IntegrationAccountAgreementListResult) (result IntegrationAccountAgreementListResult, err error) { + req, err := lastResults.integrationAccountAgreementListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "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, "logic.IntegrationAccountAgreementsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationAccountAgreementsClient) ListComplete(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountAgreementListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountAgreementsClient.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, integrationAccountName, top, filter) + return +} + +// ListContentCallbackURL get the content callback url. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// agreementName - the integration account agreement name. +func (client IntegrationAccountAgreementsClient) ListContentCallbackURL(ctx context.Context, resourceGroupName string, integrationAccountName string, agreementName string, listContentCallbackURL GetCallbackURLParameters) (result WorkflowTriggerCallbackURL, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountAgreementsClient.ListContentCallbackURL") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListContentCallbackURLPreparer(ctx, resourceGroupName, integrationAccountName, agreementName, listContentCallbackURL) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "ListContentCallbackURL", nil, "Failure preparing request") + return + } + + resp, err := client.ListContentCallbackURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "ListContentCallbackURL", resp, "Failure sending request") + return + } + + result, err = client.ListContentCallbackURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "ListContentCallbackURL", resp, "Failure responding to request") + } + + return +} + +// ListContentCallbackURLPreparer prepares the ListContentCallbackURL request. +func (client IntegrationAccountAgreementsClient) ListContentCallbackURLPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, agreementName string, listContentCallbackURL GetCallbackURLParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agreementName": autorest.Encode("path", agreementName), + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}/listContentCallbackUrl", pathParameters), + autorest.WithJSON(listContentCallbackURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListContentCallbackURLSender sends the ListContentCallbackURL request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationAccountAgreementsClient) ListContentCallbackURLSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListContentCallbackURLResponder handles the response to the ListContentCallbackURL request. The method always +// closes the http.Response Body. +func (client IntegrationAccountAgreementsClient) ListContentCallbackURLResponder(resp *http.Response) (result WorkflowTriggerCallbackURL, 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/logic/mgmt/2019-05-01/logic/integrationaccountassemblies.go b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountassemblies.go new file mode 100644 index 000000000000..18d6f53958c0 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountassemblies.go @@ -0,0 +1,445 @@ +package logic + +// 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" +) + +// IntegrationAccountAssembliesClient is the REST API for Azure Logic Apps. +type IntegrationAccountAssembliesClient struct { + BaseClient +} + +// NewIntegrationAccountAssembliesClient creates an instance of the IntegrationAccountAssembliesClient client. +func NewIntegrationAccountAssembliesClient(subscriptionID string) IntegrationAccountAssembliesClient { + return NewIntegrationAccountAssembliesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationAccountAssembliesClientWithBaseURI creates an instance of the IntegrationAccountAssembliesClient +// client. +func NewIntegrationAccountAssembliesClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountAssembliesClient { + return IntegrationAccountAssembliesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update an assembly for an integration account. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// assemblyArtifactName - the assembly artifact name. +// assemblyArtifact - the assembly artifact. +func (client IntegrationAccountAssembliesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, assemblyArtifactName string, assemblyArtifact AssemblyDefinition) (result AssemblyDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountAssembliesClient.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: assemblyArtifact, + Constraints: []validation.Constraint{{Target: "assemblyArtifact.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "assemblyArtifact.Properties.AssemblyName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("logic.IntegrationAccountAssembliesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, integrationAccountName, assemblyArtifactName, assemblyArtifact) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IntegrationAccountAssembliesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, assemblyArtifactName string, assemblyArtifact AssemblyDefinition) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assemblyArtifactName": autorest.Encode("path", assemblyArtifactName), + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}", pathParameters), + autorest.WithJSON(assemblyArtifact), + 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 IntegrationAccountAssembliesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IntegrationAccountAssembliesClient) CreateOrUpdateResponder(resp *http.Response) (result AssemblyDefinition, 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 assembly for an integration account. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// assemblyArtifactName - the assembly artifact name. +func (client IntegrationAccountAssembliesClient) Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, assemblyArtifactName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountAssembliesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, integrationAccountName, assemblyArtifactName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationAccountAssembliesClient) DeletePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, assemblyArtifactName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assemblyArtifactName": autorest.Encode("path", assemblyArtifactName), + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}", 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 IntegrationAccountAssembliesClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IntegrationAccountAssembliesClient) 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 assembly for an integration account. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// assemblyArtifactName - the assembly artifact name. +func (client IntegrationAccountAssembliesClient) Get(ctx context.Context, resourceGroupName string, integrationAccountName string, assemblyArtifactName string) (result AssemblyDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountAssembliesClient.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, integrationAccountName, assemblyArtifactName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationAccountAssembliesClient) GetPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, assemblyArtifactName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assemblyArtifactName": autorest.Encode("path", assemblyArtifactName), + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}", 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 IntegrationAccountAssembliesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IntegrationAccountAssembliesClient) GetResponder(resp *http.Response) (result AssemblyDefinition, 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 the assemblies for an integration account. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +func (client IntegrationAccountAssembliesClient) List(ctx context.Context, resourceGroupName string, integrationAccountName string) (result AssemblyCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountAssembliesClient.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, integrationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IntegrationAccountAssembliesClient) ListPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/assemblies", 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 IntegrationAccountAssembliesClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IntegrationAccountAssembliesClient) ListResponder(resp *http.Response) (result AssemblyCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListContentCallbackURL get the content callback url for an integration account assembly. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// assemblyArtifactName - the assembly artifact name. +func (client IntegrationAccountAssembliesClient) ListContentCallbackURL(ctx context.Context, resourceGroupName string, integrationAccountName string, assemblyArtifactName string) (result WorkflowTriggerCallbackURL, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountAssembliesClient.ListContentCallbackURL") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListContentCallbackURLPreparer(ctx, resourceGroupName, integrationAccountName, assemblyArtifactName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "ListContentCallbackURL", nil, "Failure preparing request") + return + } + + resp, err := client.ListContentCallbackURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "ListContentCallbackURL", resp, "Failure sending request") + return + } + + result, err = client.ListContentCallbackURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAssembliesClient", "ListContentCallbackURL", resp, "Failure responding to request") + } + + return +} + +// ListContentCallbackURLPreparer prepares the ListContentCallbackURL request. +func (client IntegrationAccountAssembliesClient) ListContentCallbackURLPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, assemblyArtifactName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assemblyArtifactName": autorest.Encode("path", assemblyArtifactName), + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}/listContentCallbackUrl", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListContentCallbackURLSender sends the ListContentCallbackURL request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationAccountAssembliesClient) ListContentCallbackURLSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListContentCallbackURLResponder handles the response to the ListContentCallbackURL request. The method always +// closes the http.Response Body. +func (client IntegrationAccountAssembliesClient) ListContentCallbackURLResponder(resp *http.Response) (result WorkflowTriggerCallbackURL, 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/logic/mgmt/2019-05-01/logic/integrationaccountbatchconfigurations.go b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountbatchconfigurations.go new file mode 100644 index 000000000000..406f145f0165 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountbatchconfigurations.go @@ -0,0 +1,369 @@ +package logic + +// 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" +) + +// IntegrationAccountBatchConfigurationsClient is the REST API for Azure Logic Apps. +type IntegrationAccountBatchConfigurationsClient struct { + BaseClient +} + +// NewIntegrationAccountBatchConfigurationsClient creates an instance of the +// IntegrationAccountBatchConfigurationsClient client. +func NewIntegrationAccountBatchConfigurationsClient(subscriptionID string) IntegrationAccountBatchConfigurationsClient { + return NewIntegrationAccountBatchConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationAccountBatchConfigurationsClientWithBaseURI creates an instance of the +// IntegrationAccountBatchConfigurationsClient client. +func NewIntegrationAccountBatchConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountBatchConfigurationsClient { + return IntegrationAccountBatchConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a batch configuration for an integration account. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// batchConfigurationName - the batch configuration name. +// batchConfiguration - the batch configuration. +func (client IntegrationAccountBatchConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, batchConfigurationName string, batchConfiguration BatchConfiguration) (result BatchConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountBatchConfigurationsClient.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: batchConfiguration, + Constraints: []validation.Constraint{{Target: "batchConfiguration.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "batchConfiguration.Properties.BatchGroupName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "batchConfiguration.Properties.ReleaseCriteria", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("logic.IntegrationAccountBatchConfigurationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, integrationAccountName, batchConfigurationName, batchConfiguration) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountBatchConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountBatchConfigurationsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountBatchConfigurationsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IntegrationAccountBatchConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, batchConfigurationName string, batchConfiguration BatchConfiguration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "batchConfigurationName": autorest.Encode("path", batchConfigurationName), + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}", pathParameters), + autorest.WithJSON(batchConfiguration), + 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 IntegrationAccountBatchConfigurationsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IntegrationAccountBatchConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result BatchConfiguration, 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 batch configuration for an integration account. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// batchConfigurationName - the batch configuration name. +func (client IntegrationAccountBatchConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, batchConfigurationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountBatchConfigurationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, integrationAccountName, batchConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountBatchConfigurationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountBatchConfigurationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountBatchConfigurationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationAccountBatchConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, batchConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "batchConfigurationName": autorest.Encode("path", batchConfigurationName), + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}", 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 IntegrationAccountBatchConfigurationsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IntegrationAccountBatchConfigurationsClient) 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 batch configuration for an integration account. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// batchConfigurationName - the batch configuration name. +func (client IntegrationAccountBatchConfigurationsClient) Get(ctx context.Context, resourceGroupName string, integrationAccountName string, batchConfigurationName string) (result BatchConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountBatchConfigurationsClient.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, integrationAccountName, batchConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountBatchConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountBatchConfigurationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountBatchConfigurationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationAccountBatchConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, batchConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "batchConfigurationName": autorest.Encode("path", batchConfigurationName), + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}", 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 IntegrationAccountBatchConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IntegrationAccountBatchConfigurationsClient) GetResponder(resp *http.Response) (result BatchConfiguration, 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 the batch configurations for an integration account. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +func (client IntegrationAccountBatchConfigurationsClient) List(ctx context.Context, resourceGroupName string, integrationAccountName string) (result BatchConfigurationCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountBatchConfigurationsClient.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, integrationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountBatchConfigurationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountBatchConfigurationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountBatchConfigurationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IntegrationAccountBatchConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations", 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 IntegrationAccountBatchConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IntegrationAccountBatchConfigurationsClient) ListResponder(resp *http.Response) (result BatchConfigurationCollection, 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/logic/mgmt/2019-05-01/logic/integrationaccountcertificates.go b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountcertificates.go new file mode 100644 index 000000000000..64c787e6bd7a --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountcertificates.go @@ -0,0 +1,412 @@ +package logic + +// 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" +) + +// IntegrationAccountCertificatesClient is the REST API for Azure Logic Apps. +type IntegrationAccountCertificatesClient struct { + BaseClient +} + +// NewIntegrationAccountCertificatesClient creates an instance of the IntegrationAccountCertificatesClient client. +func NewIntegrationAccountCertificatesClient(subscriptionID string) IntegrationAccountCertificatesClient { + return NewIntegrationAccountCertificatesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationAccountCertificatesClientWithBaseURI creates an instance of the IntegrationAccountCertificatesClient +// client. +func NewIntegrationAccountCertificatesClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountCertificatesClient { + return IntegrationAccountCertificatesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an integration account certificate. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// certificateName - the integration account certificate name. +// certificate - the integration account certificate. +func (client IntegrationAccountCertificatesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, certificateName string, certificate IntegrationAccountCertificate) (result IntegrationAccountCertificate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountCertificatesClient.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: certificate, + Constraints: []validation.Constraint{{Target: "certificate.IntegrationAccountCertificateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "certificate.IntegrationAccountCertificateProperties.Key", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "certificate.IntegrationAccountCertificateProperties.Key.KeyVault", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "certificate.IntegrationAccountCertificateProperties.Key.KeyName", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("logic.IntegrationAccountCertificatesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, integrationAccountName, certificateName, certificate) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IntegrationAccountCertificatesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, certificateName string, certificate IntegrationAccountCertificate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateName": autorest.Encode("path", certificateName), + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}", pathParameters), + autorest.WithJSON(certificate), + 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 IntegrationAccountCertificatesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IntegrationAccountCertificatesClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationAccountCertificate, 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 integration account certificate. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// certificateName - the integration account certificate name. +func (client IntegrationAccountCertificatesClient) Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, certificateName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountCertificatesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, integrationAccountName, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationAccountCertificatesClient) DeletePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, certificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateName": autorest.Encode("path", certificateName), + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}", 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 IntegrationAccountCertificatesClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IntegrationAccountCertificatesClient) 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 integration account certificate. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// certificateName - the integration account certificate name. +func (client IntegrationAccountCertificatesClient) Get(ctx context.Context, resourceGroupName string, integrationAccountName string, certificateName string) (result IntegrationAccountCertificate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountCertificatesClient.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, integrationAccountName, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationAccountCertificatesClient) GetPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, certificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateName": autorest.Encode("path", certificateName), + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/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 IntegrationAccountCertificatesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IntegrationAccountCertificatesClient) GetResponder(resp *http.Response) (result IntegrationAccountCertificate, 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 integration account certificates. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// top - the number of items to be included in the result. +func (client IntegrationAccountCertificatesClient) List(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32) (result IntegrationAccountCertificateListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountCertificatesClient.List") + defer func() { + sc := -1 + if result.iaclr.Response.Response != nil { + sc = result.iaclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, integrationAccountName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.iaclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "List", resp, "Failure sending request") + return + } + + result.iaclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IntegrationAccountCertificatesClient) ListPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationAccountCertificatesClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IntegrationAccountCertificatesClient) ListResponder(resp *http.Response) (result IntegrationAccountCertificateListResult, 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 IntegrationAccountCertificatesClient) listNextResults(ctx context.Context, lastResults IntegrationAccountCertificateListResult) (result IntegrationAccountCertificateListResult, err error) { + req, err := lastResults.integrationAccountCertificateListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "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, "logic.IntegrationAccountCertificatesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationAccountCertificatesClient) ListComplete(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32) (result IntegrationAccountCertificateListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountCertificatesClient.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, integrationAccountName, top) + return +} diff --git a/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountmaps.go b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountmaps.go new file mode 100644 index 000000000000..185229088465 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountmaps.go @@ -0,0 +1,491 @@ +package logic + +// 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" +) + +// IntegrationAccountMapsClient is the REST API for Azure Logic Apps. +type IntegrationAccountMapsClient struct { + BaseClient +} + +// NewIntegrationAccountMapsClient creates an instance of the IntegrationAccountMapsClient client. +func NewIntegrationAccountMapsClient(subscriptionID string) IntegrationAccountMapsClient { + return NewIntegrationAccountMapsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationAccountMapsClientWithBaseURI creates an instance of the IntegrationAccountMapsClient client. +func NewIntegrationAccountMapsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountMapsClient { + return IntegrationAccountMapsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an integration account map. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// mapName - the integration account map name. +// mapParameter - the integration account map. +func (client IntegrationAccountMapsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, mapName string, mapParameter IntegrationAccountMap) (result IntegrationAccountMap, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountMapsClient.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: mapParameter, + Constraints: []validation.Constraint{{Target: "mapParameter.IntegrationAccountMapProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("logic.IntegrationAccountMapsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, integrationAccountName, mapName, mapParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IntegrationAccountMapsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, mapName string, mapParameter IntegrationAccountMap) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "mapName": autorest.Encode("path", mapName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}", pathParameters), + autorest.WithJSON(mapParameter), + 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 IntegrationAccountMapsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IntegrationAccountMapsClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationAccountMap, 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 integration account map. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// mapName - the integration account map name. +func (client IntegrationAccountMapsClient) Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, mapName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountMapsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, integrationAccountName, mapName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationAccountMapsClient) DeletePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, mapName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "mapName": autorest.Encode("path", mapName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}", 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 IntegrationAccountMapsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IntegrationAccountMapsClient) 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 integration account map. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// mapName - the integration account map name. +func (client IntegrationAccountMapsClient) Get(ctx context.Context, resourceGroupName string, integrationAccountName string, mapName string) (result IntegrationAccountMap, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountMapsClient.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, integrationAccountName, mapName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationAccountMapsClient) GetPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, mapName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "mapName": autorest.Encode("path", mapName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}", 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 IntegrationAccountMapsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IntegrationAccountMapsClient) GetResponder(resp *http.Response) (result IntegrationAccountMap, 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 integration account maps. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// top - the number of items to be included in the result. +// filter - the filter to apply on the operation. Options for filters include: MapType. +func (client IntegrationAccountMapsClient) List(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountMapListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountMapsClient.List") + defer func() { + sc := -1 + if result.iamlr.Response.Response != nil { + sc = result.iamlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, integrationAccountName, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.iamlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "List", resp, "Failure sending request") + return + } + + result.iamlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IntegrationAccountMapsClient) ListPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + 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.Logic/integrationAccounts/{integrationAccountName}/maps", 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 IntegrationAccountMapsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IntegrationAccountMapsClient) ListResponder(resp *http.Response) (result IntegrationAccountMapListResult, 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 IntegrationAccountMapsClient) listNextResults(ctx context.Context, lastResults IntegrationAccountMapListResult) (result IntegrationAccountMapListResult, err error) { + req, err := lastResults.integrationAccountMapListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "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, "logic.IntegrationAccountMapsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationAccountMapsClient) ListComplete(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountMapListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountMapsClient.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, integrationAccountName, top, filter) + return +} + +// ListContentCallbackURL get the content callback url. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// mapName - the integration account map name. +func (client IntegrationAccountMapsClient) ListContentCallbackURL(ctx context.Context, resourceGroupName string, integrationAccountName string, mapName string, listContentCallbackURL GetCallbackURLParameters) (result WorkflowTriggerCallbackURL, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountMapsClient.ListContentCallbackURL") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListContentCallbackURLPreparer(ctx, resourceGroupName, integrationAccountName, mapName, listContentCallbackURL) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "ListContentCallbackURL", nil, "Failure preparing request") + return + } + + resp, err := client.ListContentCallbackURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "ListContentCallbackURL", resp, "Failure sending request") + return + } + + result, err = client.ListContentCallbackURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "ListContentCallbackURL", resp, "Failure responding to request") + } + + return +} + +// ListContentCallbackURLPreparer prepares the ListContentCallbackURL request. +func (client IntegrationAccountMapsClient) ListContentCallbackURLPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, mapName string, listContentCallbackURL GetCallbackURLParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "mapName": autorest.Encode("path", mapName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}/listContentCallbackUrl", pathParameters), + autorest.WithJSON(listContentCallbackURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListContentCallbackURLSender sends the ListContentCallbackURL request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationAccountMapsClient) ListContentCallbackURLSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListContentCallbackURLResponder handles the response to the ListContentCallbackURL request. The method always +// closes the http.Response Body. +func (client IntegrationAccountMapsClient) ListContentCallbackURLResponder(resp *http.Response) (result WorkflowTriggerCallbackURL, 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/logic/mgmt/2019-05-01/logic/integrationaccountpartners.go b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountpartners.go new file mode 100644 index 000000000000..2dcfcc5da813 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountpartners.go @@ -0,0 +1,492 @@ +package logic + +// 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" +) + +// IntegrationAccountPartnersClient is the REST API for Azure Logic Apps. +type IntegrationAccountPartnersClient struct { + BaseClient +} + +// NewIntegrationAccountPartnersClient creates an instance of the IntegrationAccountPartnersClient client. +func NewIntegrationAccountPartnersClient(subscriptionID string) IntegrationAccountPartnersClient { + return NewIntegrationAccountPartnersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationAccountPartnersClientWithBaseURI creates an instance of the IntegrationAccountPartnersClient client. +func NewIntegrationAccountPartnersClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountPartnersClient { + return IntegrationAccountPartnersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an integration account partner. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// partnerName - the integration account partner name. +// partner - the integration account partner. +func (client IntegrationAccountPartnersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, partnerName string, partner IntegrationAccountPartner) (result IntegrationAccountPartner, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountPartnersClient.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: partner, + Constraints: []validation.Constraint{{Target: "partner.IntegrationAccountPartnerProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "partner.IntegrationAccountPartnerProperties.Content", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("logic.IntegrationAccountPartnersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, integrationAccountName, partnerName, partner) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IntegrationAccountPartnersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, partnerName string, partner IntegrationAccountPartner) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "partnerName": autorest.Encode("path", partnerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}", pathParameters), + autorest.WithJSON(partner), + 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 IntegrationAccountPartnersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IntegrationAccountPartnersClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationAccountPartner, 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 integration account partner. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// partnerName - the integration account partner name. +func (client IntegrationAccountPartnersClient) Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, partnerName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountPartnersClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, integrationAccountName, partnerName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationAccountPartnersClient) DeletePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, partnerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "partnerName": autorest.Encode("path", partnerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}", 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 IntegrationAccountPartnersClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IntegrationAccountPartnersClient) 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 integration account partner. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// partnerName - the integration account partner name. +func (client IntegrationAccountPartnersClient) Get(ctx context.Context, resourceGroupName string, integrationAccountName string, partnerName string) (result IntegrationAccountPartner, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountPartnersClient.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, integrationAccountName, partnerName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationAccountPartnersClient) GetPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, partnerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "partnerName": autorest.Encode("path", partnerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}", 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 IntegrationAccountPartnersClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IntegrationAccountPartnersClient) GetResponder(resp *http.Response) (result IntegrationAccountPartner, 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 integration account partners. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// top - the number of items to be included in the result. +// filter - the filter to apply on the operation. Options for filters include: PartnerType. +func (client IntegrationAccountPartnersClient) List(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountPartnerListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountPartnersClient.List") + defer func() { + sc := -1 + if result.iaplr.Response.Response != nil { + sc = result.iaplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, integrationAccountName, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.iaplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "List", resp, "Failure sending request") + return + } + + result.iaplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IntegrationAccountPartnersClient) ListPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + 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.Logic/integrationAccounts/{integrationAccountName}/partners", 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 IntegrationAccountPartnersClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IntegrationAccountPartnersClient) ListResponder(resp *http.Response) (result IntegrationAccountPartnerListResult, 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 IntegrationAccountPartnersClient) listNextResults(ctx context.Context, lastResults IntegrationAccountPartnerListResult) (result IntegrationAccountPartnerListResult, err error) { + req, err := lastResults.integrationAccountPartnerListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "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, "logic.IntegrationAccountPartnersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationAccountPartnersClient) ListComplete(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountPartnerListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountPartnersClient.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, integrationAccountName, top, filter) + return +} + +// ListContentCallbackURL get the content callback url. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// partnerName - the integration account partner name. +func (client IntegrationAccountPartnersClient) ListContentCallbackURL(ctx context.Context, resourceGroupName string, integrationAccountName string, partnerName string, listContentCallbackURL GetCallbackURLParameters) (result WorkflowTriggerCallbackURL, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountPartnersClient.ListContentCallbackURL") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListContentCallbackURLPreparer(ctx, resourceGroupName, integrationAccountName, partnerName, listContentCallbackURL) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "ListContentCallbackURL", nil, "Failure preparing request") + return + } + + resp, err := client.ListContentCallbackURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "ListContentCallbackURL", resp, "Failure sending request") + return + } + + result, err = client.ListContentCallbackURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "ListContentCallbackURL", resp, "Failure responding to request") + } + + return +} + +// ListContentCallbackURLPreparer prepares the ListContentCallbackURL request. +func (client IntegrationAccountPartnersClient) ListContentCallbackURLPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, partnerName string, listContentCallbackURL GetCallbackURLParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "partnerName": autorest.Encode("path", partnerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}/listContentCallbackUrl", pathParameters), + autorest.WithJSON(listContentCallbackURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListContentCallbackURLSender sends the ListContentCallbackURL request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationAccountPartnersClient) ListContentCallbackURLSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListContentCallbackURLResponder handles the response to the ListContentCallbackURL request. The method always +// closes the http.Response Body. +func (client IntegrationAccountPartnersClient) ListContentCallbackURLResponder(resp *http.Response) (result WorkflowTriggerCallbackURL, 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/logic/mgmt/2019-05-01/logic/integrationaccounts.go b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccounts.go new file mode 100644 index 000000000000..8e1323f505e2 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccounts.go @@ -0,0 +1,919 @@ +package logic + +// 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" +) + +// IntegrationAccountsClient is the REST API for Azure Logic Apps. +type IntegrationAccountsClient struct { + BaseClient +} + +// NewIntegrationAccountsClient creates an instance of the IntegrationAccountsClient client. +func NewIntegrationAccountsClient(subscriptionID string) IntegrationAccountsClient { + return NewIntegrationAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationAccountsClientWithBaseURI creates an instance of the IntegrationAccountsClient client. +func NewIntegrationAccountsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountsClient { + return IntegrationAccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an integration account. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// integrationAccount - the integration account. +func (client IntegrationAccountsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, integrationAccount IntegrationAccount) (result IntegrationAccount, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountsClient.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, integrationAccountName, integrationAccount) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IntegrationAccountsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, integrationAccount IntegrationAccount) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}", pathParameters), + autorest.WithJSON(integrationAccount), + 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 IntegrationAccountsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IntegrationAccountsClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationAccount, 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 integration account. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +func (client IntegrationAccountsClient) Delete(ctx context.Context, resourceGroupName string, integrationAccountName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, integrationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationAccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}", 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 IntegrationAccountsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IntegrationAccountsClient) 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 integration account. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +func (client IntegrationAccountsClient) Get(ctx context.Context, resourceGroupName string, integrationAccountName string) (result IntegrationAccount, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountsClient.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, integrationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationAccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}", 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 IntegrationAccountsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IntegrationAccountsClient) GetResponder(resp *http.Response) (result IntegrationAccount, 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 a list of integration accounts by resource group. +// Parameters: +// resourceGroupName - the resource group name. +// top - the number of items to be included in the result. +func (client IntegrationAccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, top *int32) (result IntegrationAccountListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.ialr.Response.Response != nil { + sc = result.ialr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.ialr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.ialr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client IntegrationAccountsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts", 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 IntegrationAccountsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client IntegrationAccountsClient) ListByResourceGroupResponder(resp *http.Response) (result IntegrationAccountListResult, 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 IntegrationAccountsClient) listByResourceGroupNextResults(ctx context.Context, lastResults IntegrationAccountListResult) (result IntegrationAccountListResult, err error) { + req, err := lastResults.integrationAccountListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "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, "logic.IntegrationAccountsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationAccountsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, top *int32) (result IntegrationAccountListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountsClient.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, top) + return +} + +// ListBySubscription gets a list of integration accounts by subscription. +// Parameters: +// top - the number of items to be included in the result. +func (client IntegrationAccountsClient) ListBySubscription(ctx context.Context, top *int32) (result IntegrationAccountListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountsClient.ListBySubscription") + defer func() { + sc := -1 + if result.ialr.Response.Response != nil { + sc = result.ialr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, top) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.ialr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.ialr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client IntegrationAccountsClient) ListBySubscriptionPreparer(ctx context.Context, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationAccounts", 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 IntegrationAccountsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client IntegrationAccountsClient) ListBySubscriptionResponder(resp *http.Response) (result IntegrationAccountListResult, 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 IntegrationAccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults IntegrationAccountListResult) (result IntegrationAccountListResult, err error) { + req, err := lastResults.integrationAccountListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "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, "logic.IntegrationAccountsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationAccountsClient) ListBySubscriptionComplete(ctx context.Context, top *int32) (result IntegrationAccountListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountsClient.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, top) + return +} + +// ListCallbackURL gets the integration account callback URL. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// parameters - the callback URL parameters. +func (client IntegrationAccountsClient) ListCallbackURL(ctx context.Context, resourceGroupName string, integrationAccountName string, parameters GetCallbackURLParameters) (result CallbackURL, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountsClient.ListCallbackURL") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListCallbackURLPreparer(ctx, resourceGroupName, integrationAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListCallbackURL", nil, "Failure preparing request") + return + } + + resp, err := client.ListCallbackURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListCallbackURL", resp, "Failure sending request") + return + } + + result, err = client.ListCallbackURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListCallbackURL", resp, "Failure responding to request") + } + + return +} + +// ListCallbackURLPreparer prepares the ListCallbackURL request. +func (client IntegrationAccountsClient) ListCallbackURLPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, parameters GetCallbackURLParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/listCallbackUrl", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCallbackURLSender sends the ListCallbackURL request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationAccountsClient) ListCallbackURLSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListCallbackURLResponder handles the response to the ListCallbackURL request. The method always +// closes the http.Response Body. +func (client IntegrationAccountsClient) ListCallbackURLResponder(resp *http.Response) (result CallbackURL, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListKeyVaultKeys gets the integration account's Key Vault keys. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// listKeyVaultKeys - the key vault parameters. +func (client IntegrationAccountsClient) ListKeyVaultKeys(ctx context.Context, resourceGroupName string, integrationAccountName string, listKeyVaultKeys ListKeyVaultKeysDefinition) (result KeyVaultKeyCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountsClient.ListKeyVaultKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: listKeyVaultKeys, + Constraints: []validation.Constraint{{Target: "listKeyVaultKeys.KeyVault", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("logic.IntegrationAccountsClient", "ListKeyVaultKeys", err.Error()) + } + + req, err := client.ListKeyVaultKeysPreparer(ctx, resourceGroupName, integrationAccountName, listKeyVaultKeys) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListKeyVaultKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeyVaultKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListKeyVaultKeys", resp, "Failure sending request") + return + } + + result, err = client.ListKeyVaultKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListKeyVaultKeys", resp, "Failure responding to request") + } + + return +} + +// ListKeyVaultKeysPreparer prepares the ListKeyVaultKeys request. +func (client IntegrationAccountsClient) ListKeyVaultKeysPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, listKeyVaultKeys ListKeyVaultKeysDefinition) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/listKeyVaultKeys", pathParameters), + autorest.WithJSON(listKeyVaultKeys), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeyVaultKeysSender sends the ListKeyVaultKeys request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationAccountsClient) ListKeyVaultKeysSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListKeyVaultKeysResponder handles the response to the ListKeyVaultKeys request. The method always +// closes the http.Response Body. +func (client IntegrationAccountsClient) ListKeyVaultKeysResponder(resp *http.Response) (result KeyVaultKeyCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// LogTrackingEvents logs the integration account's tracking events. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// logTrackingEvents - the callback URL parameters. +func (client IntegrationAccountsClient) LogTrackingEvents(ctx context.Context, resourceGroupName string, integrationAccountName string, logTrackingEvents TrackingEventsDefinition) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountsClient.LogTrackingEvents") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: logTrackingEvents, + Constraints: []validation.Constraint{{Target: "logTrackingEvents.SourceType", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "logTrackingEvents.Events", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("logic.IntegrationAccountsClient", "LogTrackingEvents", err.Error()) + } + + req, err := client.LogTrackingEventsPreparer(ctx, resourceGroupName, integrationAccountName, logTrackingEvents) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "LogTrackingEvents", nil, "Failure preparing request") + return + } + + resp, err := client.LogTrackingEventsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "LogTrackingEvents", resp, "Failure sending request") + return + } + + result, err = client.LogTrackingEventsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "LogTrackingEvents", resp, "Failure responding to request") + } + + return +} + +// LogTrackingEventsPreparer prepares the LogTrackingEvents request. +func (client IntegrationAccountsClient) LogTrackingEventsPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, logTrackingEvents TrackingEventsDefinition) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/logTrackingEvents", pathParameters), + autorest.WithJSON(logTrackingEvents), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// LogTrackingEventsSender sends the LogTrackingEvents request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationAccountsClient) LogTrackingEventsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// LogTrackingEventsResponder handles the response to the LogTrackingEvents request. The method always +// closes the http.Response Body. +func (client IntegrationAccountsClient) LogTrackingEventsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// RegenerateAccessKey regenerates the integration account access key. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// regenerateAccessKey - the access key type. +func (client IntegrationAccountsClient) RegenerateAccessKey(ctx context.Context, resourceGroupName string, integrationAccountName string, regenerateAccessKey RegenerateActionParameter) (result IntegrationAccount, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountsClient.RegenerateAccessKey") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RegenerateAccessKeyPreparer(ctx, resourceGroupName, integrationAccountName, regenerateAccessKey) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "RegenerateAccessKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateAccessKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "RegenerateAccessKey", resp, "Failure sending request") + return + } + + result, err = client.RegenerateAccessKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "RegenerateAccessKey", resp, "Failure responding to request") + } + + return +} + +// RegenerateAccessKeyPreparer prepares the RegenerateAccessKey request. +func (client IntegrationAccountsClient) RegenerateAccessKeyPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, regenerateAccessKey RegenerateActionParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/regenerateAccessKey", pathParameters), + autorest.WithJSON(regenerateAccessKey), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateAccessKeySender sends the RegenerateAccessKey request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationAccountsClient) RegenerateAccessKeySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// RegenerateAccessKeyResponder handles the response to the RegenerateAccessKey request. The method always +// closes the http.Response Body. +func (client IntegrationAccountsClient) RegenerateAccessKeyResponder(resp *http.Response) (result IntegrationAccount, 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 integration account. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// integrationAccount - the integration account. +func (client IntegrationAccountsClient) Update(ctx context.Context, resourceGroupName string, integrationAccountName string, integrationAccount IntegrationAccount) (result IntegrationAccount, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountsClient.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, integrationAccountName, integrationAccount) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client IntegrationAccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, integrationAccount IntegrationAccount) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}", pathParameters), + autorest.WithJSON(integrationAccount), + 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 IntegrationAccountsClient) UpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client IntegrationAccountsClient) UpdateResponder(resp *http.Response) (result IntegrationAccount, 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/logic/mgmt/2019-05-01/logic/integrationaccountschemas.go b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountschemas.go new file mode 100644 index 000000000000..63a98c3f455a --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountschemas.go @@ -0,0 +1,491 @@ +package logic + +// 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" +) + +// IntegrationAccountSchemasClient is the REST API for Azure Logic Apps. +type IntegrationAccountSchemasClient struct { + BaseClient +} + +// NewIntegrationAccountSchemasClient creates an instance of the IntegrationAccountSchemasClient client. +func NewIntegrationAccountSchemasClient(subscriptionID string) IntegrationAccountSchemasClient { + return NewIntegrationAccountSchemasClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationAccountSchemasClientWithBaseURI creates an instance of the IntegrationAccountSchemasClient client. +func NewIntegrationAccountSchemasClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountSchemasClient { + return IntegrationAccountSchemasClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an integration account schema. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// schemaName - the integration account schema name. +// schema - the integration account schema. +func (client IntegrationAccountSchemasClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, schemaName string, schema IntegrationAccountSchema) (result IntegrationAccountSchema, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSchemasClient.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: schema, + Constraints: []validation.Constraint{{Target: "schema.IntegrationAccountSchemaProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("logic.IntegrationAccountSchemasClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, integrationAccountName, schemaName, schema) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IntegrationAccountSchemasClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, schemaName string, schema IntegrationAccountSchema) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "schemaName": autorest.Encode("path", schemaName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}", pathParameters), + autorest.WithJSON(schema), + 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 IntegrationAccountSchemasClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IntegrationAccountSchemasClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationAccountSchema, 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 integration account schema. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// schemaName - the integration account schema name. +func (client IntegrationAccountSchemasClient) Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, schemaName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSchemasClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, integrationAccountName, schemaName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationAccountSchemasClient) DeletePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, schemaName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "schemaName": autorest.Encode("path", schemaName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}", 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 IntegrationAccountSchemasClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IntegrationAccountSchemasClient) 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 integration account schema. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// schemaName - the integration account schema name. +func (client IntegrationAccountSchemasClient) Get(ctx context.Context, resourceGroupName string, integrationAccountName string, schemaName string) (result IntegrationAccountSchema, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSchemasClient.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, integrationAccountName, schemaName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationAccountSchemasClient) GetPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, schemaName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "schemaName": autorest.Encode("path", schemaName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}", 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 IntegrationAccountSchemasClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IntegrationAccountSchemasClient) GetResponder(resp *http.Response) (result IntegrationAccountSchema, 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 integration account schemas. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// top - the number of items to be included in the result. +// filter - the filter to apply on the operation. Options for filters include: SchemaType. +func (client IntegrationAccountSchemasClient) List(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountSchemaListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSchemasClient.List") + defer func() { + sc := -1 + if result.iaslr.Response.Response != nil { + sc = result.iaslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, integrationAccountName, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.iaslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "List", resp, "Failure sending request") + return + } + + result.iaslr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IntegrationAccountSchemasClient) ListPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + 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.Logic/integrationAccounts/{integrationAccountName}/schemas", 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 IntegrationAccountSchemasClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IntegrationAccountSchemasClient) ListResponder(resp *http.Response) (result IntegrationAccountSchemaListResult, 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 IntegrationAccountSchemasClient) listNextResults(ctx context.Context, lastResults IntegrationAccountSchemaListResult) (result IntegrationAccountSchemaListResult, err error) { + req, err := lastResults.integrationAccountSchemaListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "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, "logic.IntegrationAccountSchemasClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationAccountSchemasClient) ListComplete(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountSchemaListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSchemasClient.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, integrationAccountName, top, filter) + return +} + +// ListContentCallbackURL get the content callback url. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// schemaName - the integration account schema name. +func (client IntegrationAccountSchemasClient) ListContentCallbackURL(ctx context.Context, resourceGroupName string, integrationAccountName string, schemaName string, listContentCallbackURL GetCallbackURLParameters) (result WorkflowTriggerCallbackURL, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSchemasClient.ListContentCallbackURL") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListContentCallbackURLPreparer(ctx, resourceGroupName, integrationAccountName, schemaName, listContentCallbackURL) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "ListContentCallbackURL", nil, "Failure preparing request") + return + } + + resp, err := client.ListContentCallbackURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "ListContentCallbackURL", resp, "Failure sending request") + return + } + + result, err = client.ListContentCallbackURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "ListContentCallbackURL", resp, "Failure responding to request") + } + + return +} + +// ListContentCallbackURLPreparer prepares the ListContentCallbackURL request. +func (client IntegrationAccountSchemasClient) ListContentCallbackURLPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, schemaName string, listContentCallbackURL GetCallbackURLParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "schemaName": autorest.Encode("path", schemaName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}/listContentCallbackUrl", pathParameters), + autorest.WithJSON(listContentCallbackURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListContentCallbackURLSender sends the ListContentCallbackURL request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationAccountSchemasClient) ListContentCallbackURLSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListContentCallbackURLResponder handles the response to the ListContentCallbackURL request. The method always +// closes the http.Response Body. +func (client IntegrationAccountSchemasClient) ListContentCallbackURLResponder(resp *http.Response) (result WorkflowTriggerCallbackURL, 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/logic/mgmt/2019-05-01/logic/integrationaccountsessions.go b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountsessions.go new file mode 100644 index 000000000000..6cc412ce1588 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/integrationaccountsessions.go @@ -0,0 +1,410 @@ +package logic + +// 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" +) + +// IntegrationAccountSessionsClient is the REST API for Azure Logic Apps. +type IntegrationAccountSessionsClient struct { + BaseClient +} + +// NewIntegrationAccountSessionsClient creates an instance of the IntegrationAccountSessionsClient client. +func NewIntegrationAccountSessionsClient(subscriptionID string) IntegrationAccountSessionsClient { + return NewIntegrationAccountSessionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationAccountSessionsClientWithBaseURI creates an instance of the IntegrationAccountSessionsClient client. +func NewIntegrationAccountSessionsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountSessionsClient { + return IntegrationAccountSessionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an integration account session. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// sessionName - the integration account session name. +// session - the integration account session. +func (client IntegrationAccountSessionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, sessionName string, session IntegrationAccountSession) (result IntegrationAccountSession, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSessionsClient.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: session, + Constraints: []validation.Constraint{{Target: "session.IntegrationAccountSessionProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("logic.IntegrationAccountSessionsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, integrationAccountName, sessionName, session) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSessionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSessionsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSessionsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IntegrationAccountSessionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, sessionName string, session IntegrationAccountSession) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionName": autorest.Encode("path", sessionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}", pathParameters), + autorest.WithJSON(session), + 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 IntegrationAccountSessionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IntegrationAccountSessionsClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationAccountSession, 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 integration account session. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// sessionName - the integration account session name. +func (client IntegrationAccountSessionsClient) Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, sessionName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSessionsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, integrationAccountName, sessionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSessionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSessionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSessionsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationAccountSessionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, sessionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionName": autorest.Encode("path", sessionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}", 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 IntegrationAccountSessionsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IntegrationAccountSessionsClient) 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 integration account session. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// sessionName - the integration account session name. +func (client IntegrationAccountSessionsClient) Get(ctx context.Context, resourceGroupName string, integrationAccountName string, sessionName string) (result IntegrationAccountSession, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSessionsClient.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, integrationAccountName, sessionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSessionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSessionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSessionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationAccountSessionsClient) GetPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, sessionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionName": autorest.Encode("path", sessionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}", 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 IntegrationAccountSessionsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IntegrationAccountSessionsClient) GetResponder(resp *http.Response) (result IntegrationAccountSession, 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 integration account sessions. +// Parameters: +// resourceGroupName - the resource group name. +// integrationAccountName - the integration account name. +// top - the number of items to be included in the result. +// filter - the filter to apply on the operation. Options for filters include: ChangedTime. +func (client IntegrationAccountSessionsClient) List(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountSessionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSessionsClient.List") + defer func() { + sc := -1 + if result.iaslr.Response.Response != nil { + sc = result.iaslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, integrationAccountName, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSessionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.iaslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSessionsClient", "List", resp, "Failure sending request") + return + } + + result.iaslr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSessionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IntegrationAccountSessionsClient) ListPreparer(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationAccountName": autorest.Encode("path", integrationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + 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.Logic/integrationAccounts/{integrationAccountName}/sessions", 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 IntegrationAccountSessionsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IntegrationAccountSessionsClient) ListResponder(resp *http.Response) (result IntegrationAccountSessionListResult, 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 IntegrationAccountSessionsClient) listNextResults(ctx context.Context, lastResults IntegrationAccountSessionListResult) (result IntegrationAccountSessionListResult, err error) { + req, err := lastResults.integrationAccountSessionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountSessionsClient", "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, "logic.IntegrationAccountSessionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSessionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationAccountSessionsClient) ListComplete(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountSessionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSessionsClient.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, integrationAccountName, top, filter) + return +} diff --git a/services/preview/logic/mgmt/2019-05-01/logic/integrationserviceenvironmentmanagedapioperations.go b/services/preview/logic/mgmt/2019-05-01/logic/integrationserviceenvironmentmanagedapioperations.go new file mode 100644 index 000000000000..3cf35cc6b268 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/integrationserviceenvironmentmanagedapioperations.go @@ -0,0 +1,160 @@ +package logic + +// 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" +) + +// IntegrationServiceEnvironmentManagedAPIOperationsClient is the REST API for Azure Logic Apps. +type IntegrationServiceEnvironmentManagedAPIOperationsClient struct { + BaseClient +} + +// NewIntegrationServiceEnvironmentManagedAPIOperationsClient creates an instance of the +// IntegrationServiceEnvironmentManagedAPIOperationsClient client. +func NewIntegrationServiceEnvironmentManagedAPIOperationsClient(subscriptionID string) IntegrationServiceEnvironmentManagedAPIOperationsClient { + return NewIntegrationServiceEnvironmentManagedAPIOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationServiceEnvironmentManagedAPIOperationsClientWithBaseURI creates an instance of the +// IntegrationServiceEnvironmentManagedAPIOperationsClient client. +func NewIntegrationServiceEnvironmentManagedAPIOperationsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentManagedAPIOperationsClient { + return IntegrationServiceEnvironmentManagedAPIOperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets the managed Api operations. +// Parameters: +// resourceGroup - the resource group. +// integrationServiceEnvironmentName - the integration service environment name. +// APIName - the api name. +func (client IntegrationServiceEnvironmentManagedAPIOperationsClient) List(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, APIName string) (result APIOperationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentManagedAPIOperationsClient.List") + defer func() { + sc := -1 + if result.aolr.Response.Response != nil { + sc = result.aolr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroup, integrationServiceEnvironmentName, APIName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedAPIOperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.aolr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedAPIOperationsClient", "List", resp, "Failure sending request") + return + } + + result.aolr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedAPIOperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IntegrationServiceEnvironmentManagedAPIOperationsClient) ListPreparer(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, APIName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiName": autorest.Encode("path", APIName), + "integrationServiceEnvironmentName": autorest.Encode("path", integrationServiceEnvironmentName), + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}/apiOperations", 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 IntegrationServiceEnvironmentManagedAPIOperationsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IntegrationServiceEnvironmentManagedAPIOperationsClient) ListResponder(resp *http.Response) (result APIOperationListResult, 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 IntegrationServiceEnvironmentManagedAPIOperationsClient) listNextResults(ctx context.Context, lastResults APIOperationListResult) (result APIOperationListResult, err error) { + req, err := lastResults.aPIOperationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedAPIOperationsClient", "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, "logic.IntegrationServiceEnvironmentManagedAPIOperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedAPIOperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationServiceEnvironmentManagedAPIOperationsClient) ListComplete(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, APIName string) (result APIOperationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentManagedAPIOperationsClient.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, resourceGroup, integrationServiceEnvironmentName, APIName) + return +} diff --git a/services/preview/logic/mgmt/2019-05-01/logic/integrationserviceenvironmentmanagedapis.go b/services/preview/logic/mgmt/2019-05-01/logic/integrationserviceenvironmentmanagedapis.go new file mode 100644 index 000000000000..560c5226e45e --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/integrationserviceenvironmentmanagedapis.go @@ -0,0 +1,394 @@ +package logic + +// 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" +) + +// IntegrationServiceEnvironmentManagedApisClient is the REST API for Azure Logic Apps. +type IntegrationServiceEnvironmentManagedApisClient struct { + BaseClient +} + +// NewIntegrationServiceEnvironmentManagedApisClient creates an instance of the +// IntegrationServiceEnvironmentManagedApisClient client. +func NewIntegrationServiceEnvironmentManagedApisClient(subscriptionID string) IntegrationServiceEnvironmentManagedApisClient { + return NewIntegrationServiceEnvironmentManagedApisClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationServiceEnvironmentManagedApisClientWithBaseURI creates an instance of the +// IntegrationServiceEnvironmentManagedApisClient client. +func NewIntegrationServiceEnvironmentManagedApisClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentManagedApisClient { + return IntegrationServiceEnvironmentManagedApisClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete deletes the integration service environment managed Api. +// Parameters: +// resourceGroup - the resource group. +// integrationServiceEnvironmentName - the integration service environment name. +// APIName - the api name. +func (client IntegrationServiceEnvironmentManagedApisClient) Delete(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, APIName string) (result IntegrationServiceEnvironmentManagedApisDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentManagedApisClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroup, integrationServiceEnvironmentName, APIName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationServiceEnvironmentManagedApisClient) DeletePreparer(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, APIName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiName": autorest.Encode("path", APIName), + "integrationServiceEnvironmentName": autorest.Encode("path", integrationServiceEnvironmentName), + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}", 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 IntegrationServiceEnvironmentManagedApisClient) DeleteSender(req *http.Request) (future IntegrationServiceEnvironmentManagedApisDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 IntegrationServiceEnvironmentManagedApisClient) 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 integration service environment managed Api. +// Parameters: +// resourceGroup - the resource group name. +// integrationServiceEnvironmentName - the integration service environment name. +// APIName - the api name. +func (client IntegrationServiceEnvironmentManagedApisClient) Get(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, APIName string) (result ManagedAPI, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentManagedApisClient.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, resourceGroup, integrationServiceEnvironmentName, APIName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationServiceEnvironmentManagedApisClient) GetPreparer(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, APIName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiName": autorest.Encode("path", APIName), + "integrationServiceEnvironmentName": autorest.Encode("path", integrationServiceEnvironmentName), + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}", 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 IntegrationServiceEnvironmentManagedApisClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IntegrationServiceEnvironmentManagedApisClient) GetResponder(resp *http.Response) (result ManagedAPI, 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 integration service environment managed Apis. +// Parameters: +// resourceGroup - the resource group. +// integrationServiceEnvironmentName - the integration service environment name. +func (client IntegrationServiceEnvironmentManagedApisClient) List(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (result ManagedAPIListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentManagedApisClient.List") + defer func() { + sc := -1 + if result.malr.Response.Response != nil { + sc = result.malr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroup, integrationServiceEnvironmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.malr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisClient", "List", resp, "Failure sending request") + return + } + + result.malr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IntegrationServiceEnvironmentManagedApisClient) ListPreparer(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationServiceEnvironmentName": autorest.Encode("path", integrationServiceEnvironmentName), + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis", 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 IntegrationServiceEnvironmentManagedApisClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IntegrationServiceEnvironmentManagedApisClient) ListResponder(resp *http.Response) (result ManagedAPIListResult, 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 IntegrationServiceEnvironmentManagedApisClient) listNextResults(ctx context.Context, lastResults ManagedAPIListResult) (result ManagedAPIListResult, err error) { + req, err := lastResults.managedAPIListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisClient", "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, "logic.IntegrationServiceEnvironmentManagedApisClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationServiceEnvironmentManagedApisClient) ListComplete(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (result ManagedAPIListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentManagedApisClient.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, resourceGroup, integrationServiceEnvironmentName) + return +} + +// Put puts the integration service environment managed Api. +// Parameters: +// resourceGroup - the resource group name. +// integrationServiceEnvironmentName - the integration service environment name. +// APIName - the api name. +func (client IntegrationServiceEnvironmentManagedApisClient) Put(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, APIName string) (result IntegrationServiceEnvironmentManagedApisPutFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentManagedApisClient.Put") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PutPreparer(ctx, resourceGroup, integrationServiceEnvironmentName, APIName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisClient", "Put", nil, "Failure preparing request") + return + } + + result, err = client.PutSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisClient", "Put", result.Response(), "Failure sending request") + return + } + + return +} + +// PutPreparer prepares the Put request. +func (client IntegrationServiceEnvironmentManagedApisClient) PutPreparer(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, APIName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiName": autorest.Encode("path", APIName), + "integrationServiceEnvironmentName": autorest.Encode("path", integrationServiceEnvironmentName), + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}", pathParameters), + 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 IntegrationServiceEnvironmentManagedApisClient) PutSender(req *http.Request) (future IntegrationServiceEnvironmentManagedApisPutFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// PutResponder handles the response to the Put request. The method always +// closes the http.Response Body. +func (client IntegrationServiceEnvironmentManagedApisClient) PutResponder(resp *http.Response) (result ManagedAPI, 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/logic/mgmt/2019-05-01/logic/integrationserviceenvironmentnetworkhealth.go b/services/preview/logic/mgmt/2019-05-01/logic/integrationserviceenvironmentnetworkhealth.go new file mode 100644 index 000000000000..43092b7df7d9 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/integrationserviceenvironmentnetworkhealth.go @@ -0,0 +1,120 @@ +package logic + +// 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" +) + +// IntegrationServiceEnvironmentNetworkHealthClient is the REST API for Azure Logic Apps. +type IntegrationServiceEnvironmentNetworkHealthClient struct { + BaseClient +} + +// NewIntegrationServiceEnvironmentNetworkHealthClient creates an instance of the +// IntegrationServiceEnvironmentNetworkHealthClient client. +func NewIntegrationServiceEnvironmentNetworkHealthClient(subscriptionID string) IntegrationServiceEnvironmentNetworkHealthClient { + return NewIntegrationServiceEnvironmentNetworkHealthClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationServiceEnvironmentNetworkHealthClientWithBaseURI creates an instance of the +// IntegrationServiceEnvironmentNetworkHealthClient client. +func NewIntegrationServiceEnvironmentNetworkHealthClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentNetworkHealthClient { + return IntegrationServiceEnvironmentNetworkHealthClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the integration service environment network health. +// Parameters: +// resourceGroup - the resource group. +// integrationServiceEnvironmentName - the integration service environment name. +func (client IntegrationServiceEnvironmentNetworkHealthClient) Get(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (result SetIntegrationServiceEnvironmentSubnetNetworkHealth, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentNetworkHealthClient.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, resourceGroup, integrationServiceEnvironmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentNetworkHealthClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentNetworkHealthClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentNetworkHealthClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationServiceEnvironmentNetworkHealthClient) GetPreparer(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationServiceEnvironmentName": autorest.Encode("path", integrationServiceEnvironmentName), + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/health/network", 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 IntegrationServiceEnvironmentNetworkHealthClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IntegrationServiceEnvironmentNetworkHealthClient) GetResponder(resp *http.Response) (result SetIntegrationServiceEnvironmentSubnetNetworkHealth, 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/logic/mgmt/2019-05-01/logic/integrationserviceenvironments.go b/services/preview/logic/mgmt/2019-05-01/logic/integrationserviceenvironments.go new file mode 100644 index 000000000000..fe767c387e14 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/integrationserviceenvironments.go @@ -0,0 +1,663 @@ +package logic + +// 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" +) + +// IntegrationServiceEnvironmentsClient is the REST API for Azure Logic Apps. +type IntegrationServiceEnvironmentsClient struct { + BaseClient +} + +// NewIntegrationServiceEnvironmentsClient creates an instance of the IntegrationServiceEnvironmentsClient client. +func NewIntegrationServiceEnvironmentsClient(subscriptionID string) IntegrationServiceEnvironmentsClient { + return NewIntegrationServiceEnvironmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationServiceEnvironmentsClientWithBaseURI creates an instance of the IntegrationServiceEnvironmentsClient +// client. +func NewIntegrationServiceEnvironmentsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentsClient { + return IntegrationServiceEnvironmentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an integration service environment. +// Parameters: +// resourceGroup - the resource group. +// integrationServiceEnvironmentName - the integration service environment name. +// integrationServiceEnvironment - the integration service environment. +func (client IntegrationServiceEnvironmentsClient) CreateOrUpdate(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, integrationServiceEnvironment IntegrationServiceEnvironment) (result IntegrationServiceEnvironmentsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroup, integrationServiceEnvironmentName, integrationServiceEnvironment) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IntegrationServiceEnvironmentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, integrationServiceEnvironment IntegrationServiceEnvironment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationServiceEnvironmentName": autorest.Encode("path", integrationServiceEnvironmentName), + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}", pathParameters), + autorest.WithJSON(integrationServiceEnvironment), + 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 IntegrationServiceEnvironmentsClient) CreateOrUpdateSender(req *http.Request) (future IntegrationServiceEnvironmentsCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 IntegrationServiceEnvironmentsClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationServiceEnvironment, 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 integration service environment. +// Parameters: +// resourceGroup - the resource group. +// integrationServiceEnvironmentName - the integration service environment name. +func (client IntegrationServiceEnvironmentsClient) Delete(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroup, integrationServiceEnvironmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationServiceEnvironmentsClient) DeletePreparer(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationServiceEnvironmentName": autorest.Encode("path", integrationServiceEnvironmentName), + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}", 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 IntegrationServiceEnvironmentsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IntegrationServiceEnvironmentsClient) 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 integration service environment. +// Parameters: +// resourceGroup - the resource group. +// integrationServiceEnvironmentName - the integration service environment name. +func (client IntegrationServiceEnvironmentsClient) Get(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (result IntegrationServiceEnvironment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentsClient.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, resourceGroup, integrationServiceEnvironmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationServiceEnvironmentsClient) GetPreparer(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationServiceEnvironmentName": autorest.Encode("path", integrationServiceEnvironmentName), + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}", 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 IntegrationServiceEnvironmentsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IntegrationServiceEnvironmentsClient) GetResponder(resp *http.Response) (result IntegrationServiceEnvironment, 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 a list of integration service environments by resource group. +// Parameters: +// resourceGroup - the resource group. +// top - the number of items to be included in the result. +func (client IntegrationServiceEnvironmentsClient) ListByResourceGroup(ctx context.Context, resourceGroup string, top *int32) (result IntegrationServiceEnvironmentListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.iselr.Response.Response != nil { + sc = result.iselr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroup, top) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.iselr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.iselr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client IntegrationServiceEnvironmentsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroup string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments", 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 IntegrationServiceEnvironmentsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client IntegrationServiceEnvironmentsClient) ListByResourceGroupResponder(resp *http.Response) (result IntegrationServiceEnvironmentListResult, 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 IntegrationServiceEnvironmentsClient) listByResourceGroupNextResults(ctx context.Context, lastResults IntegrationServiceEnvironmentListResult) (result IntegrationServiceEnvironmentListResult, err error) { + req, err := lastResults.integrationServiceEnvironmentListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "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, "logic.IntegrationServiceEnvironmentsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationServiceEnvironmentsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroup string, top *int32) (result IntegrationServiceEnvironmentListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentsClient.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, resourceGroup, top) + return +} + +// ListBySubscription gets a list of integration service environments by subscription. +// Parameters: +// top - the number of items to be included in the result. +func (client IntegrationServiceEnvironmentsClient) ListBySubscription(ctx context.Context, top *int32) (result IntegrationServiceEnvironmentListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentsClient.ListBySubscription") + defer func() { + sc := -1 + if result.iselr.Response.Response != nil { + sc = result.iselr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, top) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.iselr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.iselr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client IntegrationServiceEnvironmentsClient) ListBySubscriptionPreparer(ctx context.Context, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationServiceEnvironments", 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 IntegrationServiceEnvironmentsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client IntegrationServiceEnvironmentsClient) ListBySubscriptionResponder(resp *http.Response) (result IntegrationServiceEnvironmentListResult, 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 IntegrationServiceEnvironmentsClient) listBySubscriptionNextResults(ctx context.Context, lastResults IntegrationServiceEnvironmentListResult) (result IntegrationServiceEnvironmentListResult, err error) { + req, err := lastResults.integrationServiceEnvironmentListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "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, "logic.IntegrationServiceEnvironmentsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationServiceEnvironmentsClient) ListBySubscriptionComplete(ctx context.Context, top *int32) (result IntegrationServiceEnvironmentListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentsClient.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, top) + return +} + +// Restart restarts an integration service environment. +// Parameters: +// resourceGroup - the resource group. +// integrationServiceEnvironmentName - the integration service environment name. +func (client IntegrationServiceEnvironmentsClient) Restart(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentsClient.Restart") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, resourceGroup, integrationServiceEnvironmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "Restart", nil, "Failure preparing request") + return + } + + resp, err := client.RestartSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "Restart", resp, "Failure sending request") + return + } + + result, err = client.RestartResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "Restart", resp, "Failure responding to request") + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client IntegrationServiceEnvironmentsClient) RestartPreparer(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationServiceEnvironmentName": autorest.Encode("path", integrationServiceEnvironmentName), + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/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 IntegrationServiceEnvironmentsClient) RestartSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client IntegrationServiceEnvironmentsClient) RestartResponder(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 an integration service environment. +// Parameters: +// resourceGroup - the resource group. +// integrationServiceEnvironmentName - the integration service environment name. +// integrationServiceEnvironment - the integration service environment. +func (client IntegrationServiceEnvironmentsClient) Update(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, integrationServiceEnvironment IntegrationServiceEnvironment) (result IntegrationServiceEnvironmentsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentsClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroup, integrationServiceEnvironmentName, integrationServiceEnvironment) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client IntegrationServiceEnvironmentsClient) UpdatePreparer(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, integrationServiceEnvironment IntegrationServiceEnvironment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationServiceEnvironmentName": autorest.Encode("path", integrationServiceEnvironmentName), + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}", pathParameters), + autorest.WithJSON(integrationServiceEnvironment), + 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 IntegrationServiceEnvironmentsClient) UpdateSender(req *http.Request) (future IntegrationServiceEnvironmentsUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 IntegrationServiceEnvironmentsClient) UpdateResponder(resp *http.Response) (result IntegrationServiceEnvironment, 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/logic/mgmt/2019-05-01/logic/integrationserviceenvironmentskus.go b/services/preview/logic/mgmt/2019-05-01/logic/integrationserviceenvironmentskus.go new file mode 100644 index 000000000000..6e9edcad4a6a --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/integrationserviceenvironmentskus.go @@ -0,0 +1,158 @@ +package logic + +// 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" +) + +// IntegrationServiceEnvironmentSkusClient is the REST API for Azure Logic Apps. +type IntegrationServiceEnvironmentSkusClient struct { + BaseClient +} + +// NewIntegrationServiceEnvironmentSkusClient creates an instance of the IntegrationServiceEnvironmentSkusClient +// client. +func NewIntegrationServiceEnvironmentSkusClient(subscriptionID string) IntegrationServiceEnvironmentSkusClient { + return NewIntegrationServiceEnvironmentSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationServiceEnvironmentSkusClientWithBaseURI creates an instance of the +// IntegrationServiceEnvironmentSkusClient client. +func NewIntegrationServiceEnvironmentSkusClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentSkusClient { + return IntegrationServiceEnvironmentSkusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets a list of integration service environment Skus. +// Parameters: +// resourceGroup - the resource group. +// integrationServiceEnvironmentName - the integration service environment name. +func (client IntegrationServiceEnvironmentSkusClient) List(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (result IntegrationServiceEnvironmentSkuListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentSkusClient.List") + defer func() { + sc := -1 + if result.isesl.Response.Response != nil { + sc = result.isesl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroup, integrationServiceEnvironmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentSkusClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.isesl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentSkusClient", "List", resp, "Failure sending request") + return + } + + result.isesl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentSkusClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IntegrationServiceEnvironmentSkusClient) ListPreparer(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationServiceEnvironmentName": autorest.Encode("path", integrationServiceEnvironmentName), + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/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 IntegrationServiceEnvironmentSkusClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IntegrationServiceEnvironmentSkusClient) ListResponder(resp *http.Response) (result IntegrationServiceEnvironmentSkuList, 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 IntegrationServiceEnvironmentSkusClient) listNextResults(ctx context.Context, lastResults IntegrationServiceEnvironmentSkuList) (result IntegrationServiceEnvironmentSkuList, err error) { + req, err := lastResults.integrationServiceEnvironmentSkuListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentSkusClient", "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, "logic.IntegrationServiceEnvironmentSkusClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentSkusClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationServiceEnvironmentSkusClient) ListComplete(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (result IntegrationServiceEnvironmentSkuListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentSkusClient.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, resourceGroup, integrationServiceEnvironmentName) + return +} diff --git a/services/preview/logic/mgmt/2019-05-01/logic/logicapi/interfaces.go b/services/preview/logic/mgmt/2019-05-01/logic/logicapi/interfaces.go new file mode 100644 index 000000000000..ad50af7ed0f1 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/logicapi/interfaces.go @@ -0,0 +1,292 @@ +package logicapi + +// 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/logic/mgmt/2019-05-01/logic" + "github.com/Azure/go-autorest/autorest" +) + +// WorkflowsClientAPI contains the set of methods on the WorkflowsClient type. +type WorkflowsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workflowName string, workflow logic.Workflow) (result logic.Workflow, err error) + Delete(ctx context.Context, resourceGroupName string, workflowName string) (result autorest.Response, err error) + Disable(ctx context.Context, resourceGroupName string, workflowName string) (result autorest.Response, err error) + Enable(ctx context.Context, resourceGroupName string, workflowName string) (result autorest.Response, err error) + GenerateUpgradedDefinition(ctx context.Context, resourceGroupName string, workflowName string, parameters logic.GenerateUpgradedDefinitionParameters) (result logic.SetObject, err error) + Get(ctx context.Context, resourceGroupName string, workflowName string) (result logic.Workflow, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, top *int32, filter string) (result logic.WorkflowListResultPage, err error) + ListBySubscription(ctx context.Context, top *int32, filter string) (result logic.WorkflowListResultPage, err error) + ListCallbackURL(ctx context.Context, resourceGroupName string, workflowName string, listCallbackURL logic.GetCallbackURLParameters) (result logic.WorkflowTriggerCallbackURL, err error) + ListSwagger(ctx context.Context, resourceGroupName string, workflowName string) (result logic.SetObject, err error) + Move(ctx context.Context, resourceGroupName string, workflowName string, move logic.Workflow) (result logic.WorkflowsMoveFuture, err error) + RegenerateAccessKey(ctx context.Context, resourceGroupName string, workflowName string, keyType logic.RegenerateActionParameter) (result autorest.Response, err error) + Update(ctx context.Context, resourceGroupName string, workflowName string, workflow logic.Workflow) (result logic.Workflow, err error) + ValidateByLocation(ctx context.Context, resourceGroupName string, location string, workflowName string) (result autorest.Response, err error) + ValidateByResourceGroup(ctx context.Context, resourceGroupName string, workflowName string, validate logic.Workflow) (result autorest.Response, err error) +} + +var _ WorkflowsClientAPI = (*logic.WorkflowsClient)(nil) + +// WorkflowVersionsClientAPI contains the set of methods on the WorkflowVersionsClient type. +type WorkflowVersionsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workflowName string, versionID string) (result logic.WorkflowVersion, err error) + List(ctx context.Context, resourceGroupName string, workflowName string, top *int32) (result logic.WorkflowVersionListResultPage, err error) +} + +var _ WorkflowVersionsClientAPI = (*logic.WorkflowVersionsClient)(nil) + +// WorkflowTriggersClientAPI contains the set of methods on the WorkflowTriggersClient type. +type WorkflowTriggersClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (result logic.WorkflowTrigger, err error) + GetSchemaJSON(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (result logic.JSONSchema, err error) + List(ctx context.Context, resourceGroupName string, workflowName string, top *int32, filter string) (result logic.WorkflowTriggerListResultPage, err error) + ListCallbackURL(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (result logic.WorkflowTriggerCallbackURL, err error) + Reset(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (result autorest.Response, err error) + Run(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (result logic.SetObject, err error) + SetState(ctx context.Context, resourceGroupName string, workflowName string, triggerName string, setState logic.SetTriggerStateActionDefinition) (result autorest.Response, err error) +} + +var _ WorkflowTriggersClientAPI = (*logic.WorkflowTriggersClient)(nil) + +// WorkflowVersionTriggersClientAPI contains the set of methods on the WorkflowVersionTriggersClient type. +type WorkflowVersionTriggersClientAPI interface { + ListCallbackURL(ctx context.Context, resourceGroupName string, workflowName string, versionID string, triggerName string, parameters *logic.GetCallbackURLParameters) (result logic.WorkflowTriggerCallbackURL, err error) +} + +var _ WorkflowVersionTriggersClientAPI = (*logic.WorkflowVersionTriggersClient)(nil) + +// WorkflowTriggerHistoriesClientAPI contains the set of methods on the WorkflowTriggerHistoriesClient type. +type WorkflowTriggerHistoriesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workflowName string, triggerName string, historyName string) (result logic.WorkflowTriggerHistory, err error) + List(ctx context.Context, resourceGroupName string, workflowName string, triggerName string, top *int32, filter string) (result logic.WorkflowTriggerHistoryListResultPage, err error) + Resubmit(ctx context.Context, resourceGroupName string, workflowName string, triggerName string, historyName string) (result autorest.Response, err error) +} + +var _ WorkflowTriggerHistoriesClientAPI = (*logic.WorkflowTriggerHistoriesClient)(nil) + +// WorkflowRunsClientAPI contains the set of methods on the WorkflowRunsClient type. +type WorkflowRunsClientAPI interface { + Cancel(ctx context.Context, resourceGroupName string, workflowName string, runName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workflowName string, runName string) (result logic.WorkflowRun, err error) + List(ctx context.Context, resourceGroupName string, workflowName string, top *int32, filter string) (result logic.WorkflowRunListResultPage, err error) +} + +var _ WorkflowRunsClientAPI = (*logic.WorkflowRunsClient)(nil) + +// WorkflowRunActionsClientAPI contains the set of methods on the WorkflowRunActionsClient type. +type WorkflowRunActionsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (result logic.WorkflowRunAction, err error) + List(ctx context.Context, resourceGroupName string, workflowName string, runName string, top *int32, filter string) (result logic.WorkflowRunActionListResultPage, err error) + ListExpressionTraces(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (result logic.ExpressionTraces, err error) +} + +var _ WorkflowRunActionsClientAPI = (*logic.WorkflowRunActionsClient)(nil) + +// WorkflowRunActionRepetitionsClientAPI contains the set of methods on the WorkflowRunActionRepetitionsClient type. +type WorkflowRunActionRepetitionsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (result logic.WorkflowRunActionRepetitionDefinition, err error) + List(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (result logic.WorkflowRunActionRepetitionDefinitionCollection, err error) + ListExpressionTraces(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (result logic.ExpressionTraces, err error) +} + +var _ WorkflowRunActionRepetitionsClientAPI = (*logic.WorkflowRunActionRepetitionsClient)(nil) + +// WorkflowRunActionRepetitionsRequestHistoriesClientAPI contains the set of methods on the WorkflowRunActionRepetitionsRequestHistoriesClient type. +type WorkflowRunActionRepetitionsRequestHistoriesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string, requestHistoryName string) (result logic.RequestHistory, err error) + List(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (result logic.RequestHistoryListResultPage, err error) +} + +var _ WorkflowRunActionRepetitionsRequestHistoriesClientAPI = (*logic.WorkflowRunActionRepetitionsRequestHistoriesClient)(nil) + +// WorkflowRunActionRequestHistoriesClientAPI contains the set of methods on the WorkflowRunActionRequestHistoriesClient type. +type WorkflowRunActionRequestHistoriesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, requestHistoryName string) (result logic.RequestHistory, err error) + List(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (result logic.RequestHistoryListResultPage, err error) +} + +var _ WorkflowRunActionRequestHistoriesClientAPI = (*logic.WorkflowRunActionRequestHistoriesClient)(nil) + +// WorkflowRunActionScopeRepetitionsClientAPI contains the set of methods on the WorkflowRunActionScopeRepetitionsClient type. +type WorkflowRunActionScopeRepetitionsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (result logic.WorkflowRunActionRepetitionDefinition, err error) + List(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (result logic.WorkflowRunActionRepetitionDefinitionCollection, err error) +} + +var _ WorkflowRunActionScopeRepetitionsClientAPI = (*logic.WorkflowRunActionScopeRepetitionsClient)(nil) + +// WorkflowRunOperationsClientAPI contains the set of methods on the WorkflowRunOperationsClient type. +type WorkflowRunOperationsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, operationID string) (result logic.WorkflowRun, err error) +} + +var _ WorkflowRunOperationsClientAPI = (*logic.WorkflowRunOperationsClient)(nil) + +// IntegrationAccountsClientAPI contains the set of methods on the IntegrationAccountsClient type. +type IntegrationAccountsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, integrationAccount logic.IntegrationAccount) (result logic.IntegrationAccount, err error) + Delete(ctx context.Context, resourceGroupName string, integrationAccountName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, integrationAccountName string) (result logic.IntegrationAccount, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, top *int32) (result logic.IntegrationAccountListResultPage, err error) + ListBySubscription(ctx context.Context, top *int32) (result logic.IntegrationAccountListResultPage, err error) + ListCallbackURL(ctx context.Context, resourceGroupName string, integrationAccountName string, parameters logic.GetCallbackURLParameters) (result logic.CallbackURL, err error) + ListKeyVaultKeys(ctx context.Context, resourceGroupName string, integrationAccountName string, listKeyVaultKeys logic.ListKeyVaultKeysDefinition) (result logic.KeyVaultKeyCollection, err error) + LogTrackingEvents(ctx context.Context, resourceGroupName string, integrationAccountName string, logTrackingEvents logic.TrackingEventsDefinition) (result autorest.Response, err error) + RegenerateAccessKey(ctx context.Context, resourceGroupName string, integrationAccountName string, regenerateAccessKey logic.RegenerateActionParameter) (result logic.IntegrationAccount, err error) + Update(ctx context.Context, resourceGroupName string, integrationAccountName string, integrationAccount logic.IntegrationAccount) (result logic.IntegrationAccount, err error) +} + +var _ IntegrationAccountsClientAPI = (*logic.IntegrationAccountsClient)(nil) + +// IntegrationAccountAssembliesClientAPI contains the set of methods on the IntegrationAccountAssembliesClient type. +type IntegrationAccountAssembliesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, assemblyArtifactName string, assemblyArtifact logic.AssemblyDefinition) (result logic.AssemblyDefinition, err error) + Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, assemblyArtifactName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, integrationAccountName string, assemblyArtifactName string) (result logic.AssemblyDefinition, err error) + List(ctx context.Context, resourceGroupName string, integrationAccountName string) (result logic.AssemblyCollection, err error) + ListContentCallbackURL(ctx context.Context, resourceGroupName string, integrationAccountName string, assemblyArtifactName string) (result logic.WorkflowTriggerCallbackURL, err error) +} + +var _ IntegrationAccountAssembliesClientAPI = (*logic.IntegrationAccountAssembliesClient)(nil) + +// IntegrationAccountBatchConfigurationsClientAPI contains the set of methods on the IntegrationAccountBatchConfigurationsClient type. +type IntegrationAccountBatchConfigurationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, batchConfigurationName string, batchConfiguration logic.BatchConfiguration) (result logic.BatchConfiguration, err error) + Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, batchConfigurationName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, integrationAccountName string, batchConfigurationName string) (result logic.BatchConfiguration, err error) + List(ctx context.Context, resourceGroupName string, integrationAccountName string) (result logic.BatchConfigurationCollection, err error) +} + +var _ IntegrationAccountBatchConfigurationsClientAPI = (*logic.IntegrationAccountBatchConfigurationsClient)(nil) + +// IntegrationAccountSchemasClientAPI contains the set of methods on the IntegrationAccountSchemasClient type. +type IntegrationAccountSchemasClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, schemaName string, schema logic.IntegrationAccountSchema) (result logic.IntegrationAccountSchema, err error) + Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, schemaName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, integrationAccountName string, schemaName string) (result logic.IntegrationAccountSchema, err error) + List(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result logic.IntegrationAccountSchemaListResultPage, err error) + ListContentCallbackURL(ctx context.Context, resourceGroupName string, integrationAccountName string, schemaName string, listContentCallbackURL logic.GetCallbackURLParameters) (result logic.WorkflowTriggerCallbackURL, err error) +} + +var _ IntegrationAccountSchemasClientAPI = (*logic.IntegrationAccountSchemasClient)(nil) + +// IntegrationAccountMapsClientAPI contains the set of methods on the IntegrationAccountMapsClient type. +type IntegrationAccountMapsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, mapName string, mapParameter logic.IntegrationAccountMap) (result logic.IntegrationAccountMap, err error) + Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, mapName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, integrationAccountName string, mapName string) (result logic.IntegrationAccountMap, err error) + List(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result logic.IntegrationAccountMapListResultPage, err error) + ListContentCallbackURL(ctx context.Context, resourceGroupName string, integrationAccountName string, mapName string, listContentCallbackURL logic.GetCallbackURLParameters) (result logic.WorkflowTriggerCallbackURL, err error) +} + +var _ IntegrationAccountMapsClientAPI = (*logic.IntegrationAccountMapsClient)(nil) + +// IntegrationAccountPartnersClientAPI contains the set of methods on the IntegrationAccountPartnersClient type. +type IntegrationAccountPartnersClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, partnerName string, partner logic.IntegrationAccountPartner) (result logic.IntegrationAccountPartner, err error) + Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, partnerName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, integrationAccountName string, partnerName string) (result logic.IntegrationAccountPartner, err error) + List(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result logic.IntegrationAccountPartnerListResultPage, err error) + ListContentCallbackURL(ctx context.Context, resourceGroupName string, integrationAccountName string, partnerName string, listContentCallbackURL logic.GetCallbackURLParameters) (result logic.WorkflowTriggerCallbackURL, err error) +} + +var _ IntegrationAccountPartnersClientAPI = (*logic.IntegrationAccountPartnersClient)(nil) + +// IntegrationAccountAgreementsClientAPI contains the set of methods on the IntegrationAccountAgreementsClient type. +type IntegrationAccountAgreementsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, agreementName string, agreement logic.IntegrationAccountAgreement) (result logic.IntegrationAccountAgreement, err error) + Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, agreementName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, integrationAccountName string, agreementName string) (result logic.IntegrationAccountAgreement, err error) + List(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result logic.IntegrationAccountAgreementListResultPage, err error) + ListContentCallbackURL(ctx context.Context, resourceGroupName string, integrationAccountName string, agreementName string, listContentCallbackURL logic.GetCallbackURLParameters) (result logic.WorkflowTriggerCallbackURL, err error) +} + +var _ IntegrationAccountAgreementsClientAPI = (*logic.IntegrationAccountAgreementsClient)(nil) + +// IntegrationAccountCertificatesClientAPI contains the set of methods on the IntegrationAccountCertificatesClient type. +type IntegrationAccountCertificatesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, certificateName string, certificate logic.IntegrationAccountCertificate) (result logic.IntegrationAccountCertificate, err error) + Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, certificateName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, integrationAccountName string, certificateName string) (result logic.IntegrationAccountCertificate, err error) + List(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32) (result logic.IntegrationAccountCertificateListResultPage, err error) +} + +var _ IntegrationAccountCertificatesClientAPI = (*logic.IntegrationAccountCertificatesClient)(nil) + +// IntegrationAccountSessionsClientAPI contains the set of methods on the IntegrationAccountSessionsClient type. +type IntegrationAccountSessionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, integrationAccountName string, sessionName string, session logic.IntegrationAccountSession) (result logic.IntegrationAccountSession, err error) + Delete(ctx context.Context, resourceGroupName string, integrationAccountName string, sessionName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, integrationAccountName string, sessionName string) (result logic.IntegrationAccountSession, err error) + List(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result logic.IntegrationAccountSessionListResultPage, err error) +} + +var _ IntegrationAccountSessionsClientAPI = (*logic.IntegrationAccountSessionsClient)(nil) + +// IntegrationServiceEnvironmentsClientAPI contains the set of methods on the IntegrationServiceEnvironmentsClient type. +type IntegrationServiceEnvironmentsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, integrationServiceEnvironment logic.IntegrationServiceEnvironment) (result logic.IntegrationServiceEnvironmentsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (result logic.IntegrationServiceEnvironment, err error) + ListByResourceGroup(ctx context.Context, resourceGroup string, top *int32) (result logic.IntegrationServiceEnvironmentListResultPage, err error) + ListBySubscription(ctx context.Context, top *int32) (result logic.IntegrationServiceEnvironmentListResultPage, err error) + Restart(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (result autorest.Response, err error) + Update(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, integrationServiceEnvironment logic.IntegrationServiceEnvironment) (result logic.IntegrationServiceEnvironmentsUpdateFuture, err error) +} + +var _ IntegrationServiceEnvironmentsClientAPI = (*logic.IntegrationServiceEnvironmentsClient)(nil) + +// IntegrationServiceEnvironmentSkusClientAPI contains the set of methods on the IntegrationServiceEnvironmentSkusClient type. +type IntegrationServiceEnvironmentSkusClientAPI interface { + List(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (result logic.IntegrationServiceEnvironmentSkuListPage, err error) +} + +var _ IntegrationServiceEnvironmentSkusClientAPI = (*logic.IntegrationServiceEnvironmentSkusClient)(nil) + +// IntegrationServiceEnvironmentNetworkHealthClientAPI contains the set of methods on the IntegrationServiceEnvironmentNetworkHealthClient type. +type IntegrationServiceEnvironmentNetworkHealthClientAPI interface { + Get(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (result logic.SetIntegrationServiceEnvironmentSubnetNetworkHealth, err error) +} + +var _ IntegrationServiceEnvironmentNetworkHealthClientAPI = (*logic.IntegrationServiceEnvironmentNetworkHealthClient)(nil) + +// IntegrationServiceEnvironmentManagedApisClientAPI contains the set of methods on the IntegrationServiceEnvironmentManagedApisClient type. +type IntegrationServiceEnvironmentManagedApisClientAPI interface { + Delete(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, APIName string) (result logic.IntegrationServiceEnvironmentManagedApisDeleteFuture, err error) + Get(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, APIName string) (result logic.ManagedAPI, err error) + List(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string) (result logic.ManagedAPIListResultPage, err error) + Put(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, APIName string) (result logic.IntegrationServiceEnvironmentManagedApisPutFuture, err error) +} + +var _ IntegrationServiceEnvironmentManagedApisClientAPI = (*logic.IntegrationServiceEnvironmentManagedApisClient)(nil) + +// IntegrationServiceEnvironmentManagedAPIOperationsClientAPI contains the set of methods on the IntegrationServiceEnvironmentManagedAPIOperationsClient type. +type IntegrationServiceEnvironmentManagedAPIOperationsClientAPI interface { + List(ctx context.Context, resourceGroup string, integrationServiceEnvironmentName string, APIName string) (result logic.APIOperationListResultPage, err error) +} + +var _ IntegrationServiceEnvironmentManagedAPIOperationsClientAPI = (*logic.IntegrationServiceEnvironmentManagedAPIOperationsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result logic.OperationListResultPage, err error) +} + +var _ OperationsClientAPI = (*logic.OperationsClient)(nil) diff --git a/services/preview/logic/mgmt/2019-05-01/logic/models.go b/services/preview/logic/mgmt/2019-05-01/logic/models.go new file mode 100644 index 000000000000..c724773861fa --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/models.go @@ -0,0 +1,8143 @@ +package logic + +// 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/logic/mgmt/2019-05-01/logic" + +// AgreementType enumerates the values for agreement type. +type AgreementType string + +const ( + // AS2 ... + AS2 AgreementType = "AS2" + // Edifact ... + Edifact AgreementType = "Edifact" + // NotSpecified ... + NotSpecified AgreementType = "NotSpecified" + // X12 ... + X12 AgreementType = "X12" +) + +// PossibleAgreementTypeValues returns an array of possible values for the AgreementType const type. +func PossibleAgreementTypeValues() []AgreementType { + return []AgreementType{AS2, Edifact, NotSpecified, X12} +} + +// APIDeploymentParameterVisibility enumerates the values for api deployment parameter visibility. +type APIDeploymentParameterVisibility string + +const ( + // APIDeploymentParameterVisibilityDefault ... + APIDeploymentParameterVisibilityDefault APIDeploymentParameterVisibility = "Default" + // APIDeploymentParameterVisibilityInternal ... + APIDeploymentParameterVisibilityInternal APIDeploymentParameterVisibility = "Internal" + // APIDeploymentParameterVisibilityNotSpecified ... + APIDeploymentParameterVisibilityNotSpecified APIDeploymentParameterVisibility = "NotSpecified" +) + +// PossibleAPIDeploymentParameterVisibilityValues returns an array of possible values for the APIDeploymentParameterVisibility const type. +func PossibleAPIDeploymentParameterVisibilityValues() []APIDeploymentParameterVisibility { + return []APIDeploymentParameterVisibility{APIDeploymentParameterVisibilityDefault, APIDeploymentParameterVisibilityInternal, APIDeploymentParameterVisibilityNotSpecified} +} + +// APITier enumerates the values for api tier. +type APITier string + +const ( + // APITierEnterprise ... + APITierEnterprise APITier = "Enterprise" + // APITierNotSpecified ... + APITierNotSpecified APITier = "NotSpecified" + // APITierPremium ... + APITierPremium APITier = "Premium" + // APITierStandard ... + APITierStandard APITier = "Standard" +) + +// PossibleAPITierValues returns an array of possible values for the APITier const type. +func PossibleAPITierValues() []APITier { + return []APITier{APITierEnterprise, APITierNotSpecified, APITierPremium, APITierStandard} +} + +// APIType enumerates the values for api type. +type APIType string + +const ( + // APITypeNotSpecified ... + APITypeNotSpecified APIType = "NotSpecified" + // APITypeRest ... + APITypeRest APIType = "Rest" + // APITypeSoap ... + APITypeSoap APIType = "Soap" +) + +// PossibleAPITypeValues returns an array of possible values for the APIType const type. +func PossibleAPITypeValues() []APIType { + return []APIType{APITypeNotSpecified, APITypeRest, APITypeSoap} +} + +// AzureAsyncOperationState enumerates the values for azure async operation state. +type AzureAsyncOperationState string + +const ( + // Canceled ... + Canceled AzureAsyncOperationState = "Canceled" + // Failed ... + Failed AzureAsyncOperationState = "Failed" + // Pending ... + Pending AzureAsyncOperationState = "Pending" + // Succeeded ... + Succeeded AzureAsyncOperationState = "Succeeded" +) + +// PossibleAzureAsyncOperationStateValues returns an array of possible values for the AzureAsyncOperationState const type. +func PossibleAzureAsyncOperationStateValues() []AzureAsyncOperationState { + return []AzureAsyncOperationState{Canceled, Failed, Pending, Succeeded} +} + +// DayOfWeek enumerates the values for day of week. +type DayOfWeek string + +const ( + // Friday ... + Friday DayOfWeek = "Friday" + // Monday ... + Monday DayOfWeek = "Monday" + // Saturday ... + Saturday DayOfWeek = "Saturday" + // Sunday ... + Sunday DayOfWeek = "Sunday" + // Thursday ... + Thursday DayOfWeek = "Thursday" + // Tuesday ... + Tuesday DayOfWeek = "Tuesday" + // Wednesday ... + Wednesday DayOfWeek = "Wednesday" +) + +// PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type. +func PossibleDayOfWeekValues() []DayOfWeek { + return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} +} + +// DaysOfWeek enumerates the values for days of week. +type DaysOfWeek string + +const ( + // DaysOfWeekFriday ... + DaysOfWeekFriday DaysOfWeek = "Friday" + // DaysOfWeekMonday ... + DaysOfWeekMonday DaysOfWeek = "Monday" + // DaysOfWeekSaturday ... + DaysOfWeekSaturday DaysOfWeek = "Saturday" + // DaysOfWeekSunday ... + DaysOfWeekSunday DaysOfWeek = "Sunday" + // DaysOfWeekThursday ... + DaysOfWeekThursday DaysOfWeek = "Thursday" + // DaysOfWeekTuesday ... + DaysOfWeekTuesday DaysOfWeek = "Tuesday" + // DaysOfWeekWednesday ... + DaysOfWeekWednesday DaysOfWeek = "Wednesday" +) + +// PossibleDaysOfWeekValues returns an array of possible values for the DaysOfWeek const type. +func PossibleDaysOfWeekValues() []DaysOfWeek { + return []DaysOfWeek{DaysOfWeekFriday, DaysOfWeekMonday, DaysOfWeekSaturday, DaysOfWeekSunday, DaysOfWeekThursday, DaysOfWeekTuesday, DaysOfWeekWednesday} +} + +// EdifactCharacterSet enumerates the values for edifact character set. +type EdifactCharacterSet string + +const ( + // EdifactCharacterSetKECA ... + EdifactCharacterSetKECA EdifactCharacterSet = "KECA" + // EdifactCharacterSetNotSpecified ... + EdifactCharacterSetNotSpecified EdifactCharacterSet = "NotSpecified" + // EdifactCharacterSetUNOA ... + EdifactCharacterSetUNOA EdifactCharacterSet = "UNOA" + // EdifactCharacterSetUNOB ... + EdifactCharacterSetUNOB EdifactCharacterSet = "UNOB" + // EdifactCharacterSetUNOC ... + EdifactCharacterSetUNOC EdifactCharacterSet = "UNOC" + // EdifactCharacterSetUNOD ... + EdifactCharacterSetUNOD EdifactCharacterSet = "UNOD" + // EdifactCharacterSetUNOE ... + EdifactCharacterSetUNOE EdifactCharacterSet = "UNOE" + // EdifactCharacterSetUNOF ... + EdifactCharacterSetUNOF EdifactCharacterSet = "UNOF" + // EdifactCharacterSetUNOG ... + EdifactCharacterSetUNOG EdifactCharacterSet = "UNOG" + // EdifactCharacterSetUNOH ... + EdifactCharacterSetUNOH EdifactCharacterSet = "UNOH" + // EdifactCharacterSetUNOI ... + EdifactCharacterSetUNOI EdifactCharacterSet = "UNOI" + // EdifactCharacterSetUNOJ ... + EdifactCharacterSetUNOJ EdifactCharacterSet = "UNOJ" + // EdifactCharacterSetUNOK ... + EdifactCharacterSetUNOK EdifactCharacterSet = "UNOK" + // EdifactCharacterSetUNOX ... + EdifactCharacterSetUNOX EdifactCharacterSet = "UNOX" + // EdifactCharacterSetUNOY ... + EdifactCharacterSetUNOY EdifactCharacterSet = "UNOY" +) + +// PossibleEdifactCharacterSetValues returns an array of possible values for the EdifactCharacterSet const type. +func PossibleEdifactCharacterSetValues() []EdifactCharacterSet { + return []EdifactCharacterSet{EdifactCharacterSetKECA, EdifactCharacterSetNotSpecified, EdifactCharacterSetUNOA, EdifactCharacterSetUNOB, EdifactCharacterSetUNOC, EdifactCharacterSetUNOD, EdifactCharacterSetUNOE, EdifactCharacterSetUNOF, EdifactCharacterSetUNOG, EdifactCharacterSetUNOH, EdifactCharacterSetUNOI, EdifactCharacterSetUNOJ, EdifactCharacterSetUNOK, EdifactCharacterSetUNOX, EdifactCharacterSetUNOY} +} + +// EdifactDecimalIndicator enumerates the values for edifact decimal indicator. +type EdifactDecimalIndicator string + +const ( + // EdifactDecimalIndicatorComma ... + EdifactDecimalIndicatorComma EdifactDecimalIndicator = "Comma" + // EdifactDecimalIndicatorDecimal ... + EdifactDecimalIndicatorDecimal EdifactDecimalIndicator = "Decimal" + // EdifactDecimalIndicatorNotSpecified ... + EdifactDecimalIndicatorNotSpecified EdifactDecimalIndicator = "NotSpecified" +) + +// PossibleEdifactDecimalIndicatorValues returns an array of possible values for the EdifactDecimalIndicator const type. +func PossibleEdifactDecimalIndicatorValues() []EdifactDecimalIndicator { + return []EdifactDecimalIndicator{EdifactDecimalIndicatorComma, EdifactDecimalIndicatorDecimal, EdifactDecimalIndicatorNotSpecified} +} + +// EncryptionAlgorithm enumerates the values for encryption algorithm. +type EncryptionAlgorithm string + +const ( + // EncryptionAlgorithmAES128 ... + EncryptionAlgorithmAES128 EncryptionAlgorithm = "AES128" + // EncryptionAlgorithmAES192 ... + EncryptionAlgorithmAES192 EncryptionAlgorithm = "AES192" + // EncryptionAlgorithmAES256 ... + EncryptionAlgorithmAES256 EncryptionAlgorithm = "AES256" + // EncryptionAlgorithmDES3 ... + EncryptionAlgorithmDES3 EncryptionAlgorithm = "DES3" + // EncryptionAlgorithmNone ... + EncryptionAlgorithmNone EncryptionAlgorithm = "None" + // EncryptionAlgorithmNotSpecified ... + EncryptionAlgorithmNotSpecified EncryptionAlgorithm = "NotSpecified" + // EncryptionAlgorithmRC2 ... + EncryptionAlgorithmRC2 EncryptionAlgorithm = "RC2" +) + +// PossibleEncryptionAlgorithmValues returns an array of possible values for the EncryptionAlgorithm const type. +func PossibleEncryptionAlgorithmValues() []EncryptionAlgorithm { + return []EncryptionAlgorithm{EncryptionAlgorithmAES128, EncryptionAlgorithmAES192, EncryptionAlgorithmAES256, EncryptionAlgorithmDES3, EncryptionAlgorithmNone, EncryptionAlgorithmNotSpecified, EncryptionAlgorithmRC2} +} + +// ErrorResponseCode enumerates the values for error response code. +type ErrorResponseCode string + +const ( + // ErrorResponseCodeIntegrationServiceEnvironmentNotFound ... + ErrorResponseCodeIntegrationServiceEnvironmentNotFound ErrorResponseCode = "IntegrationServiceEnvironmentNotFound" + // ErrorResponseCodeInternalServerError ... + ErrorResponseCodeInternalServerError ErrorResponseCode = "InternalServerError" + // ErrorResponseCodeInvalidOperationID ... + ErrorResponseCodeInvalidOperationID ErrorResponseCode = "InvalidOperationId" + // ErrorResponseCodeNotSpecified ... + ErrorResponseCodeNotSpecified ErrorResponseCode = "NotSpecified" +) + +// PossibleErrorResponseCodeValues returns an array of possible values for the ErrorResponseCode const type. +func PossibleErrorResponseCodeValues() []ErrorResponseCode { + return []ErrorResponseCode{ErrorResponseCodeIntegrationServiceEnvironmentNotFound, ErrorResponseCodeInternalServerError, ErrorResponseCodeInvalidOperationID, ErrorResponseCodeNotSpecified} +} + +// EventLevel enumerates the values for event level. +type EventLevel string + +const ( + // Critical ... + Critical EventLevel = "Critical" + // Error ... + Error EventLevel = "Error" + // Informational ... + Informational EventLevel = "Informational" + // LogAlways ... + LogAlways EventLevel = "LogAlways" + // Verbose ... + Verbose EventLevel = "Verbose" + // Warning ... + Warning EventLevel = "Warning" +) + +// PossibleEventLevelValues returns an array of possible values for the EventLevel const type. +func PossibleEventLevelValues() []EventLevel { + return []EventLevel{Critical, Error, Informational, LogAlways, Verbose, Warning} +} + +// HashingAlgorithm enumerates the values for hashing algorithm. +type HashingAlgorithm string + +const ( + // HashingAlgorithmMD5 ... + HashingAlgorithmMD5 HashingAlgorithm = "MD5" + // HashingAlgorithmNone ... + HashingAlgorithmNone HashingAlgorithm = "None" + // HashingAlgorithmNotSpecified ... + HashingAlgorithmNotSpecified HashingAlgorithm = "NotSpecified" + // HashingAlgorithmSHA1 ... + HashingAlgorithmSHA1 HashingAlgorithm = "SHA1" + // HashingAlgorithmSHA2256 ... + HashingAlgorithmSHA2256 HashingAlgorithm = "SHA2256" + // HashingAlgorithmSHA2384 ... + HashingAlgorithmSHA2384 HashingAlgorithm = "SHA2384" + // HashingAlgorithmSHA2512 ... + HashingAlgorithmSHA2512 HashingAlgorithm = "SHA2512" +) + +// PossibleHashingAlgorithmValues returns an array of possible values for the HashingAlgorithm const type. +func PossibleHashingAlgorithmValues() []HashingAlgorithm { + return []HashingAlgorithm{HashingAlgorithmMD5, HashingAlgorithmNone, HashingAlgorithmNotSpecified, HashingAlgorithmSHA1, HashingAlgorithmSHA2256, HashingAlgorithmSHA2384, HashingAlgorithmSHA2512} +} + +// IntegrationAccountSkuName enumerates the values for integration account sku name. +type IntegrationAccountSkuName string + +const ( + // IntegrationAccountSkuNameBasic ... + IntegrationAccountSkuNameBasic IntegrationAccountSkuName = "Basic" + // IntegrationAccountSkuNameFree ... + IntegrationAccountSkuNameFree IntegrationAccountSkuName = "Free" + // IntegrationAccountSkuNameNotSpecified ... + IntegrationAccountSkuNameNotSpecified IntegrationAccountSkuName = "NotSpecified" + // IntegrationAccountSkuNameStandard ... + IntegrationAccountSkuNameStandard IntegrationAccountSkuName = "Standard" +) + +// PossibleIntegrationAccountSkuNameValues returns an array of possible values for the IntegrationAccountSkuName const type. +func PossibleIntegrationAccountSkuNameValues() []IntegrationAccountSkuName { + return []IntegrationAccountSkuName{IntegrationAccountSkuNameBasic, IntegrationAccountSkuNameFree, IntegrationAccountSkuNameNotSpecified, IntegrationAccountSkuNameStandard} +} + +// IntegrationServiceEnvironmentAccessEndpointType enumerates the values for integration service environment +// access endpoint type. +type IntegrationServiceEnvironmentAccessEndpointType string + +const ( + // IntegrationServiceEnvironmentAccessEndpointTypeExternal ... + IntegrationServiceEnvironmentAccessEndpointTypeExternal IntegrationServiceEnvironmentAccessEndpointType = "External" + // IntegrationServiceEnvironmentAccessEndpointTypeInternal ... + IntegrationServiceEnvironmentAccessEndpointTypeInternal IntegrationServiceEnvironmentAccessEndpointType = "Internal" + // IntegrationServiceEnvironmentAccessEndpointTypeNotSpecified ... + IntegrationServiceEnvironmentAccessEndpointTypeNotSpecified IntegrationServiceEnvironmentAccessEndpointType = "NotSpecified" +) + +// PossibleIntegrationServiceEnvironmentAccessEndpointTypeValues returns an array of possible values for the IntegrationServiceEnvironmentAccessEndpointType const type. +func PossibleIntegrationServiceEnvironmentAccessEndpointTypeValues() []IntegrationServiceEnvironmentAccessEndpointType { + return []IntegrationServiceEnvironmentAccessEndpointType{IntegrationServiceEnvironmentAccessEndpointTypeExternal, IntegrationServiceEnvironmentAccessEndpointTypeInternal, IntegrationServiceEnvironmentAccessEndpointTypeNotSpecified} +} + +// IntegrationServiceEnvironmentNetworkDependencyCategoryType enumerates the values for integration service +// environment network dependency category type. +type IntegrationServiceEnvironmentNetworkDependencyCategoryType string + +const ( + // IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAccessEndpoints ... + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAccessEndpoints IntegrationServiceEnvironmentNetworkDependencyCategoryType = "AccessEndpoints" + // IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureActiveDirectory ... + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureActiveDirectory IntegrationServiceEnvironmentNetworkDependencyCategoryType = "AzureActiveDirectory" + // IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureManagement ... + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureManagement IntegrationServiceEnvironmentNetworkDependencyCategoryType = "AzureManagement" + // IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureStorage ... + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureStorage IntegrationServiceEnvironmentNetworkDependencyCategoryType = "AzureStorage" + // IntegrationServiceEnvironmentNetworkDependencyCategoryTypeDiagnosticLogsAndMetrics ... + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeDiagnosticLogsAndMetrics IntegrationServiceEnvironmentNetworkDependencyCategoryType = "DiagnosticLogsAndMetrics" + // IntegrationServiceEnvironmentNetworkDependencyCategoryTypeIntegrationServiceEnvironmentConnectors ... + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeIntegrationServiceEnvironmentConnectors IntegrationServiceEnvironmentNetworkDependencyCategoryType = "IntegrationServiceEnvironmentConnectors" + // IntegrationServiceEnvironmentNetworkDependencyCategoryTypeNotSpecified ... + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeNotSpecified IntegrationServiceEnvironmentNetworkDependencyCategoryType = "NotSpecified" + // IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRecoveryService ... + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRecoveryService IntegrationServiceEnvironmentNetworkDependencyCategoryType = "RecoveryService" + // IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRedisCache ... + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRedisCache IntegrationServiceEnvironmentNetworkDependencyCategoryType = "RedisCache" + // IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRegionalService ... + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRegionalService IntegrationServiceEnvironmentNetworkDependencyCategoryType = "RegionalService" + // IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSQL ... + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSQL IntegrationServiceEnvironmentNetworkDependencyCategoryType = "SQL" + // IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSSLCertificateVerification ... + IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSSLCertificateVerification IntegrationServiceEnvironmentNetworkDependencyCategoryType = "SSLCertificateVerification" +) + +// PossibleIntegrationServiceEnvironmentNetworkDependencyCategoryTypeValues returns an array of possible values for the IntegrationServiceEnvironmentNetworkDependencyCategoryType const type. +func PossibleIntegrationServiceEnvironmentNetworkDependencyCategoryTypeValues() []IntegrationServiceEnvironmentNetworkDependencyCategoryType { + return []IntegrationServiceEnvironmentNetworkDependencyCategoryType{IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAccessEndpoints, IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureActiveDirectory, IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureManagement, IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureStorage, IntegrationServiceEnvironmentNetworkDependencyCategoryTypeDiagnosticLogsAndMetrics, IntegrationServiceEnvironmentNetworkDependencyCategoryTypeIntegrationServiceEnvironmentConnectors, IntegrationServiceEnvironmentNetworkDependencyCategoryTypeNotSpecified, IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRecoveryService, IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRedisCache, IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRegionalService, IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSQL, IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSSLCertificateVerification} +} + +// IntegrationServiceEnvironmentNetworkDependencyHealthState enumerates the values for integration service +// environment network dependency health state. +type IntegrationServiceEnvironmentNetworkDependencyHealthState string + +const ( + // IntegrationServiceEnvironmentNetworkDependencyHealthStateHealthy ... + IntegrationServiceEnvironmentNetworkDependencyHealthStateHealthy IntegrationServiceEnvironmentNetworkDependencyHealthState = "Healthy" + // IntegrationServiceEnvironmentNetworkDependencyHealthStateNotSpecified ... + IntegrationServiceEnvironmentNetworkDependencyHealthStateNotSpecified IntegrationServiceEnvironmentNetworkDependencyHealthState = "NotSpecified" + // IntegrationServiceEnvironmentNetworkDependencyHealthStateUnhealthy ... + IntegrationServiceEnvironmentNetworkDependencyHealthStateUnhealthy IntegrationServiceEnvironmentNetworkDependencyHealthState = "Unhealthy" + // IntegrationServiceEnvironmentNetworkDependencyHealthStateUnknown ... + IntegrationServiceEnvironmentNetworkDependencyHealthStateUnknown IntegrationServiceEnvironmentNetworkDependencyHealthState = "Unknown" +) + +// PossibleIntegrationServiceEnvironmentNetworkDependencyHealthStateValues returns an array of possible values for the IntegrationServiceEnvironmentNetworkDependencyHealthState const type. +func PossibleIntegrationServiceEnvironmentNetworkDependencyHealthStateValues() []IntegrationServiceEnvironmentNetworkDependencyHealthState { + return []IntegrationServiceEnvironmentNetworkDependencyHealthState{IntegrationServiceEnvironmentNetworkDependencyHealthStateHealthy, IntegrationServiceEnvironmentNetworkDependencyHealthStateNotSpecified, IntegrationServiceEnvironmentNetworkDependencyHealthStateUnhealthy, IntegrationServiceEnvironmentNetworkDependencyHealthStateUnknown} +} + +// IntegrationServiceEnvironmentNetworkEndPointAccessibilityState enumerates the values for integration service +// environment network end point accessibility state. +type IntegrationServiceEnvironmentNetworkEndPointAccessibilityState string + +const ( + // IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateAvailable ... + IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateAvailable IntegrationServiceEnvironmentNetworkEndPointAccessibilityState = "Available" + // IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotAvailable ... + IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotAvailable IntegrationServiceEnvironmentNetworkEndPointAccessibilityState = "NotAvailable" + // IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotSpecified ... + IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotSpecified IntegrationServiceEnvironmentNetworkEndPointAccessibilityState = "NotSpecified" + // IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateUnknown ... + IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateUnknown IntegrationServiceEnvironmentNetworkEndPointAccessibilityState = "Unknown" +) + +// PossibleIntegrationServiceEnvironmentNetworkEndPointAccessibilityStateValues returns an array of possible values for the IntegrationServiceEnvironmentNetworkEndPointAccessibilityState const type. +func PossibleIntegrationServiceEnvironmentNetworkEndPointAccessibilityStateValues() []IntegrationServiceEnvironmentNetworkEndPointAccessibilityState { + return []IntegrationServiceEnvironmentNetworkEndPointAccessibilityState{IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateAvailable, IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotAvailable, IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotSpecified, IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateUnknown} +} + +// IntegrationServiceEnvironmentSkuName enumerates the values for integration service environment sku name. +type IntegrationServiceEnvironmentSkuName string + +const ( + // IntegrationServiceEnvironmentSkuNameDeveloper ... + IntegrationServiceEnvironmentSkuNameDeveloper IntegrationServiceEnvironmentSkuName = "Developer" + // IntegrationServiceEnvironmentSkuNameNotSpecified ... + IntegrationServiceEnvironmentSkuNameNotSpecified IntegrationServiceEnvironmentSkuName = "NotSpecified" + // IntegrationServiceEnvironmentSkuNamePremium ... + IntegrationServiceEnvironmentSkuNamePremium IntegrationServiceEnvironmentSkuName = "Premium" +) + +// PossibleIntegrationServiceEnvironmentSkuNameValues returns an array of possible values for the IntegrationServiceEnvironmentSkuName const type. +func PossibleIntegrationServiceEnvironmentSkuNameValues() []IntegrationServiceEnvironmentSkuName { + return []IntegrationServiceEnvironmentSkuName{IntegrationServiceEnvironmentSkuNameDeveloper, IntegrationServiceEnvironmentSkuNameNotSpecified, IntegrationServiceEnvironmentSkuNamePremium} +} + +// IntegrationServiceEnvironmentSkuScaleType enumerates the values for integration service environment sku +// scale type. +type IntegrationServiceEnvironmentSkuScaleType string + +const ( + // Automatic ... + Automatic IntegrationServiceEnvironmentSkuScaleType = "Automatic" + // Manual ... + Manual IntegrationServiceEnvironmentSkuScaleType = "Manual" + // None ... + None IntegrationServiceEnvironmentSkuScaleType = "None" +) + +// PossibleIntegrationServiceEnvironmentSkuScaleTypeValues returns an array of possible values for the IntegrationServiceEnvironmentSkuScaleType const type. +func PossibleIntegrationServiceEnvironmentSkuScaleTypeValues() []IntegrationServiceEnvironmentSkuScaleType { + return []IntegrationServiceEnvironmentSkuScaleType{Automatic, Manual, None} +} + +// KeyType enumerates the values for key type. +type KeyType string + +const ( + // KeyTypeNotSpecified ... + KeyTypeNotSpecified KeyType = "NotSpecified" + // KeyTypePrimary ... + KeyTypePrimary KeyType = "Primary" + // KeyTypeSecondary ... + KeyTypeSecondary KeyType = "Secondary" +) + +// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. +func PossibleKeyTypeValues() []KeyType { + return []KeyType{KeyTypeNotSpecified, KeyTypePrimary, KeyTypeSecondary} +} + +// MapType enumerates the values for map type. +type MapType string + +const ( + // MapTypeLiquid ... + MapTypeLiquid MapType = "Liquid" + // MapTypeNotSpecified ... + MapTypeNotSpecified MapType = "NotSpecified" + // MapTypeXslt ... + MapTypeXslt MapType = "Xslt" + // MapTypeXslt20 ... + MapTypeXslt20 MapType = "Xslt20" + // MapTypeXslt30 ... + MapTypeXslt30 MapType = "Xslt30" +) + +// PossibleMapTypeValues returns an array of possible values for the MapType const type. +func PossibleMapTypeValues() []MapType { + return []MapType{MapTypeLiquid, MapTypeNotSpecified, MapTypeXslt, MapTypeXslt20, MapTypeXslt30} +} + +// MessageFilterType enumerates the values for message filter type. +type MessageFilterType string + +const ( + // MessageFilterTypeExclude ... + MessageFilterTypeExclude MessageFilterType = "Exclude" + // MessageFilterTypeInclude ... + MessageFilterTypeInclude MessageFilterType = "Include" + // MessageFilterTypeNotSpecified ... + MessageFilterTypeNotSpecified MessageFilterType = "NotSpecified" +) + +// PossibleMessageFilterTypeValues returns an array of possible values for the MessageFilterType const type. +func PossibleMessageFilterTypeValues() []MessageFilterType { + return []MessageFilterType{MessageFilterTypeExclude, MessageFilterTypeInclude, MessageFilterTypeNotSpecified} +} + +// ParameterType enumerates the values for parameter type. +type ParameterType string + +const ( + // ParameterTypeArray ... + ParameterTypeArray ParameterType = "Array" + // ParameterTypeBool ... + ParameterTypeBool ParameterType = "Bool" + // ParameterTypeFloat ... + ParameterTypeFloat ParameterType = "Float" + // ParameterTypeInt ... + ParameterTypeInt ParameterType = "Int" + // ParameterTypeNotSpecified ... + ParameterTypeNotSpecified ParameterType = "NotSpecified" + // ParameterTypeObject ... + ParameterTypeObject ParameterType = "Object" + // ParameterTypeSecureObject ... + ParameterTypeSecureObject ParameterType = "SecureObject" + // ParameterTypeSecureString ... + ParameterTypeSecureString ParameterType = "SecureString" + // ParameterTypeString ... + ParameterTypeString ParameterType = "String" +) + +// PossibleParameterTypeValues returns an array of possible values for the ParameterType const type. +func PossibleParameterTypeValues() []ParameterType { + return []ParameterType{ParameterTypeArray, ParameterTypeBool, ParameterTypeFloat, ParameterTypeInt, ParameterTypeNotSpecified, ParameterTypeObject, ParameterTypeSecureObject, ParameterTypeSecureString, ParameterTypeString} +} + +// PartnerType enumerates the values for partner type. +type PartnerType string + +const ( + // PartnerTypeB2B ... + PartnerTypeB2B PartnerType = "B2B" + // PartnerTypeNotSpecified ... + PartnerTypeNotSpecified PartnerType = "NotSpecified" +) + +// PossiblePartnerTypeValues returns an array of possible values for the PartnerType const type. +func PossiblePartnerTypeValues() []PartnerType { + return []PartnerType{PartnerTypeB2B, PartnerTypeNotSpecified} +} + +// RecurrenceFrequency enumerates the values for recurrence frequency. +type RecurrenceFrequency string + +const ( + // RecurrenceFrequencyDay ... + RecurrenceFrequencyDay RecurrenceFrequency = "Day" + // RecurrenceFrequencyHour ... + RecurrenceFrequencyHour RecurrenceFrequency = "Hour" + // RecurrenceFrequencyMinute ... + RecurrenceFrequencyMinute RecurrenceFrequency = "Minute" + // RecurrenceFrequencyMonth ... + RecurrenceFrequencyMonth RecurrenceFrequency = "Month" + // RecurrenceFrequencyNotSpecified ... + RecurrenceFrequencyNotSpecified RecurrenceFrequency = "NotSpecified" + // RecurrenceFrequencySecond ... + RecurrenceFrequencySecond RecurrenceFrequency = "Second" + // RecurrenceFrequencyWeek ... + RecurrenceFrequencyWeek RecurrenceFrequency = "Week" + // RecurrenceFrequencyYear ... + RecurrenceFrequencyYear RecurrenceFrequency = "Year" +) + +// PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type. +func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency { + return []RecurrenceFrequency{RecurrenceFrequencyDay, RecurrenceFrequencyHour, RecurrenceFrequencyMinute, RecurrenceFrequencyMonth, RecurrenceFrequencyNotSpecified, RecurrenceFrequencySecond, RecurrenceFrequencyWeek, RecurrenceFrequencyYear} +} + +// SchemaType enumerates the values for schema type. +type SchemaType string + +const ( + // SchemaTypeNotSpecified ... + SchemaTypeNotSpecified SchemaType = "NotSpecified" + // SchemaTypeXML ... + SchemaTypeXML SchemaType = "Xml" +) + +// PossibleSchemaTypeValues returns an array of possible values for the SchemaType const type. +func PossibleSchemaTypeValues() []SchemaType { + return []SchemaType{SchemaTypeNotSpecified, SchemaTypeXML} +} + +// SegmentTerminatorSuffix enumerates the values for segment terminator suffix. +type SegmentTerminatorSuffix string + +const ( + // SegmentTerminatorSuffixCR ... + SegmentTerminatorSuffixCR SegmentTerminatorSuffix = "CR" + // SegmentTerminatorSuffixCRLF ... + SegmentTerminatorSuffixCRLF SegmentTerminatorSuffix = "CRLF" + // SegmentTerminatorSuffixLF ... + SegmentTerminatorSuffixLF SegmentTerminatorSuffix = "LF" + // SegmentTerminatorSuffixNone ... + SegmentTerminatorSuffixNone SegmentTerminatorSuffix = "None" + // SegmentTerminatorSuffixNotSpecified ... + SegmentTerminatorSuffixNotSpecified SegmentTerminatorSuffix = "NotSpecified" +) + +// PossibleSegmentTerminatorSuffixValues returns an array of possible values for the SegmentTerminatorSuffix const type. +func PossibleSegmentTerminatorSuffixValues() []SegmentTerminatorSuffix { + return []SegmentTerminatorSuffix{SegmentTerminatorSuffixCR, SegmentTerminatorSuffixCRLF, SegmentTerminatorSuffixLF, SegmentTerminatorSuffixNone, SegmentTerminatorSuffixNotSpecified} +} + +// SigningAlgorithm enumerates the values for signing algorithm. +type SigningAlgorithm string + +const ( + // SigningAlgorithmDefault ... + SigningAlgorithmDefault SigningAlgorithm = "Default" + // SigningAlgorithmNotSpecified ... + SigningAlgorithmNotSpecified SigningAlgorithm = "NotSpecified" + // SigningAlgorithmSHA1 ... + SigningAlgorithmSHA1 SigningAlgorithm = "SHA1" + // SigningAlgorithmSHA2256 ... + SigningAlgorithmSHA2256 SigningAlgorithm = "SHA2256" + // SigningAlgorithmSHA2384 ... + SigningAlgorithmSHA2384 SigningAlgorithm = "SHA2384" + // SigningAlgorithmSHA2512 ... + SigningAlgorithmSHA2512 SigningAlgorithm = "SHA2512" +) + +// PossibleSigningAlgorithmValues returns an array of possible values for the SigningAlgorithm const type. +func PossibleSigningAlgorithmValues() []SigningAlgorithm { + return []SigningAlgorithm{SigningAlgorithmDefault, SigningAlgorithmNotSpecified, SigningAlgorithmSHA1, SigningAlgorithmSHA2256, SigningAlgorithmSHA2384, SigningAlgorithmSHA2512} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // SkuNameBasic ... + SkuNameBasic SkuName = "Basic" + // SkuNameFree ... + SkuNameFree SkuName = "Free" + // SkuNameNotSpecified ... + SkuNameNotSpecified SkuName = "NotSpecified" + // SkuNamePremium ... + SkuNamePremium SkuName = "Premium" + // SkuNameShared ... + SkuNameShared SkuName = "Shared" + // SkuNameStandard ... + SkuNameStandard SkuName = "Standard" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{SkuNameBasic, SkuNameFree, SkuNameNotSpecified, SkuNamePremium, SkuNameShared, SkuNameStandard} +} + +// StatusAnnotation enumerates the values for status annotation. +type StatusAnnotation string + +const ( + // StatusAnnotationNotSpecified ... + StatusAnnotationNotSpecified StatusAnnotation = "NotSpecified" + // StatusAnnotationPreview ... + StatusAnnotationPreview StatusAnnotation = "Preview" + // StatusAnnotationProduction ... + StatusAnnotationProduction StatusAnnotation = "Production" +) + +// PossibleStatusAnnotationValues returns an array of possible values for the StatusAnnotation const type. +func PossibleStatusAnnotationValues() []StatusAnnotation { + return []StatusAnnotation{StatusAnnotationNotSpecified, StatusAnnotationPreview, StatusAnnotationProduction} +} + +// SwaggerSchemaType enumerates the values for swagger schema type. +type SwaggerSchemaType string + +const ( + // Array ... + Array SwaggerSchemaType = "Array" + // Boolean ... + Boolean SwaggerSchemaType = "Boolean" + // File ... + File SwaggerSchemaType = "File" + // Integer ... + Integer SwaggerSchemaType = "Integer" + // Null ... + Null SwaggerSchemaType = "Null" + // Number ... + Number SwaggerSchemaType = "Number" + // Object ... + Object SwaggerSchemaType = "Object" + // String ... + String SwaggerSchemaType = "String" +) + +// PossibleSwaggerSchemaTypeValues returns an array of possible values for the SwaggerSchemaType const type. +func PossibleSwaggerSchemaTypeValues() []SwaggerSchemaType { + return []SwaggerSchemaType{Array, Boolean, File, Integer, Null, Number, Object, String} +} + +// TrackEventsOperationOptions enumerates the values for track events operation options. +type TrackEventsOperationOptions string + +const ( + // TrackEventsOperationOptionsDisableSourceInfoEnrich ... + TrackEventsOperationOptionsDisableSourceInfoEnrich TrackEventsOperationOptions = "DisableSourceInfoEnrich" + // TrackEventsOperationOptionsNone ... + TrackEventsOperationOptionsNone TrackEventsOperationOptions = "None" +) + +// PossibleTrackEventsOperationOptionsValues returns an array of possible values for the TrackEventsOperationOptions const type. +func PossibleTrackEventsOperationOptionsValues() []TrackEventsOperationOptions { + return []TrackEventsOperationOptions{TrackEventsOperationOptionsDisableSourceInfoEnrich, TrackEventsOperationOptionsNone} +} + +// TrackingRecordType enumerates the values for tracking record type. +type TrackingRecordType string + +const ( + // TrackingRecordTypeAS2MDN ... + TrackingRecordTypeAS2MDN TrackingRecordType = "AS2MDN" + // TrackingRecordTypeAS2Message ... + TrackingRecordTypeAS2Message TrackingRecordType = "AS2Message" + // TrackingRecordTypeCustom ... + TrackingRecordTypeCustom TrackingRecordType = "Custom" + // TrackingRecordTypeEdifactFunctionalGroup ... + TrackingRecordTypeEdifactFunctionalGroup TrackingRecordType = "EdifactFunctionalGroup" + // TrackingRecordTypeEdifactFunctionalGroupAcknowledgment ... + TrackingRecordTypeEdifactFunctionalGroupAcknowledgment TrackingRecordType = "EdifactFunctionalGroupAcknowledgment" + // TrackingRecordTypeEdifactInterchange ... + TrackingRecordTypeEdifactInterchange TrackingRecordType = "EdifactInterchange" + // TrackingRecordTypeEdifactInterchangeAcknowledgment ... + TrackingRecordTypeEdifactInterchangeAcknowledgment TrackingRecordType = "EdifactInterchangeAcknowledgment" + // TrackingRecordTypeEdifactTransactionSet ... + TrackingRecordTypeEdifactTransactionSet TrackingRecordType = "EdifactTransactionSet" + // TrackingRecordTypeEdifactTransactionSetAcknowledgment ... + TrackingRecordTypeEdifactTransactionSetAcknowledgment TrackingRecordType = "EdifactTransactionSetAcknowledgment" + // TrackingRecordTypeNotSpecified ... + TrackingRecordTypeNotSpecified TrackingRecordType = "NotSpecified" + // TrackingRecordTypeX12FunctionalGroup ... + TrackingRecordTypeX12FunctionalGroup TrackingRecordType = "X12FunctionalGroup" + // TrackingRecordTypeX12FunctionalGroupAcknowledgment ... + TrackingRecordTypeX12FunctionalGroupAcknowledgment TrackingRecordType = "X12FunctionalGroupAcknowledgment" + // TrackingRecordTypeX12Interchange ... + TrackingRecordTypeX12Interchange TrackingRecordType = "X12Interchange" + // TrackingRecordTypeX12InterchangeAcknowledgment ... + TrackingRecordTypeX12InterchangeAcknowledgment TrackingRecordType = "X12InterchangeAcknowledgment" + // TrackingRecordTypeX12TransactionSet ... + TrackingRecordTypeX12TransactionSet TrackingRecordType = "X12TransactionSet" + // TrackingRecordTypeX12TransactionSetAcknowledgment ... + TrackingRecordTypeX12TransactionSetAcknowledgment TrackingRecordType = "X12TransactionSetAcknowledgment" +) + +// PossibleTrackingRecordTypeValues returns an array of possible values for the TrackingRecordType const type. +func PossibleTrackingRecordTypeValues() []TrackingRecordType { + return []TrackingRecordType{TrackingRecordTypeAS2MDN, TrackingRecordTypeAS2Message, TrackingRecordTypeCustom, TrackingRecordTypeEdifactFunctionalGroup, TrackingRecordTypeEdifactFunctionalGroupAcknowledgment, TrackingRecordTypeEdifactInterchange, TrackingRecordTypeEdifactInterchangeAcknowledgment, TrackingRecordTypeEdifactTransactionSet, TrackingRecordTypeEdifactTransactionSetAcknowledgment, TrackingRecordTypeNotSpecified, TrackingRecordTypeX12FunctionalGroup, TrackingRecordTypeX12FunctionalGroupAcknowledgment, TrackingRecordTypeX12Interchange, TrackingRecordTypeX12InterchangeAcknowledgment, TrackingRecordTypeX12TransactionSet, TrackingRecordTypeX12TransactionSetAcknowledgment} +} + +// TrailingSeparatorPolicy enumerates the values for trailing separator policy. +type TrailingSeparatorPolicy string + +const ( + // TrailingSeparatorPolicyMandatory ... + TrailingSeparatorPolicyMandatory TrailingSeparatorPolicy = "Mandatory" + // TrailingSeparatorPolicyNotAllowed ... + TrailingSeparatorPolicyNotAllowed TrailingSeparatorPolicy = "NotAllowed" + // TrailingSeparatorPolicyNotSpecified ... + TrailingSeparatorPolicyNotSpecified TrailingSeparatorPolicy = "NotSpecified" + // TrailingSeparatorPolicyOptional ... + TrailingSeparatorPolicyOptional TrailingSeparatorPolicy = "Optional" +) + +// PossibleTrailingSeparatorPolicyValues returns an array of possible values for the TrailingSeparatorPolicy const type. +func PossibleTrailingSeparatorPolicyValues() []TrailingSeparatorPolicy { + return []TrailingSeparatorPolicy{TrailingSeparatorPolicyMandatory, TrailingSeparatorPolicyNotAllowed, TrailingSeparatorPolicyNotSpecified, TrailingSeparatorPolicyOptional} +} + +// UsageIndicator enumerates the values for usage indicator. +type UsageIndicator string + +const ( + // UsageIndicatorInformation ... + UsageIndicatorInformation UsageIndicator = "Information" + // UsageIndicatorNotSpecified ... + UsageIndicatorNotSpecified UsageIndicator = "NotSpecified" + // UsageIndicatorProduction ... + UsageIndicatorProduction UsageIndicator = "Production" + // UsageIndicatorTest ... + UsageIndicatorTest UsageIndicator = "Test" +) + +// PossibleUsageIndicatorValues returns an array of possible values for the UsageIndicator const type. +func PossibleUsageIndicatorValues() []UsageIndicator { + return []UsageIndicator{UsageIndicatorInformation, UsageIndicatorNotSpecified, UsageIndicatorProduction, UsageIndicatorTest} +} + +// WorkflowProvisioningState enumerates the values for workflow provisioning state. +type WorkflowProvisioningState string + +const ( + // WorkflowProvisioningStateAccepted ... + WorkflowProvisioningStateAccepted WorkflowProvisioningState = "Accepted" + // WorkflowProvisioningStateCanceled ... + WorkflowProvisioningStateCanceled WorkflowProvisioningState = "Canceled" + // WorkflowProvisioningStateCompleted ... + WorkflowProvisioningStateCompleted WorkflowProvisioningState = "Completed" + // WorkflowProvisioningStateCreated ... + WorkflowProvisioningStateCreated WorkflowProvisioningState = "Created" + // WorkflowProvisioningStateCreating ... + WorkflowProvisioningStateCreating WorkflowProvisioningState = "Creating" + // WorkflowProvisioningStateDeleted ... + WorkflowProvisioningStateDeleted WorkflowProvisioningState = "Deleted" + // WorkflowProvisioningStateDeleting ... + WorkflowProvisioningStateDeleting WorkflowProvisioningState = "Deleting" + // WorkflowProvisioningStateFailed ... + WorkflowProvisioningStateFailed WorkflowProvisioningState = "Failed" + // WorkflowProvisioningStateMoving ... + WorkflowProvisioningStateMoving WorkflowProvisioningState = "Moving" + // WorkflowProvisioningStateNotSpecified ... + WorkflowProvisioningStateNotSpecified WorkflowProvisioningState = "NotSpecified" + // WorkflowProvisioningStateReady ... + WorkflowProvisioningStateReady WorkflowProvisioningState = "Ready" + // WorkflowProvisioningStateRegistered ... + WorkflowProvisioningStateRegistered WorkflowProvisioningState = "Registered" + // WorkflowProvisioningStateRegistering ... + WorkflowProvisioningStateRegistering WorkflowProvisioningState = "Registering" + // WorkflowProvisioningStateRunning ... + WorkflowProvisioningStateRunning WorkflowProvisioningState = "Running" + // WorkflowProvisioningStateSucceeded ... + WorkflowProvisioningStateSucceeded WorkflowProvisioningState = "Succeeded" + // WorkflowProvisioningStateUnregistered ... + WorkflowProvisioningStateUnregistered WorkflowProvisioningState = "Unregistered" + // WorkflowProvisioningStateUnregistering ... + WorkflowProvisioningStateUnregistering WorkflowProvisioningState = "Unregistering" + // WorkflowProvisioningStateUpdating ... + WorkflowProvisioningStateUpdating WorkflowProvisioningState = "Updating" +) + +// PossibleWorkflowProvisioningStateValues returns an array of possible values for the WorkflowProvisioningState const type. +func PossibleWorkflowProvisioningStateValues() []WorkflowProvisioningState { + return []WorkflowProvisioningState{WorkflowProvisioningStateAccepted, WorkflowProvisioningStateCanceled, WorkflowProvisioningStateCompleted, WorkflowProvisioningStateCreated, WorkflowProvisioningStateCreating, WorkflowProvisioningStateDeleted, WorkflowProvisioningStateDeleting, WorkflowProvisioningStateFailed, WorkflowProvisioningStateMoving, WorkflowProvisioningStateNotSpecified, WorkflowProvisioningStateReady, WorkflowProvisioningStateRegistered, WorkflowProvisioningStateRegistering, WorkflowProvisioningStateRunning, WorkflowProvisioningStateSucceeded, WorkflowProvisioningStateUnregistered, WorkflowProvisioningStateUnregistering, WorkflowProvisioningStateUpdating} +} + +// WorkflowState enumerates the values for workflow state. +type WorkflowState string + +const ( + // WorkflowStateCompleted ... + WorkflowStateCompleted WorkflowState = "Completed" + // WorkflowStateDeleted ... + WorkflowStateDeleted WorkflowState = "Deleted" + // WorkflowStateDisabled ... + WorkflowStateDisabled WorkflowState = "Disabled" + // WorkflowStateEnabled ... + WorkflowStateEnabled WorkflowState = "Enabled" + // WorkflowStateNotSpecified ... + WorkflowStateNotSpecified WorkflowState = "NotSpecified" + // WorkflowStateSuspended ... + WorkflowStateSuspended WorkflowState = "Suspended" +) + +// PossibleWorkflowStateValues returns an array of possible values for the WorkflowState const type. +func PossibleWorkflowStateValues() []WorkflowState { + return []WorkflowState{WorkflowStateCompleted, WorkflowStateDeleted, WorkflowStateDisabled, WorkflowStateEnabled, WorkflowStateNotSpecified, WorkflowStateSuspended} +} + +// WorkflowStatus enumerates the values for workflow status. +type WorkflowStatus string + +const ( + // WorkflowStatusAborted ... + WorkflowStatusAborted WorkflowStatus = "Aborted" + // WorkflowStatusCancelled ... + WorkflowStatusCancelled WorkflowStatus = "Cancelled" + // WorkflowStatusFailed ... + WorkflowStatusFailed WorkflowStatus = "Failed" + // WorkflowStatusFaulted ... + WorkflowStatusFaulted WorkflowStatus = "Faulted" + // WorkflowStatusIgnored ... + WorkflowStatusIgnored WorkflowStatus = "Ignored" + // WorkflowStatusNotSpecified ... + WorkflowStatusNotSpecified WorkflowStatus = "NotSpecified" + // WorkflowStatusPaused ... + WorkflowStatusPaused WorkflowStatus = "Paused" + // WorkflowStatusRunning ... + WorkflowStatusRunning WorkflowStatus = "Running" + // WorkflowStatusSkipped ... + WorkflowStatusSkipped WorkflowStatus = "Skipped" + // WorkflowStatusSucceeded ... + WorkflowStatusSucceeded WorkflowStatus = "Succeeded" + // WorkflowStatusSuspended ... + WorkflowStatusSuspended WorkflowStatus = "Suspended" + // WorkflowStatusTimedOut ... + WorkflowStatusTimedOut WorkflowStatus = "TimedOut" + // WorkflowStatusWaiting ... + WorkflowStatusWaiting WorkflowStatus = "Waiting" +) + +// PossibleWorkflowStatusValues returns an array of possible values for the WorkflowStatus const type. +func PossibleWorkflowStatusValues() []WorkflowStatus { + return []WorkflowStatus{WorkflowStatusAborted, WorkflowStatusCancelled, WorkflowStatusFailed, WorkflowStatusFaulted, WorkflowStatusIgnored, WorkflowStatusNotSpecified, WorkflowStatusPaused, WorkflowStatusRunning, WorkflowStatusSkipped, WorkflowStatusSucceeded, WorkflowStatusSuspended, WorkflowStatusTimedOut, WorkflowStatusWaiting} +} + +// WorkflowTriggerProvisioningState enumerates the values for workflow trigger provisioning state. +type WorkflowTriggerProvisioningState string + +const ( + // WorkflowTriggerProvisioningStateAccepted ... + WorkflowTriggerProvisioningStateAccepted WorkflowTriggerProvisioningState = "Accepted" + // WorkflowTriggerProvisioningStateCanceled ... + WorkflowTriggerProvisioningStateCanceled WorkflowTriggerProvisioningState = "Canceled" + // WorkflowTriggerProvisioningStateCompleted ... + WorkflowTriggerProvisioningStateCompleted WorkflowTriggerProvisioningState = "Completed" + // WorkflowTriggerProvisioningStateCreated ... + WorkflowTriggerProvisioningStateCreated WorkflowTriggerProvisioningState = "Created" + // WorkflowTriggerProvisioningStateCreating ... + WorkflowTriggerProvisioningStateCreating WorkflowTriggerProvisioningState = "Creating" + // WorkflowTriggerProvisioningStateDeleted ... + WorkflowTriggerProvisioningStateDeleted WorkflowTriggerProvisioningState = "Deleted" + // WorkflowTriggerProvisioningStateDeleting ... + WorkflowTriggerProvisioningStateDeleting WorkflowTriggerProvisioningState = "Deleting" + // WorkflowTriggerProvisioningStateFailed ... + WorkflowTriggerProvisioningStateFailed WorkflowTriggerProvisioningState = "Failed" + // WorkflowTriggerProvisioningStateMoving ... + WorkflowTriggerProvisioningStateMoving WorkflowTriggerProvisioningState = "Moving" + // WorkflowTriggerProvisioningStateNotSpecified ... + WorkflowTriggerProvisioningStateNotSpecified WorkflowTriggerProvisioningState = "NotSpecified" + // WorkflowTriggerProvisioningStateReady ... + WorkflowTriggerProvisioningStateReady WorkflowTriggerProvisioningState = "Ready" + // WorkflowTriggerProvisioningStateRegistered ... + WorkflowTriggerProvisioningStateRegistered WorkflowTriggerProvisioningState = "Registered" + // WorkflowTriggerProvisioningStateRegistering ... + WorkflowTriggerProvisioningStateRegistering WorkflowTriggerProvisioningState = "Registering" + // WorkflowTriggerProvisioningStateRunning ... + WorkflowTriggerProvisioningStateRunning WorkflowTriggerProvisioningState = "Running" + // WorkflowTriggerProvisioningStateSucceeded ... + WorkflowTriggerProvisioningStateSucceeded WorkflowTriggerProvisioningState = "Succeeded" + // WorkflowTriggerProvisioningStateUnregistered ... + WorkflowTriggerProvisioningStateUnregistered WorkflowTriggerProvisioningState = "Unregistered" + // WorkflowTriggerProvisioningStateUnregistering ... + WorkflowTriggerProvisioningStateUnregistering WorkflowTriggerProvisioningState = "Unregistering" + // WorkflowTriggerProvisioningStateUpdating ... + WorkflowTriggerProvisioningStateUpdating WorkflowTriggerProvisioningState = "Updating" +) + +// PossibleWorkflowTriggerProvisioningStateValues returns an array of possible values for the WorkflowTriggerProvisioningState const type. +func PossibleWorkflowTriggerProvisioningStateValues() []WorkflowTriggerProvisioningState { + return []WorkflowTriggerProvisioningState{WorkflowTriggerProvisioningStateAccepted, WorkflowTriggerProvisioningStateCanceled, WorkflowTriggerProvisioningStateCompleted, WorkflowTriggerProvisioningStateCreated, WorkflowTriggerProvisioningStateCreating, WorkflowTriggerProvisioningStateDeleted, WorkflowTriggerProvisioningStateDeleting, WorkflowTriggerProvisioningStateFailed, WorkflowTriggerProvisioningStateMoving, WorkflowTriggerProvisioningStateNotSpecified, WorkflowTriggerProvisioningStateReady, WorkflowTriggerProvisioningStateRegistered, WorkflowTriggerProvisioningStateRegistering, WorkflowTriggerProvisioningStateRunning, WorkflowTriggerProvisioningStateSucceeded, WorkflowTriggerProvisioningStateUnregistered, WorkflowTriggerProvisioningStateUnregistering, WorkflowTriggerProvisioningStateUpdating} +} + +// WsdlImportMethod enumerates the values for wsdl import method. +type WsdlImportMethod string + +const ( + // WsdlImportMethodNotSpecified ... + WsdlImportMethodNotSpecified WsdlImportMethod = "NotSpecified" + // WsdlImportMethodSoapPassThrough ... + WsdlImportMethodSoapPassThrough WsdlImportMethod = "SoapPassThrough" + // WsdlImportMethodSoapToRest ... + WsdlImportMethodSoapToRest WsdlImportMethod = "SoapToRest" +) + +// PossibleWsdlImportMethodValues returns an array of possible values for the WsdlImportMethod const type. +func PossibleWsdlImportMethodValues() []WsdlImportMethod { + return []WsdlImportMethod{WsdlImportMethodNotSpecified, WsdlImportMethodSoapPassThrough, WsdlImportMethodSoapToRest} +} + +// X12CharacterSet enumerates the values for x12 character set. +type X12CharacterSet string + +const ( + // X12CharacterSetBasic ... + X12CharacterSetBasic X12CharacterSet = "Basic" + // X12CharacterSetExtended ... + X12CharacterSetExtended X12CharacterSet = "Extended" + // X12CharacterSetNotSpecified ... + X12CharacterSetNotSpecified X12CharacterSet = "NotSpecified" + // X12CharacterSetUTF8 ... + X12CharacterSetUTF8 X12CharacterSet = "UTF8" +) + +// PossibleX12CharacterSetValues returns an array of possible values for the X12CharacterSet const type. +func PossibleX12CharacterSetValues() []X12CharacterSet { + return []X12CharacterSet{X12CharacterSetBasic, X12CharacterSetExtended, X12CharacterSetNotSpecified, X12CharacterSetUTF8} +} + +// X12DateFormat enumerates the values for x12 date format. +type X12DateFormat string + +const ( + // X12DateFormatCCYYMMDD ... + X12DateFormatCCYYMMDD X12DateFormat = "CCYYMMDD" + // X12DateFormatNotSpecified ... + X12DateFormatNotSpecified X12DateFormat = "NotSpecified" + // X12DateFormatYYMMDD ... + X12DateFormatYYMMDD X12DateFormat = "YYMMDD" +) + +// PossibleX12DateFormatValues returns an array of possible values for the X12DateFormat const type. +func PossibleX12DateFormatValues() []X12DateFormat { + return []X12DateFormat{X12DateFormatCCYYMMDD, X12DateFormatNotSpecified, X12DateFormatYYMMDD} +} + +// X12TimeFormat enumerates the values for x12 time format. +type X12TimeFormat string + +const ( + // X12TimeFormatHHMM ... + X12TimeFormatHHMM X12TimeFormat = "HHMM" + // X12TimeFormatHHMMSS ... + X12TimeFormatHHMMSS X12TimeFormat = "HHMMSS" + // X12TimeFormatHHMMSSd ... + X12TimeFormatHHMMSSd X12TimeFormat = "HHMMSSd" + // X12TimeFormatHHMMSSdd ... + X12TimeFormatHHMMSSdd X12TimeFormat = "HHMMSSdd" + // X12TimeFormatNotSpecified ... + X12TimeFormatNotSpecified X12TimeFormat = "NotSpecified" +) + +// PossibleX12TimeFormatValues returns an array of possible values for the X12TimeFormat const type. +func PossibleX12TimeFormatValues() []X12TimeFormat { + return []X12TimeFormat{X12TimeFormatHHMM, X12TimeFormatHHMMSS, X12TimeFormatHHMMSSd, X12TimeFormatHHMMSSdd, X12TimeFormatNotSpecified} +} + +// AgreementContent the integration account agreement content. +type AgreementContent struct { + // AS2 - The AS2 agreement content. + AS2 *AS2AgreementContent `json:"aS2,omitempty"` + // X12 - The X12 agreement content. + X12 *X12AgreementContent `json:"x12,omitempty"` + // Edifact - The EDIFACT agreement content. + Edifact *EdifactAgreementContent `json:"edifact,omitempty"` +} + +// APIDeploymentParameterMetadata the API deployment parameter metadata. +type APIDeploymentParameterMetadata struct { + // Type - The type. + Type *string `json:"type,omitempty"` + // IsRequired - Indicates whether its required. + IsRequired *bool `json:"isRequired,omitempty"` + // DisplayName - The display name. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description. + Description *string `json:"description,omitempty"` + // Visibility - The visibility. Possible values include: 'APIDeploymentParameterVisibilityNotSpecified', 'APIDeploymentParameterVisibilityDefault', 'APIDeploymentParameterVisibilityInternal' + Visibility APIDeploymentParameterVisibility `json:"visibility,omitempty"` +} + +// APIDeploymentParameterMetadataSet the API deployment parameters metadata. +type APIDeploymentParameterMetadataSet struct { + // PackageContentLink - The package content link parameter. + PackageContentLink *APIDeploymentParameterMetadata `json:"packageContentLink,omitempty"` + // RedisCacheConnectionString - The package content link parameter. + RedisCacheConnectionString *APIDeploymentParameterMetadata `json:"redisCacheConnectionString,omitempty"` +} + +// APIOperation the api operation. +type APIOperation struct { + Properties *APIOperationPropertiesDefinition `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 APIOperation. +func (ao APIOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ao.Properties != nil { + objectMap["properties"] = ao.Properties + } + if ao.Location != nil { + objectMap["location"] = ao.Location + } + if ao.Tags != nil { + objectMap["tags"] = ao.Tags + } + return json.Marshal(objectMap) +} + +// APIOperationAnnotation the Api Operation Annotation. +type APIOperationAnnotation struct { + // Status - Possible values include: 'StatusAnnotationNotSpecified', 'StatusAnnotationPreview', 'StatusAnnotationProduction' + Status StatusAnnotation `json:"status,omitempty"` + // Family - The family. + Family *string `json:"family,omitempty"` + // Revision - The revision. + Revision *int32 `json:"revision,omitempty"` +} + +// APIOperationListResult the list of managed API operations. +type APIOperationListResult struct { + autorest.Response `json:"-"` + // Value - The api operation definitions for an API. + Value *[]APIOperation `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// APIOperationListResultIterator provides access to a complete listing of APIOperation values. +type APIOperationListResultIterator struct { + i int + page APIOperationListResultPage +} + +// 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 *APIOperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/APIOperationListResultIterator.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 *APIOperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter APIOperationListResultIterator) 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 APIOperationListResultIterator) Response() APIOperationListResult { + 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 APIOperationListResultIterator) Value() APIOperation { + if !iter.page.NotDone() { + return APIOperation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the APIOperationListResultIterator type. +func NewAPIOperationListResultIterator(page APIOperationListResultPage) APIOperationListResultIterator { + return APIOperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (aolr APIOperationListResult) IsEmpty() bool { + return aolr.Value == nil || len(*aolr.Value) == 0 +} + +// aPIOperationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (aolr APIOperationListResult) aPIOperationListResultPreparer(ctx context.Context) (*http.Request, error) { + if aolr.NextLink == nil || len(to.String(aolr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(aolr.NextLink))) +} + +// APIOperationListResultPage contains a page of APIOperation values. +type APIOperationListResultPage struct { + fn func(context.Context, APIOperationListResult) (APIOperationListResult, error) + aolr APIOperationListResult +} + +// 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 *APIOperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/APIOperationListResultPage.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.aolr) + if err != nil { + return err + } + page.aolr = 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 *APIOperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page APIOperationListResultPage) NotDone() bool { + return !page.aolr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page APIOperationListResultPage) Response() APIOperationListResult { + return page.aolr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page APIOperationListResultPage) Values() []APIOperation { + if page.aolr.IsEmpty() { + return nil + } + return *page.aolr.Value +} + +// Creates a new instance of the APIOperationListResultPage type. +func NewAPIOperationListResultPage(getNextPage func(context.Context, APIOperationListResult) (APIOperationListResult, error)) APIOperationListResultPage { + return APIOperationListResultPage{fn: getNextPage} +} + +// APIOperationPropertiesDefinition the api operations properties +type APIOperationPropertiesDefinition struct { + // Summary - The summary of the api operation. + Summary *string `json:"summary,omitempty"` + // Description - The description of the api operation. + Description *string `json:"description,omitempty"` + // Visibility - The visibility of the api operation. + Visibility *string `json:"visibility,omitempty"` + // Trigger - The trigger type of api operation. + Trigger *string `json:"trigger,omitempty"` + // TriggerHint - The trigger hint for the api operation. + TriggerHint *string `json:"triggerHint,omitempty"` + // Pageable - Indicates whether the api operation is pageable. + Pageable *bool `json:"pageable,omitempty"` + // Annotation - The annotation of api operation. + Annotation *APIOperationAnnotation `json:"annotation,omitempty"` + // API - The api reference. + API *APIReference `json:"api,omitempty"` + // InputsDefinition - The operation inputs definition schema. + InputsDefinition *SwaggerSchema `json:"inputsDefinition,omitempty"` + // ResponsesDefinition - The operation responses definition schemas. + ResponsesDefinition map[string]*SwaggerSchema `json:"responsesDefinition"` + // IsWebhook - Indicates whether the API operation is webhook or not. + IsWebhook *bool `json:"isWebhook,omitempty"` + // IsNotification - Indicates whether the API operation is notification or not. + IsNotification *bool `json:"isNotification,omitempty"` +} + +// MarshalJSON is the custom marshaler for APIOperationPropertiesDefinition. +func (aopd APIOperationPropertiesDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aopd.Summary != nil { + objectMap["summary"] = aopd.Summary + } + if aopd.Description != nil { + objectMap["description"] = aopd.Description + } + if aopd.Visibility != nil { + objectMap["visibility"] = aopd.Visibility + } + if aopd.Trigger != nil { + objectMap["trigger"] = aopd.Trigger + } + if aopd.TriggerHint != nil { + objectMap["triggerHint"] = aopd.TriggerHint + } + if aopd.Pageable != nil { + objectMap["pageable"] = aopd.Pageable + } + if aopd.Annotation != nil { + objectMap["annotation"] = aopd.Annotation + } + if aopd.API != nil { + objectMap["api"] = aopd.API + } + if aopd.InputsDefinition != nil { + objectMap["inputsDefinition"] = aopd.InputsDefinition + } + if aopd.ResponsesDefinition != nil { + objectMap["responsesDefinition"] = aopd.ResponsesDefinition + } + if aopd.IsWebhook != nil { + objectMap["isWebhook"] = aopd.IsWebhook + } + if aopd.IsNotification != nil { + objectMap["isNotification"] = aopd.IsNotification + } + return json.Marshal(objectMap) +} + +// APIReference the Api reference. +type APIReference struct { + // DisplayName - The display name of the api. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description of the api. + Description *string `json:"description,omitempty"` + // IconURI - The icon uri of the api. + IconURI *string `json:"iconUri,omitempty"` + // Swagger - The swagger of the api. + Swagger interface{} `json:"swagger,omitempty"` + // BrandColor - The brand color of the api. + BrandColor *string `json:"brandColor,omitempty"` + // Category - The tier. Possible values include: 'APITierNotSpecified', 'APITierEnterprise', 'APITierStandard', 'APITierPremium' + Category APITier `json:"category,omitempty"` + // IntegrationServiceEnvironment - The integration service environment reference. + IntegrationServiceEnvironment *ResourceReference `json:"integrationServiceEnvironment,omitempty"` + // ID - The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the resource type. + Type *string `json:"type,omitempty"` +} + +// APIResourceBackendService the API backend service. +type APIResourceBackendService struct { + // ServiceURL - The service URL. + ServiceURL *string `json:"serviceUrl,omitempty"` +} + +// APIResourceDefinitions the Api resource definition. +type APIResourceDefinitions struct { + // OriginalSwaggerURL - The original swagger url. + OriginalSwaggerURL *string `json:"originalSwaggerUrl,omitempty"` + // ModifiedSwaggerURL - The modified swagger url. + ModifiedSwaggerURL *string `json:"modifiedSwaggerUrl,omitempty"` +} + +// APIResourceGeneralInformation the API general information. +type APIResourceGeneralInformation struct { + // IconURL - The icon url. + IconURL *string `json:"iconUrl,omitempty"` + // DisplayName - The display name. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description. + Description *string `json:"description,omitempty"` + // TermsOfUseURL - The terms of use url. + TermsOfUseURL *string `json:"termsOfUseUrl,omitempty"` + // ReleaseTag - The release tag. + ReleaseTag *string `json:"releaseTag,omitempty"` + // Tier - The tier. Possible values include: 'APITierNotSpecified', 'APITierEnterprise', 'APITierStandard', 'APITierPremium' + Tier APITier `json:"tier,omitempty"` +} + +// APIResourceMetadata the api resource metadata. +type APIResourceMetadata struct { + // Source - The source. + Source *string `json:"source,omitempty"` + // BrandColor - The brand color. + BrandColor *string `json:"brandColor,omitempty"` + // HideKey - The hide key. + HideKey *string `json:"hideKey,omitempty"` + // Tags - The tags. + Tags map[string]*string `json:"tags"` + // APIType - The api type. Possible values include: 'APITypeNotSpecified', 'APITypeRest', 'APITypeSoap' + APIType APIType `json:"ApiType,omitempty"` + // WsdlService - The WSDL service. + WsdlService *WsdlService `json:"wsdlService,omitempty"` + // WsdlImportMethod - The WSDL import method. Possible values include: 'WsdlImportMethodNotSpecified', 'WsdlImportMethodSoapToRest', 'WsdlImportMethodSoapPassThrough' + WsdlImportMethod WsdlImportMethod `json:"wsdlImportMethod,omitempty"` + // ConnectionType - The connection type. + ConnectionType *string `json:"connectionType,omitempty"` + // ProvisioningState - The provisioning state. Possible values include: 'WorkflowProvisioningStateNotSpecified', 'WorkflowProvisioningStateAccepted', 'WorkflowProvisioningStateRunning', 'WorkflowProvisioningStateReady', 'WorkflowProvisioningStateCreating', 'WorkflowProvisioningStateCreated', 'WorkflowProvisioningStateDeleting', 'WorkflowProvisioningStateDeleted', 'WorkflowProvisioningStateCanceled', 'WorkflowProvisioningStateFailed', 'WorkflowProvisioningStateSucceeded', 'WorkflowProvisioningStateMoving', 'WorkflowProvisioningStateUpdating', 'WorkflowProvisioningStateRegistering', 'WorkflowProvisioningStateRegistered', 'WorkflowProvisioningStateUnregistering', 'WorkflowProvisioningStateUnregistered', 'WorkflowProvisioningStateCompleted' + ProvisioningState WorkflowProvisioningState `json:"provisioningState,omitempty"` + // DeploymentParameters - The connector deployment parameters metadata. + DeploymentParameters *APIDeploymentParameterMetadataSet `json:"deploymentParameters,omitempty"` +} + +// MarshalJSON is the custom marshaler for APIResourceMetadata. +func (arm APIResourceMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if arm.Source != nil { + objectMap["source"] = arm.Source + } + if arm.BrandColor != nil { + objectMap["brandColor"] = arm.BrandColor + } + if arm.HideKey != nil { + objectMap["hideKey"] = arm.HideKey + } + if arm.Tags != nil { + objectMap["tags"] = arm.Tags + } + if arm.APIType != "" { + objectMap["ApiType"] = arm.APIType + } + if arm.WsdlService != nil { + objectMap["wsdlService"] = arm.WsdlService + } + if arm.WsdlImportMethod != "" { + objectMap["wsdlImportMethod"] = arm.WsdlImportMethod + } + if arm.ConnectionType != nil { + objectMap["connectionType"] = arm.ConnectionType + } + if arm.ProvisioningState != "" { + objectMap["provisioningState"] = arm.ProvisioningState + } + if arm.DeploymentParameters != nil { + objectMap["deploymentParameters"] = arm.DeploymentParameters + } + return json.Marshal(objectMap) +} + +// APIResourcePolicies the API resource policies. +type APIResourcePolicies struct { + // Content - The API level only policies XML as embedded content. + Content *string `json:"content,omitempty"` + // ContentLink - The content link to the policies. + ContentLink *string `json:"contentLink,omitempty"` +} + +// APIResourceProperties the API resource properties. +type APIResourceProperties struct { + // Name - The name + Name *string `json:"name,omitempty"` + // ConnectionParameters - The connection parameters. + ConnectionParameters map[string]interface{} `json:"connectionParameters"` + // Metadata - The metadata. + Metadata *APIResourceMetadata `json:"metadata,omitempty"` + // RuntimeUrls - The runtime urls. + RuntimeUrls *[]string `json:"runtimeUrls,omitempty"` + // GeneralInformation - The api general information. + GeneralInformation *APIResourceGeneralInformation `json:"generalInformation,omitempty"` + // Capabilities - The capabilities. + Capabilities *[]string `json:"capabilities,omitempty"` + // BackendService - The backend service. + BackendService *APIResourceBackendService `json:"backendService,omitempty"` + // Policies - The policies for the API. + Policies *APIResourcePolicies `json:"policies,omitempty"` + // APIDefinitionURL - The API definition. + APIDefinitionURL *string `json:"apiDefinitionUrl,omitempty"` + // APIDefinitions - The api definitions. + APIDefinitions *APIResourceDefinitions `json:"apiDefinitions,omitempty"` + // IntegrationServiceEnvironment - The integration service environment reference. + IntegrationServiceEnvironment *ResourceReference `json:"integrationServiceEnvironment,omitempty"` + // ProvisioningState - The provisioning state. Possible values include: 'WorkflowProvisioningStateNotSpecified', 'WorkflowProvisioningStateAccepted', 'WorkflowProvisioningStateRunning', 'WorkflowProvisioningStateReady', 'WorkflowProvisioningStateCreating', 'WorkflowProvisioningStateCreated', 'WorkflowProvisioningStateDeleting', 'WorkflowProvisioningStateDeleted', 'WorkflowProvisioningStateCanceled', 'WorkflowProvisioningStateFailed', 'WorkflowProvisioningStateSucceeded', 'WorkflowProvisioningStateMoving', 'WorkflowProvisioningStateUpdating', 'WorkflowProvisioningStateRegistering', 'WorkflowProvisioningStateRegistered', 'WorkflowProvisioningStateUnregistering', 'WorkflowProvisioningStateUnregistered', 'WorkflowProvisioningStateCompleted' + ProvisioningState WorkflowProvisioningState `json:"provisioningState,omitempty"` + // Category - The category. Possible values include: 'APITierNotSpecified', 'APITierEnterprise', 'APITierStandard', 'APITierPremium' + Category APITier `json:"category,omitempty"` +} + +// MarshalJSON is the custom marshaler for APIResourceProperties. +func (arp APIResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if arp.Name != nil { + objectMap["name"] = arp.Name + } + if arp.ConnectionParameters != nil { + objectMap["connectionParameters"] = arp.ConnectionParameters + } + if arp.Metadata != nil { + objectMap["metadata"] = arp.Metadata + } + if arp.RuntimeUrls != nil { + objectMap["runtimeUrls"] = arp.RuntimeUrls + } + if arp.GeneralInformation != nil { + objectMap["generalInformation"] = arp.GeneralInformation + } + if arp.Capabilities != nil { + objectMap["capabilities"] = arp.Capabilities + } + if arp.BackendService != nil { + objectMap["backendService"] = arp.BackendService + } + if arp.Policies != nil { + objectMap["policies"] = arp.Policies + } + if arp.APIDefinitionURL != nil { + objectMap["apiDefinitionUrl"] = arp.APIDefinitionURL + } + if arp.APIDefinitions != nil { + objectMap["apiDefinitions"] = arp.APIDefinitions + } + if arp.IntegrationServiceEnvironment != nil { + objectMap["integrationServiceEnvironment"] = arp.IntegrationServiceEnvironment + } + if arp.ProvisioningState != "" { + objectMap["provisioningState"] = arp.ProvisioningState + } + if arp.Category != "" { + objectMap["category"] = arp.Category + } + return json.Marshal(objectMap) +} + +// ArtifactContentPropertiesDefinition the artifact content properties definition. +type ArtifactContentPropertiesDefinition struct { + Content interface{} `json:"content,omitempty"` + // ContentType - The content type. + ContentType *string `json:"contentType,omitempty"` + // ContentLink - The content link. + ContentLink *ContentLink `json:"contentLink,omitempty"` + // CreatedTime - The artifact creation time. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ChangedTime - The artifact changed time. + ChangedTime *date.Time `json:"changedTime,omitempty"` + Metadata interface{} `json:"metadata,omitempty"` +} + +// ArtifactProperties the artifact properties definition. +type ArtifactProperties struct { + // CreatedTime - The artifact creation time. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ChangedTime - The artifact changed time. + ChangedTime *date.Time `json:"changedTime,omitempty"` + Metadata interface{} `json:"metadata,omitempty"` +} + +// AS2AcknowledgementConnectionSettings the AS2 agreement acknowledgement connection settings. +type AS2AcknowledgementConnectionSettings struct { + // IgnoreCertificateNameMismatch - Indicates whether to ignore mismatch in certificate name. + IgnoreCertificateNameMismatch *bool `json:"ignoreCertificateNameMismatch,omitempty"` + // SupportHTTPStatusCodeContinue - Indicates whether to support HTTP status code 'CONTINUE'. + SupportHTTPStatusCodeContinue *bool `json:"supportHttpStatusCodeContinue,omitempty"` + // KeepHTTPConnectionAlive - Indicates whether to keep the connection alive. + KeepHTTPConnectionAlive *bool `json:"keepHttpConnectionAlive,omitempty"` + // UnfoldHTTPHeaders - Indicates whether to unfold the HTTP headers. + UnfoldHTTPHeaders *bool `json:"unfoldHttpHeaders,omitempty"` +} + +// AS2AgreementContent the integration account AS2 agreement content. +type AS2AgreementContent struct { + // ReceiveAgreement - The AS2 one-way receive agreement. + ReceiveAgreement *AS2OneWayAgreement `json:"receiveAgreement,omitempty"` + // SendAgreement - The AS2 one-way send agreement. + SendAgreement *AS2OneWayAgreement `json:"sendAgreement,omitempty"` +} + +// AS2EnvelopeSettings the AS2 agreement envelope settings. +type AS2EnvelopeSettings struct { + // MessageContentType - The message content type. + MessageContentType *string `json:"messageContentType,omitempty"` + // TransmitFileNameInMimeHeader - The value indicating whether to transmit file name in mime header. + TransmitFileNameInMimeHeader *bool `json:"transmitFileNameInMimeHeader,omitempty"` + // FileNameTemplate - The template for file name. + FileNameTemplate *string `json:"fileNameTemplate,omitempty"` + // SuspendMessageOnFileNameGenerationError - The value indicating whether to suspend message on file name generation error. + SuspendMessageOnFileNameGenerationError *bool `json:"suspendMessageOnFileNameGenerationError,omitempty"` + // AutogenerateFileName - The value indicating whether to auto generate file name. + AutogenerateFileName *bool `json:"autogenerateFileName,omitempty"` +} + +// AS2ErrorSettings the AS2 agreement error settings. +type AS2ErrorSettings struct { + // SuspendDuplicateMessage - The value indicating whether to suspend duplicate message. + SuspendDuplicateMessage *bool `json:"suspendDuplicateMessage,omitempty"` + // ResendIfMDNNotReceived - The value indicating whether to resend message If MDN is not received. + ResendIfMDNNotReceived *bool `json:"resendIfMDNNotReceived,omitempty"` +} + +// AS2MdnSettings the AS2 agreement mdn settings. +type AS2MdnSettings struct { + // NeedMDN - The value indicating whether to send or request a MDN. + NeedMDN *bool `json:"needMDN,omitempty"` + // SignMDN - The value indicating whether the MDN needs to be signed or not. + SignMDN *bool `json:"signMDN,omitempty"` + // SendMDNAsynchronously - The value indicating whether to send the asynchronous MDN. + SendMDNAsynchronously *bool `json:"sendMDNAsynchronously,omitempty"` + // ReceiptDeliveryURL - The receipt delivery URL. + ReceiptDeliveryURL *string `json:"receiptDeliveryUrl,omitempty"` + // DispositionNotificationTo - The disposition notification to header value. + DispositionNotificationTo *string `json:"dispositionNotificationTo,omitempty"` + // SignOutboundMDNIfOptional - The value indicating whether to sign the outbound MDN if optional. + SignOutboundMDNIfOptional *bool `json:"signOutboundMDNIfOptional,omitempty"` + // MdnText - The MDN text. + MdnText *string `json:"mdnText,omitempty"` + // SendInboundMDNToMessageBox - The value indicating whether to send inbound MDN to message box. + SendInboundMDNToMessageBox *bool `json:"sendInboundMDNToMessageBox,omitempty"` + // MicHashingAlgorithm - The signing or hashing algorithm. Possible values include: 'HashingAlgorithmNotSpecified', 'HashingAlgorithmNone', 'HashingAlgorithmMD5', 'HashingAlgorithmSHA1', 'HashingAlgorithmSHA2256', 'HashingAlgorithmSHA2384', 'HashingAlgorithmSHA2512' + MicHashingAlgorithm HashingAlgorithm `json:"micHashingAlgorithm,omitempty"` +} + +// AS2MessageConnectionSettings the AS2 agreement message connection settings. +type AS2MessageConnectionSettings struct { + // IgnoreCertificateNameMismatch - The value indicating whether to ignore mismatch in certificate name. + IgnoreCertificateNameMismatch *bool `json:"ignoreCertificateNameMismatch,omitempty"` + // SupportHTTPStatusCodeContinue - The value indicating whether to support HTTP status code 'CONTINUE'. + SupportHTTPStatusCodeContinue *bool `json:"supportHttpStatusCodeContinue,omitempty"` + // KeepHTTPConnectionAlive - The value indicating whether to keep the connection alive. + KeepHTTPConnectionAlive *bool `json:"keepHttpConnectionAlive,omitempty"` + // UnfoldHTTPHeaders - The value indicating whether to unfold the HTTP headers. + UnfoldHTTPHeaders *bool `json:"unfoldHttpHeaders,omitempty"` +} + +// AS2OneWayAgreement the integration account AS2 one-way agreement. +type AS2OneWayAgreement struct { + // SenderBusinessIdentity - The sender business identity + SenderBusinessIdentity *BusinessIdentity `json:"senderBusinessIdentity,omitempty"` + // ReceiverBusinessIdentity - The receiver business identity + ReceiverBusinessIdentity *BusinessIdentity `json:"receiverBusinessIdentity,omitempty"` + // ProtocolSettings - The AS2 protocol settings. + ProtocolSettings *AS2ProtocolSettings `json:"protocolSettings,omitempty"` +} + +// AS2ProtocolSettings the AS2 agreement protocol settings. +type AS2ProtocolSettings struct { + // MessageConnectionSettings - The message connection settings. + MessageConnectionSettings *AS2MessageConnectionSettings `json:"messageConnectionSettings,omitempty"` + // AcknowledgementConnectionSettings - The acknowledgement connection settings. + AcknowledgementConnectionSettings *AS2AcknowledgementConnectionSettings `json:"acknowledgementConnectionSettings,omitempty"` + // MdnSettings - The MDN settings. + MdnSettings *AS2MdnSettings `json:"mdnSettings,omitempty"` + // SecuritySettings - The security settings. + SecuritySettings *AS2SecuritySettings `json:"securitySettings,omitempty"` + // ValidationSettings - The validation settings. + ValidationSettings *AS2ValidationSettings `json:"validationSettings,omitempty"` + // EnvelopeSettings - The envelope settings. + EnvelopeSettings *AS2EnvelopeSettings `json:"envelopeSettings,omitempty"` + // ErrorSettings - The error settings. + ErrorSettings *AS2ErrorSettings `json:"errorSettings,omitempty"` +} + +// AS2SecuritySettings the AS2 agreement security settings. +type AS2SecuritySettings struct { + // OverrideGroupSigningCertificate - The value indicating whether to send or request a MDN. + OverrideGroupSigningCertificate *bool `json:"overrideGroupSigningCertificate,omitempty"` + // SigningCertificateName - The name of the signing certificate. + SigningCertificateName *string `json:"signingCertificateName,omitempty"` + // EncryptionCertificateName - The name of the encryption certificate. + EncryptionCertificateName *string `json:"encryptionCertificateName,omitempty"` + // EnableNRRForInboundEncodedMessages - The value indicating whether to enable NRR for inbound encoded messages. + EnableNRRForInboundEncodedMessages *bool `json:"enableNRRForInboundEncodedMessages,omitempty"` + // EnableNRRForInboundDecodedMessages - The value indicating whether to enable NRR for inbound decoded messages. + EnableNRRForInboundDecodedMessages *bool `json:"enableNRRForInboundDecodedMessages,omitempty"` + // EnableNRRForOutboundMDN - The value indicating whether to enable NRR for outbound MDN. + EnableNRRForOutboundMDN *bool `json:"enableNRRForOutboundMDN,omitempty"` + // EnableNRRForOutboundEncodedMessages - The value indicating whether to enable NRR for outbound encoded messages. + EnableNRRForOutboundEncodedMessages *bool `json:"enableNRRForOutboundEncodedMessages,omitempty"` + // EnableNRRForOutboundDecodedMessages - The value indicating whether to enable NRR for outbound decoded messages. + EnableNRRForOutboundDecodedMessages *bool `json:"enableNRRForOutboundDecodedMessages,omitempty"` + // EnableNRRForInboundMDN - The value indicating whether to enable NRR for inbound MDN. + EnableNRRForInboundMDN *bool `json:"enableNRRForInboundMDN,omitempty"` + // Sha2AlgorithmFormat - The Sha2 algorithm format. Valid values are Sha2, ShaHashSize, ShaHyphenHashSize, Sha2UnderscoreHashSize. + Sha2AlgorithmFormat *string `json:"sha2AlgorithmFormat,omitempty"` +} + +// AS2ValidationSettings the AS2 agreement validation settings. +type AS2ValidationSettings struct { + // OverrideMessageProperties - The value indicating whether to override incoming message properties with those in agreement. + OverrideMessageProperties *bool `json:"overrideMessageProperties,omitempty"` + // EncryptMessage - The value indicating whether the message has to be encrypted. + EncryptMessage *bool `json:"encryptMessage,omitempty"` + // SignMessage - The value indicating whether the message has to be signed. + SignMessage *bool `json:"signMessage,omitempty"` + // CompressMessage - The value indicating whether the message has to be compressed. + CompressMessage *bool `json:"compressMessage,omitempty"` + // CheckDuplicateMessage - The value indicating whether to check for duplicate message. + CheckDuplicateMessage *bool `json:"checkDuplicateMessage,omitempty"` + // InterchangeDuplicatesValidityDays - The number of days to look back for duplicate interchange. + InterchangeDuplicatesValidityDays *int32 `json:"interchangeDuplicatesValidityDays,omitempty"` + // CheckCertificateRevocationListOnSend - The value indicating whether to check for certificate revocation list on send. + CheckCertificateRevocationListOnSend *bool `json:"checkCertificateRevocationListOnSend,omitempty"` + // CheckCertificateRevocationListOnReceive - The value indicating whether to check for certificate revocation list on receive. + CheckCertificateRevocationListOnReceive *bool `json:"checkCertificateRevocationListOnReceive,omitempty"` + // EncryptionAlgorithm - The encryption algorithm. Possible values include: 'EncryptionAlgorithmNotSpecified', 'EncryptionAlgorithmNone', 'EncryptionAlgorithmDES3', 'EncryptionAlgorithmRC2', 'EncryptionAlgorithmAES128', 'EncryptionAlgorithmAES192', 'EncryptionAlgorithmAES256' + EncryptionAlgorithm EncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"` + // SigningAlgorithm - The signing algorithm. Possible values include: 'SigningAlgorithmNotSpecified', 'SigningAlgorithmDefault', 'SigningAlgorithmSHA1', 'SigningAlgorithmSHA2256', 'SigningAlgorithmSHA2384', 'SigningAlgorithmSHA2512' + SigningAlgorithm SigningAlgorithm `json:"signingAlgorithm,omitempty"` +} + +// AssemblyCollection a collection of assembly definitions. +type AssemblyCollection struct { + autorest.Response `json:"-"` + Value *[]AssemblyDefinition `json:"value,omitempty"` +} + +// AssemblyDefinition the assembly definition. +type AssemblyDefinition struct { + autorest.Response `json:"-"` + // Properties - The assembly properties. + Properties *AssemblyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 AssemblyDefinition. +func (ad AssemblyDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ad.Properties != nil { + objectMap["properties"] = ad.Properties + } + if ad.Location != nil { + objectMap["location"] = ad.Location + } + if ad.Tags != nil { + objectMap["tags"] = ad.Tags + } + return json.Marshal(objectMap) +} + +// AssemblyProperties the assembly properties definition. +type AssemblyProperties struct { + // AssemblyName - The assembly name. + AssemblyName *string `json:"assemblyName,omitempty"` + // AssemblyVersion - The assembly version. + AssemblyVersion *string `json:"assemblyVersion,omitempty"` + // AssemblyCulture - The assembly culture. + AssemblyCulture *string `json:"assemblyCulture,omitempty"` + // AssemblyPublicKeyToken - The assembly public key token. + AssemblyPublicKeyToken *string `json:"assemblyPublicKeyToken,omitempty"` + Content interface{} `json:"content,omitempty"` + // ContentType - The content type. + ContentType *string `json:"contentType,omitempty"` + // ContentLink - The content link. + ContentLink *ContentLink `json:"contentLink,omitempty"` + // CreatedTime - The artifact creation time. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ChangedTime - The artifact changed time. + ChangedTime *date.Time `json:"changedTime,omitempty"` + Metadata interface{} `json:"metadata,omitempty"` +} + +// AzureResourceErrorInfo the azure resource error info. +type AzureResourceErrorInfo struct { + // Message - The error message. + Message *string `json:"message,omitempty"` + // Details - The error details. + Details *[]AzureResourceErrorInfo `json:"details,omitempty"` + // Code - The error code. + Code *string `json:"code,omitempty"` +} + +// B2BPartnerContent the B2B partner content. +type B2BPartnerContent struct { + // BusinessIdentities - The list of partner business identities. + BusinessIdentities *[]BusinessIdentity `json:"businessIdentities,omitempty"` +} + +// BatchConfiguration the batch configuration resource definition. +type BatchConfiguration struct { + autorest.Response `json:"-"` + // Properties - The batch configuration properties. + Properties *BatchConfigurationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 BatchConfiguration. +func (bc BatchConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bc.Properties != nil { + objectMap["properties"] = bc.Properties + } + if bc.Location != nil { + objectMap["location"] = bc.Location + } + if bc.Tags != nil { + objectMap["tags"] = bc.Tags + } + return json.Marshal(objectMap) +} + +// BatchConfigurationCollection a collection of batch configurations. +type BatchConfigurationCollection struct { + autorest.Response `json:"-"` + Value *[]BatchConfiguration `json:"value,omitempty"` +} + +// BatchConfigurationProperties the batch configuration properties definition. +type BatchConfigurationProperties struct { + // BatchGroupName - The name of the batch group. + BatchGroupName *string `json:"batchGroupName,omitempty"` + // ReleaseCriteria - The batch release criteria. + ReleaseCriteria *BatchReleaseCriteria `json:"releaseCriteria,omitempty"` + // CreatedTime - The artifact creation time. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ChangedTime - The artifact changed time. + ChangedTime *date.Time `json:"changedTime,omitempty"` + Metadata interface{} `json:"metadata,omitempty"` +} + +// BatchReleaseCriteria the batch release criteria. +type BatchReleaseCriteria struct { + // MessageCount - The message count. + MessageCount *int32 `json:"messageCount,omitempty"` + // BatchSize - The batch size in bytes. + BatchSize *int32 `json:"batchSize,omitempty"` + // Recurrence - The recurrence. + Recurrence *WorkflowTriggerRecurrence `json:"recurrence,omitempty"` +} + +// BusinessIdentity the integration account partner's business identity. +type BusinessIdentity struct { + // Qualifier - The business identity qualifier e.g. as2identity, ZZ, ZZZ, 31, 32 + Qualifier *string `json:"qualifier,omitempty"` + // Value - The user defined business identity value. + Value *string `json:"value,omitempty"` +} + +// CallbackURL the callback url. +type CallbackURL struct { + autorest.Response `json:"-"` + // Value - The URL value. + Value *string `json:"value,omitempty"` +} + +// ContentHash the content hash. +type ContentHash struct { + // Algorithm - The algorithm of the content hash. + Algorithm *string `json:"algorithm,omitempty"` + // Value - The value of the content hash. + Value *string `json:"value,omitempty"` +} + +// ContentLink the content link. +type ContentLink struct { + // URI - The content link URI. + URI *string `json:"uri,omitempty"` + // ContentVersion - The content version. + ContentVersion *string `json:"contentVersion,omitempty"` + // ContentSize - The content size. + ContentSize *int64 `json:"contentSize,omitempty"` + // ContentHash - The content hash. + ContentHash *ContentHash `json:"contentHash,omitempty"` + // Metadata - The metadata. + Metadata interface{} `json:"metadata,omitempty"` +} + +// Correlation the correlation property. +type Correlation struct { + // ClientTrackingID - The client tracking id. + ClientTrackingID *string `json:"clientTrackingId,omitempty"` +} + +// EdifactAcknowledgementSettings the Edifact agreement acknowledgement settings. +type EdifactAcknowledgementSettings struct { + // NeedTechnicalAcknowledgement - The value indicating whether technical acknowledgement is needed. + NeedTechnicalAcknowledgement *bool `json:"needTechnicalAcknowledgement,omitempty"` + // BatchTechnicalAcknowledgements - The value indicating whether to batch the technical acknowledgements. + BatchTechnicalAcknowledgements *bool `json:"batchTechnicalAcknowledgements,omitempty"` + // NeedFunctionalAcknowledgement - The value indicating whether functional acknowledgement is needed. + NeedFunctionalAcknowledgement *bool `json:"needFunctionalAcknowledgement,omitempty"` + // BatchFunctionalAcknowledgements - The value indicating whether to batch functional acknowledgements. + BatchFunctionalAcknowledgements *bool `json:"batchFunctionalAcknowledgements,omitempty"` + // NeedLoopForValidMessages - The value indicating whether a loop is needed for valid messages. + NeedLoopForValidMessages *bool `json:"needLoopForValidMessages,omitempty"` + // SendSynchronousAcknowledgement - The value indicating whether to send synchronous acknowledgement. + SendSynchronousAcknowledgement *bool `json:"sendSynchronousAcknowledgement,omitempty"` + // AcknowledgementControlNumberPrefix - The acknowledgement control number prefix. + AcknowledgementControlNumberPrefix *string `json:"acknowledgementControlNumberPrefix,omitempty"` + // AcknowledgementControlNumberSuffix - The acknowledgement control number suffix. + AcknowledgementControlNumberSuffix *string `json:"acknowledgementControlNumberSuffix,omitempty"` + // AcknowledgementControlNumberLowerBound - The acknowledgement control number lower bound. + AcknowledgementControlNumberLowerBound *int32 `json:"acknowledgementControlNumberLowerBound,omitempty"` + // AcknowledgementControlNumberUpperBound - The acknowledgement control number upper bound. + AcknowledgementControlNumberUpperBound *int32 `json:"acknowledgementControlNumberUpperBound,omitempty"` + // RolloverAcknowledgementControlNumber - The value indicating whether to rollover acknowledgement control number. + RolloverAcknowledgementControlNumber *bool `json:"rolloverAcknowledgementControlNumber,omitempty"` +} + +// EdifactAgreementContent the Edifact agreement content. +type EdifactAgreementContent struct { + // ReceiveAgreement - The EDIFACT one-way receive agreement. + ReceiveAgreement *EdifactOneWayAgreement `json:"receiveAgreement,omitempty"` + // SendAgreement - The EDIFACT one-way send agreement. + SendAgreement *EdifactOneWayAgreement `json:"sendAgreement,omitempty"` +} + +// EdifactDelimiterOverride the Edifact delimiter override settings. +type EdifactDelimiterOverride struct { + // MessageID - The message id. + MessageID *string `json:"messageId,omitempty"` + // MessageVersion - The message version. + MessageVersion *string `json:"messageVersion,omitempty"` + // MessageRelease - The message release. + MessageRelease *string `json:"messageRelease,omitempty"` + // DataElementSeparator - The data element separator. + DataElementSeparator *int32 `json:"dataElementSeparator,omitempty"` + // ComponentSeparator - The component separator. + ComponentSeparator *int32 `json:"componentSeparator,omitempty"` + // SegmentTerminator - The segment terminator. + SegmentTerminator *int32 `json:"segmentTerminator,omitempty"` + // RepetitionSeparator - The repetition separator. + RepetitionSeparator *int32 `json:"repetitionSeparator,omitempty"` + // SegmentTerminatorSuffix - The segment terminator suffix. Possible values include: 'SegmentTerminatorSuffixNotSpecified', 'SegmentTerminatorSuffixNone', 'SegmentTerminatorSuffixCR', 'SegmentTerminatorSuffixLF', 'SegmentTerminatorSuffixCRLF' + SegmentTerminatorSuffix SegmentTerminatorSuffix `json:"segmentTerminatorSuffix,omitempty"` + // DecimalPointIndicator - The decimal point indicator. Possible values include: 'EdifactDecimalIndicatorNotSpecified', 'EdifactDecimalIndicatorComma', 'EdifactDecimalIndicatorDecimal' + DecimalPointIndicator EdifactDecimalIndicator `json:"decimalPointIndicator,omitempty"` + // ReleaseIndicator - The release indicator. + ReleaseIndicator *int32 `json:"releaseIndicator,omitempty"` + // MessageAssociationAssignedCode - The message association assigned code. + MessageAssociationAssignedCode *string `json:"messageAssociationAssignedCode,omitempty"` + // TargetNamespace - The target namespace on which this delimiter settings has to be applied. + TargetNamespace *string `json:"targetNamespace,omitempty"` +} + +// EdifactEnvelopeOverride the Edifact envelope override settings. +type EdifactEnvelopeOverride struct { + // MessageID - The message id on which this envelope settings has to be applied. + MessageID *string `json:"messageId,omitempty"` + // MessageVersion - The message version on which this envelope settings has to be applied. + MessageVersion *string `json:"messageVersion,omitempty"` + // MessageRelease - The message release version on which this envelope settings has to be applied. + MessageRelease *string `json:"messageRelease,omitempty"` + // MessageAssociationAssignedCode - The message association assigned code. + MessageAssociationAssignedCode *string `json:"messageAssociationAssignedCode,omitempty"` + // TargetNamespace - The target namespace on which this envelope settings has to be applied. + TargetNamespace *string `json:"targetNamespace,omitempty"` + // FunctionalGroupID - The functional group id. + FunctionalGroupID *string `json:"functionalGroupId,omitempty"` + // SenderApplicationQualifier - The sender application qualifier. + SenderApplicationQualifier *string `json:"senderApplicationQualifier,omitempty"` + // SenderApplicationID - The sender application id. + SenderApplicationID *string `json:"senderApplicationId,omitempty"` + // ReceiverApplicationQualifier - The receiver application qualifier. + ReceiverApplicationQualifier *string `json:"receiverApplicationQualifier,omitempty"` + // ReceiverApplicationID - The receiver application id. + ReceiverApplicationID *string `json:"receiverApplicationId,omitempty"` + // ControllingAgencyCode - The controlling agency code. + ControllingAgencyCode *string `json:"controllingAgencyCode,omitempty"` + // GroupHeaderMessageVersion - The group header message version. + GroupHeaderMessageVersion *string `json:"groupHeaderMessageVersion,omitempty"` + // GroupHeaderMessageRelease - The group header message release. + GroupHeaderMessageRelease *string `json:"groupHeaderMessageRelease,omitempty"` + // AssociationAssignedCode - The association assigned code. + AssociationAssignedCode *string `json:"associationAssignedCode,omitempty"` + // ApplicationPassword - The application password. + ApplicationPassword *string `json:"applicationPassword,omitempty"` +} + +// EdifactEnvelopeSettings the Edifact agreement envelope settings. +type EdifactEnvelopeSettings struct { + // GroupAssociationAssignedCode - The group association assigned code. + GroupAssociationAssignedCode *string `json:"groupAssociationAssignedCode,omitempty"` + // CommunicationAgreementID - The communication agreement id. + CommunicationAgreementID *string `json:"communicationAgreementId,omitempty"` + // ApplyDelimiterStringAdvice - The value indicating whether to apply delimiter string advice. + ApplyDelimiterStringAdvice *bool `json:"applyDelimiterStringAdvice,omitempty"` + // CreateGroupingSegments - The value indicating whether to create grouping segments. + CreateGroupingSegments *bool `json:"createGroupingSegments,omitempty"` + // EnableDefaultGroupHeaders - The value indicating whether to enable default group headers. + EnableDefaultGroupHeaders *bool `json:"enableDefaultGroupHeaders,omitempty"` + // RecipientReferencePasswordValue - The recipient reference password value. + RecipientReferencePasswordValue *string `json:"recipientReferencePasswordValue,omitempty"` + // RecipientReferencePasswordQualifier - The recipient reference password qualifier. + RecipientReferencePasswordQualifier *string `json:"recipientReferencePasswordQualifier,omitempty"` + // ApplicationReferenceID - The application reference id. + ApplicationReferenceID *string `json:"applicationReferenceId,omitempty"` + // ProcessingPriorityCode - The processing priority code. + ProcessingPriorityCode *string `json:"processingPriorityCode,omitempty"` + // InterchangeControlNumberLowerBound - The interchange control number lower bound. + InterchangeControlNumberLowerBound *int64 `json:"interchangeControlNumberLowerBound,omitempty"` + // InterchangeControlNumberUpperBound - The interchange control number upper bound. + InterchangeControlNumberUpperBound *int64 `json:"interchangeControlNumberUpperBound,omitempty"` + // RolloverInterchangeControlNumber - The value indicating whether to rollover interchange control number. + RolloverInterchangeControlNumber *bool `json:"rolloverInterchangeControlNumber,omitempty"` + // InterchangeControlNumberPrefix - The interchange control number prefix. + InterchangeControlNumberPrefix *string `json:"interchangeControlNumberPrefix,omitempty"` + // InterchangeControlNumberSuffix - The interchange control number suffix. + InterchangeControlNumberSuffix *string `json:"interchangeControlNumberSuffix,omitempty"` + // SenderReverseRoutingAddress - The sender reverse routing address. + SenderReverseRoutingAddress *string `json:"senderReverseRoutingAddress,omitempty"` + // ReceiverReverseRoutingAddress - The receiver reverse routing address. + ReceiverReverseRoutingAddress *string `json:"receiverReverseRoutingAddress,omitempty"` + // FunctionalGroupID - The functional group id. + FunctionalGroupID *string `json:"functionalGroupId,omitempty"` + // GroupControllingAgencyCode - The group controlling agency code. + GroupControllingAgencyCode *string `json:"groupControllingAgencyCode,omitempty"` + // GroupMessageVersion - The group message version. + GroupMessageVersion *string `json:"groupMessageVersion,omitempty"` + // GroupMessageRelease - The group message release. + GroupMessageRelease *string `json:"groupMessageRelease,omitempty"` + // GroupControlNumberLowerBound - The group control number lower bound. + GroupControlNumberLowerBound *int64 `json:"groupControlNumberLowerBound,omitempty"` + // GroupControlNumberUpperBound - The group control number upper bound. + GroupControlNumberUpperBound *int64 `json:"groupControlNumberUpperBound,omitempty"` + // RolloverGroupControlNumber - The value indicating whether to rollover group control number. + RolloverGroupControlNumber *bool `json:"rolloverGroupControlNumber,omitempty"` + // GroupControlNumberPrefix - The group control number prefix. + GroupControlNumberPrefix *string `json:"groupControlNumberPrefix,omitempty"` + // GroupControlNumberSuffix - The group control number suffix. + GroupControlNumberSuffix *string `json:"groupControlNumberSuffix,omitempty"` + // GroupApplicationReceiverQualifier - The group application receiver qualifier. + GroupApplicationReceiverQualifier *string `json:"groupApplicationReceiverQualifier,omitempty"` + // GroupApplicationReceiverID - The group application receiver id. + GroupApplicationReceiverID *string `json:"groupApplicationReceiverId,omitempty"` + // GroupApplicationSenderQualifier - The group application sender qualifier. + GroupApplicationSenderQualifier *string `json:"groupApplicationSenderQualifier,omitempty"` + // GroupApplicationSenderID - The group application sender id. + GroupApplicationSenderID *string `json:"groupApplicationSenderId,omitempty"` + // GroupApplicationPassword - The group application password. + GroupApplicationPassword *string `json:"groupApplicationPassword,omitempty"` + // OverwriteExistingTransactionSetControlNumber - The value indicating whether to overwrite existing transaction set control number. + OverwriteExistingTransactionSetControlNumber *bool `json:"overwriteExistingTransactionSetControlNumber,omitempty"` + // TransactionSetControlNumberPrefix - The transaction set control number prefix. + TransactionSetControlNumberPrefix *string `json:"transactionSetControlNumberPrefix,omitempty"` + // TransactionSetControlNumberSuffix - The transaction set control number suffix. + TransactionSetControlNumberSuffix *string `json:"transactionSetControlNumberSuffix,omitempty"` + // TransactionSetControlNumberLowerBound - The transaction set control number lower bound. + TransactionSetControlNumberLowerBound *int64 `json:"transactionSetControlNumberLowerBound,omitempty"` + // TransactionSetControlNumberUpperBound - The transaction set control number upper bound. + TransactionSetControlNumberUpperBound *int64 `json:"transactionSetControlNumberUpperBound,omitempty"` + // RolloverTransactionSetControlNumber - The value indicating whether to rollover transaction set control number. + RolloverTransactionSetControlNumber *bool `json:"rolloverTransactionSetControlNumber,omitempty"` + // IsTestInterchange - The value indicating whether the message is a test interchange. + IsTestInterchange *bool `json:"isTestInterchange,omitempty"` + // SenderInternalIdentification - The sender internal identification. + SenderInternalIdentification *string `json:"senderInternalIdentification,omitempty"` + // SenderInternalSubIdentification - The sender internal sub identification. + SenderInternalSubIdentification *string `json:"senderInternalSubIdentification,omitempty"` + // ReceiverInternalIdentification - The receiver internal identification. + ReceiverInternalIdentification *string `json:"receiverInternalIdentification,omitempty"` + // ReceiverInternalSubIdentification - The receiver internal sub identification. + ReceiverInternalSubIdentification *string `json:"receiverInternalSubIdentification,omitempty"` +} + +// EdifactFramingSettings the Edifact agreement framing settings. +type EdifactFramingSettings struct { + // ServiceCodeListDirectoryVersion - The service code list directory version. + ServiceCodeListDirectoryVersion *string `json:"serviceCodeListDirectoryVersion,omitempty"` + // CharacterEncoding - The character encoding. + CharacterEncoding *string `json:"characterEncoding,omitempty"` + // ProtocolVersion - The protocol version. + ProtocolVersion *int32 `json:"protocolVersion,omitempty"` + // DataElementSeparator - The data element separator. + DataElementSeparator *int32 `json:"dataElementSeparator,omitempty"` + // ComponentSeparator - The component separator. + ComponentSeparator *int32 `json:"componentSeparator,omitempty"` + // SegmentTerminator - The segment terminator. + SegmentTerminator *int32 `json:"segmentTerminator,omitempty"` + // ReleaseIndicator - The release indicator. + ReleaseIndicator *int32 `json:"releaseIndicator,omitempty"` + // RepetitionSeparator - The repetition separator. + RepetitionSeparator *int32 `json:"repetitionSeparator,omitempty"` + // CharacterSet - The EDIFACT frame setting characterSet. Possible values include: 'EdifactCharacterSetNotSpecified', 'EdifactCharacterSetUNOB', 'EdifactCharacterSetUNOA', 'EdifactCharacterSetUNOC', 'EdifactCharacterSetUNOD', 'EdifactCharacterSetUNOE', 'EdifactCharacterSetUNOF', 'EdifactCharacterSetUNOG', 'EdifactCharacterSetUNOH', 'EdifactCharacterSetUNOI', 'EdifactCharacterSetUNOJ', 'EdifactCharacterSetUNOK', 'EdifactCharacterSetUNOX', 'EdifactCharacterSetUNOY', 'EdifactCharacterSetKECA' + CharacterSet EdifactCharacterSet `json:"characterSet,omitempty"` + // DecimalPointIndicator - The EDIFACT frame setting decimal indicator. Possible values include: 'EdifactDecimalIndicatorNotSpecified', 'EdifactDecimalIndicatorComma', 'EdifactDecimalIndicatorDecimal' + DecimalPointIndicator EdifactDecimalIndicator `json:"decimalPointIndicator,omitempty"` + // SegmentTerminatorSuffix - The EDIFACT frame setting segment terminator suffix. Possible values include: 'SegmentTerminatorSuffixNotSpecified', 'SegmentTerminatorSuffixNone', 'SegmentTerminatorSuffixCR', 'SegmentTerminatorSuffixLF', 'SegmentTerminatorSuffixCRLF' + SegmentTerminatorSuffix SegmentTerminatorSuffix `json:"segmentTerminatorSuffix,omitempty"` +} + +// EdifactMessageFilter the Edifact message filter for odata query. +type EdifactMessageFilter struct { + // MessageFilterType - The message filter type. Possible values include: 'MessageFilterTypeNotSpecified', 'MessageFilterTypeInclude', 'MessageFilterTypeExclude' + MessageFilterType MessageFilterType `json:"messageFilterType,omitempty"` +} + +// EdifactMessageIdentifier the Edifact message identifier. +type EdifactMessageIdentifier struct { + // MessageID - The message id on which this envelope settings has to be applied. + MessageID *string `json:"messageId,omitempty"` +} + +// EdifactOneWayAgreement the Edifact one way agreement. +type EdifactOneWayAgreement struct { + // SenderBusinessIdentity - The sender business identity + SenderBusinessIdentity *BusinessIdentity `json:"senderBusinessIdentity,omitempty"` + // ReceiverBusinessIdentity - The receiver business identity + ReceiverBusinessIdentity *BusinessIdentity `json:"receiverBusinessIdentity,omitempty"` + // ProtocolSettings - The EDIFACT protocol settings. + ProtocolSettings *EdifactProtocolSettings `json:"protocolSettings,omitempty"` +} + +// EdifactProcessingSettings the Edifact agreement protocol settings. +type EdifactProcessingSettings struct { + // MaskSecurityInfo - The value indicating whether to mask security information. + MaskSecurityInfo *bool `json:"maskSecurityInfo,omitempty"` + // PreserveInterchange - The value indicating whether to preserve interchange. + PreserveInterchange *bool `json:"preserveInterchange,omitempty"` + // SuspendInterchangeOnError - The value indicating whether to suspend interchange on error. + SuspendInterchangeOnError *bool `json:"suspendInterchangeOnError,omitempty"` + // CreateEmptyXMLTagsForTrailingSeparators - The value indicating whether to create empty xml tags for trailing separators. + CreateEmptyXMLTagsForTrailingSeparators *bool `json:"createEmptyXmlTagsForTrailingSeparators,omitempty"` + // UseDotAsDecimalSeparator - The value indicating whether to use dot as decimal separator. + UseDotAsDecimalSeparator *bool `json:"useDotAsDecimalSeparator,omitempty"` +} + +// EdifactProtocolSettings the Edifact agreement protocol settings. +type EdifactProtocolSettings struct { + // ValidationSettings - The EDIFACT validation settings. + ValidationSettings *EdifactValidationSettings `json:"validationSettings,omitempty"` + // FramingSettings - The EDIFACT framing settings. + FramingSettings *EdifactFramingSettings `json:"framingSettings,omitempty"` + // EnvelopeSettings - The EDIFACT envelope settings. + EnvelopeSettings *EdifactEnvelopeSettings `json:"envelopeSettings,omitempty"` + // AcknowledgementSettings - The EDIFACT acknowledgement settings. + AcknowledgementSettings *EdifactAcknowledgementSettings `json:"acknowledgementSettings,omitempty"` + // MessageFilter - The EDIFACT message filter. + MessageFilter *EdifactMessageFilter `json:"messageFilter,omitempty"` + // ProcessingSettings - The EDIFACT processing Settings. + ProcessingSettings *EdifactProcessingSettings `json:"processingSettings,omitempty"` + // EnvelopeOverrides - The EDIFACT envelope override settings. + EnvelopeOverrides *[]EdifactEnvelopeOverride `json:"envelopeOverrides,omitempty"` + // MessageFilterList - The EDIFACT message filter list. + MessageFilterList *[]EdifactMessageIdentifier `json:"messageFilterList,omitempty"` + // SchemaReferences - The EDIFACT schema references. + SchemaReferences *[]EdifactSchemaReference `json:"schemaReferences,omitempty"` + // ValidationOverrides - The EDIFACT validation override settings. + ValidationOverrides *[]EdifactValidationOverride `json:"validationOverrides,omitempty"` + // EdifactDelimiterOverrides - The EDIFACT delimiter override settings. + EdifactDelimiterOverrides *[]EdifactDelimiterOverride `json:"edifactDelimiterOverrides,omitempty"` +} + +// EdifactSchemaReference the Edifact schema reference. +type EdifactSchemaReference struct { + // MessageID - The message id. + MessageID *string `json:"messageId,omitempty"` + // MessageVersion - The message version. + MessageVersion *string `json:"messageVersion,omitempty"` + // MessageRelease - The message release version. + MessageRelease *string `json:"messageRelease,omitempty"` + // SenderApplicationID - The sender application id. + SenderApplicationID *string `json:"senderApplicationId,omitempty"` + // SenderApplicationQualifier - The sender application qualifier. + SenderApplicationQualifier *string `json:"senderApplicationQualifier,omitempty"` + // AssociationAssignedCode - The association assigned code. + AssociationAssignedCode *string `json:"associationAssignedCode,omitempty"` + // SchemaName - The schema name. + SchemaName *string `json:"schemaName,omitempty"` +} + +// EdifactValidationOverride the Edifact validation override settings. +type EdifactValidationOverride struct { + // MessageID - The message id on which the validation settings has to be applied. + MessageID *string `json:"messageId,omitempty"` + // EnforceCharacterSet - The value indicating whether to validate character Set. + EnforceCharacterSet *bool `json:"enforceCharacterSet,omitempty"` + // ValidateEDITypes - The value indicating whether to validate EDI types. + ValidateEDITypes *bool `json:"validateEDITypes,omitempty"` + // ValidateXSDTypes - The value indicating whether to validate XSD types. + ValidateXSDTypes *bool `json:"validateXSDTypes,omitempty"` + // AllowLeadingAndTrailingSpacesAndZeroes - The value indicating whether to allow leading and trailing spaces and zeroes. + AllowLeadingAndTrailingSpacesAndZeroes *bool `json:"allowLeadingAndTrailingSpacesAndZeroes,omitempty"` + // TrailingSeparatorPolicy - The trailing separator policy. Possible values include: 'TrailingSeparatorPolicyNotSpecified', 'TrailingSeparatorPolicyNotAllowed', 'TrailingSeparatorPolicyOptional', 'TrailingSeparatorPolicyMandatory' + TrailingSeparatorPolicy TrailingSeparatorPolicy `json:"trailingSeparatorPolicy,omitempty"` + // TrimLeadingAndTrailingSpacesAndZeroes - The value indicating whether to trim leading and trailing spaces and zeroes. + TrimLeadingAndTrailingSpacesAndZeroes *bool `json:"trimLeadingAndTrailingSpacesAndZeroes,omitempty"` +} + +// EdifactValidationSettings the Edifact agreement validation settings. +type EdifactValidationSettings struct { + // ValidateCharacterSet - The value indicating whether to validate character set in the message. + ValidateCharacterSet *bool `json:"validateCharacterSet,omitempty"` + // CheckDuplicateInterchangeControlNumber - The value indicating whether to check for duplicate interchange control number. + CheckDuplicateInterchangeControlNumber *bool `json:"checkDuplicateInterchangeControlNumber,omitempty"` + // InterchangeControlNumberValidityDays - The validity period of interchange control number. + InterchangeControlNumberValidityDays *int32 `json:"interchangeControlNumberValidityDays,omitempty"` + // CheckDuplicateGroupControlNumber - The value indicating whether to check for duplicate group control number. + CheckDuplicateGroupControlNumber *bool `json:"checkDuplicateGroupControlNumber,omitempty"` + // CheckDuplicateTransactionSetControlNumber - The value indicating whether to check for duplicate transaction set control number. + CheckDuplicateTransactionSetControlNumber *bool `json:"checkDuplicateTransactionSetControlNumber,omitempty"` + // ValidateEDITypes - The value indicating whether to Whether to validate EDI types. + ValidateEDITypes *bool `json:"validateEDITypes,omitempty"` + // ValidateXSDTypes - The value indicating whether to Whether to validate XSD types. + ValidateXSDTypes *bool `json:"validateXSDTypes,omitempty"` + // AllowLeadingAndTrailingSpacesAndZeroes - The value indicating whether to allow leading and trailing spaces and zeroes. + AllowLeadingAndTrailingSpacesAndZeroes *bool `json:"allowLeadingAndTrailingSpacesAndZeroes,omitempty"` + // TrimLeadingAndTrailingSpacesAndZeroes - The value indicating whether to trim leading and trailing spaces and zeroes. + TrimLeadingAndTrailingSpacesAndZeroes *bool `json:"trimLeadingAndTrailingSpacesAndZeroes,omitempty"` + // TrailingSeparatorPolicy - The trailing separator policy. Possible values include: 'TrailingSeparatorPolicyNotSpecified', 'TrailingSeparatorPolicyNotAllowed', 'TrailingSeparatorPolicyOptional', 'TrailingSeparatorPolicyMandatory' + TrailingSeparatorPolicy TrailingSeparatorPolicy `json:"trailingSeparatorPolicy,omitempty"` +} + +// ErrorInfo the error info. +type ErrorInfo struct { + // Code - The error code. + Code *string `json:"code,omitempty"` +} + +// ErrorProperties error properties indicate why the Logic service was not able to process the incoming +// request. The reason is provided in the error message. +type ErrorProperties struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// ErrorResponse error response indicates Logic service is not able to process the incoming request. The +// error property contains the error details. +type ErrorResponse struct { + // Error - The error properties. + Error *ErrorProperties `json:"error,omitempty"` +} + +// Expression the expression. +type Expression struct { + // Text - The text. + Text *string `json:"text,omitempty"` + Value interface{} `json:"value,omitempty"` + // Subexpressions - The sub expressions. + Subexpressions *[]Expression `json:"subexpressions,omitempty"` + Error *AzureResourceErrorInfo `json:"error,omitempty"` +} + +// ExpressionRoot the expression root. +type ExpressionRoot struct { + // Path - The path. + Path *string `json:"path,omitempty"` + // Text - The text. + Text *string `json:"text,omitempty"` + Value interface{} `json:"value,omitempty"` + // Subexpressions - The sub expressions. + Subexpressions *[]Expression `json:"subexpressions,omitempty"` + Error *AzureResourceErrorInfo `json:"error,omitempty"` +} + +// ExpressionTraces the expression traces. +type ExpressionTraces struct { + autorest.Response `json:"-"` + Inputs *[]ExpressionRoot `json:"inputs,omitempty"` +} + +// ExtendedErrorInfo the extended error info. +type ExtendedErrorInfo struct { + // Code - The error code. Possible values include: 'ErrorResponseCodeNotSpecified', 'ErrorResponseCodeIntegrationServiceEnvironmentNotFound', 'ErrorResponseCodeInternalServerError', 'ErrorResponseCodeInvalidOperationID' + Code ErrorResponseCode `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` + // Details - The error message details. + Details *[]ExtendedErrorInfo `json:"details,omitempty"` + // InnerError - The inner error. + InnerError interface{} `json:"innerError,omitempty"` +} + +// FlowEndpoints the flow endpoints configuration. +type FlowEndpoints struct { + // OutgoingIPAddresses - The outgoing ip address. + OutgoingIPAddresses *[]IPAddress `json:"outgoingIpAddresses,omitempty"` + // AccessEndpointIPAddresses - The access endpoint ip address. + AccessEndpointIPAddresses *[]IPAddress `json:"accessEndpointIpAddresses,omitempty"` +} + +// FlowEndpointsConfiguration the endpoints configuration. +type FlowEndpointsConfiguration struct { + // Workflow - The workflow endpoints. + Workflow *FlowEndpoints `json:"workflow,omitempty"` + // Connector - The connector endpoints. + Connector *FlowEndpoints `json:"connector,omitempty"` +} + +// GenerateUpgradedDefinitionParameters the parameters to generate upgraded definition. +type GenerateUpgradedDefinitionParameters struct { + // TargetSchemaVersion - The target schema version. + TargetSchemaVersion *string `json:"targetSchemaVersion,omitempty"` +} + +// GetCallbackURLParameters the callback url parameters. +type GetCallbackURLParameters struct { + // NotAfter - The expiry time. + NotAfter *date.Time `json:"notAfter,omitempty"` + // KeyType - The key type. Possible values include: 'KeyTypeNotSpecified', 'KeyTypePrimary', 'KeyTypeSecondary' + KeyType KeyType `json:"keyType,omitempty"` +} + +// IntegrationAccount the integration account. +type IntegrationAccount struct { + autorest.Response `json:"-"` + // IntegrationAccountProperties - The integration account properties. + *IntegrationAccountProperties `json:"properties,omitempty"` + // Sku - The sku. + Sku *IntegrationAccountSku `json:"sku,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 IntegrationAccount. +func (ia IntegrationAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ia.IntegrationAccountProperties != nil { + objectMap["properties"] = ia.IntegrationAccountProperties + } + if ia.Sku != nil { + objectMap["sku"] = ia.Sku + } + if ia.Location != nil { + objectMap["location"] = ia.Location + } + if ia.Tags != nil { + objectMap["tags"] = ia.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationAccount struct. +func (ia *IntegrationAccount) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var integrationAccountProperties IntegrationAccountProperties + err = json.Unmarshal(*v, &integrationAccountProperties) + if err != nil { + return err + } + ia.IntegrationAccountProperties = &integrationAccountProperties + } + case "sku": + if v != nil { + var sku IntegrationAccountSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + ia.Sku = &sku + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ia.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ia.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ia.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ia.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ia.Tags = tags + } + } + } + + return nil +} + +// IntegrationAccountAgreement the integration account agreement. +type IntegrationAccountAgreement struct { + autorest.Response `json:"-"` + // IntegrationAccountAgreementProperties - The integration account agreement properties. + *IntegrationAccountAgreementProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 IntegrationAccountAgreement. +func (iaa IntegrationAccountAgreement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iaa.IntegrationAccountAgreementProperties != nil { + objectMap["properties"] = iaa.IntegrationAccountAgreementProperties + } + if iaa.Location != nil { + objectMap["location"] = iaa.Location + } + if iaa.Tags != nil { + objectMap["tags"] = iaa.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationAccountAgreement struct. +func (iaa *IntegrationAccountAgreement) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var integrationAccountAgreementProperties IntegrationAccountAgreementProperties + err = json.Unmarshal(*v, &integrationAccountAgreementProperties) + if err != nil { + return err + } + iaa.IntegrationAccountAgreementProperties = &integrationAccountAgreementProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + iaa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + iaa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + iaa.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + iaa.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + iaa.Tags = tags + } + } + } + + return nil +} + +// IntegrationAccountAgreementFilter the integration account agreement filter for odata query. +type IntegrationAccountAgreementFilter struct { + // AgreementType - The agreement type of integration account agreement. Possible values include: 'NotSpecified', 'AS2', 'X12', 'Edifact' + AgreementType AgreementType `json:"agreementType,omitempty"` +} + +// IntegrationAccountAgreementListResult the list of integration account agreements. +type IntegrationAccountAgreementListResult struct { + autorest.Response `json:"-"` + // Value - The list of integration account agreements. + Value *[]IntegrationAccountAgreement `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// IntegrationAccountAgreementListResultIterator provides access to a complete listing of +// IntegrationAccountAgreement values. +type IntegrationAccountAgreementListResultIterator struct { + i int + page IntegrationAccountAgreementListResultPage +} + +// 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 *IntegrationAccountAgreementListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountAgreementListResultIterator.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 *IntegrationAccountAgreementListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IntegrationAccountAgreementListResultIterator) 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 IntegrationAccountAgreementListResultIterator) Response() IntegrationAccountAgreementListResult { + 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 IntegrationAccountAgreementListResultIterator) Value() IntegrationAccountAgreement { + if !iter.page.NotDone() { + return IntegrationAccountAgreement{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IntegrationAccountAgreementListResultIterator type. +func NewIntegrationAccountAgreementListResultIterator(page IntegrationAccountAgreementListResultPage) IntegrationAccountAgreementListResultIterator { + return IntegrationAccountAgreementListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (iaalr IntegrationAccountAgreementListResult) IsEmpty() bool { + return iaalr.Value == nil || len(*iaalr.Value) == 0 +} + +// integrationAccountAgreementListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (iaalr IntegrationAccountAgreementListResult) integrationAccountAgreementListResultPreparer(ctx context.Context) (*http.Request, error) { + if iaalr.NextLink == nil || len(to.String(iaalr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(iaalr.NextLink))) +} + +// IntegrationAccountAgreementListResultPage contains a page of IntegrationAccountAgreement values. +type IntegrationAccountAgreementListResultPage struct { + fn func(context.Context, IntegrationAccountAgreementListResult) (IntegrationAccountAgreementListResult, error) + iaalr IntegrationAccountAgreementListResult +} + +// 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 *IntegrationAccountAgreementListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountAgreementListResultPage.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.iaalr) + if err != nil { + return err + } + page.iaalr = 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 *IntegrationAccountAgreementListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IntegrationAccountAgreementListResultPage) NotDone() bool { + return !page.iaalr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IntegrationAccountAgreementListResultPage) Response() IntegrationAccountAgreementListResult { + return page.iaalr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IntegrationAccountAgreementListResultPage) Values() []IntegrationAccountAgreement { + if page.iaalr.IsEmpty() { + return nil + } + return *page.iaalr.Value +} + +// Creates a new instance of the IntegrationAccountAgreementListResultPage type. +func NewIntegrationAccountAgreementListResultPage(getNextPage func(context.Context, IntegrationAccountAgreementListResult) (IntegrationAccountAgreementListResult, error)) IntegrationAccountAgreementListResultPage { + return IntegrationAccountAgreementListResultPage{fn: getNextPage} +} + +// IntegrationAccountAgreementProperties the integration account agreement properties. +type IntegrationAccountAgreementProperties struct { + // CreatedTime - READ-ONLY; The created time. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ChangedTime - READ-ONLY; The changed time. + ChangedTime *date.Time `json:"changedTime,omitempty"` + // Metadata - The metadata. + Metadata interface{} `json:"metadata,omitempty"` + // AgreementType - The agreement type. Possible values include: 'NotSpecified', 'AS2', 'X12', 'Edifact' + AgreementType AgreementType `json:"agreementType,omitempty"` + // HostPartner - The integration account partner that is set as host partner for this agreement. + HostPartner *string `json:"hostPartner,omitempty"` + // GuestPartner - The integration account partner that is set as guest partner for this agreement. + GuestPartner *string `json:"guestPartner,omitempty"` + // HostIdentity - The business identity of the host partner. + HostIdentity *BusinessIdentity `json:"hostIdentity,omitempty"` + // GuestIdentity - The business identity of the guest partner. + GuestIdentity *BusinessIdentity `json:"guestIdentity,omitempty"` + // Content - The agreement content. + Content *AgreementContent `json:"content,omitempty"` +} + +// IntegrationAccountCertificate the integration account certificate. +type IntegrationAccountCertificate struct { + autorest.Response `json:"-"` + // IntegrationAccountCertificateProperties - The integration account certificate properties. + *IntegrationAccountCertificateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 IntegrationAccountCertificate. +func (iac IntegrationAccountCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iac.IntegrationAccountCertificateProperties != nil { + objectMap["properties"] = iac.IntegrationAccountCertificateProperties + } + if iac.Location != nil { + objectMap["location"] = iac.Location + } + if iac.Tags != nil { + objectMap["tags"] = iac.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationAccountCertificate struct. +func (iac *IntegrationAccountCertificate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var integrationAccountCertificateProperties IntegrationAccountCertificateProperties + err = json.Unmarshal(*v, &integrationAccountCertificateProperties) + if err != nil { + return err + } + iac.IntegrationAccountCertificateProperties = &integrationAccountCertificateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + iac.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + iac.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + iac.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + iac.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + iac.Tags = tags + } + } + } + + return nil +} + +// IntegrationAccountCertificateListResult the list of integration account certificates. +type IntegrationAccountCertificateListResult struct { + autorest.Response `json:"-"` + // Value - The list of integration account certificates. + Value *[]IntegrationAccountCertificate `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// IntegrationAccountCertificateListResultIterator provides access to a complete listing of +// IntegrationAccountCertificate values. +type IntegrationAccountCertificateListResultIterator struct { + i int + page IntegrationAccountCertificateListResultPage +} + +// 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 *IntegrationAccountCertificateListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountCertificateListResultIterator.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 *IntegrationAccountCertificateListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IntegrationAccountCertificateListResultIterator) 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 IntegrationAccountCertificateListResultIterator) Response() IntegrationAccountCertificateListResult { + 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 IntegrationAccountCertificateListResultIterator) Value() IntegrationAccountCertificate { + if !iter.page.NotDone() { + return IntegrationAccountCertificate{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IntegrationAccountCertificateListResultIterator type. +func NewIntegrationAccountCertificateListResultIterator(page IntegrationAccountCertificateListResultPage) IntegrationAccountCertificateListResultIterator { + return IntegrationAccountCertificateListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (iaclr IntegrationAccountCertificateListResult) IsEmpty() bool { + return iaclr.Value == nil || len(*iaclr.Value) == 0 +} + +// integrationAccountCertificateListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (iaclr IntegrationAccountCertificateListResult) integrationAccountCertificateListResultPreparer(ctx context.Context) (*http.Request, error) { + if iaclr.NextLink == nil || len(to.String(iaclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(iaclr.NextLink))) +} + +// IntegrationAccountCertificateListResultPage contains a page of IntegrationAccountCertificate values. +type IntegrationAccountCertificateListResultPage struct { + fn func(context.Context, IntegrationAccountCertificateListResult) (IntegrationAccountCertificateListResult, error) + iaclr IntegrationAccountCertificateListResult +} + +// 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 *IntegrationAccountCertificateListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountCertificateListResultPage.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.iaclr) + if err != nil { + return err + } + page.iaclr = 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 *IntegrationAccountCertificateListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IntegrationAccountCertificateListResultPage) NotDone() bool { + return !page.iaclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IntegrationAccountCertificateListResultPage) Response() IntegrationAccountCertificateListResult { + return page.iaclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IntegrationAccountCertificateListResultPage) Values() []IntegrationAccountCertificate { + if page.iaclr.IsEmpty() { + return nil + } + return *page.iaclr.Value +} + +// Creates a new instance of the IntegrationAccountCertificateListResultPage type. +func NewIntegrationAccountCertificateListResultPage(getNextPage func(context.Context, IntegrationAccountCertificateListResult) (IntegrationAccountCertificateListResult, error)) IntegrationAccountCertificateListResultPage { + return IntegrationAccountCertificateListResultPage{fn: getNextPage} +} + +// IntegrationAccountCertificateProperties the integration account certificate properties. +type IntegrationAccountCertificateProperties struct { + // CreatedTime - READ-ONLY; The created time. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ChangedTime - READ-ONLY; The changed time. + ChangedTime *date.Time `json:"changedTime,omitempty"` + // Metadata - The metadata. + Metadata interface{} `json:"metadata,omitempty"` + // Key - The key details in the key vault. + Key *KeyVaultKeyReference `json:"key,omitempty"` + // PublicCertificate - The public certificate. + PublicCertificate *string `json:"publicCertificate,omitempty"` +} + +// IntegrationAccountListResult the list of integration accounts. +type IntegrationAccountListResult struct { + autorest.Response `json:"-"` + // Value - The list of integration accounts. + Value *[]IntegrationAccount `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// IntegrationAccountListResultIterator provides access to a complete listing of IntegrationAccount values. +type IntegrationAccountListResultIterator struct { + i int + page IntegrationAccountListResultPage +} + +// 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 *IntegrationAccountListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountListResultIterator.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 *IntegrationAccountListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IntegrationAccountListResultIterator) 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 IntegrationAccountListResultIterator) Response() IntegrationAccountListResult { + 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 IntegrationAccountListResultIterator) Value() IntegrationAccount { + if !iter.page.NotDone() { + return IntegrationAccount{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IntegrationAccountListResultIterator type. +func NewIntegrationAccountListResultIterator(page IntegrationAccountListResultPage) IntegrationAccountListResultIterator { + return IntegrationAccountListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ialr IntegrationAccountListResult) IsEmpty() bool { + return ialr.Value == nil || len(*ialr.Value) == 0 +} + +// integrationAccountListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ialr IntegrationAccountListResult) integrationAccountListResultPreparer(ctx context.Context) (*http.Request, error) { + if ialr.NextLink == nil || len(to.String(ialr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ialr.NextLink))) +} + +// IntegrationAccountListResultPage contains a page of IntegrationAccount values. +type IntegrationAccountListResultPage struct { + fn func(context.Context, IntegrationAccountListResult) (IntegrationAccountListResult, error) + ialr IntegrationAccountListResult +} + +// 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 *IntegrationAccountListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountListResultPage.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.ialr) + if err != nil { + return err + } + page.ialr = 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 *IntegrationAccountListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IntegrationAccountListResultPage) NotDone() bool { + return !page.ialr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IntegrationAccountListResultPage) Response() IntegrationAccountListResult { + return page.ialr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IntegrationAccountListResultPage) Values() []IntegrationAccount { + if page.ialr.IsEmpty() { + return nil + } + return *page.ialr.Value +} + +// Creates a new instance of the IntegrationAccountListResultPage type. +func NewIntegrationAccountListResultPage(getNextPage func(context.Context, IntegrationAccountListResult) (IntegrationAccountListResult, error)) IntegrationAccountListResultPage { + return IntegrationAccountListResultPage{fn: getNextPage} +} + +// IntegrationAccountMap the integration account map. +type IntegrationAccountMap struct { + autorest.Response `json:"-"` + // IntegrationAccountMapProperties - The integration account map properties. + *IntegrationAccountMapProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 IntegrationAccountMap. +func (iam IntegrationAccountMap) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iam.IntegrationAccountMapProperties != nil { + objectMap["properties"] = iam.IntegrationAccountMapProperties + } + if iam.Location != nil { + objectMap["location"] = iam.Location + } + if iam.Tags != nil { + objectMap["tags"] = iam.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationAccountMap struct. +func (iam *IntegrationAccountMap) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var integrationAccountMapProperties IntegrationAccountMapProperties + err = json.Unmarshal(*v, &integrationAccountMapProperties) + if err != nil { + return err + } + iam.IntegrationAccountMapProperties = &integrationAccountMapProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + iam.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + iam.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + iam.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + iam.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + iam.Tags = tags + } + } + } + + return nil +} + +// IntegrationAccountMapFilter the integration account map filter for odata query. +type IntegrationAccountMapFilter struct { + // MapType - The map type of integration account map. Possible values include: 'MapTypeNotSpecified', 'MapTypeXslt', 'MapTypeXslt20', 'MapTypeXslt30', 'MapTypeLiquid' + MapType MapType `json:"mapType,omitempty"` +} + +// IntegrationAccountMapListResult the list of integration account maps. +type IntegrationAccountMapListResult struct { + autorest.Response `json:"-"` + // Value - The list of integration account maps. + Value *[]IntegrationAccountMap `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// IntegrationAccountMapListResultIterator provides access to a complete listing of IntegrationAccountMap +// values. +type IntegrationAccountMapListResultIterator struct { + i int + page IntegrationAccountMapListResultPage +} + +// 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 *IntegrationAccountMapListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountMapListResultIterator.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 *IntegrationAccountMapListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IntegrationAccountMapListResultIterator) 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 IntegrationAccountMapListResultIterator) Response() IntegrationAccountMapListResult { + 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 IntegrationAccountMapListResultIterator) Value() IntegrationAccountMap { + if !iter.page.NotDone() { + return IntegrationAccountMap{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IntegrationAccountMapListResultIterator type. +func NewIntegrationAccountMapListResultIterator(page IntegrationAccountMapListResultPage) IntegrationAccountMapListResultIterator { + return IntegrationAccountMapListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (iamlr IntegrationAccountMapListResult) IsEmpty() bool { + return iamlr.Value == nil || len(*iamlr.Value) == 0 +} + +// integrationAccountMapListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (iamlr IntegrationAccountMapListResult) integrationAccountMapListResultPreparer(ctx context.Context) (*http.Request, error) { + if iamlr.NextLink == nil || len(to.String(iamlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(iamlr.NextLink))) +} + +// IntegrationAccountMapListResultPage contains a page of IntegrationAccountMap values. +type IntegrationAccountMapListResultPage struct { + fn func(context.Context, IntegrationAccountMapListResult) (IntegrationAccountMapListResult, error) + iamlr IntegrationAccountMapListResult +} + +// 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 *IntegrationAccountMapListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountMapListResultPage.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.iamlr) + if err != nil { + return err + } + page.iamlr = 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 *IntegrationAccountMapListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IntegrationAccountMapListResultPage) NotDone() bool { + return !page.iamlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IntegrationAccountMapListResultPage) Response() IntegrationAccountMapListResult { + return page.iamlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IntegrationAccountMapListResultPage) Values() []IntegrationAccountMap { + if page.iamlr.IsEmpty() { + return nil + } + return *page.iamlr.Value +} + +// Creates a new instance of the IntegrationAccountMapListResultPage type. +func NewIntegrationAccountMapListResultPage(getNextPage func(context.Context, IntegrationAccountMapListResult) (IntegrationAccountMapListResult, error)) IntegrationAccountMapListResultPage { + return IntegrationAccountMapListResultPage{fn: getNextPage} +} + +// IntegrationAccountMapProperties the integration account map. +type IntegrationAccountMapProperties struct { + // MapType - The map type. Possible values include: 'MapTypeNotSpecified', 'MapTypeXslt', 'MapTypeXslt20', 'MapTypeXslt30', 'MapTypeLiquid' + MapType MapType `json:"mapType,omitempty"` + // ParametersSchema - The parameters schema of integration account map. + ParametersSchema *IntegrationAccountMapPropertiesParametersSchema `json:"parametersSchema,omitempty"` + // CreatedTime - READ-ONLY; The created time. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ChangedTime - READ-ONLY; The changed time. + ChangedTime *date.Time `json:"changedTime,omitempty"` + // Content - The content. + Content *string `json:"content,omitempty"` + // ContentType - The content type. + ContentType *string `json:"contentType,omitempty"` + // ContentLink - READ-ONLY; The content link. + ContentLink *ContentLink `json:"contentLink,omitempty"` + // Metadata - The metadata. + Metadata interface{} `json:"metadata,omitempty"` +} + +// IntegrationAccountMapPropertiesParametersSchema the parameters schema of integration account map. +type IntegrationAccountMapPropertiesParametersSchema struct { + // Ref - The reference name. + Ref *string `json:"ref,omitempty"` +} + +// IntegrationAccountPartner the integration account partner. +type IntegrationAccountPartner struct { + autorest.Response `json:"-"` + // IntegrationAccountPartnerProperties - The integration account partner properties. + *IntegrationAccountPartnerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 IntegrationAccountPartner. +func (iap IntegrationAccountPartner) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iap.IntegrationAccountPartnerProperties != nil { + objectMap["properties"] = iap.IntegrationAccountPartnerProperties + } + if iap.Location != nil { + objectMap["location"] = iap.Location + } + if iap.Tags != nil { + objectMap["tags"] = iap.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationAccountPartner struct. +func (iap *IntegrationAccountPartner) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var integrationAccountPartnerProperties IntegrationAccountPartnerProperties + err = json.Unmarshal(*v, &integrationAccountPartnerProperties) + if err != nil { + return err + } + iap.IntegrationAccountPartnerProperties = &integrationAccountPartnerProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + iap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + iap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + iap.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + iap.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + iap.Tags = tags + } + } + } + + return nil +} + +// IntegrationAccountPartnerFilter the integration account partner filter for odata query. +type IntegrationAccountPartnerFilter struct { + // PartnerType - The partner type of integration account partner. Possible values include: 'PartnerTypeNotSpecified', 'PartnerTypeB2B' + PartnerType PartnerType `json:"partnerType,omitempty"` +} + +// IntegrationAccountPartnerListResult the list of integration account partners. +type IntegrationAccountPartnerListResult struct { + autorest.Response `json:"-"` + // Value - The list of integration account partners. + Value *[]IntegrationAccountPartner `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// IntegrationAccountPartnerListResultIterator provides access to a complete listing of +// IntegrationAccountPartner values. +type IntegrationAccountPartnerListResultIterator struct { + i int + page IntegrationAccountPartnerListResultPage +} + +// 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 *IntegrationAccountPartnerListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountPartnerListResultIterator.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 *IntegrationAccountPartnerListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IntegrationAccountPartnerListResultIterator) 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 IntegrationAccountPartnerListResultIterator) Response() IntegrationAccountPartnerListResult { + 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 IntegrationAccountPartnerListResultIterator) Value() IntegrationAccountPartner { + if !iter.page.NotDone() { + return IntegrationAccountPartner{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IntegrationAccountPartnerListResultIterator type. +func NewIntegrationAccountPartnerListResultIterator(page IntegrationAccountPartnerListResultPage) IntegrationAccountPartnerListResultIterator { + return IntegrationAccountPartnerListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (iaplr IntegrationAccountPartnerListResult) IsEmpty() bool { + return iaplr.Value == nil || len(*iaplr.Value) == 0 +} + +// integrationAccountPartnerListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (iaplr IntegrationAccountPartnerListResult) integrationAccountPartnerListResultPreparer(ctx context.Context) (*http.Request, error) { + if iaplr.NextLink == nil || len(to.String(iaplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(iaplr.NextLink))) +} + +// IntegrationAccountPartnerListResultPage contains a page of IntegrationAccountPartner values. +type IntegrationAccountPartnerListResultPage struct { + fn func(context.Context, IntegrationAccountPartnerListResult) (IntegrationAccountPartnerListResult, error) + iaplr IntegrationAccountPartnerListResult +} + +// 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 *IntegrationAccountPartnerListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountPartnerListResultPage.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.iaplr) + if err != nil { + return err + } + page.iaplr = 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 *IntegrationAccountPartnerListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IntegrationAccountPartnerListResultPage) NotDone() bool { + return !page.iaplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IntegrationAccountPartnerListResultPage) Response() IntegrationAccountPartnerListResult { + return page.iaplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IntegrationAccountPartnerListResultPage) Values() []IntegrationAccountPartner { + if page.iaplr.IsEmpty() { + return nil + } + return *page.iaplr.Value +} + +// Creates a new instance of the IntegrationAccountPartnerListResultPage type. +func NewIntegrationAccountPartnerListResultPage(getNextPage func(context.Context, IntegrationAccountPartnerListResult) (IntegrationAccountPartnerListResult, error)) IntegrationAccountPartnerListResultPage { + return IntegrationAccountPartnerListResultPage{fn: getNextPage} +} + +// IntegrationAccountPartnerProperties the integration account partner properties. +type IntegrationAccountPartnerProperties struct { + // PartnerType - The partner type. Possible values include: 'PartnerTypeNotSpecified', 'PartnerTypeB2B' + PartnerType PartnerType `json:"partnerType,omitempty"` + // CreatedTime - READ-ONLY; The created time. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ChangedTime - READ-ONLY; The changed time. + ChangedTime *date.Time `json:"changedTime,omitempty"` + // Metadata - The metadata. + Metadata interface{} `json:"metadata,omitempty"` + // Content - The partner content. + Content *PartnerContent `json:"content,omitempty"` +} + +// IntegrationAccountProperties the integration account properties. +type IntegrationAccountProperties struct { + // IntegrationServiceEnvironment - The integration service environment. + IntegrationServiceEnvironment *IntegrationServiceEnvironment `json:"integrationServiceEnvironment,omitempty"` + // State - The workflow state. Possible values include: 'WorkflowStateNotSpecified', 'WorkflowStateCompleted', 'WorkflowStateEnabled', 'WorkflowStateDisabled', 'WorkflowStateDeleted', 'WorkflowStateSuspended' + State WorkflowState `json:"state,omitempty"` +} + +// IntegrationAccountSchema the integration account schema. +type IntegrationAccountSchema struct { + autorest.Response `json:"-"` + // IntegrationAccountSchemaProperties - The integration account schema properties. + *IntegrationAccountSchemaProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 IntegrationAccountSchema. +func (ias IntegrationAccountSchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ias.IntegrationAccountSchemaProperties != nil { + objectMap["properties"] = ias.IntegrationAccountSchemaProperties + } + if ias.Location != nil { + objectMap["location"] = ias.Location + } + if ias.Tags != nil { + objectMap["tags"] = ias.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationAccountSchema struct. +func (ias *IntegrationAccountSchema) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var integrationAccountSchemaProperties IntegrationAccountSchemaProperties + err = json.Unmarshal(*v, &integrationAccountSchemaProperties) + if err != nil { + return err + } + ias.IntegrationAccountSchemaProperties = &integrationAccountSchemaProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ias.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ias.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ias.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ias.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ias.Tags = tags + } + } + } + + return nil +} + +// IntegrationAccountSchemaFilter the integration account schema filter for odata query. +type IntegrationAccountSchemaFilter struct { + // SchemaType - The schema type of integration account schema. Possible values include: 'SchemaTypeNotSpecified', 'SchemaTypeXML' + SchemaType SchemaType `json:"schemaType,omitempty"` +} + +// IntegrationAccountSchemaListResult the list of integration account schemas. +type IntegrationAccountSchemaListResult struct { + autorest.Response `json:"-"` + // Value - The list of integration account schemas. + Value *[]IntegrationAccountSchema `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// IntegrationAccountSchemaListResultIterator provides access to a complete listing of +// IntegrationAccountSchema values. +type IntegrationAccountSchemaListResultIterator struct { + i int + page IntegrationAccountSchemaListResultPage +} + +// 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 *IntegrationAccountSchemaListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSchemaListResultIterator.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 *IntegrationAccountSchemaListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IntegrationAccountSchemaListResultIterator) 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 IntegrationAccountSchemaListResultIterator) Response() IntegrationAccountSchemaListResult { + 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 IntegrationAccountSchemaListResultIterator) Value() IntegrationAccountSchema { + if !iter.page.NotDone() { + return IntegrationAccountSchema{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IntegrationAccountSchemaListResultIterator type. +func NewIntegrationAccountSchemaListResultIterator(page IntegrationAccountSchemaListResultPage) IntegrationAccountSchemaListResultIterator { + return IntegrationAccountSchemaListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (iaslr IntegrationAccountSchemaListResult) IsEmpty() bool { + return iaslr.Value == nil || len(*iaslr.Value) == 0 +} + +// integrationAccountSchemaListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (iaslr IntegrationAccountSchemaListResult) integrationAccountSchemaListResultPreparer(ctx context.Context) (*http.Request, error) { + if iaslr.NextLink == nil || len(to.String(iaslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(iaslr.NextLink))) +} + +// IntegrationAccountSchemaListResultPage contains a page of IntegrationAccountSchema values. +type IntegrationAccountSchemaListResultPage struct { + fn func(context.Context, IntegrationAccountSchemaListResult) (IntegrationAccountSchemaListResult, error) + iaslr IntegrationAccountSchemaListResult +} + +// 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 *IntegrationAccountSchemaListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSchemaListResultPage.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.iaslr) + if err != nil { + return err + } + page.iaslr = 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 *IntegrationAccountSchemaListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IntegrationAccountSchemaListResultPage) NotDone() bool { + return !page.iaslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IntegrationAccountSchemaListResultPage) Response() IntegrationAccountSchemaListResult { + return page.iaslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IntegrationAccountSchemaListResultPage) Values() []IntegrationAccountSchema { + if page.iaslr.IsEmpty() { + return nil + } + return *page.iaslr.Value +} + +// Creates a new instance of the IntegrationAccountSchemaListResultPage type. +func NewIntegrationAccountSchemaListResultPage(getNextPage func(context.Context, IntegrationAccountSchemaListResult) (IntegrationAccountSchemaListResult, error)) IntegrationAccountSchemaListResultPage { + return IntegrationAccountSchemaListResultPage{fn: getNextPage} +} + +// IntegrationAccountSchemaProperties the integration account schema properties. +type IntegrationAccountSchemaProperties struct { + // SchemaType - The schema type. Possible values include: 'SchemaTypeNotSpecified', 'SchemaTypeXML' + SchemaType SchemaType `json:"schemaType,omitempty"` + // TargetNamespace - The target namespace of the schema. + TargetNamespace *string `json:"targetNamespace,omitempty"` + // DocumentName - The document name. + DocumentName *string `json:"documentName,omitempty"` + // FileName - The file name. + FileName *string `json:"fileName,omitempty"` + // CreatedTime - READ-ONLY; The created time. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ChangedTime - READ-ONLY; The changed time. + ChangedTime *date.Time `json:"changedTime,omitempty"` + // Metadata - The metadata. + Metadata interface{} `json:"metadata,omitempty"` + // Content - The content. + Content *string `json:"content,omitempty"` + // ContentType - The content type. + ContentType *string `json:"contentType,omitempty"` + // ContentLink - READ-ONLY; The content link. + ContentLink *ContentLink `json:"contentLink,omitempty"` +} + +// IntegrationAccountSession the integration account session. +type IntegrationAccountSession struct { + autorest.Response `json:"-"` + // IntegrationAccountSessionProperties - The integration account session properties. + *IntegrationAccountSessionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 IntegrationAccountSession. +func (ias IntegrationAccountSession) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ias.IntegrationAccountSessionProperties != nil { + objectMap["properties"] = ias.IntegrationAccountSessionProperties + } + if ias.Location != nil { + objectMap["location"] = ias.Location + } + if ias.Tags != nil { + objectMap["tags"] = ias.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationAccountSession struct. +func (ias *IntegrationAccountSession) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var integrationAccountSessionProperties IntegrationAccountSessionProperties + err = json.Unmarshal(*v, &integrationAccountSessionProperties) + if err != nil { + return err + } + ias.IntegrationAccountSessionProperties = &integrationAccountSessionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ias.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ias.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ias.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ias.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ias.Tags = tags + } + } + } + + return nil +} + +// IntegrationAccountSessionFilter the integration account session filter. +type IntegrationAccountSessionFilter struct { + // ChangedTime - The changed time of integration account sessions. + ChangedTime *date.Time `json:"changedTime,omitempty"` +} + +// IntegrationAccountSessionListResult the list of integration account sessions. +type IntegrationAccountSessionListResult struct { + autorest.Response `json:"-"` + // Value - The list of integration account sessions. + Value *[]IntegrationAccountSession `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// IntegrationAccountSessionListResultIterator provides access to a complete listing of +// IntegrationAccountSession values. +type IntegrationAccountSessionListResultIterator struct { + i int + page IntegrationAccountSessionListResultPage +} + +// 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 *IntegrationAccountSessionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSessionListResultIterator.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 *IntegrationAccountSessionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IntegrationAccountSessionListResultIterator) 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 IntegrationAccountSessionListResultIterator) Response() IntegrationAccountSessionListResult { + 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 IntegrationAccountSessionListResultIterator) Value() IntegrationAccountSession { + if !iter.page.NotDone() { + return IntegrationAccountSession{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IntegrationAccountSessionListResultIterator type. +func NewIntegrationAccountSessionListResultIterator(page IntegrationAccountSessionListResultPage) IntegrationAccountSessionListResultIterator { + return IntegrationAccountSessionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (iaslr IntegrationAccountSessionListResult) IsEmpty() bool { + return iaslr.Value == nil || len(*iaslr.Value) == 0 +} + +// integrationAccountSessionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (iaslr IntegrationAccountSessionListResult) integrationAccountSessionListResultPreparer(ctx context.Context) (*http.Request, error) { + if iaslr.NextLink == nil || len(to.String(iaslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(iaslr.NextLink))) +} + +// IntegrationAccountSessionListResultPage contains a page of IntegrationAccountSession values. +type IntegrationAccountSessionListResultPage struct { + fn func(context.Context, IntegrationAccountSessionListResult) (IntegrationAccountSessionListResult, error) + iaslr IntegrationAccountSessionListResult +} + +// 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 *IntegrationAccountSessionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationAccountSessionListResultPage.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.iaslr) + if err != nil { + return err + } + page.iaslr = 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 *IntegrationAccountSessionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IntegrationAccountSessionListResultPage) NotDone() bool { + return !page.iaslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IntegrationAccountSessionListResultPage) Response() IntegrationAccountSessionListResult { + return page.iaslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IntegrationAccountSessionListResultPage) Values() []IntegrationAccountSession { + if page.iaslr.IsEmpty() { + return nil + } + return *page.iaslr.Value +} + +// Creates a new instance of the IntegrationAccountSessionListResultPage type. +func NewIntegrationAccountSessionListResultPage(getNextPage func(context.Context, IntegrationAccountSessionListResult) (IntegrationAccountSessionListResult, error)) IntegrationAccountSessionListResultPage { + return IntegrationAccountSessionListResultPage{fn: getNextPage} +} + +// IntegrationAccountSessionProperties the integration account session properties. +type IntegrationAccountSessionProperties struct { + // CreatedTime - READ-ONLY; The created time. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ChangedTime - READ-ONLY; The changed time. + ChangedTime *date.Time `json:"changedTime,omitempty"` + // Content - The session content. + Content interface{} `json:"content,omitempty"` +} + +// IntegrationAccountSku the integration account sku. +type IntegrationAccountSku struct { + // Name - The sku name. Possible values include: 'IntegrationAccountSkuNameNotSpecified', 'IntegrationAccountSkuNameFree', 'IntegrationAccountSkuNameBasic', 'IntegrationAccountSkuNameStandard' + Name IntegrationAccountSkuName `json:"name,omitempty"` +} + +// IntegrationServiceEnvironment the integration service environment. +type IntegrationServiceEnvironment struct { + autorest.Response `json:"-"` + // Properties - The integration service environment properties. + Properties *IntegrationServiceEnvironmentProperties `json:"properties,omitempty"` + // Sku - The sku. + Sku *IntegrationServiceEnvironmentSku `json:"sku,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 IntegrationServiceEnvironment. +func (ise IntegrationServiceEnvironment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ise.Properties != nil { + objectMap["properties"] = ise.Properties + } + if ise.Sku != nil { + objectMap["sku"] = ise.Sku + } + if ise.Location != nil { + objectMap["location"] = ise.Location + } + if ise.Tags != nil { + objectMap["tags"] = ise.Tags + } + return json.Marshal(objectMap) +} + +// IntegrationServiceEnvironmentAccessEndpoint the integration service environment access endpoint. +type IntegrationServiceEnvironmentAccessEndpoint struct { + // Type - The access endpoint type. Possible values include: 'IntegrationServiceEnvironmentAccessEndpointTypeNotSpecified', 'IntegrationServiceEnvironmentAccessEndpointTypeExternal', 'IntegrationServiceEnvironmentAccessEndpointTypeInternal' + Type IntegrationServiceEnvironmentAccessEndpointType `json:"type,omitempty"` +} + +// IntegrationServiceEnvironmentListResult the list of integration service environments. +type IntegrationServiceEnvironmentListResult struct { + autorest.Response `json:"-"` + Value *[]IntegrationServiceEnvironment `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// IntegrationServiceEnvironmentListResultIterator provides access to a complete listing of +// IntegrationServiceEnvironment values. +type IntegrationServiceEnvironmentListResultIterator struct { + i int + page IntegrationServiceEnvironmentListResultPage +} + +// 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 *IntegrationServiceEnvironmentListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentListResultIterator.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 *IntegrationServiceEnvironmentListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IntegrationServiceEnvironmentListResultIterator) 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 IntegrationServiceEnvironmentListResultIterator) Response() IntegrationServiceEnvironmentListResult { + 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 IntegrationServiceEnvironmentListResultIterator) Value() IntegrationServiceEnvironment { + if !iter.page.NotDone() { + return IntegrationServiceEnvironment{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IntegrationServiceEnvironmentListResultIterator type. +func NewIntegrationServiceEnvironmentListResultIterator(page IntegrationServiceEnvironmentListResultPage) IntegrationServiceEnvironmentListResultIterator { + return IntegrationServiceEnvironmentListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (iselr IntegrationServiceEnvironmentListResult) IsEmpty() bool { + return iselr.Value == nil || len(*iselr.Value) == 0 +} + +// integrationServiceEnvironmentListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (iselr IntegrationServiceEnvironmentListResult) integrationServiceEnvironmentListResultPreparer(ctx context.Context) (*http.Request, error) { + if iselr.NextLink == nil || len(to.String(iselr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(iselr.NextLink))) +} + +// IntegrationServiceEnvironmentListResultPage contains a page of IntegrationServiceEnvironment values. +type IntegrationServiceEnvironmentListResultPage struct { + fn func(context.Context, IntegrationServiceEnvironmentListResult) (IntegrationServiceEnvironmentListResult, error) + iselr IntegrationServiceEnvironmentListResult +} + +// 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 *IntegrationServiceEnvironmentListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentListResultPage.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.iselr) + if err != nil { + return err + } + page.iselr = 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 *IntegrationServiceEnvironmentListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IntegrationServiceEnvironmentListResultPage) NotDone() bool { + return !page.iselr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IntegrationServiceEnvironmentListResultPage) Response() IntegrationServiceEnvironmentListResult { + return page.iselr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IntegrationServiceEnvironmentListResultPage) Values() []IntegrationServiceEnvironment { + if page.iselr.IsEmpty() { + return nil + } + return *page.iselr.Value +} + +// Creates a new instance of the IntegrationServiceEnvironmentListResultPage type. +func NewIntegrationServiceEnvironmentListResultPage(getNextPage func(context.Context, IntegrationServiceEnvironmentListResult) (IntegrationServiceEnvironmentListResult, error)) IntegrationServiceEnvironmentListResultPage { + return IntegrationServiceEnvironmentListResultPage{fn: getNextPage} +} + +// IntegrationServiceEnvironmentManagedApisDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type IntegrationServiceEnvironmentManagedApisDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IntegrationServiceEnvironmentManagedApisDeleteFuture) Result(client IntegrationServiceEnvironmentManagedApisClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("logic.IntegrationServiceEnvironmentManagedApisDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// IntegrationServiceEnvironmentManagedApisPutFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type IntegrationServiceEnvironmentManagedApisPutFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IntegrationServiceEnvironmentManagedApisPutFuture) Result(client IntegrationServiceEnvironmentManagedApisClient) (ma ManagedAPI, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisPutFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("logic.IntegrationServiceEnvironmentManagedApisPutFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ma.Response.Response, err = future.GetResult(sender); err == nil && ma.Response.Response.StatusCode != http.StatusNoContent { + ma, err = client.PutResponder(ma.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentManagedApisPutFuture", "Result", ma.Response.Response, "Failure responding to request") + } + } + return +} + +// IntegrationServiceEnvironmentNetworkDependency the azure async operation resource. +type IntegrationServiceEnvironmentNetworkDependency struct { + // Category - The network dependency category type. Possible values include: 'IntegrationServiceEnvironmentNetworkDependencyCategoryTypeNotSpecified', 'IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureStorage', 'IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureManagement', 'IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureActiveDirectory', 'IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSSLCertificateVerification', 'IntegrationServiceEnvironmentNetworkDependencyCategoryTypeDiagnosticLogsAndMetrics', 'IntegrationServiceEnvironmentNetworkDependencyCategoryTypeIntegrationServiceEnvironmentConnectors', 'IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRedisCache', 'IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAccessEndpoints', 'IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRecoveryService', 'IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSQL', 'IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRegionalService' + Category IntegrationServiceEnvironmentNetworkDependencyCategoryType `json:"category,omitempty"` + // DisplayName - The display name. + DisplayName *string `json:"displayName,omitempty"` + // Endpoints - The endpoints. + Endpoints *[]IntegrationServiceEnvironmentNetworkEndpoint `json:"endpoints,omitempty"` +} + +// IntegrationServiceEnvironmentNetworkDependencyHealth the integration service environment subnet network +// health. +type IntegrationServiceEnvironmentNetworkDependencyHealth struct { + // Error - The error if any occurred during the operation. + Error *ExtendedErrorInfo `json:"error,omitempty"` + // State - The network dependency health state. Possible values include: 'IntegrationServiceEnvironmentNetworkDependencyHealthStateNotSpecified', 'IntegrationServiceEnvironmentNetworkDependencyHealthStateHealthy', 'IntegrationServiceEnvironmentNetworkDependencyHealthStateUnhealthy', 'IntegrationServiceEnvironmentNetworkDependencyHealthStateUnknown' + State IntegrationServiceEnvironmentNetworkDependencyHealthState `json:"state,omitempty"` +} + +// IntegrationServiceEnvironmentNetworkEndpoint the network endpoint. +type IntegrationServiceEnvironmentNetworkEndpoint struct { + // Accessibility - The accessibility state. Possible values include: 'IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotSpecified', 'IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateUnknown', 'IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateAvailable', 'IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotAvailable' + Accessibility IntegrationServiceEnvironmentNetworkEndPointAccessibilityState `json:"accessibility,omitempty"` + // DomainName - The domain name. + DomainName *string `json:"domainName,omitempty"` + // Ports - The ports. + Ports *[]string `json:"ports,omitempty"` +} + +// IntegrationServiceEnvironmentProperties the integration service environment properties. +type IntegrationServiceEnvironmentProperties struct { + // ProvisioningState - The provisioning state. Possible values include: 'WorkflowProvisioningStateNotSpecified', 'WorkflowProvisioningStateAccepted', 'WorkflowProvisioningStateRunning', 'WorkflowProvisioningStateReady', 'WorkflowProvisioningStateCreating', 'WorkflowProvisioningStateCreated', 'WorkflowProvisioningStateDeleting', 'WorkflowProvisioningStateDeleted', 'WorkflowProvisioningStateCanceled', 'WorkflowProvisioningStateFailed', 'WorkflowProvisioningStateSucceeded', 'WorkflowProvisioningStateMoving', 'WorkflowProvisioningStateUpdating', 'WorkflowProvisioningStateRegistering', 'WorkflowProvisioningStateRegistered', 'WorkflowProvisioningStateUnregistering', 'WorkflowProvisioningStateUnregistered', 'WorkflowProvisioningStateCompleted' + ProvisioningState WorkflowProvisioningState `json:"provisioningState,omitempty"` + // State - The integration service environment state. Possible values include: 'WorkflowStateNotSpecified', 'WorkflowStateCompleted', 'WorkflowStateEnabled', 'WorkflowStateDisabled', 'WorkflowStateDeleted', 'WorkflowStateSuspended' + State WorkflowState `json:"state,omitempty"` + // IntegrationServiceEnvironmentID - Gets the tracking id. + IntegrationServiceEnvironmentID *string `json:"integrationServiceEnvironmentId,omitempty"` + // EndpointsConfiguration - The endpoints configuration. + EndpointsConfiguration *FlowEndpointsConfiguration `json:"endpointsConfiguration,omitempty"` + // NetworkConfiguration - The network configuration. + NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` +} + +// IntegrationServiceEnvironmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type IntegrationServiceEnvironmentsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IntegrationServiceEnvironmentsCreateOrUpdateFuture) Result(client IntegrationServiceEnvironmentsClient) (ise IntegrationServiceEnvironment, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("logic.IntegrationServiceEnvironmentsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ise.Response.Response, err = future.GetResult(sender); err == nil && ise.Response.Response.StatusCode != http.StatusNoContent { + ise, err = client.CreateOrUpdateResponder(ise.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsCreateOrUpdateFuture", "Result", ise.Response.Response, "Failure responding to request") + } + } + return +} + +// IntegrationServiceEnvironmentSku the integration service environment sku. +type IntegrationServiceEnvironmentSku struct { + // Name - The sku name. Possible values include: 'IntegrationServiceEnvironmentSkuNameNotSpecified', 'IntegrationServiceEnvironmentSkuNamePremium', 'IntegrationServiceEnvironmentSkuNameDeveloper' + Name IntegrationServiceEnvironmentSkuName `json:"name,omitempty"` + // Capacity - The sku capacity. + Capacity *int32 `json:"capacity,omitempty"` +} + +// IntegrationServiceEnvironmentSkuCapacity the integration service environment sku capacity. +type IntegrationServiceEnvironmentSkuCapacity struct { + // Minimum - The minimum capacity. + Minimum *int32 `json:"minimum,omitempty"` + // Maximum - The maximum capacity. + Maximum *int32 `json:"maximum,omitempty"` + // Default - The default capacity. + Default *int32 `json:"default,omitempty"` + // ScaleType - The sku scale type. Possible values include: 'Manual', 'Automatic', 'None' + ScaleType IntegrationServiceEnvironmentSkuScaleType `json:"scaleType,omitempty"` +} + +// IntegrationServiceEnvironmentSkuDefinition the integration service environment sku definition. +type IntegrationServiceEnvironmentSkuDefinition struct { + // ResourceType - The resource type. + ResourceType *string `json:"resourceType,omitempty"` + // Sku - The sku. + Sku *IntegrationServiceEnvironmentSkuDefinitionSku `json:"sku,omitempty"` + // Capacity - The sku capacity. + Capacity *IntegrationServiceEnvironmentSkuCapacity `json:"capacity,omitempty"` +} + +// IntegrationServiceEnvironmentSkuDefinitionSku the sku. +type IntegrationServiceEnvironmentSkuDefinitionSku struct { + // Name - The sku name. Possible values include: 'IntegrationServiceEnvironmentSkuNameNotSpecified', 'IntegrationServiceEnvironmentSkuNamePremium', 'IntegrationServiceEnvironmentSkuNameDeveloper' + Name IntegrationServiceEnvironmentSkuName `json:"name,omitempty"` + // Tier - The sku tier. + Tier *string `json:"tier,omitempty"` +} + +// IntegrationServiceEnvironmentSkuList the list of integration service environment skus. +type IntegrationServiceEnvironmentSkuList struct { + autorest.Response `json:"-"` + // Value - The list of integration service environment skus. + Value *[]IntegrationServiceEnvironmentSkuDefinition `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// IntegrationServiceEnvironmentSkuListIterator provides access to a complete listing of +// IntegrationServiceEnvironmentSkuDefinition values. +type IntegrationServiceEnvironmentSkuListIterator struct { + i int + page IntegrationServiceEnvironmentSkuListPage +} + +// 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 *IntegrationServiceEnvironmentSkuListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentSkuListIterator.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 *IntegrationServiceEnvironmentSkuListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IntegrationServiceEnvironmentSkuListIterator) 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 IntegrationServiceEnvironmentSkuListIterator) Response() IntegrationServiceEnvironmentSkuList { + 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 IntegrationServiceEnvironmentSkuListIterator) Value() IntegrationServiceEnvironmentSkuDefinition { + if !iter.page.NotDone() { + return IntegrationServiceEnvironmentSkuDefinition{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IntegrationServiceEnvironmentSkuListIterator type. +func NewIntegrationServiceEnvironmentSkuListIterator(page IntegrationServiceEnvironmentSkuListPage) IntegrationServiceEnvironmentSkuListIterator { + return IntegrationServiceEnvironmentSkuListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (isesl IntegrationServiceEnvironmentSkuList) IsEmpty() bool { + return isesl.Value == nil || len(*isesl.Value) == 0 +} + +// integrationServiceEnvironmentSkuListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (isesl IntegrationServiceEnvironmentSkuList) integrationServiceEnvironmentSkuListPreparer(ctx context.Context) (*http.Request, error) { + if isesl.NextLink == nil || len(to.String(isesl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(isesl.NextLink))) +} + +// IntegrationServiceEnvironmentSkuListPage contains a page of IntegrationServiceEnvironmentSkuDefinition +// values. +type IntegrationServiceEnvironmentSkuListPage struct { + fn func(context.Context, IntegrationServiceEnvironmentSkuList) (IntegrationServiceEnvironmentSkuList, error) + isesl IntegrationServiceEnvironmentSkuList +} + +// 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 *IntegrationServiceEnvironmentSkuListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationServiceEnvironmentSkuListPage.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.isesl) + if err != nil { + return err + } + page.isesl = 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 *IntegrationServiceEnvironmentSkuListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IntegrationServiceEnvironmentSkuListPage) NotDone() bool { + return !page.isesl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IntegrationServiceEnvironmentSkuListPage) Response() IntegrationServiceEnvironmentSkuList { + return page.isesl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IntegrationServiceEnvironmentSkuListPage) Values() []IntegrationServiceEnvironmentSkuDefinition { + if page.isesl.IsEmpty() { + return nil + } + return *page.isesl.Value +} + +// Creates a new instance of the IntegrationServiceEnvironmentSkuListPage type. +func NewIntegrationServiceEnvironmentSkuListPage(getNextPage func(context.Context, IntegrationServiceEnvironmentSkuList) (IntegrationServiceEnvironmentSkuList, error)) IntegrationServiceEnvironmentSkuListPage { + return IntegrationServiceEnvironmentSkuListPage{fn: getNextPage} +} + +// IntegrationServiceEnvironmentSubnetNetworkHealth the integration service environment subnet network +// health. +type IntegrationServiceEnvironmentSubnetNetworkHealth struct { + // OutboundNetworkDependencies - The outbound network dependencies. + OutboundNetworkDependencies *[]IntegrationServiceEnvironmentNetworkDependency `json:"outboundNetworkDependencies,omitempty"` + // OutboundNetworkHealth - The integration service environment network health. + OutboundNetworkHealth *IntegrationServiceEnvironmentNetworkDependencyHealth `json:"outboundNetworkHealth,omitempty"` + // NetworkDependencyHealthState - The integration service environment network health state. Possible values include: 'IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotSpecified', 'IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateUnknown', 'IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateAvailable', 'IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotAvailable' + NetworkDependencyHealthState IntegrationServiceEnvironmentNetworkEndPointAccessibilityState `json:"networkDependencyHealthState,omitempty"` +} + +// IntegrationServiceEnvironmentsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type IntegrationServiceEnvironmentsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IntegrationServiceEnvironmentsUpdateFuture) Result(client IntegrationServiceEnvironmentsClient) (ise IntegrationServiceEnvironment, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("logic.IntegrationServiceEnvironmentsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ise.Response.Response, err = future.GetResult(sender); err == nil && ise.Response.Response.StatusCode != http.StatusNoContent { + ise, err = client.UpdateResponder(ise.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.IntegrationServiceEnvironmentsUpdateFuture", "Result", ise.Response.Response, "Failure responding to request") + } + } + return +} + +// IPAddress the ip address. +type IPAddress struct { + // Address - The address. + Address *string `json:"address,omitempty"` +} + +// JSONSchema the JSON schema. +type JSONSchema struct { + autorest.Response `json:"-"` + // Title - The JSON title. + Title *string `json:"title,omitempty"` + // Content - The JSON content. + Content *string `json:"content,omitempty"` +} + +// KeyVaultKey the key vault key. +type KeyVaultKey struct { + // Kid - The key id. + Kid *string `json:"kid,omitempty"` + // Attributes - The key attributes. + Attributes *KeyVaultKeyAttributes `json:"attributes,omitempty"` +} + +// KeyVaultKeyAttributes the key attributes. +type KeyVaultKeyAttributes struct { + // Enabled - Whether the key is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + // Created - When the key was created. + Created *int64 `json:"created,omitempty"` + // Updated - When the key was updated. + Updated *int64 `json:"updated,omitempty"` +} + +// KeyVaultKeyCollection collection of key vault keys. +type KeyVaultKeyCollection struct { + autorest.Response `json:"-"` + // Value - The key vault keys. + Value *[]KeyVaultKey `json:"value,omitempty"` + // SkipToken - The skip token. + SkipToken *string `json:"skipToken,omitempty"` +} + +// KeyVaultKeyReference the reference to the key vault key. +type KeyVaultKeyReference struct { + // KeyVault - The key vault reference. + KeyVault *KeyVaultKeyReferenceKeyVault `json:"keyVault,omitempty"` + // KeyName - The private key name in key vault. + KeyName *string `json:"keyName,omitempty"` + // KeyVersion - The private key version in key vault. + KeyVersion *string `json:"keyVersion,omitempty"` +} + +// KeyVaultKeyReferenceKeyVault the key vault reference. +type KeyVaultKeyReferenceKeyVault struct { + // ID - The resource id. + 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"` +} + +// KeyVaultReference the key vault reference. +type KeyVaultReference struct { + // ID - The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the resource type. + Type *string `json:"type,omitempty"` +} + +// ListKeyVaultKeysDefinition the list key vault keys definition. +type ListKeyVaultKeysDefinition struct { + // KeyVault - The key vault reference. + KeyVault *KeyVaultReference `json:"keyVault,omitempty"` + // SkipToken - The skip token. + SkipToken *string `json:"skipToken,omitempty"` +} + +// ManagedAPI the managed api definition. +type ManagedAPI struct { + autorest.Response `json:"-"` + // Properties - The api resource properties. + Properties *APIResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 ManagedAPI. +func (ma ManagedAPI) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ma.Properties != nil { + objectMap["properties"] = ma.Properties + } + if ma.Location != nil { + objectMap["location"] = ma.Location + } + if ma.Tags != nil { + objectMap["tags"] = ma.Tags + } + return json.Marshal(objectMap) +} + +// ManagedAPIListResult the list of managed APIs. +type ManagedAPIListResult struct { + autorest.Response `json:"-"` + // Value - The managed APIs. + Value *[]ManagedAPI `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ManagedAPIListResultIterator provides access to a complete listing of ManagedAPI values. +type ManagedAPIListResultIterator struct { + i int + page ManagedAPIListResultPage +} + +// 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 *ManagedAPIListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedAPIListResultIterator.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 *ManagedAPIListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ManagedAPIListResultIterator) 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 ManagedAPIListResultIterator) Response() ManagedAPIListResult { + 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 ManagedAPIListResultIterator) Value() ManagedAPI { + if !iter.page.NotDone() { + return ManagedAPI{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ManagedAPIListResultIterator type. +func NewManagedAPIListResultIterator(page ManagedAPIListResultPage) ManagedAPIListResultIterator { + return ManagedAPIListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (malr ManagedAPIListResult) IsEmpty() bool { + return malr.Value == nil || len(*malr.Value) == 0 +} + +// managedAPIListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (malr ManagedAPIListResult) managedAPIListResultPreparer(ctx context.Context) (*http.Request, error) { + if malr.NextLink == nil || len(to.String(malr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(malr.NextLink))) +} + +// ManagedAPIListResultPage contains a page of ManagedAPI values. +type ManagedAPIListResultPage struct { + fn func(context.Context, ManagedAPIListResult) (ManagedAPIListResult, error) + malr ManagedAPIListResult +} + +// 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 *ManagedAPIListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedAPIListResultPage.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.malr) + if err != nil { + return err + } + page.malr = 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 *ManagedAPIListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ManagedAPIListResultPage) NotDone() bool { + return !page.malr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ManagedAPIListResultPage) Response() ManagedAPIListResult { + return page.malr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ManagedAPIListResultPage) Values() []ManagedAPI { + if page.malr.IsEmpty() { + return nil + } + return *page.malr.Value +} + +// Creates a new instance of the ManagedAPIListResultPage type. +func NewManagedAPIListResultPage(getNextPage func(context.Context, ManagedAPIListResult) (ManagedAPIListResult, error)) ManagedAPIListResultPage { + return ManagedAPIListResultPage{fn: getNextPage} +} + +// NetworkConfiguration the network configuration. +type NetworkConfiguration struct { + // VirtualNetworkAddressSpace - Gets the virtual network address space. + VirtualNetworkAddressSpace *string `json:"virtualNetworkAddressSpace,omitempty"` + // AccessEndpoint - The access endpoint. + AccessEndpoint *IntegrationServiceEnvironmentAccessEndpoint `json:"accessEndpoint,omitempty"` + // Subnets - The subnets. + Subnets *[]ResourceReference `json:"subnets,omitempty"` +} + +// Operation logic 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.Logic + 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"` +} + +// OperationListResult result of the request to list Logic 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 - List of Logic operations supported by the Logic 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"` +} + +// 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} +} + +// OperationResult the operation result definition. +type OperationResult struct { + // TrackingID - READ-ONLY; Gets the tracking id. + TrackingID *string `json:"trackingId,omitempty"` + // Inputs - READ-ONLY; Gets the inputs. + Inputs interface{} `json:"inputs,omitempty"` + // InputsLink - READ-ONLY; Gets the link to inputs. + InputsLink *ContentLink `json:"inputsLink,omitempty"` + // Outputs - READ-ONLY; Gets the outputs. + Outputs interface{} `json:"outputs,omitempty"` + // OutputsLink - READ-ONLY; Gets the link to outputs. + OutputsLink *ContentLink `json:"outputsLink,omitempty"` + // TrackedProperties - READ-ONLY; Gets the tracked properties. + TrackedProperties interface{} `json:"trackedProperties,omitempty"` + // RetryHistory - Gets the retry histories. + RetryHistory *[]RetryHistory `json:"retryHistory,omitempty"` + IterationCount *int32 `json:"iterationCount,omitempty"` + // StartTime - The start time of the workflow scope repetition. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the workflow scope repetition. + EndTime *date.Time `json:"endTime,omitempty"` + // Correlation - The correlation properties. + Correlation *RunActionCorrelation `json:"correlation,omitempty"` + // Status - The status of the workflow scope repetition. Possible values include: 'WorkflowStatusNotSpecified', 'WorkflowStatusPaused', 'WorkflowStatusRunning', 'WorkflowStatusWaiting', 'WorkflowStatusSucceeded', 'WorkflowStatusSkipped', 'WorkflowStatusSuspended', 'WorkflowStatusCancelled', 'WorkflowStatusFailed', 'WorkflowStatusFaulted', 'WorkflowStatusTimedOut', 'WorkflowStatusAborted', 'WorkflowStatusIgnored' + Status WorkflowStatus `json:"status,omitempty"` + // Code - The workflow scope repetition code. + Code *string `json:"code,omitempty"` + Error interface{} `json:"error,omitempty"` +} + +// OperationResultProperties the run operation result properties. +type OperationResultProperties struct { + // StartTime - The start time of the workflow scope repetition. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the workflow scope repetition. + EndTime *date.Time `json:"endTime,omitempty"` + // Correlation - The correlation properties. + Correlation *RunActionCorrelation `json:"correlation,omitempty"` + // Status - The status of the workflow scope repetition. Possible values include: 'WorkflowStatusNotSpecified', 'WorkflowStatusPaused', 'WorkflowStatusRunning', 'WorkflowStatusWaiting', 'WorkflowStatusSucceeded', 'WorkflowStatusSkipped', 'WorkflowStatusSuspended', 'WorkflowStatusCancelled', 'WorkflowStatusFailed', 'WorkflowStatusFaulted', 'WorkflowStatusTimedOut', 'WorkflowStatusAborted', 'WorkflowStatusIgnored' + Status WorkflowStatus `json:"status,omitempty"` + // Code - The workflow scope repetition code. + Code *string `json:"code,omitempty"` + Error interface{} `json:"error,omitempty"` +} + +// PartnerContent the integration account partner content. +type PartnerContent struct { + // B2b - The B2B partner content. + B2b *B2BPartnerContent `json:"b2b,omitempty"` +} + +// RecurrenceSchedule the recurrence schedule. +type RecurrenceSchedule struct { + // Minutes - The minutes. + Minutes *[]int32 `json:"minutes,omitempty"` + // Hours - The hours. + Hours *[]int32 `json:"hours,omitempty"` + // WeekDays - The days of the week. + WeekDays *[]DaysOfWeek `json:"weekDays,omitempty"` + // MonthDays - The month days. + MonthDays *[]int32 `json:"monthDays,omitempty"` + // MonthlyOccurrences - The monthly occurrences. + MonthlyOccurrences *[]RecurrenceScheduleOccurrence `json:"monthlyOccurrences,omitempty"` +} + +// RecurrenceScheduleOccurrence the recurrence schedule occurrence. +type RecurrenceScheduleOccurrence struct { + // Day - The day of the week. Possible values include: 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' + Day DayOfWeek `json:"day,omitempty"` + // Occurrence - The occurrence. + Occurrence *int32 `json:"occurrence,omitempty"` +} + +// RegenerateActionParameter the access key regenerate action content. +type RegenerateActionParameter struct { + // KeyType - The key type. Possible values include: 'KeyTypeNotSpecified', 'KeyTypePrimary', 'KeyTypeSecondary' + KeyType KeyType `json:"keyType,omitempty"` +} + +// RepetitionIndex the workflow run action repetition index. +type RepetitionIndex struct { + // ScopeName - The scope. + ScopeName *string `json:"scopeName,omitempty"` + // ItemIndex - The index. + ItemIndex *int32 `json:"itemIndex,omitempty"` +} + +// Request a request. +type Request struct { + // Headers - A list of all the headers attached to the request. + Headers interface{} `json:"headers,omitempty"` + // URI - The destination for the request. + URI *string `json:"uri,omitempty"` + // Method - The HTTP method used for the request. + Method *string `json:"method,omitempty"` +} + +// RequestHistory the request history. +type RequestHistory struct { + autorest.Response `json:"-"` + // Properties - The request history properties. + Properties *RequestHistoryProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 RequestHistory. +func (rh RequestHistory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rh.Properties != nil { + objectMap["properties"] = rh.Properties + } + if rh.Location != nil { + objectMap["location"] = rh.Location + } + if rh.Tags != nil { + objectMap["tags"] = rh.Tags + } + return json.Marshal(objectMap) +} + +// RequestHistoryListResult the list of workflow request histories. +type RequestHistoryListResult struct { + autorest.Response `json:"-"` + // Value - A list of workflow request histories. + Value *[]RequestHistory `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// RequestHistoryListResultIterator provides access to a complete listing of RequestHistory values. +type RequestHistoryListResultIterator struct { + i int + page RequestHistoryListResultPage +} + +// 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 *RequestHistoryListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RequestHistoryListResultIterator.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 *RequestHistoryListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RequestHistoryListResultIterator) 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 RequestHistoryListResultIterator) Response() RequestHistoryListResult { + 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 RequestHistoryListResultIterator) Value() RequestHistory { + if !iter.page.NotDone() { + return RequestHistory{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RequestHistoryListResultIterator type. +func NewRequestHistoryListResultIterator(page RequestHistoryListResultPage) RequestHistoryListResultIterator { + return RequestHistoryListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rhlr RequestHistoryListResult) IsEmpty() bool { + return rhlr.Value == nil || len(*rhlr.Value) == 0 +} + +// requestHistoryListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rhlr RequestHistoryListResult) requestHistoryListResultPreparer(ctx context.Context) (*http.Request, error) { + if rhlr.NextLink == nil || len(to.String(rhlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rhlr.NextLink))) +} + +// RequestHistoryListResultPage contains a page of RequestHistory values. +type RequestHistoryListResultPage struct { + fn func(context.Context, RequestHistoryListResult) (RequestHistoryListResult, error) + rhlr RequestHistoryListResult +} + +// 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 *RequestHistoryListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RequestHistoryListResultPage.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.rhlr) + if err != nil { + return err + } + page.rhlr = 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 *RequestHistoryListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RequestHistoryListResultPage) NotDone() bool { + return !page.rhlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RequestHistoryListResultPage) Response() RequestHistoryListResult { + return page.rhlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RequestHistoryListResultPage) Values() []RequestHistory { + if page.rhlr.IsEmpty() { + return nil + } + return *page.rhlr.Value +} + +// Creates a new instance of the RequestHistoryListResultPage type. +func NewRequestHistoryListResultPage(getNextPage func(context.Context, RequestHistoryListResult) (RequestHistoryListResult, error)) RequestHistoryListResultPage { + return RequestHistoryListResultPage{fn: getNextPage} +} + +// RequestHistoryProperties the request history. +type RequestHistoryProperties struct { + // StartTime - The time the request started. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The time the request ended. + EndTime *date.Time `json:"endTime,omitempty"` + // Request - The request. + Request *Request `json:"request,omitempty"` + // Response - The response. + Response *Response `json:"response,omitempty"` +} + +// Resource the base resource type. +type Resource struct { + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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) +} + +// ResourceReference the resource reference. +type ResourceReference struct { + // ID - The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the resource type. + Type *string `json:"type,omitempty"` +} + +// Response a response. +type Response struct { + // Headers - A list of all the headers attached to the response. + Headers interface{} `json:"headers,omitempty"` + // StatusCode - The status code of the response. + StatusCode *int32 `json:"statusCode,omitempty"` + // BodyLink - Details on the location of the body content. + BodyLink *ContentLink `json:"bodyLink,omitempty"` +} + +// RetryHistory the retry history. +type RetryHistory struct { + // StartTime - Gets the start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets the end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Code - Gets the status code. + Code *string `json:"code,omitempty"` + // ClientRequestID - Gets the client request Id. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // ServiceRequestID - Gets the service request Id. + ServiceRequestID *string `json:"serviceRequestId,omitempty"` + // Error - Gets the error response. + Error *ErrorResponse `json:"error,omitempty"` +} + +// RunActionCorrelation the workflow run action correlation properties. +type RunActionCorrelation struct { + // ActionTrackingID - The action tracking identifier. + ActionTrackingID *string `json:"actionTrackingId,omitempty"` + // ClientTrackingID - The client tracking identifier. + ClientTrackingID *string `json:"clientTrackingId,omitempty"` + // ClientKeywords - The client keywords. + ClientKeywords *[]string `json:"clientKeywords,omitempty"` +} + +// RunCorrelation the correlation properties. +type RunCorrelation struct { + // ClientTrackingID - The client tracking identifier. + ClientTrackingID *string `json:"clientTrackingId,omitempty"` + // ClientKeywords - The client keywords. + ClientKeywords *[]string `json:"clientKeywords,omitempty"` +} + +// SetIntegrationServiceEnvironmentSubnetNetworkHealth ... +type SetIntegrationServiceEnvironmentSubnetNetworkHealth struct { + autorest.Response `json:"-"` + Value map[string]*IntegrationServiceEnvironmentSubnetNetworkHealth `json:"value"` +} + +// MarshalJSON is the custom marshaler for SetIntegrationServiceEnvironmentSubnetNetworkHealth. +func (sisesnh SetIntegrationServiceEnvironmentSubnetNetworkHealth) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sisesnh.Value != nil { + objectMap["value"] = sisesnh.Value + } + return json.Marshal(objectMap) +} + +// SetObject ... +type SetObject struct { + autorest.Response `json:"-"` + Value interface{} `json:"value,omitempty"` +} + +// SetTriggerStateActionDefinition the set trigger state action definition. +type SetTriggerStateActionDefinition struct { + // Source - The source. + Source *WorkflowTrigger `json:"source,omitempty"` +} + +// Sku the sku type. +type Sku struct { + // Name - The name. Possible values include: 'SkuNameNotSpecified', 'SkuNameFree', 'SkuNameShared', 'SkuNameBasic', 'SkuNameStandard', 'SkuNamePremium' + Name SkuName `json:"name,omitempty"` + // Plan - The reference to plan. + Plan *ResourceReference `json:"plan,omitempty"` +} + +// SubResource the sub resource type. +type SubResource struct { + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` +} + +// SwaggerCustomDynamicList the swagger custom dynamic list. +type SwaggerCustomDynamicList struct { + // OperationID - The operation id to fetch dynamic schema. + OperationID *string `json:"operationId,omitempty"` + // BuiltInOperation - The built in operation. + BuiltInOperation *string `json:"builtInOperation,omitempty"` + // ItemsPath - The path to a response property (relative to the response object, not the response body) which contains an array of dynamic value items. + ItemsPath *string `json:"itemsPath,omitempty"` + // ItemValuePath - The path to a property which defines the value which should be used. + ItemValuePath *string `json:"itemValuePath,omitempty"` + // ItemTitlePath - The path to an item property which defines the display name of the item. + ItemTitlePath *string `json:"itemTitlePath,omitempty"` + // Parameters - The parameters. + Parameters map[string]*SwaggerCustomDynamicProperties `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for SwaggerCustomDynamicList. +func (scdl SwaggerCustomDynamicList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scdl.OperationID != nil { + objectMap["operationId"] = scdl.OperationID + } + if scdl.BuiltInOperation != nil { + objectMap["builtInOperation"] = scdl.BuiltInOperation + } + if scdl.ItemsPath != nil { + objectMap["itemsPath"] = scdl.ItemsPath + } + if scdl.ItemValuePath != nil { + objectMap["itemValuePath"] = scdl.ItemValuePath + } + if scdl.ItemTitlePath != nil { + objectMap["itemTitlePath"] = scdl.ItemTitlePath + } + if scdl.Parameters != nil { + objectMap["parameters"] = scdl.Parameters + } + return json.Marshal(objectMap) +} + +// SwaggerCustomDynamicProperties the swagger custom dynamic properties. +type SwaggerCustomDynamicProperties struct { + // OperationID - The operation id to fetch dynamic schema. + OperationID *string `json:"operationId,omitempty"` + // ValuePath - Json pointer to the dynamic schema on the response body. + ValuePath *string `json:"valuePath,omitempty"` + // Parameters - The operation parameters. + Parameters map[string]*SwaggerCustomDynamicProperties `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for SwaggerCustomDynamicProperties. +func (scdp SwaggerCustomDynamicProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scdp.OperationID != nil { + objectMap["operationId"] = scdp.OperationID + } + if scdp.ValuePath != nil { + objectMap["valuePath"] = scdp.ValuePath + } + if scdp.Parameters != nil { + objectMap["parameters"] = scdp.Parameters + } + return json.Marshal(objectMap) +} + +// SwaggerCustomDynamicSchema the swagger custom dynamic schema. +type SwaggerCustomDynamicSchema struct { + // OperationID - The operation id to fetch dynamic schema. + OperationID *string `json:"operationId,omitempty"` + // ValuePath - Json pointer to the dynamic schema on the response body. + ValuePath *string `json:"valuePath,omitempty"` + // Parameters - The operation parameters. + Parameters map[string]interface{} `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for SwaggerCustomDynamicSchema. +func (scds SwaggerCustomDynamicSchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scds.OperationID != nil { + objectMap["operationId"] = scds.OperationID + } + if scds.ValuePath != nil { + objectMap["valuePath"] = scds.ValuePath + } + if scds.Parameters != nil { + objectMap["parameters"] = scds.Parameters + } + return json.Marshal(objectMap) +} + +// SwaggerCustomDynamicTree the swagger custom dynamic tree. +type SwaggerCustomDynamicTree struct { + // Settings - The tree settings + Settings *SwaggerCustomDynamicTreeSettings `json:"settings,omitempty"` + // Open - The tree on-open configuration + Open *SwaggerCustomDynamicTreeCommand `json:"open,omitempty"` + // Browse - The tree on-browse configuration + Browse *SwaggerCustomDynamicTreeCommand `json:"browse,omitempty"` +} + +// SwaggerCustomDynamicTreeCommand the swagger tree command. +type SwaggerCustomDynamicTreeCommand struct { + // OperationID - The path to an item property which defines the display name of the item. + OperationID *string `json:"operationId,omitempty"` + // ItemsPath - The path to an item property which defines the display name of the item. + ItemsPath *string `json:"itemsPath,omitempty"` + // ItemValuePath - The path to an item property which defines the display name of the item. + ItemValuePath *string `json:"itemValuePath,omitempty"` + // ItemTitlePath - The path to an item property which defines the display name of the item. + ItemTitlePath *string `json:"itemTitlePath,omitempty"` + // ItemFullTitlePath - The path to an item property which defines the display name of the item. + ItemFullTitlePath *string `json:"itemFullTitlePath,omitempty"` + // ItemIsParent - The path to an item property which defines the display name of the item. + ItemIsParent *string `json:"itemIsParent,omitempty"` + // SelectableFilter - The path to an item property which defines the display name of the item. + SelectableFilter *string `json:"selectableFilter,omitempty"` + Parameters map[string]*SwaggerCustomDynamicTreeParameter `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for SwaggerCustomDynamicTreeCommand. +func (scdtc SwaggerCustomDynamicTreeCommand) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scdtc.OperationID != nil { + objectMap["operationId"] = scdtc.OperationID + } + if scdtc.ItemsPath != nil { + objectMap["itemsPath"] = scdtc.ItemsPath + } + if scdtc.ItemValuePath != nil { + objectMap["itemValuePath"] = scdtc.ItemValuePath + } + if scdtc.ItemTitlePath != nil { + objectMap["itemTitlePath"] = scdtc.ItemTitlePath + } + if scdtc.ItemFullTitlePath != nil { + objectMap["itemFullTitlePath"] = scdtc.ItemFullTitlePath + } + if scdtc.ItemIsParent != nil { + objectMap["itemIsParent"] = scdtc.ItemIsParent + } + if scdtc.SelectableFilter != nil { + objectMap["selectableFilter"] = scdtc.SelectableFilter + } + if scdtc.Parameters != nil { + objectMap["parameters"] = scdtc.Parameters + } + return json.Marshal(objectMap) +} + +// SwaggerCustomDynamicTreeParameter the swagger custom dynamic tree parameter. +type SwaggerCustomDynamicTreeParameter struct { + // SelectedItemValuePath - Gets or sets a path to a property in the currently selected item to pass as a value to a parameter for the given operation. + SelectedItemValuePath *string `json:"selectedItemValuePath,omitempty"` + // Value - The parameter value. + Value interface{} `json:"value,omitempty"` + // ParameterReference - The parameter reference. + ParameterReference *string `json:"parameterReference,omitempty"` + // Required - Indicates whether the parameter is required. + Required *bool `json:"required,omitempty"` +} + +// SwaggerCustomDynamicTreeSettings the swagger custom dynamic tree settings. +type SwaggerCustomDynamicTreeSettings struct { + // CanSelectParentNodes - Indicates whether parent nodes can be selected. + CanSelectParentNodes *bool `json:"CanSelectParentNodes,omitempty"` + // CanSelectLeafNodes - Indicates whether leaf nodes can be selected. + CanSelectLeafNodes *bool `json:"CanSelectLeafNodes,omitempty"` +} + +// SwaggerExternalDocumentation the swagger external documentation +type SwaggerExternalDocumentation struct { + // Description - The document description. + Description *string `json:"description,omitempty"` + // URI - The documentation Uri. + URI *string `json:"uri,omitempty"` + // Extensions - The vendor extensions. + Extensions map[string]interface{} `json:"extensions"` +} + +// MarshalJSON is the custom marshaler for SwaggerExternalDocumentation. +func (sed SwaggerExternalDocumentation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sed.Description != nil { + objectMap["description"] = sed.Description + } + if sed.URI != nil { + objectMap["uri"] = sed.URI + } + if sed.Extensions != nil { + objectMap["extensions"] = sed.Extensions + } + return json.Marshal(objectMap) +} + +// SwaggerSchema the swagger schema. +type SwaggerSchema struct { + // Ref - The reference. + Ref *string `json:"ref,omitempty"` + // Type - The type. Possible values include: 'String', 'Number', 'Integer', 'Boolean', 'Array', 'File', 'Object', 'Null' + Type SwaggerSchemaType `json:"type,omitempty"` + // Title - The title. + Title *string `json:"title,omitempty"` + // Items - The items schema. + Items *SwaggerSchema `json:"items,omitempty"` + // Properties - The object properties + Properties map[string]*SwaggerSchema `json:"properties"` + // AdditionalProperties - The additional properties. + AdditionalProperties interface{} `json:"additionalProperties,omitempty"` + // Required - The object required properties. + Required *[]string `json:"required,omitempty"` + // MaxProperties - The maximum number of allowed properties. + MaxProperties *int32 `json:"maxProperties,omitempty"` + // MinProperties - The minimum number of allowed properties. + MinProperties *int32 `json:"minProperties,omitempty"` + // AllOf - The schemas which must pass validation when this schema is used. + AllOf *[]SwaggerSchema `json:"allOf,omitempty"` + // Discriminator - The discriminator. + Discriminator *string `json:"discriminator,omitempty"` + // ReadOnly - Indicates whether this property must be present in the a request. + ReadOnly *bool `json:"readOnly,omitempty"` + // XML - The xml representation format for a property. + XML *SwaggerXML `json:"xml,omitempty"` + // ExternalDocs - The external documentation. + ExternalDocs *SwaggerExternalDocumentation `json:"externalDocs,omitempty"` + // Example - The example value. + Example interface{} `json:"example,omitempty"` + // NotificationURLExtension - Indicates the notification url extension. If this is set, the property's value should be a callback url for a webhook. + NotificationURLExtension *bool `json:"notificationUrlExtension,omitempty"` + // DynamicSchemaOld - The dynamic schema configuration. + DynamicSchemaOld *SwaggerCustomDynamicSchema `json:"dynamicSchemaOld,omitempty"` + // DynamicSchemaNew - The dynamic schema configuration. + DynamicSchemaNew *SwaggerCustomDynamicProperties `json:"dynamicSchemaNew,omitempty"` + // DynamicListNew - The dynamic list. + DynamicListNew *SwaggerCustomDynamicList `json:"dynamicListNew,omitempty"` + // DynamicTree - The dynamic values tree configuration. + DynamicTree *SwaggerCustomDynamicTree `json:"dynamicTree,omitempty"` +} + +// MarshalJSON is the custom marshaler for SwaggerSchema. +func (ss SwaggerSchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.Ref != nil { + objectMap["ref"] = ss.Ref + } + if ss.Type != "" { + objectMap["type"] = ss.Type + } + if ss.Title != nil { + objectMap["title"] = ss.Title + } + if ss.Items != nil { + objectMap["items"] = ss.Items + } + if ss.Properties != nil { + objectMap["properties"] = ss.Properties + } + if ss.AdditionalProperties != nil { + objectMap["additionalProperties"] = ss.AdditionalProperties + } + if ss.Required != nil { + objectMap["required"] = ss.Required + } + if ss.MaxProperties != nil { + objectMap["maxProperties"] = ss.MaxProperties + } + if ss.MinProperties != nil { + objectMap["minProperties"] = ss.MinProperties + } + if ss.AllOf != nil { + objectMap["allOf"] = ss.AllOf + } + if ss.Discriminator != nil { + objectMap["discriminator"] = ss.Discriminator + } + if ss.ReadOnly != nil { + objectMap["readOnly"] = ss.ReadOnly + } + if ss.XML != nil { + objectMap["xml"] = ss.XML + } + if ss.ExternalDocs != nil { + objectMap["externalDocs"] = ss.ExternalDocs + } + if ss.Example != nil { + objectMap["example"] = ss.Example + } + if ss.NotificationURLExtension != nil { + objectMap["notificationUrlExtension"] = ss.NotificationURLExtension + } + if ss.DynamicSchemaOld != nil { + objectMap["dynamicSchemaOld"] = ss.DynamicSchemaOld + } + if ss.DynamicSchemaNew != nil { + objectMap["dynamicSchemaNew"] = ss.DynamicSchemaNew + } + if ss.DynamicListNew != nil { + objectMap["dynamicListNew"] = ss.DynamicListNew + } + if ss.DynamicTree != nil { + objectMap["dynamicTree"] = ss.DynamicTree + } + return json.Marshal(objectMap) +} + +// SwaggerXML the Swagger XML. +type SwaggerXML struct { + // Name - The xml element or attribute name. + Name *string `json:"name,omitempty"` + // Namespace - The xml namespace. + Namespace *string `json:"namespace,omitempty"` + // Prefix - The name prefix. + Prefix *string `json:"prefix,omitempty"` + // Attribute - Indicates whether the property should be an attribute instead of an element. + Attribute *bool `json:"attribute,omitempty"` + // Wrapped - Indicates whether the array elements are wrapped in a container element. + Wrapped *bool `json:"wrapped,omitempty"` + // Extensions - The vendor extensions. + Extensions map[string]interface{} `json:"extensions"` +} + +// MarshalJSON is the custom marshaler for SwaggerXML. +func (sx SwaggerXML) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sx.Name != nil { + objectMap["name"] = sx.Name + } + if sx.Namespace != nil { + objectMap["namespace"] = sx.Namespace + } + if sx.Prefix != nil { + objectMap["prefix"] = sx.Prefix + } + if sx.Attribute != nil { + objectMap["attribute"] = sx.Attribute + } + if sx.Wrapped != nil { + objectMap["wrapped"] = sx.Wrapped + } + if sx.Extensions != nil { + objectMap["extensions"] = sx.Extensions + } + return json.Marshal(objectMap) +} + +// TrackingEvent the tracking event. +type TrackingEvent struct { + // EventLevel - The event level. Possible values include: 'LogAlways', 'Critical', 'Error', 'Warning', 'Informational', 'Verbose' + EventLevel EventLevel `json:"eventLevel,omitempty"` + // EventTime - The event time. + EventTime *date.Time `json:"eventTime,omitempty"` + // RecordType - The record type. Possible values include: 'TrackingRecordTypeNotSpecified', 'TrackingRecordTypeCustom', 'TrackingRecordTypeAS2Message', 'TrackingRecordTypeAS2MDN', 'TrackingRecordTypeX12Interchange', 'TrackingRecordTypeX12FunctionalGroup', 'TrackingRecordTypeX12TransactionSet', 'TrackingRecordTypeX12InterchangeAcknowledgment', 'TrackingRecordTypeX12FunctionalGroupAcknowledgment', 'TrackingRecordTypeX12TransactionSetAcknowledgment', 'TrackingRecordTypeEdifactInterchange', 'TrackingRecordTypeEdifactFunctionalGroup', 'TrackingRecordTypeEdifactTransactionSet', 'TrackingRecordTypeEdifactInterchangeAcknowledgment', 'TrackingRecordTypeEdifactFunctionalGroupAcknowledgment', 'TrackingRecordTypeEdifactTransactionSetAcknowledgment' + RecordType TrackingRecordType `json:"recordType,omitempty"` + // Error - The error. + Error *TrackingEventErrorInfo `json:"error,omitempty"` +} + +// TrackingEventErrorInfo the tracking event error info. +type TrackingEventErrorInfo struct { + // Message - The message. + Message *string `json:"message,omitempty"` + // Code - The code. + Code *string `json:"code,omitempty"` +} + +// TrackingEventsDefinition the tracking events definition. +type TrackingEventsDefinition struct { + // SourceType - The source type. + SourceType *string `json:"sourceType,omitempty"` + // TrackEventsOptions - The track events options. Possible values include: 'TrackEventsOperationOptionsNone', 'TrackEventsOperationOptionsDisableSourceInfoEnrich' + TrackEventsOptions TrackEventsOperationOptions `json:"trackEventsOptions,omitempty"` + // Events - The events. + Events *[]TrackingEvent `json:"events,omitempty"` +} + +// Workflow the workflow type. +type Workflow struct { + autorest.Response `json:"-"` + // WorkflowProperties - The workflow properties. + *WorkflowProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 Workflow. +func (w Workflow) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WorkflowProperties != nil { + objectMap["properties"] = w.WorkflowProperties + } + if w.Location != nil { + objectMap["location"] = w.Location + } + if w.Tags != nil { + objectMap["tags"] = w.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Workflow struct. +func (w *Workflow) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var workflowProperties WorkflowProperties + err = json.Unmarshal(*v, &workflowProperties) + if err != nil { + return err + } + w.WorkflowProperties = &workflowProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + w.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + w.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + w.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + w.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + w.Tags = tags + } + } + } + + return nil +} + +// WorkflowFilter the workflow filter. +type WorkflowFilter struct { + // State - The state of workflows. Possible values include: 'WorkflowStateNotSpecified', 'WorkflowStateCompleted', 'WorkflowStateEnabled', 'WorkflowStateDisabled', 'WorkflowStateDeleted', 'WorkflowStateSuspended' + State WorkflowState `json:"state,omitempty"` +} + +// WorkflowListResult the list of workflows. +type WorkflowListResult struct { + autorest.Response `json:"-"` + // Value - The list of workflows. + Value *[]Workflow `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// WorkflowListResultIterator provides access to a complete listing of Workflow values. +type WorkflowListResultIterator struct { + i int + page WorkflowListResultPage +} + +// 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 *WorkflowListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowListResultIterator.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 *WorkflowListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkflowListResultIterator) 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 WorkflowListResultIterator) Response() WorkflowListResult { + 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 WorkflowListResultIterator) Value() Workflow { + if !iter.page.NotDone() { + return Workflow{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkflowListResultIterator type. +func NewWorkflowListResultIterator(page WorkflowListResultPage) WorkflowListResultIterator { + return WorkflowListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wlr WorkflowListResult) IsEmpty() bool { + return wlr.Value == nil || len(*wlr.Value) == 0 +} + +// workflowListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wlr WorkflowListResult) workflowListResultPreparer(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))) +} + +// WorkflowListResultPage contains a page of Workflow values. +type WorkflowListResultPage struct { + fn func(context.Context, WorkflowListResult) (WorkflowListResult, error) + wlr WorkflowListResult +} + +// 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 *WorkflowListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowListResultPage.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 *WorkflowListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkflowListResultPage) NotDone() bool { + return !page.wlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkflowListResultPage) Response() WorkflowListResult { + return page.wlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkflowListResultPage) Values() []Workflow { + if page.wlr.IsEmpty() { + return nil + } + return *page.wlr.Value +} + +// Creates a new instance of the WorkflowListResultPage type. +func NewWorkflowListResultPage(getNextPage func(context.Context, WorkflowListResult) (WorkflowListResult, error)) WorkflowListResultPage { + return WorkflowListResultPage{fn: getNextPage} +} + +// WorkflowOutputParameter the workflow output parameter. +type WorkflowOutputParameter struct { + // Error - READ-ONLY; Gets the error. + Error interface{} `json:"error,omitempty"` + // Type - The type. Possible values include: 'ParameterTypeNotSpecified', 'ParameterTypeString', 'ParameterTypeSecureString', 'ParameterTypeInt', 'ParameterTypeFloat', 'ParameterTypeBool', 'ParameterTypeArray', 'ParameterTypeObject', 'ParameterTypeSecureObject' + Type ParameterType `json:"type,omitempty"` + // Value - The value. + Value interface{} `json:"value,omitempty"` + // Metadata - The metadata. + Metadata interface{} `json:"metadata,omitempty"` + // Description - The description. + Description *string `json:"description,omitempty"` +} + +// WorkflowParameter the workflow parameters. +type WorkflowParameter struct { + // Type - The type. Possible values include: 'ParameterTypeNotSpecified', 'ParameterTypeString', 'ParameterTypeSecureString', 'ParameterTypeInt', 'ParameterTypeFloat', 'ParameterTypeBool', 'ParameterTypeArray', 'ParameterTypeObject', 'ParameterTypeSecureObject' + Type ParameterType `json:"type,omitempty"` + // Value - The value. + Value interface{} `json:"value,omitempty"` + // Metadata - The metadata. + Metadata interface{} `json:"metadata,omitempty"` + // Description - The description. + Description *string `json:"description,omitempty"` +} + +// WorkflowProperties the workflow properties. +type WorkflowProperties struct { + // ProvisioningState - READ-ONLY; Gets the provisioning state. Possible values include: 'WorkflowProvisioningStateNotSpecified', 'WorkflowProvisioningStateAccepted', 'WorkflowProvisioningStateRunning', 'WorkflowProvisioningStateReady', 'WorkflowProvisioningStateCreating', 'WorkflowProvisioningStateCreated', 'WorkflowProvisioningStateDeleting', 'WorkflowProvisioningStateDeleted', 'WorkflowProvisioningStateCanceled', 'WorkflowProvisioningStateFailed', 'WorkflowProvisioningStateSucceeded', 'WorkflowProvisioningStateMoving', 'WorkflowProvisioningStateUpdating', 'WorkflowProvisioningStateRegistering', 'WorkflowProvisioningStateRegistered', 'WorkflowProvisioningStateUnregistering', 'WorkflowProvisioningStateUnregistered', 'WorkflowProvisioningStateCompleted' + ProvisioningState WorkflowProvisioningState `json:"provisioningState,omitempty"` + // CreatedTime - READ-ONLY; Gets the created time. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ChangedTime - READ-ONLY; Gets the changed time. + ChangedTime *date.Time `json:"changedTime,omitempty"` + // State - The state. Possible values include: 'WorkflowStateNotSpecified', 'WorkflowStateCompleted', 'WorkflowStateEnabled', 'WorkflowStateDisabled', 'WorkflowStateDeleted', 'WorkflowStateSuspended' + State WorkflowState `json:"state,omitempty"` + // Version - READ-ONLY; Gets the version. + Version *string `json:"version,omitempty"` + // AccessEndpoint - READ-ONLY; Gets the access endpoint. + AccessEndpoint *string `json:"accessEndpoint,omitempty"` + // EndpointsConfiguration - The endpoints configuration. + EndpointsConfiguration *FlowEndpointsConfiguration `json:"endpointsConfiguration,omitempty"` + // Sku - The sku. + Sku *Sku `json:"sku,omitempty"` + // IntegrationAccount - The integration account. + IntegrationAccount *ResourceReference `json:"integrationAccount,omitempty"` + // IntegrationServiceEnvironment - The integration service environment. + IntegrationServiceEnvironment *ResourceReference `json:"integrationServiceEnvironment,omitempty"` + // Definition - The definition. + Definition interface{} `json:"definition,omitempty"` + // Parameters - The parameters. + Parameters map[string]*WorkflowParameter `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for WorkflowProperties. +func (wp WorkflowProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.State != "" { + objectMap["state"] = wp.State + } + if wp.EndpointsConfiguration != nil { + objectMap["endpointsConfiguration"] = wp.EndpointsConfiguration + } + if wp.Sku != nil { + objectMap["sku"] = wp.Sku + } + if wp.IntegrationAccount != nil { + objectMap["integrationAccount"] = wp.IntegrationAccount + } + if wp.IntegrationServiceEnvironment != nil { + objectMap["integrationServiceEnvironment"] = wp.IntegrationServiceEnvironment + } + if wp.Definition != nil { + objectMap["definition"] = wp.Definition + } + if wp.Parameters != nil { + objectMap["parameters"] = wp.Parameters + } + return json.Marshal(objectMap) +} + +// WorkflowRun the workflow run. +type WorkflowRun struct { + autorest.Response `json:"-"` + // WorkflowRunProperties - The workflow run properties. + *WorkflowRunProperties `json:"properties,omitempty"` + // Name - READ-ONLY; Gets the workflow run name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the workflow run type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkflowRun. +func (wr WorkflowRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wr.WorkflowRunProperties != nil { + objectMap["properties"] = wr.WorkflowRunProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkflowRun struct. +func (wr *WorkflowRun) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var workflowRunProperties WorkflowRunProperties + err = json.Unmarshal(*v, &workflowRunProperties) + if err != nil { + return err + } + wr.WorkflowRunProperties = &workflowRunProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wr.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wr.ID = &ID + } + } + } + + return nil +} + +// WorkflowRunAction the workflow run action. +type WorkflowRunAction struct { + autorest.Response `json:"-"` + // WorkflowRunActionProperties - The workflow run action properties. + *WorkflowRunActionProperties `json:"properties,omitempty"` + // Name - READ-ONLY; Gets the workflow run action name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the workflow run action type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkflowRunAction. +func (wra WorkflowRunAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wra.WorkflowRunActionProperties != nil { + objectMap["properties"] = wra.WorkflowRunActionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkflowRunAction struct. +func (wra *WorkflowRunAction) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var workflowRunActionProperties WorkflowRunActionProperties + err = json.Unmarshal(*v, &workflowRunActionProperties) + if err != nil { + return err + } + wra.WorkflowRunActionProperties = &workflowRunActionProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wra.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wra.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wra.ID = &ID + } + } + } + + return nil +} + +// WorkflowRunActionFilter the workflow run action filter. +type WorkflowRunActionFilter struct { + // Status - The status of workflow run action. Possible values include: 'WorkflowStatusNotSpecified', 'WorkflowStatusPaused', 'WorkflowStatusRunning', 'WorkflowStatusWaiting', 'WorkflowStatusSucceeded', 'WorkflowStatusSkipped', 'WorkflowStatusSuspended', 'WorkflowStatusCancelled', 'WorkflowStatusFailed', 'WorkflowStatusFaulted', 'WorkflowStatusTimedOut', 'WorkflowStatusAborted', 'WorkflowStatusIgnored' + Status WorkflowStatus `json:"status,omitempty"` +} + +// WorkflowRunActionListResult the list of workflow run actions. +type WorkflowRunActionListResult struct { + autorest.Response `json:"-"` + // Value - A list of workflow run actions. + Value *[]WorkflowRunAction `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// WorkflowRunActionListResultIterator provides access to a complete listing of WorkflowRunAction values. +type WorkflowRunActionListResultIterator struct { + i int + page WorkflowRunActionListResultPage +} + +// 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 *WorkflowRunActionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionListResultIterator.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 *WorkflowRunActionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkflowRunActionListResultIterator) 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 WorkflowRunActionListResultIterator) Response() WorkflowRunActionListResult { + 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 WorkflowRunActionListResultIterator) Value() WorkflowRunAction { + if !iter.page.NotDone() { + return WorkflowRunAction{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkflowRunActionListResultIterator type. +func NewWorkflowRunActionListResultIterator(page WorkflowRunActionListResultPage) WorkflowRunActionListResultIterator { + return WorkflowRunActionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wralr WorkflowRunActionListResult) IsEmpty() bool { + return wralr.Value == nil || len(*wralr.Value) == 0 +} + +// workflowRunActionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wralr WorkflowRunActionListResult) workflowRunActionListResultPreparer(ctx context.Context) (*http.Request, error) { + if wralr.NextLink == nil || len(to.String(wralr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wralr.NextLink))) +} + +// WorkflowRunActionListResultPage contains a page of WorkflowRunAction values. +type WorkflowRunActionListResultPage struct { + fn func(context.Context, WorkflowRunActionListResult) (WorkflowRunActionListResult, error) + wralr WorkflowRunActionListResult +} + +// 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 *WorkflowRunActionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionListResultPage.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.wralr) + if err != nil { + return err + } + page.wralr = 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 *WorkflowRunActionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkflowRunActionListResultPage) NotDone() bool { + return !page.wralr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkflowRunActionListResultPage) Response() WorkflowRunActionListResult { + return page.wralr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkflowRunActionListResultPage) Values() []WorkflowRunAction { + if page.wralr.IsEmpty() { + return nil + } + return *page.wralr.Value +} + +// Creates a new instance of the WorkflowRunActionListResultPage type. +func NewWorkflowRunActionListResultPage(getNextPage func(context.Context, WorkflowRunActionListResult) (WorkflowRunActionListResult, error)) WorkflowRunActionListResultPage { + return WorkflowRunActionListResultPage{fn: getNextPage} +} + +// WorkflowRunActionProperties the workflow run action properties. +type WorkflowRunActionProperties struct { + // StartTime - READ-ONLY; Gets the start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; Gets the end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Status - READ-ONLY; Gets the status. Possible values include: 'WorkflowStatusNotSpecified', 'WorkflowStatusPaused', 'WorkflowStatusRunning', 'WorkflowStatusWaiting', 'WorkflowStatusSucceeded', 'WorkflowStatusSkipped', 'WorkflowStatusSuspended', 'WorkflowStatusCancelled', 'WorkflowStatusFailed', 'WorkflowStatusFaulted', 'WorkflowStatusTimedOut', 'WorkflowStatusAborted', 'WorkflowStatusIgnored' + Status WorkflowStatus `json:"status,omitempty"` + // Code - READ-ONLY; Gets the code. + Code *string `json:"code,omitempty"` + // Error - READ-ONLY; Gets the error. + Error interface{} `json:"error,omitempty"` + // TrackingID - READ-ONLY; Gets the tracking id. + TrackingID *string `json:"trackingId,omitempty"` + // Correlation - The correlation properties. + Correlation *Correlation `json:"correlation,omitempty"` + // InputsLink - READ-ONLY; Gets the link to inputs. + InputsLink *ContentLink `json:"inputsLink,omitempty"` + // OutputsLink - READ-ONLY; Gets the link to outputs. + OutputsLink *ContentLink `json:"outputsLink,omitempty"` + // TrackedProperties - READ-ONLY; Gets the tracked properties. + TrackedProperties interface{} `json:"trackedProperties,omitempty"` + // RetryHistory - Gets the retry histories. + RetryHistory *[]RetryHistory `json:"retryHistory,omitempty"` +} + +// WorkflowRunActionRepetitionDefinition the workflow run action repetition definition. +type WorkflowRunActionRepetitionDefinition struct { + autorest.Response `json:"-"` + // WorkflowRunActionRepetitionProperties - The workflow run action repetition properties definition. + *WorkflowRunActionRepetitionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 WorkflowRunActionRepetitionDefinition. +func (wrard WorkflowRunActionRepetitionDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wrard.WorkflowRunActionRepetitionProperties != nil { + objectMap["properties"] = wrard.WorkflowRunActionRepetitionProperties + } + if wrard.Location != nil { + objectMap["location"] = wrard.Location + } + if wrard.Tags != nil { + objectMap["tags"] = wrard.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkflowRunActionRepetitionDefinition struct. +func (wrard *WorkflowRunActionRepetitionDefinition) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var workflowRunActionRepetitionProperties WorkflowRunActionRepetitionProperties + err = json.Unmarshal(*v, &workflowRunActionRepetitionProperties) + if err != nil { + return err + } + wrard.WorkflowRunActionRepetitionProperties = &workflowRunActionRepetitionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wrard.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wrard.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wrard.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wrard.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wrard.Tags = tags + } + } + } + + return nil +} + +// WorkflowRunActionRepetitionDefinitionCollection a collection of workflow run action repetitions. +type WorkflowRunActionRepetitionDefinitionCollection struct { + autorest.Response `json:"-"` + // NextLink - The link used to get the next page of recommendations. + NextLink *string `json:"nextLink,omitempty"` + Value *[]WorkflowRunActionRepetitionDefinition `json:"value,omitempty"` +} + +// WorkflowRunActionRepetitionProperties the workflow run action repetition properties definition. +type WorkflowRunActionRepetitionProperties struct { + // RepetitionIndexes - The repetition indexes. + RepetitionIndexes *[]RepetitionIndex `json:"repetitionIndexes,omitempty"` + // TrackingID - READ-ONLY; Gets the tracking id. + TrackingID *string `json:"trackingId,omitempty"` + // Inputs - READ-ONLY; Gets the inputs. + Inputs interface{} `json:"inputs,omitempty"` + // InputsLink - READ-ONLY; Gets the link to inputs. + InputsLink *ContentLink `json:"inputsLink,omitempty"` + // Outputs - READ-ONLY; Gets the outputs. + Outputs interface{} `json:"outputs,omitempty"` + // OutputsLink - READ-ONLY; Gets the link to outputs. + OutputsLink *ContentLink `json:"outputsLink,omitempty"` + // TrackedProperties - READ-ONLY; Gets the tracked properties. + TrackedProperties interface{} `json:"trackedProperties,omitempty"` + // RetryHistory - Gets the retry histories. + RetryHistory *[]RetryHistory `json:"retryHistory,omitempty"` + IterationCount *int32 `json:"iterationCount,omitempty"` + // StartTime - The start time of the workflow scope repetition. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the workflow scope repetition. + EndTime *date.Time `json:"endTime,omitempty"` + // Correlation - The correlation properties. + Correlation *RunActionCorrelation `json:"correlation,omitempty"` + // Status - The status of the workflow scope repetition. Possible values include: 'WorkflowStatusNotSpecified', 'WorkflowStatusPaused', 'WorkflowStatusRunning', 'WorkflowStatusWaiting', 'WorkflowStatusSucceeded', 'WorkflowStatusSkipped', 'WorkflowStatusSuspended', 'WorkflowStatusCancelled', 'WorkflowStatusFailed', 'WorkflowStatusFaulted', 'WorkflowStatusTimedOut', 'WorkflowStatusAborted', 'WorkflowStatusIgnored' + Status WorkflowStatus `json:"status,omitempty"` + // Code - The workflow scope repetition code. + Code *string `json:"code,omitempty"` + Error interface{} `json:"error,omitempty"` +} + +// WorkflowRunFilter the workflow run filter. +type WorkflowRunFilter struct { + // Status - The status of workflow run. Possible values include: 'WorkflowStatusNotSpecified', 'WorkflowStatusPaused', 'WorkflowStatusRunning', 'WorkflowStatusWaiting', 'WorkflowStatusSucceeded', 'WorkflowStatusSkipped', 'WorkflowStatusSuspended', 'WorkflowStatusCancelled', 'WorkflowStatusFailed', 'WorkflowStatusFaulted', 'WorkflowStatusTimedOut', 'WorkflowStatusAborted', 'WorkflowStatusIgnored' + Status WorkflowStatus `json:"status,omitempty"` +} + +// WorkflowRunListResult the list of workflow runs. +type WorkflowRunListResult struct { + autorest.Response `json:"-"` + // Value - A list of workflow runs. + Value *[]WorkflowRun `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// WorkflowRunListResultIterator provides access to a complete listing of WorkflowRun values. +type WorkflowRunListResultIterator struct { + i int + page WorkflowRunListResultPage +} + +// 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 *WorkflowRunListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunListResultIterator.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 *WorkflowRunListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkflowRunListResultIterator) 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 WorkflowRunListResultIterator) Response() WorkflowRunListResult { + 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 WorkflowRunListResultIterator) Value() WorkflowRun { + if !iter.page.NotDone() { + return WorkflowRun{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkflowRunListResultIterator type. +func NewWorkflowRunListResultIterator(page WorkflowRunListResultPage) WorkflowRunListResultIterator { + return WorkflowRunListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wrlr WorkflowRunListResult) IsEmpty() bool { + return wrlr.Value == nil || len(*wrlr.Value) == 0 +} + +// workflowRunListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wrlr WorkflowRunListResult) workflowRunListResultPreparer(ctx context.Context) (*http.Request, error) { + if wrlr.NextLink == nil || len(to.String(wrlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wrlr.NextLink))) +} + +// WorkflowRunListResultPage contains a page of WorkflowRun values. +type WorkflowRunListResultPage struct { + fn func(context.Context, WorkflowRunListResult) (WorkflowRunListResult, error) + wrlr WorkflowRunListResult +} + +// 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 *WorkflowRunListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunListResultPage.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.wrlr) + if err != nil { + return err + } + page.wrlr = 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 *WorkflowRunListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkflowRunListResultPage) NotDone() bool { + return !page.wrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkflowRunListResultPage) Response() WorkflowRunListResult { + return page.wrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkflowRunListResultPage) Values() []WorkflowRun { + if page.wrlr.IsEmpty() { + return nil + } + return *page.wrlr.Value +} + +// Creates a new instance of the WorkflowRunListResultPage type. +func NewWorkflowRunListResultPage(getNextPage func(context.Context, WorkflowRunListResult) (WorkflowRunListResult, error)) WorkflowRunListResultPage { + return WorkflowRunListResultPage{fn: getNextPage} +} + +// WorkflowRunProperties the workflow run properties. +type WorkflowRunProperties struct { + // WaitEndTime - READ-ONLY; Gets the wait end time. + WaitEndTime *date.Time `json:"waitEndTime,omitempty"` + // StartTime - READ-ONLY; Gets the start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; Gets the end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Status - READ-ONLY; Gets the status. Possible values include: 'WorkflowStatusNotSpecified', 'WorkflowStatusPaused', 'WorkflowStatusRunning', 'WorkflowStatusWaiting', 'WorkflowStatusSucceeded', 'WorkflowStatusSkipped', 'WorkflowStatusSuspended', 'WorkflowStatusCancelled', 'WorkflowStatusFailed', 'WorkflowStatusFaulted', 'WorkflowStatusTimedOut', 'WorkflowStatusAborted', 'WorkflowStatusIgnored' + Status WorkflowStatus `json:"status,omitempty"` + // Code - READ-ONLY; Gets the code. + Code *string `json:"code,omitempty"` + // Error - READ-ONLY; Gets the error. + Error interface{} `json:"error,omitempty"` + // CorrelationID - READ-ONLY; Gets the correlation id. + CorrelationID *string `json:"correlationId,omitempty"` + // Correlation - The run correlation. + Correlation *Correlation `json:"correlation,omitempty"` + // Workflow - READ-ONLY; Gets the reference to workflow version. + Workflow *ResourceReference `json:"workflow,omitempty"` + // Trigger - READ-ONLY; Gets the fired trigger. + Trigger *WorkflowRunTrigger `json:"trigger,omitempty"` + // Outputs - READ-ONLY; Gets the outputs. + Outputs map[string]*WorkflowOutputParameter `json:"outputs"` + // Response - READ-ONLY; Gets the response of the flow run. + Response *WorkflowRunTrigger `json:"response,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkflowRunProperties. +func (wrp WorkflowRunProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wrp.Correlation != nil { + objectMap["correlation"] = wrp.Correlation + } + return json.Marshal(objectMap) +} + +// WorkflowRunTrigger the workflow run trigger. +type WorkflowRunTrigger struct { + // Name - READ-ONLY; Gets the name. + Name *string `json:"name,omitempty"` + // Inputs - READ-ONLY; Gets the inputs. + Inputs interface{} `json:"inputs,omitempty"` + // InputsLink - READ-ONLY; Gets the link to inputs. + InputsLink *ContentLink `json:"inputsLink,omitempty"` + // Outputs - READ-ONLY; Gets the outputs. + Outputs interface{} `json:"outputs,omitempty"` + // OutputsLink - READ-ONLY; Gets the link to outputs. + OutputsLink *ContentLink `json:"outputsLink,omitempty"` + // ScheduledTime - READ-ONLY; Gets the scheduled time. + ScheduledTime *date.Time `json:"scheduledTime,omitempty"` + // StartTime - READ-ONLY; Gets the start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; Gets the end time. + EndTime *date.Time `json:"endTime,omitempty"` + // TrackingID - READ-ONLY; Gets the tracking id. + TrackingID *string `json:"trackingId,omitempty"` + // Correlation - The run correlation. + Correlation *Correlation `json:"correlation,omitempty"` + // Code - READ-ONLY; Gets the code. + Code *string `json:"code,omitempty"` + // Status - READ-ONLY; Gets the status. Possible values include: 'WorkflowStatusNotSpecified', 'WorkflowStatusPaused', 'WorkflowStatusRunning', 'WorkflowStatusWaiting', 'WorkflowStatusSucceeded', 'WorkflowStatusSkipped', 'WorkflowStatusSuspended', 'WorkflowStatusCancelled', 'WorkflowStatusFailed', 'WorkflowStatusFaulted', 'WorkflowStatusTimedOut', 'WorkflowStatusAborted', 'WorkflowStatusIgnored' + Status WorkflowStatus `json:"status,omitempty"` + // Error - READ-ONLY; Gets the error. + Error interface{} `json:"error,omitempty"` + // TrackedProperties - READ-ONLY; Gets the tracked properties. + TrackedProperties interface{} `json:"trackedProperties,omitempty"` +} + +// WorkflowsMoveFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type WorkflowsMoveFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WorkflowsMoveFuture) Result(client WorkflowsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsMoveFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("logic.WorkflowsMoveFuture") + return + } + ar.Response = future.Response() + return +} + +// WorkflowTrigger the workflow trigger. +type WorkflowTrigger struct { + autorest.Response `json:"-"` + // WorkflowTriggerProperties - The workflow trigger properties. + *WorkflowTriggerProperties `json:"properties,omitempty"` + // Name - READ-ONLY; Gets the workflow trigger name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the workflow trigger type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkflowTrigger. +func (wt WorkflowTrigger) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wt.WorkflowTriggerProperties != nil { + objectMap["properties"] = wt.WorkflowTriggerProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkflowTrigger struct. +func (wt *WorkflowTrigger) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var workflowTriggerProperties WorkflowTriggerProperties + err = json.Unmarshal(*v, &workflowTriggerProperties) + if err != nil { + return err + } + wt.WorkflowTriggerProperties = &workflowTriggerProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wt.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wt.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wt.ID = &ID + } + } + } + + return nil +} + +// WorkflowTriggerCallbackURL the workflow trigger callback URL. +type WorkflowTriggerCallbackURL struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Gets the workflow trigger callback URL. + Value *string `json:"value,omitempty"` + // Method - READ-ONLY; Gets the workflow trigger callback URL HTTP method. + Method *string `json:"method,omitempty"` + // BasePath - READ-ONLY; Gets the workflow trigger callback URL base path. + BasePath *string `json:"basePath,omitempty"` + // RelativePath - READ-ONLY; Gets the workflow trigger callback URL relative path. + RelativePath *string `json:"relativePath,omitempty"` + // RelativePathParameters - Gets the workflow trigger callback URL relative path parameters. + RelativePathParameters *[]string `json:"relativePathParameters,omitempty"` + // Queries - Gets the workflow trigger callback URL query parameters. + Queries *WorkflowTriggerListCallbackURLQueries `json:"queries,omitempty"` +} + +// WorkflowTriggerFilter the workflow trigger filter. +type WorkflowTriggerFilter struct { + // State - The state of workflow trigger. Possible values include: 'WorkflowStateNotSpecified', 'WorkflowStateCompleted', 'WorkflowStateEnabled', 'WorkflowStateDisabled', 'WorkflowStateDeleted', 'WorkflowStateSuspended' + State WorkflowState `json:"state,omitempty"` +} + +// WorkflowTriggerHistory the workflow trigger history. +type WorkflowTriggerHistory struct { + autorest.Response `json:"-"` + // WorkflowTriggerHistoryProperties - Gets the workflow trigger history properties. + *WorkflowTriggerHistoryProperties `json:"properties,omitempty"` + // Name - READ-ONLY; Gets the workflow trigger history name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the workflow trigger history type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkflowTriggerHistory. +func (wth WorkflowTriggerHistory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wth.WorkflowTriggerHistoryProperties != nil { + objectMap["properties"] = wth.WorkflowTriggerHistoryProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkflowTriggerHistory struct. +func (wth *WorkflowTriggerHistory) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var workflowTriggerHistoryProperties WorkflowTriggerHistoryProperties + err = json.Unmarshal(*v, &workflowTriggerHistoryProperties) + if err != nil { + return err + } + wth.WorkflowTriggerHistoryProperties = &workflowTriggerHistoryProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wth.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wth.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wth.ID = &ID + } + } + } + + return nil +} + +// WorkflowTriggerHistoryFilter the workflow trigger history filter. +type WorkflowTriggerHistoryFilter struct { + // Status - The status of workflow trigger history. Possible values include: 'WorkflowStatusNotSpecified', 'WorkflowStatusPaused', 'WorkflowStatusRunning', 'WorkflowStatusWaiting', 'WorkflowStatusSucceeded', 'WorkflowStatusSkipped', 'WorkflowStatusSuspended', 'WorkflowStatusCancelled', 'WorkflowStatusFailed', 'WorkflowStatusFaulted', 'WorkflowStatusTimedOut', 'WorkflowStatusAborted', 'WorkflowStatusIgnored' + Status WorkflowStatus `json:"status,omitempty"` +} + +// WorkflowTriggerHistoryListResult the list of workflow trigger histories. +type WorkflowTriggerHistoryListResult struct { + autorest.Response `json:"-"` + // Value - A list of workflow trigger histories. + Value *[]WorkflowTriggerHistory `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// WorkflowTriggerHistoryListResultIterator provides access to a complete listing of WorkflowTriggerHistory +// values. +type WorkflowTriggerHistoryListResultIterator struct { + i int + page WorkflowTriggerHistoryListResultPage +} + +// 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 *WorkflowTriggerHistoryListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggerHistoryListResultIterator.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 *WorkflowTriggerHistoryListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkflowTriggerHistoryListResultIterator) 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 WorkflowTriggerHistoryListResultIterator) Response() WorkflowTriggerHistoryListResult { + 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 WorkflowTriggerHistoryListResultIterator) Value() WorkflowTriggerHistory { + if !iter.page.NotDone() { + return WorkflowTriggerHistory{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkflowTriggerHistoryListResultIterator type. +func NewWorkflowTriggerHistoryListResultIterator(page WorkflowTriggerHistoryListResultPage) WorkflowTriggerHistoryListResultIterator { + return WorkflowTriggerHistoryListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wthlr WorkflowTriggerHistoryListResult) IsEmpty() bool { + return wthlr.Value == nil || len(*wthlr.Value) == 0 +} + +// workflowTriggerHistoryListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wthlr WorkflowTriggerHistoryListResult) workflowTriggerHistoryListResultPreparer(ctx context.Context) (*http.Request, error) { + if wthlr.NextLink == nil || len(to.String(wthlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wthlr.NextLink))) +} + +// WorkflowTriggerHistoryListResultPage contains a page of WorkflowTriggerHistory values. +type WorkflowTriggerHistoryListResultPage struct { + fn func(context.Context, WorkflowTriggerHistoryListResult) (WorkflowTriggerHistoryListResult, error) + wthlr WorkflowTriggerHistoryListResult +} + +// 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 *WorkflowTriggerHistoryListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggerHistoryListResultPage.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.wthlr) + if err != nil { + return err + } + page.wthlr = 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 *WorkflowTriggerHistoryListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkflowTriggerHistoryListResultPage) NotDone() bool { + return !page.wthlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkflowTriggerHistoryListResultPage) Response() WorkflowTriggerHistoryListResult { + return page.wthlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkflowTriggerHistoryListResultPage) Values() []WorkflowTriggerHistory { + if page.wthlr.IsEmpty() { + return nil + } + return *page.wthlr.Value +} + +// Creates a new instance of the WorkflowTriggerHistoryListResultPage type. +func NewWorkflowTriggerHistoryListResultPage(getNextPage func(context.Context, WorkflowTriggerHistoryListResult) (WorkflowTriggerHistoryListResult, error)) WorkflowTriggerHistoryListResultPage { + return WorkflowTriggerHistoryListResultPage{fn: getNextPage} +} + +// WorkflowTriggerHistoryProperties the workflow trigger history properties. +type WorkflowTriggerHistoryProperties struct { + // StartTime - READ-ONLY; Gets the start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; Gets the end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Status - READ-ONLY; Gets the status. Possible values include: 'WorkflowStatusNotSpecified', 'WorkflowStatusPaused', 'WorkflowStatusRunning', 'WorkflowStatusWaiting', 'WorkflowStatusSucceeded', 'WorkflowStatusSkipped', 'WorkflowStatusSuspended', 'WorkflowStatusCancelled', 'WorkflowStatusFailed', 'WorkflowStatusFaulted', 'WorkflowStatusTimedOut', 'WorkflowStatusAborted', 'WorkflowStatusIgnored' + Status WorkflowStatus `json:"status,omitempty"` + // Code - READ-ONLY; Gets the code. + Code *string `json:"code,omitempty"` + // Error - READ-ONLY; Gets the error. + Error interface{} `json:"error,omitempty"` + // TrackingID - READ-ONLY; Gets the tracking id. + TrackingID *string `json:"trackingId,omitempty"` + // Correlation - The run correlation. + Correlation *Correlation `json:"correlation,omitempty"` + // InputsLink - READ-ONLY; Gets the link to input parameters. + InputsLink *ContentLink `json:"inputsLink,omitempty"` + // OutputsLink - READ-ONLY; Gets the link to output parameters. + OutputsLink *ContentLink `json:"outputsLink,omitempty"` + // Fired - READ-ONLY; The value indicating whether trigger was fired. + Fired *bool `json:"fired,omitempty"` + // Run - READ-ONLY; Gets the reference to workflow run. + Run *ResourceReference `json:"run,omitempty"` +} + +// WorkflowTriggerListCallbackURLQueries gets the workflow trigger callback URL query parameters. +type WorkflowTriggerListCallbackURLQueries struct { + // APIVersion - The api version. + APIVersion *string `json:"api-version,omitempty"` + // Sp - The SAS permissions. + Sp *string `json:"sp,omitempty"` + // Sv - The SAS version. + Sv *string `json:"sv,omitempty"` + // Sig - The SAS signature. + Sig *string `json:"sig,omitempty"` + // Se - The SAS timestamp. + Se *string `json:"se,omitempty"` +} + +// WorkflowTriggerListResult the list of workflow triggers. +type WorkflowTriggerListResult struct { + autorest.Response `json:"-"` + // Value - A list of workflow triggers. + Value *[]WorkflowTrigger `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// WorkflowTriggerListResultIterator provides access to a complete listing of WorkflowTrigger values. +type WorkflowTriggerListResultIterator struct { + i int + page WorkflowTriggerListResultPage +} + +// 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 *WorkflowTriggerListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggerListResultIterator.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 *WorkflowTriggerListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkflowTriggerListResultIterator) 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 WorkflowTriggerListResultIterator) Response() WorkflowTriggerListResult { + 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 WorkflowTriggerListResultIterator) Value() WorkflowTrigger { + if !iter.page.NotDone() { + return WorkflowTrigger{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkflowTriggerListResultIterator type. +func NewWorkflowTriggerListResultIterator(page WorkflowTriggerListResultPage) WorkflowTriggerListResultIterator { + return WorkflowTriggerListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wtlr WorkflowTriggerListResult) IsEmpty() bool { + return wtlr.Value == nil || len(*wtlr.Value) == 0 +} + +// workflowTriggerListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wtlr WorkflowTriggerListResult) workflowTriggerListResultPreparer(ctx context.Context) (*http.Request, error) { + if wtlr.NextLink == nil || len(to.String(wtlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wtlr.NextLink))) +} + +// WorkflowTriggerListResultPage contains a page of WorkflowTrigger values. +type WorkflowTriggerListResultPage struct { + fn func(context.Context, WorkflowTriggerListResult) (WorkflowTriggerListResult, error) + wtlr WorkflowTriggerListResult +} + +// 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 *WorkflowTriggerListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggerListResultPage.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.wtlr) + if err != nil { + return err + } + page.wtlr = 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 *WorkflowTriggerListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkflowTriggerListResultPage) NotDone() bool { + return !page.wtlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkflowTriggerListResultPage) Response() WorkflowTriggerListResult { + return page.wtlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkflowTriggerListResultPage) Values() []WorkflowTrigger { + if page.wtlr.IsEmpty() { + return nil + } + return *page.wtlr.Value +} + +// Creates a new instance of the WorkflowTriggerListResultPage type. +func NewWorkflowTriggerListResultPage(getNextPage func(context.Context, WorkflowTriggerListResult) (WorkflowTriggerListResult, error)) WorkflowTriggerListResultPage { + return WorkflowTriggerListResultPage{fn: getNextPage} +} + +// WorkflowTriggerProperties the workflow trigger properties. +type WorkflowTriggerProperties struct { + // ProvisioningState - READ-ONLY; Gets the provisioning state. Possible values include: 'WorkflowTriggerProvisioningStateNotSpecified', 'WorkflowTriggerProvisioningStateAccepted', 'WorkflowTriggerProvisioningStateRunning', 'WorkflowTriggerProvisioningStateReady', 'WorkflowTriggerProvisioningStateCreating', 'WorkflowTriggerProvisioningStateCreated', 'WorkflowTriggerProvisioningStateDeleting', 'WorkflowTriggerProvisioningStateDeleted', 'WorkflowTriggerProvisioningStateCanceled', 'WorkflowTriggerProvisioningStateFailed', 'WorkflowTriggerProvisioningStateSucceeded', 'WorkflowTriggerProvisioningStateMoving', 'WorkflowTriggerProvisioningStateUpdating', 'WorkflowTriggerProvisioningStateRegistering', 'WorkflowTriggerProvisioningStateRegistered', 'WorkflowTriggerProvisioningStateUnregistering', 'WorkflowTriggerProvisioningStateUnregistered', 'WorkflowTriggerProvisioningStateCompleted' + ProvisioningState WorkflowTriggerProvisioningState `json:"provisioningState,omitempty"` + // CreatedTime - READ-ONLY; Gets the created time. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ChangedTime - READ-ONLY; Gets the changed time. + ChangedTime *date.Time `json:"changedTime,omitempty"` + // State - READ-ONLY; Gets the state. Possible values include: 'WorkflowStateNotSpecified', 'WorkflowStateCompleted', 'WorkflowStateEnabled', 'WorkflowStateDisabled', 'WorkflowStateDeleted', 'WorkflowStateSuspended' + State WorkflowState `json:"state,omitempty"` + // Status - READ-ONLY; Gets the status. Possible values include: 'WorkflowStatusNotSpecified', 'WorkflowStatusPaused', 'WorkflowStatusRunning', 'WorkflowStatusWaiting', 'WorkflowStatusSucceeded', 'WorkflowStatusSkipped', 'WorkflowStatusSuspended', 'WorkflowStatusCancelled', 'WorkflowStatusFailed', 'WorkflowStatusFaulted', 'WorkflowStatusTimedOut', 'WorkflowStatusAborted', 'WorkflowStatusIgnored' + Status WorkflowStatus `json:"status,omitempty"` + // LastExecutionTime - READ-ONLY; Gets the last execution time. + LastExecutionTime *date.Time `json:"lastExecutionTime,omitempty"` + // NextExecutionTime - READ-ONLY; Gets the next execution time. + NextExecutionTime *date.Time `json:"nextExecutionTime,omitempty"` + // Recurrence - READ-ONLY; Gets the workflow trigger recurrence. + Recurrence *WorkflowTriggerRecurrence `json:"recurrence,omitempty"` + // Workflow - READ-ONLY; Gets the reference to workflow. + Workflow *ResourceReference `json:"workflow,omitempty"` +} + +// WorkflowTriggerRecurrence the workflow trigger recurrence. +type WorkflowTriggerRecurrence struct { + // Frequency - The frequency. Possible values include: 'RecurrenceFrequencyNotSpecified', 'RecurrenceFrequencySecond', 'RecurrenceFrequencyMinute', 'RecurrenceFrequencyHour', 'RecurrenceFrequencyDay', 'RecurrenceFrequencyWeek', 'RecurrenceFrequencyMonth', 'RecurrenceFrequencyYear' + Frequency RecurrenceFrequency `json:"frequency,omitempty"` + // Interval - The interval. + Interval *int32 `json:"interval,omitempty"` + // StartTime - The start time. + StartTime *string `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *string `json:"endTime,omitempty"` + // TimeZone - The time zone. + TimeZone *string `json:"timeZone,omitempty"` + // Schedule - The recurrence schedule. + Schedule *RecurrenceSchedule `json:"schedule,omitempty"` +} + +// WorkflowVersion the workflow version. +type WorkflowVersion struct { + autorest.Response `json:"-"` + // WorkflowVersionProperties - The workflow version properties. + *WorkflowVersionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets 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 WorkflowVersion. +func (wv WorkflowVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wv.WorkflowVersionProperties != nil { + objectMap["properties"] = wv.WorkflowVersionProperties + } + if wv.Location != nil { + objectMap["location"] = wv.Location + } + if wv.Tags != nil { + objectMap["tags"] = wv.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkflowVersion struct. +func (wv *WorkflowVersion) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var workflowVersionProperties WorkflowVersionProperties + err = json.Unmarshal(*v, &workflowVersionProperties) + if err != nil { + return err + } + wv.WorkflowVersionProperties = &workflowVersionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wv.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wv.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wv.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wv.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wv.Tags = tags + } + } + } + + return nil +} + +// WorkflowVersionListResult the list of workflow versions. +type WorkflowVersionListResult struct { + autorest.Response `json:"-"` + // Value - A list of workflow versions. + Value *[]WorkflowVersion `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// WorkflowVersionListResultIterator provides access to a complete listing of WorkflowVersion values. +type WorkflowVersionListResultIterator struct { + i int + page WorkflowVersionListResultPage +} + +// 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 *WorkflowVersionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowVersionListResultIterator.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 *WorkflowVersionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkflowVersionListResultIterator) 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 WorkflowVersionListResultIterator) Response() WorkflowVersionListResult { + 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 WorkflowVersionListResultIterator) Value() WorkflowVersion { + if !iter.page.NotDone() { + return WorkflowVersion{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkflowVersionListResultIterator type. +func NewWorkflowVersionListResultIterator(page WorkflowVersionListResultPage) WorkflowVersionListResultIterator { + return WorkflowVersionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wvlr WorkflowVersionListResult) IsEmpty() bool { + return wvlr.Value == nil || len(*wvlr.Value) == 0 +} + +// workflowVersionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wvlr WorkflowVersionListResult) workflowVersionListResultPreparer(ctx context.Context) (*http.Request, error) { + if wvlr.NextLink == nil || len(to.String(wvlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wvlr.NextLink))) +} + +// WorkflowVersionListResultPage contains a page of WorkflowVersion values. +type WorkflowVersionListResultPage struct { + fn func(context.Context, WorkflowVersionListResult) (WorkflowVersionListResult, error) + wvlr WorkflowVersionListResult +} + +// 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 *WorkflowVersionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowVersionListResultPage.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.wvlr) + if err != nil { + return err + } + page.wvlr = 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 *WorkflowVersionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkflowVersionListResultPage) NotDone() bool { + return !page.wvlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkflowVersionListResultPage) Response() WorkflowVersionListResult { + return page.wvlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkflowVersionListResultPage) Values() []WorkflowVersion { + if page.wvlr.IsEmpty() { + return nil + } + return *page.wvlr.Value +} + +// Creates a new instance of the WorkflowVersionListResultPage type. +func NewWorkflowVersionListResultPage(getNextPage func(context.Context, WorkflowVersionListResult) (WorkflowVersionListResult, error)) WorkflowVersionListResultPage { + return WorkflowVersionListResultPage{fn: getNextPage} +} + +// WorkflowVersionProperties the workflow version properties. +type WorkflowVersionProperties struct { + // CreatedTime - READ-ONLY; Gets the created time. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ChangedTime - READ-ONLY; Gets the changed time. + ChangedTime *date.Time `json:"changedTime,omitempty"` + // State - The state. Possible values include: 'WorkflowStateNotSpecified', 'WorkflowStateCompleted', 'WorkflowStateEnabled', 'WorkflowStateDisabled', 'WorkflowStateDeleted', 'WorkflowStateSuspended' + State WorkflowState `json:"state,omitempty"` + // Version - READ-ONLY; Gets the version. + Version *string `json:"version,omitempty"` + // AccessEndpoint - READ-ONLY; Gets the access endpoint. + AccessEndpoint *string `json:"accessEndpoint,omitempty"` + // Sku - The sku. + Sku *Sku `json:"sku,omitempty"` + // IntegrationAccount - The integration account. + IntegrationAccount *ResourceReference `json:"integrationAccount,omitempty"` + // Definition - The definition. + Definition interface{} `json:"definition,omitempty"` + // Parameters - The parameters. + Parameters map[string]*WorkflowParameter `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for WorkflowVersionProperties. +func (wvp WorkflowVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wvp.State != "" { + objectMap["state"] = wvp.State + } + if wvp.Sku != nil { + objectMap["sku"] = wvp.Sku + } + if wvp.IntegrationAccount != nil { + objectMap["integrationAccount"] = wvp.IntegrationAccount + } + if wvp.Definition != nil { + objectMap["definition"] = wvp.Definition + } + if wvp.Parameters != nil { + objectMap["parameters"] = wvp.Parameters + } + return json.Marshal(objectMap) +} + +// WsdlService the WSDL service. +type WsdlService struct { + // QualifiedName - The qualified name. + QualifiedName *string `json:"qualifiedName,omitempty"` + // EndpointQualifiedNames - The list of endpoints' qualified names. + EndpointQualifiedNames *[]string `json:"EndpointQualifiedNames,omitempty"` +} + +// X12AcknowledgementSettings the X12 agreement acknowledgement settings. +type X12AcknowledgementSettings struct { + // NeedTechnicalAcknowledgement - The value indicating whether technical acknowledgement is needed. + NeedTechnicalAcknowledgement *bool `json:"needTechnicalAcknowledgement,omitempty"` + // BatchTechnicalAcknowledgements - The value indicating whether to batch the technical acknowledgements. + BatchTechnicalAcknowledgements *bool `json:"batchTechnicalAcknowledgements,omitempty"` + // NeedFunctionalAcknowledgement - The value indicating whether functional acknowledgement is needed. + NeedFunctionalAcknowledgement *bool `json:"needFunctionalAcknowledgement,omitempty"` + // FunctionalAcknowledgementVersion - The functional acknowledgement version. + FunctionalAcknowledgementVersion *string `json:"functionalAcknowledgementVersion,omitempty"` + // BatchFunctionalAcknowledgements - The value indicating whether to batch functional acknowledgements. + BatchFunctionalAcknowledgements *bool `json:"batchFunctionalAcknowledgements,omitempty"` + // NeedImplementationAcknowledgement - The value indicating whether implementation acknowledgement is needed. + NeedImplementationAcknowledgement *bool `json:"needImplementationAcknowledgement,omitempty"` + // ImplementationAcknowledgementVersion - The implementation acknowledgement version. + ImplementationAcknowledgementVersion *string `json:"implementationAcknowledgementVersion,omitempty"` + // BatchImplementationAcknowledgements - The value indicating whether to batch implementation acknowledgements. + BatchImplementationAcknowledgements *bool `json:"batchImplementationAcknowledgements,omitempty"` + // NeedLoopForValidMessages - The value indicating whether a loop is needed for valid messages. + NeedLoopForValidMessages *bool `json:"needLoopForValidMessages,omitempty"` + // SendSynchronousAcknowledgement - The value indicating whether to send synchronous acknowledgement. + SendSynchronousAcknowledgement *bool `json:"sendSynchronousAcknowledgement,omitempty"` + // AcknowledgementControlNumberPrefix - The acknowledgement control number prefix. + AcknowledgementControlNumberPrefix *string `json:"acknowledgementControlNumberPrefix,omitempty"` + // AcknowledgementControlNumberSuffix - The acknowledgement control number suffix. + AcknowledgementControlNumberSuffix *string `json:"acknowledgementControlNumberSuffix,omitempty"` + // AcknowledgementControlNumberLowerBound - The acknowledgement control number lower bound. + AcknowledgementControlNumberLowerBound *int32 `json:"acknowledgementControlNumberLowerBound,omitempty"` + // AcknowledgementControlNumberUpperBound - The acknowledgement control number upper bound. + AcknowledgementControlNumberUpperBound *int32 `json:"acknowledgementControlNumberUpperBound,omitempty"` + // RolloverAcknowledgementControlNumber - The value indicating whether to rollover acknowledgement control number. + RolloverAcknowledgementControlNumber *bool `json:"rolloverAcknowledgementControlNumber,omitempty"` +} + +// X12AgreementContent the X12 agreement content. +type X12AgreementContent struct { + // ReceiveAgreement - The X12 one-way receive agreement. + ReceiveAgreement *X12OneWayAgreement `json:"receiveAgreement,omitempty"` + // SendAgreement - The X12 one-way send agreement. + SendAgreement *X12OneWayAgreement `json:"sendAgreement,omitempty"` +} + +// X12DelimiterOverrides the X12 delimiter override settings. +type X12DelimiterOverrides struct { + // ProtocolVersion - The protocol version. + ProtocolVersion *string `json:"protocolVersion,omitempty"` + // MessageID - The message id. + MessageID *string `json:"messageId,omitempty"` + // DataElementSeparator - The data element separator. + DataElementSeparator *int32 `json:"dataElementSeparator,omitempty"` + // ComponentSeparator - The component separator. + ComponentSeparator *int32 `json:"componentSeparator,omitempty"` + // SegmentTerminator - The segment terminator. + SegmentTerminator *int32 `json:"segmentTerminator,omitempty"` + // SegmentTerminatorSuffix - The segment terminator suffix. Possible values include: 'SegmentTerminatorSuffixNotSpecified', 'SegmentTerminatorSuffixNone', 'SegmentTerminatorSuffixCR', 'SegmentTerminatorSuffixLF', 'SegmentTerminatorSuffixCRLF' + SegmentTerminatorSuffix SegmentTerminatorSuffix `json:"segmentTerminatorSuffix,omitempty"` + // ReplaceCharacter - The replacement character. + ReplaceCharacter *int32 `json:"replaceCharacter,omitempty"` + // ReplaceSeparatorsInPayload - The value indicating whether to replace separators in payload. + ReplaceSeparatorsInPayload *bool `json:"replaceSeparatorsInPayload,omitempty"` + // TargetNamespace - The target namespace on which this delimiter settings has to be applied. + TargetNamespace *string `json:"targetNamespace,omitempty"` +} + +// X12EnvelopeOverride the X12 envelope override settings. +type X12EnvelopeOverride struct { + // TargetNamespace - The target namespace on which this envelope settings has to be applied. + TargetNamespace *string `json:"targetNamespace,omitempty"` + // ProtocolVersion - The protocol version on which this envelope settings has to be applied. + ProtocolVersion *string `json:"protocolVersion,omitempty"` + // MessageID - The message id on which this envelope settings has to be applied. + MessageID *string `json:"messageId,omitempty"` + // ResponsibleAgencyCode - The responsible agency code. + ResponsibleAgencyCode *string `json:"responsibleAgencyCode,omitempty"` + // HeaderVersion - The header version. + HeaderVersion *string `json:"headerVersion,omitempty"` + // SenderApplicationID - The sender application id. + SenderApplicationID *string `json:"senderApplicationId,omitempty"` + // ReceiverApplicationID - The receiver application id. + ReceiverApplicationID *string `json:"receiverApplicationId,omitempty"` + // FunctionalIdentifierCode - The functional identifier code. + FunctionalIdentifierCode *string `json:"functionalIdentifierCode,omitempty"` + // DateFormat - The date format. Possible values include: 'X12DateFormatNotSpecified', 'X12DateFormatCCYYMMDD', 'X12DateFormatYYMMDD' + DateFormat X12DateFormat `json:"dateFormat,omitempty"` + // TimeFormat - The time format. Possible values include: 'X12TimeFormatNotSpecified', 'X12TimeFormatHHMM', 'X12TimeFormatHHMMSS', 'X12TimeFormatHHMMSSdd', 'X12TimeFormatHHMMSSd' + TimeFormat X12TimeFormat `json:"timeFormat,omitempty"` +} + +// X12EnvelopeSettings the X12 agreement envelope settings. +type X12EnvelopeSettings struct { + // ControlStandardsID - The controls standards id. + ControlStandardsID *int32 `json:"controlStandardsId,omitempty"` + // UseControlStandardsIDAsRepetitionCharacter - The value indicating whether to use control standards id as repetition character. + UseControlStandardsIDAsRepetitionCharacter *bool `json:"useControlStandardsIdAsRepetitionCharacter,omitempty"` + // SenderApplicationID - The sender application id. + SenderApplicationID *string `json:"senderApplicationId,omitempty"` + // ReceiverApplicationID - The receiver application id. + ReceiverApplicationID *string `json:"receiverApplicationId,omitempty"` + // ControlVersionNumber - The control version number. + ControlVersionNumber *string `json:"controlVersionNumber,omitempty"` + // InterchangeControlNumberLowerBound - The interchange control number lower bound. + InterchangeControlNumberLowerBound *int32 `json:"interchangeControlNumberLowerBound,omitempty"` + // InterchangeControlNumberUpperBound - The interchange control number upper bound. + InterchangeControlNumberUpperBound *int32 `json:"interchangeControlNumberUpperBound,omitempty"` + // RolloverInterchangeControlNumber - The value indicating whether to rollover interchange control number. + RolloverInterchangeControlNumber *bool `json:"rolloverInterchangeControlNumber,omitempty"` + // EnableDefaultGroupHeaders - The value indicating whether to enable default group headers. + EnableDefaultGroupHeaders *bool `json:"enableDefaultGroupHeaders,omitempty"` + // FunctionalGroupID - The functional group id. + FunctionalGroupID *string `json:"functionalGroupId,omitempty"` + // GroupControlNumberLowerBound - The group control number lower bound. + GroupControlNumberLowerBound *int32 `json:"groupControlNumberLowerBound,omitempty"` + // GroupControlNumberUpperBound - The group control number upper bound. + GroupControlNumberUpperBound *int32 `json:"groupControlNumberUpperBound,omitempty"` + // RolloverGroupControlNumber - The value indicating whether to rollover group control number. + RolloverGroupControlNumber *bool `json:"rolloverGroupControlNumber,omitempty"` + // GroupHeaderAgencyCode - The group header agency code. + GroupHeaderAgencyCode *string `json:"groupHeaderAgencyCode,omitempty"` + // GroupHeaderVersion - The group header version. + GroupHeaderVersion *string `json:"groupHeaderVersion,omitempty"` + // TransactionSetControlNumberLowerBound - The transaction set control number lower bound. + TransactionSetControlNumberLowerBound *int32 `json:"transactionSetControlNumberLowerBound,omitempty"` + // TransactionSetControlNumberUpperBound - The transaction set control number upper bound. + TransactionSetControlNumberUpperBound *int32 `json:"transactionSetControlNumberUpperBound,omitempty"` + // RolloverTransactionSetControlNumber - The value indicating whether to rollover transaction set control number. + RolloverTransactionSetControlNumber *bool `json:"rolloverTransactionSetControlNumber,omitempty"` + // TransactionSetControlNumberPrefix - The transaction set control number prefix. + TransactionSetControlNumberPrefix *string `json:"transactionSetControlNumberPrefix,omitempty"` + // TransactionSetControlNumberSuffix - The transaction set control number suffix. + TransactionSetControlNumberSuffix *string `json:"transactionSetControlNumberSuffix,omitempty"` + // OverwriteExistingTransactionSetControlNumber - The value indicating whether to overwrite existing transaction set control number. + OverwriteExistingTransactionSetControlNumber *bool `json:"overwriteExistingTransactionSetControlNumber,omitempty"` + // GroupHeaderDateFormat - The group header date format. Possible values include: 'X12DateFormatNotSpecified', 'X12DateFormatCCYYMMDD', 'X12DateFormatYYMMDD' + GroupHeaderDateFormat X12DateFormat `json:"groupHeaderDateFormat,omitempty"` + // GroupHeaderTimeFormat - The group header time format. Possible values include: 'X12TimeFormatNotSpecified', 'X12TimeFormatHHMM', 'X12TimeFormatHHMMSS', 'X12TimeFormatHHMMSSdd', 'X12TimeFormatHHMMSSd' + GroupHeaderTimeFormat X12TimeFormat `json:"groupHeaderTimeFormat,omitempty"` + // UsageIndicator - The usage indicator. Possible values include: 'UsageIndicatorNotSpecified', 'UsageIndicatorTest', 'UsageIndicatorInformation', 'UsageIndicatorProduction' + UsageIndicator UsageIndicator `json:"usageIndicator,omitempty"` +} + +// X12FramingSettings the X12 agreement framing settings. +type X12FramingSettings struct { + // DataElementSeparator - The data element separator. + DataElementSeparator *int32 `json:"dataElementSeparator,omitempty"` + // ComponentSeparator - The component separator. + ComponentSeparator *int32 `json:"componentSeparator,omitempty"` + // ReplaceSeparatorsInPayload - The value indicating whether to replace separators in payload. + ReplaceSeparatorsInPayload *bool `json:"replaceSeparatorsInPayload,omitempty"` + // ReplaceCharacter - The replacement character. + ReplaceCharacter *int32 `json:"replaceCharacter,omitempty"` + // SegmentTerminator - The segment terminator. + SegmentTerminator *int32 `json:"segmentTerminator,omitempty"` + // CharacterSet - The X12 character set. Possible values include: 'X12CharacterSetNotSpecified', 'X12CharacterSetBasic', 'X12CharacterSetExtended', 'X12CharacterSetUTF8' + CharacterSet X12CharacterSet `json:"characterSet,omitempty"` + // SegmentTerminatorSuffix - The segment terminator suffix. Possible values include: 'SegmentTerminatorSuffixNotSpecified', 'SegmentTerminatorSuffixNone', 'SegmentTerminatorSuffixCR', 'SegmentTerminatorSuffixLF', 'SegmentTerminatorSuffixCRLF' + SegmentTerminatorSuffix SegmentTerminatorSuffix `json:"segmentTerminatorSuffix,omitempty"` +} + +// X12MessageFilter the X12 message filter for odata query. +type X12MessageFilter struct { + // MessageFilterType - The message filter type. Possible values include: 'MessageFilterTypeNotSpecified', 'MessageFilterTypeInclude', 'MessageFilterTypeExclude' + MessageFilterType MessageFilterType `json:"messageFilterType,omitempty"` +} + +// X12MessageIdentifier the X12 message identifier. +type X12MessageIdentifier struct { + // MessageID - The message id. + MessageID *string `json:"messageId,omitempty"` +} + +// X12OneWayAgreement the X12 one-way agreement. +type X12OneWayAgreement struct { + // SenderBusinessIdentity - The sender business identity + SenderBusinessIdentity *BusinessIdentity `json:"senderBusinessIdentity,omitempty"` + // ReceiverBusinessIdentity - The receiver business identity + ReceiverBusinessIdentity *BusinessIdentity `json:"receiverBusinessIdentity,omitempty"` + // ProtocolSettings - The X12 protocol settings. + ProtocolSettings *X12ProtocolSettings `json:"protocolSettings,omitempty"` +} + +// X12ProcessingSettings the X12 processing settings. +type X12ProcessingSettings struct { + // MaskSecurityInfo - The value indicating whether to mask security information. + MaskSecurityInfo *bool `json:"maskSecurityInfo,omitempty"` + // ConvertImpliedDecimal - The value indicating whether to convert numerical type to implied decimal. + ConvertImpliedDecimal *bool `json:"convertImpliedDecimal,omitempty"` + // PreserveInterchange - The value indicating whether to preserve interchange. + PreserveInterchange *bool `json:"preserveInterchange,omitempty"` + // SuspendInterchangeOnError - The value indicating whether to suspend interchange on error. + SuspendInterchangeOnError *bool `json:"suspendInterchangeOnError,omitempty"` + // CreateEmptyXMLTagsForTrailingSeparators - The value indicating whether to create empty xml tags for trailing separators. + CreateEmptyXMLTagsForTrailingSeparators *bool `json:"createEmptyXmlTagsForTrailingSeparators,omitempty"` + // UseDotAsDecimalSeparator - The value indicating whether to use dot as decimal separator. + UseDotAsDecimalSeparator *bool `json:"useDotAsDecimalSeparator,omitempty"` +} + +// X12ProtocolSettings the X12 agreement protocol settings. +type X12ProtocolSettings struct { + // ValidationSettings - The X12 validation settings. + ValidationSettings *X12ValidationSettings `json:"validationSettings,omitempty"` + // FramingSettings - The X12 framing settings. + FramingSettings *X12FramingSettings `json:"framingSettings,omitempty"` + // EnvelopeSettings - The X12 envelope settings. + EnvelopeSettings *X12EnvelopeSettings `json:"envelopeSettings,omitempty"` + // AcknowledgementSettings - The X12 acknowledgment settings. + AcknowledgementSettings *X12AcknowledgementSettings `json:"acknowledgementSettings,omitempty"` + // MessageFilter - The X12 message filter. + MessageFilter *X12MessageFilter `json:"messageFilter,omitempty"` + // SecuritySettings - The X12 security settings. + SecuritySettings *X12SecuritySettings `json:"securitySettings,omitempty"` + // ProcessingSettings - The X12 processing settings. + ProcessingSettings *X12ProcessingSettings `json:"processingSettings,omitempty"` + // EnvelopeOverrides - The X12 envelope override settings. + EnvelopeOverrides *[]X12EnvelopeOverride `json:"envelopeOverrides,omitempty"` + // ValidationOverrides - The X12 validation override settings. + ValidationOverrides *[]X12ValidationOverride `json:"validationOverrides,omitempty"` + // MessageFilterList - The X12 message filter list. + MessageFilterList *[]X12MessageIdentifier `json:"messageFilterList,omitempty"` + // SchemaReferences - The X12 schema references. + SchemaReferences *[]X12SchemaReference `json:"schemaReferences,omitempty"` + // X12DelimiterOverrides - The X12 delimiter override settings. + X12DelimiterOverrides *[]X12DelimiterOverrides `json:"x12DelimiterOverrides,omitempty"` +} + +// X12SchemaReference the X12 schema reference. +type X12SchemaReference struct { + // MessageID - The message id. + MessageID *string `json:"messageId,omitempty"` + // SenderApplicationID - The sender application id. + SenderApplicationID *string `json:"senderApplicationId,omitempty"` + // SchemaVersion - The schema version. + SchemaVersion *string `json:"schemaVersion,omitempty"` + // SchemaName - The schema name. + SchemaName *string `json:"schemaName,omitempty"` +} + +// X12SecuritySettings the X12 agreement security settings. +type X12SecuritySettings struct { + // AuthorizationQualifier - The authorization qualifier. + AuthorizationQualifier *string `json:"authorizationQualifier,omitempty"` + // AuthorizationValue - The authorization value. + AuthorizationValue *string `json:"authorizationValue,omitempty"` + // SecurityQualifier - The security qualifier. + SecurityQualifier *string `json:"securityQualifier,omitempty"` + // PasswordValue - The password value. + PasswordValue *string `json:"passwordValue,omitempty"` +} + +// X12ValidationOverride the X12 validation override settings. +type X12ValidationOverride struct { + // MessageID - The message id on which the validation settings has to be applied. + MessageID *string `json:"messageId,omitempty"` + // ValidateEDITypes - The value indicating whether to validate EDI types. + ValidateEDITypes *bool `json:"validateEDITypes,omitempty"` + // ValidateXSDTypes - The value indicating whether to validate XSD types. + ValidateXSDTypes *bool `json:"validateXSDTypes,omitempty"` + // AllowLeadingAndTrailingSpacesAndZeroes - The value indicating whether to allow leading and trailing spaces and zeroes. + AllowLeadingAndTrailingSpacesAndZeroes *bool `json:"allowLeadingAndTrailingSpacesAndZeroes,omitempty"` + // ValidateCharacterSet - The value indicating whether to validate character Set. + ValidateCharacterSet *bool `json:"validateCharacterSet,omitempty"` + // TrimLeadingAndTrailingSpacesAndZeroes - The value indicating whether to trim leading and trailing spaces and zeroes. + TrimLeadingAndTrailingSpacesAndZeroes *bool `json:"trimLeadingAndTrailingSpacesAndZeroes,omitempty"` + // TrailingSeparatorPolicy - The trailing separator policy. Possible values include: 'TrailingSeparatorPolicyNotSpecified', 'TrailingSeparatorPolicyNotAllowed', 'TrailingSeparatorPolicyOptional', 'TrailingSeparatorPolicyMandatory' + TrailingSeparatorPolicy TrailingSeparatorPolicy `json:"trailingSeparatorPolicy,omitempty"` +} + +// X12ValidationSettings the X12 agreement validation settings. +type X12ValidationSettings struct { + // ValidateCharacterSet - The value indicating whether to validate character set in the message. + ValidateCharacterSet *bool `json:"validateCharacterSet,omitempty"` + // CheckDuplicateInterchangeControlNumber - The value indicating whether to check for duplicate interchange control number. + CheckDuplicateInterchangeControlNumber *bool `json:"checkDuplicateInterchangeControlNumber,omitempty"` + // InterchangeControlNumberValidityDays - The validity period of interchange control number. + InterchangeControlNumberValidityDays *int32 `json:"interchangeControlNumberValidityDays,omitempty"` + // CheckDuplicateGroupControlNumber - The value indicating whether to check for duplicate group control number. + CheckDuplicateGroupControlNumber *bool `json:"checkDuplicateGroupControlNumber,omitempty"` + // CheckDuplicateTransactionSetControlNumber - The value indicating whether to check for duplicate transaction set control number. + CheckDuplicateTransactionSetControlNumber *bool `json:"checkDuplicateTransactionSetControlNumber,omitempty"` + // ValidateEDITypes - The value indicating whether to Whether to validate EDI types. + ValidateEDITypes *bool `json:"validateEDITypes,omitempty"` + // ValidateXSDTypes - The value indicating whether to Whether to validate XSD types. + ValidateXSDTypes *bool `json:"validateXSDTypes,omitempty"` + // AllowLeadingAndTrailingSpacesAndZeroes - The value indicating whether to allow leading and trailing spaces and zeroes. + AllowLeadingAndTrailingSpacesAndZeroes *bool `json:"allowLeadingAndTrailingSpacesAndZeroes,omitempty"` + // TrimLeadingAndTrailingSpacesAndZeroes - The value indicating whether to trim leading and trailing spaces and zeroes. + TrimLeadingAndTrailingSpacesAndZeroes *bool `json:"trimLeadingAndTrailingSpacesAndZeroes,omitempty"` + // TrailingSeparatorPolicy - The trailing separator policy. Possible values include: 'TrailingSeparatorPolicyNotSpecified', 'TrailingSeparatorPolicyNotAllowed', 'TrailingSeparatorPolicyOptional', 'TrailingSeparatorPolicyMandatory' + TrailingSeparatorPolicy TrailingSeparatorPolicy `json:"trailingSeparatorPolicy,omitempty"` +} diff --git a/services/preview/peering/mgmt/2019-03-01-preview/peering/operations.go b/services/preview/logic/mgmt/2019-05-01/logic/operations.go similarity index 80% rename from services/preview/peering/mgmt/2019-03-01-preview/peering/operations.go rename to services/preview/logic/mgmt/2019-05-01/logic/operations.go index b3289d3229f7..f299645b574b 100644 --- a/services/preview/peering/mgmt/2019-03-01-preview/peering/operations.go +++ b/services/preview/logic/mgmt/2019-05-01/logic/operations.go @@ -1,4 +1,4 @@ -package peering +package logic // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,7 +25,7 @@ import ( "net/http" ) -// OperationsClient is the aPIs to manage Peering resources through the Azure Resource Manager. +// OperationsClient is the REST API for Azure Logic Apps. type OperationsClient struct { BaseClient } @@ -40,7 +40,7 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all of the available API operations for peering resources. +// List lists all of the available Logic REST API operations. func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") @@ -55,20 +55,20 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "peering.OperationsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "logic.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") + err = autorest.NewErrorWithError(err, "logic.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") + err = autorest.NewErrorWithError(err, "logic.OperationsClient", "List", resp, "Failure responding to request") } return @@ -76,7 +76,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-03-01-preview" + const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -84,7 +84,7 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Peering/operations"), + autorest.WithPath("/providers/Microsoft.Logic/operations"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -113,7 +113,7 @@ func (client OperationsClient) ListResponder(resp *http.Response) (result Operat 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") + return result, autorest.NewErrorWithError(err, "logic.OperationsClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -121,11 +121,11 @@ func (client OperationsClient) listNextResults(ctx context.Context, lastResults 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") + return result, autorest.NewErrorWithError(err, "logic.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") + err = autorest.NewErrorWithError(err, "logic.OperationsClient", "listNextResults", resp, "Failure responding to next results request") } return } diff --git a/services/batch/2016-07-01.3.1/batch/version.go b/services/preview/logic/mgmt/2019-05-01/logic/version.go similarity index 92% rename from services/batch/2016-07-01.3.1/batch/version.go rename to services/preview/logic/mgmt/2019-05-01/logic/version.go index 0119127659d9..c7fd680e7ef2 100644 --- a/services/batch/2016-07-01.3.1/batch/version.go +++ b/services/preview/logic/mgmt/2019-05-01/logic/version.go @@ -1,4 +1,4 @@ -package batch +package logic import "github.com/Azure/azure-sdk-for-go/version" @@ -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.Number + " batch/2016-07-01.3.1" + return "Azure-SDK-For-Go/" + version.Number + " logic/2019-05-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/services/preview/logic/mgmt/2019-05-01/logic/workflowrunactionrepetitions.go b/services/preview/logic/mgmt/2019-05-01/logic/workflowrunactionrepetitions.go new file mode 100644 index 000000000000..4cad34434257 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/workflowrunactionrepetitions.go @@ -0,0 +1,289 @@ +package logic + +// 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" +) + +// WorkflowRunActionRepetitionsClient is the REST API for Azure Logic Apps. +type WorkflowRunActionRepetitionsClient struct { + BaseClient +} + +// NewWorkflowRunActionRepetitionsClient creates an instance of the WorkflowRunActionRepetitionsClient client. +func NewWorkflowRunActionRepetitionsClient(subscriptionID string) WorkflowRunActionRepetitionsClient { + return NewWorkflowRunActionRepetitionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowRunActionRepetitionsClientWithBaseURI creates an instance of the WorkflowRunActionRepetitionsClient +// client. +func NewWorkflowRunActionRepetitionsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRepetitionsClient { + return WorkflowRunActionRepetitionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get a workflow run action repetition. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +// repetitionName - the workflow repetition. +func (client WorkflowRunActionRepetitionsClient) Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (result WorkflowRunActionRepetitionDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionRepetitionsClient.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, workflowName, runName, actionName, repetitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowRunActionRepetitionsClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "repetitionName": autorest.Encode("path", repetitionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}", 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 WorkflowRunActionRepetitionsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRepetitionsClient) GetResponder(resp *http.Response) (result WorkflowRunActionRepetitionDefinition, 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 get all of a workflow run action repetitions. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +func (client WorkflowRunActionRepetitionsClient) List(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (result WorkflowRunActionRepetitionDefinitionCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionRepetitionsClient.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, workflowName, runName, actionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkflowRunActionRepetitionsClient) ListPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions", 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 WorkflowRunActionRepetitionsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRepetitionsClient) ListResponder(resp *http.Response) (result WorkflowRunActionRepetitionDefinitionCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListExpressionTraces lists a workflow run expression trace. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +// repetitionName - the workflow repetition. +func (client WorkflowRunActionRepetitionsClient) ListExpressionTraces(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (result ExpressionTraces, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionRepetitionsClient.ListExpressionTraces") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListExpressionTracesPreparer(ctx, resourceGroupName, workflowName, runName, actionName, repetitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsClient", "ListExpressionTraces", nil, "Failure preparing request") + return + } + + resp, err := client.ListExpressionTracesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsClient", "ListExpressionTraces", resp, "Failure sending request") + return + } + + result, err = client.ListExpressionTracesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsClient", "ListExpressionTraces", resp, "Failure responding to request") + } + + return +} + +// ListExpressionTracesPreparer prepares the ListExpressionTraces request. +func (client WorkflowRunActionRepetitionsClient) ListExpressionTracesPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "repetitionName": autorest.Encode("path", repetitionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/listExpressionTraces", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListExpressionTracesSender sends the ListExpressionTraces request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowRunActionRepetitionsClient) ListExpressionTracesSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListExpressionTracesResponder handles the response to the ListExpressionTraces request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRepetitionsClient) ListExpressionTracesResponder(resp *http.Response) (result ExpressionTraces, 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/logic/mgmt/2019-05-01/logic/workflowrunactionrepetitionsrequesthistories.go b/services/preview/logic/mgmt/2019-05-01/logic/workflowrunactionrepetitionsrequesthistories.go new file mode 100644 index 000000000000..655f0dfc2feb --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/workflowrunactionrepetitionsrequesthistories.go @@ -0,0 +1,249 @@ +package logic + +// 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" +) + +// WorkflowRunActionRepetitionsRequestHistoriesClient is the REST API for Azure Logic Apps. +type WorkflowRunActionRepetitionsRequestHistoriesClient struct { + BaseClient +} + +// NewWorkflowRunActionRepetitionsRequestHistoriesClient creates an instance of the +// WorkflowRunActionRepetitionsRequestHistoriesClient client. +func NewWorkflowRunActionRepetitionsRequestHistoriesClient(subscriptionID string) WorkflowRunActionRepetitionsRequestHistoriesClient { + return NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI creates an instance of the +// WorkflowRunActionRepetitionsRequestHistoriesClient client. +func NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRepetitionsRequestHistoriesClient { + return WorkflowRunActionRepetitionsRequestHistoriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a workflow run repetition request history. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +// repetitionName - the workflow repetition. +// requestHistoryName - the request history name. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string, requestHistoryName string) (result RequestHistory, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionRepetitionsRequestHistoriesClient.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, workflowName, runName, actionName, repetitionName, requestHistoryName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string, requestHistoryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "repetitionName": autorest.Encode("path", repetitionName), + "requestHistoryName": autorest.Encode("path", requestHistoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories/{requestHistoryName}", 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 WorkflowRunActionRepetitionsRequestHistoriesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) GetResponder(resp *http.Response) (result RequestHistory, 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 a workflow run repetition request history. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +// repetitionName - the workflow repetition. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) List(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (result RequestHistoryListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionRepetitionsRequestHistoriesClient.List") + defer func() { + sc := -1 + if result.rhlr.Response.Response != nil { + sc = result.rhlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workflowName, runName, actionName, repetitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rhlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "List", resp, "Failure sending request") + return + } + + result.rhlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) ListPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "repetitionName": autorest.Encode("path", repetitionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories", 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 WorkflowRunActionRepetitionsRequestHistoriesClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) ListResponder(resp *http.Response) (result RequestHistoryListResult, 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 WorkflowRunActionRepetitionsRequestHistoriesClient) listNextResults(ctx context.Context, lastResults RequestHistoryListResult) (result RequestHistoryListResult, err error) { + req, err := lastResults.requestHistoryListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "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, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) ListComplete(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (result RequestHistoryListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionRepetitionsRequestHistoriesClient.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, workflowName, runName, actionName, repetitionName) + return +} diff --git a/services/preview/logic/mgmt/2019-05-01/logic/workflowrunactionrequesthistories.go b/services/preview/logic/mgmt/2019-05-01/logic/workflowrunactionrequesthistories.go new file mode 100644 index 000000000000..136c48e555af --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/workflowrunactionrequesthistories.go @@ -0,0 +1,245 @@ +package logic + +// 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" +) + +// WorkflowRunActionRequestHistoriesClient is the REST API for Azure Logic Apps. +type WorkflowRunActionRequestHistoriesClient struct { + BaseClient +} + +// NewWorkflowRunActionRequestHistoriesClient creates an instance of the WorkflowRunActionRequestHistoriesClient +// client. +func NewWorkflowRunActionRequestHistoriesClient(subscriptionID string) WorkflowRunActionRequestHistoriesClient { + return NewWorkflowRunActionRequestHistoriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowRunActionRequestHistoriesClientWithBaseURI creates an instance of the +// WorkflowRunActionRequestHistoriesClient client. +func NewWorkflowRunActionRequestHistoriesClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRequestHistoriesClient { + return WorkflowRunActionRequestHistoriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a workflow run request history. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +// requestHistoryName - the request history name. +func (client WorkflowRunActionRequestHistoriesClient) Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, requestHistoryName string) (result RequestHistory, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionRequestHistoriesClient.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, workflowName, runName, actionName, requestHistoryName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowRunActionRequestHistoriesClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, requestHistoryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "requestHistoryName": autorest.Encode("path", requestHistoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories/{requestHistoryName}", 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 WorkflowRunActionRequestHistoriesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRequestHistoriesClient) GetResponder(resp *http.Response) (result RequestHistory, 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 a workflow run request history. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +func (client WorkflowRunActionRequestHistoriesClient) List(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (result RequestHistoryListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionRequestHistoriesClient.List") + defer func() { + sc := -1 + if result.rhlr.Response.Response != nil { + sc = result.rhlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workflowName, runName, actionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rhlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "List", resp, "Failure sending request") + return + } + + result.rhlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkflowRunActionRequestHistoriesClient) ListPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories", 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 WorkflowRunActionRequestHistoriesClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRequestHistoriesClient) ListResponder(resp *http.Response) (result RequestHistoryListResult, 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 WorkflowRunActionRequestHistoriesClient) listNextResults(ctx context.Context, lastResults RequestHistoryListResult) (result RequestHistoryListResult, err error) { + req, err := lastResults.requestHistoryListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "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, "logic.WorkflowRunActionRequestHistoriesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkflowRunActionRequestHistoriesClient) ListComplete(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (result RequestHistoryListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionRequestHistoriesClient.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, workflowName, runName, actionName) + return +} diff --git a/services/preview/logic/mgmt/2019-05-01/logic/workflowrunactions.go b/services/preview/logic/mgmt/2019-05-01/logic/workflowrunactions.go new file mode 100644 index 000000000000..cffaf204691e --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/workflowrunactions.go @@ -0,0 +1,328 @@ +package logic + +// 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" +) + +// WorkflowRunActionsClient is the REST API for Azure Logic Apps. +type WorkflowRunActionsClient struct { + BaseClient +} + +// NewWorkflowRunActionsClient creates an instance of the WorkflowRunActionsClient client. +func NewWorkflowRunActionsClient(subscriptionID string) WorkflowRunActionsClient { + return NewWorkflowRunActionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowRunActionsClientWithBaseURI creates an instance of the WorkflowRunActionsClient client. +func NewWorkflowRunActionsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionsClient { + return WorkflowRunActionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a workflow run action. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +func (client WorkflowRunActionsClient) Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (result WorkflowRunAction, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionsClient.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, workflowName, runName, actionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowRunActionsClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}", 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 WorkflowRunActionsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionsClient) GetResponder(resp *http.Response) (result WorkflowRunAction, 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 workflow run actions. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// top - the number of items to be included in the result. +// filter - the filter to apply on the operation. Options for filters include: Status. +func (client WorkflowRunActionsClient) List(ctx context.Context, resourceGroupName string, workflowName string, runName string, top *int32, filter string) (result WorkflowRunActionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionsClient.List") + defer func() { + sc := -1 + if result.wralr.Response.Response != nil { + sc = result.wralr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workflowName, runName, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.wralr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionsClient", "List", resp, "Failure sending request") + return + } + + result.wralr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkflowRunActionsClient) ListPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + 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.Logic/workflows/{workflowName}/runs/{runName}/actions", 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 WorkflowRunActionsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionsClient) ListResponder(resp *http.Response) (result WorkflowRunActionListResult, 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 WorkflowRunActionsClient) listNextResults(ctx context.Context, lastResults WorkflowRunActionListResult) (result WorkflowRunActionListResult, err error) { + req, err := lastResults.workflowRunActionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.WorkflowRunActionsClient", "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, "logic.WorkflowRunActionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkflowRunActionsClient) ListComplete(ctx context.Context, resourceGroupName string, workflowName string, runName string, top *int32, filter string) (result WorkflowRunActionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionsClient.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, workflowName, runName, top, filter) + return +} + +// ListExpressionTraces lists a workflow run expression trace. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +func (client WorkflowRunActionsClient) ListExpressionTraces(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (result ExpressionTraces, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionsClient.ListExpressionTraces") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListExpressionTracesPreparer(ctx, resourceGroupName, workflowName, runName, actionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionsClient", "ListExpressionTraces", nil, "Failure preparing request") + return + } + + resp, err := client.ListExpressionTracesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionsClient", "ListExpressionTraces", resp, "Failure sending request") + return + } + + result, err = client.ListExpressionTracesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionsClient", "ListExpressionTraces", resp, "Failure responding to request") + } + + return +} + +// ListExpressionTracesPreparer prepares the ListExpressionTraces request. +func (client WorkflowRunActionsClient) ListExpressionTracesPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/listExpressionTraces", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListExpressionTracesSender sends the ListExpressionTraces request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowRunActionsClient) ListExpressionTracesSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListExpressionTracesResponder handles the response to the ListExpressionTraces request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionsClient) ListExpressionTracesResponder(resp *http.Response) (result ExpressionTraces, 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/logic/mgmt/2019-05-01/logic/workflowrunactionscoperepetitions.go b/services/preview/logic/mgmt/2019-05-01/logic/workflowrunactionscoperepetitions.go new file mode 100644 index 000000000000..78cffe1c0981 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/workflowrunactionscoperepetitions.go @@ -0,0 +1,207 @@ +package logic + +// 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" +) + +// WorkflowRunActionScopeRepetitionsClient is the REST API for Azure Logic Apps. +type WorkflowRunActionScopeRepetitionsClient struct { + BaseClient +} + +// NewWorkflowRunActionScopeRepetitionsClient creates an instance of the WorkflowRunActionScopeRepetitionsClient +// client. +func NewWorkflowRunActionScopeRepetitionsClient(subscriptionID string) WorkflowRunActionScopeRepetitionsClient { + return NewWorkflowRunActionScopeRepetitionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowRunActionScopeRepetitionsClientWithBaseURI creates an instance of the +// WorkflowRunActionScopeRepetitionsClient client. +func NewWorkflowRunActionScopeRepetitionsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionScopeRepetitionsClient { + return WorkflowRunActionScopeRepetitionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get a workflow run action scoped repetition. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +// repetitionName - the workflow repetition. +func (client WorkflowRunActionScopeRepetitionsClient) Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (result WorkflowRunActionRepetitionDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionScopeRepetitionsClient.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, workflowName, runName, actionName, repetitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionScopeRepetitionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionScopeRepetitionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionScopeRepetitionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowRunActionScopeRepetitionsClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "repetitionName": autorest.Encode("path", repetitionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions/{repetitionName}", 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 WorkflowRunActionScopeRepetitionsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionScopeRepetitionsClient) GetResponder(resp *http.Response) (result WorkflowRunActionRepetitionDefinition, 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 the workflow run action scoped repetitions. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +func (client WorkflowRunActionScopeRepetitionsClient) List(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (result WorkflowRunActionRepetitionDefinitionCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunActionScopeRepetitionsClient.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, workflowName, runName, actionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionScopeRepetitionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionScopeRepetitionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionScopeRepetitionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkflowRunActionScopeRepetitionsClient) ListPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions", 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 WorkflowRunActionScopeRepetitionsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionScopeRepetitionsClient) ListResponder(resp *http.Response) (result WorkflowRunActionRepetitionDefinitionCollection, 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/logic/mgmt/2019-05-01/logic/workflowrunoperations.go b/services/preview/logic/mgmt/2019-05-01/logic/workflowrunoperations.go new file mode 100644 index 000000000000..1e6201c9164a --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/workflowrunoperations.go @@ -0,0 +1,122 @@ +package logic + +// 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" +) + +// WorkflowRunOperationsClient is the REST API for Azure Logic Apps. +type WorkflowRunOperationsClient struct { + BaseClient +} + +// NewWorkflowRunOperationsClient creates an instance of the WorkflowRunOperationsClient client. +func NewWorkflowRunOperationsClient(subscriptionID string) WorkflowRunOperationsClient { + return NewWorkflowRunOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowRunOperationsClientWithBaseURI creates an instance of the WorkflowRunOperationsClient client. +func NewWorkflowRunOperationsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunOperationsClient { + return WorkflowRunOperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets an operation for a run. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// operationID - the workflow operation id. +func (client WorkflowRunOperationsClient) Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, operationID string) (result WorkflowRun, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunOperationsClient.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, workflowName, runName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunOperationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunOperationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunOperationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowRunOperationsClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/runs/{runName}/operations/{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 WorkflowRunOperationsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowRunOperationsClient) GetResponder(resp *http.Response) (result WorkflowRun, 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/logic/mgmt/2019-05-01/logic/workflowruns.go b/services/preview/logic/mgmt/2019-05-01/logic/workflowruns.go new file mode 100644 index 000000000000..ed0aeb6c1f89 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/workflowruns.go @@ -0,0 +1,322 @@ +package logic + +// 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" +) + +// WorkflowRunsClient is the REST API for Azure Logic Apps. +type WorkflowRunsClient struct { + BaseClient +} + +// NewWorkflowRunsClient creates an instance of the WorkflowRunsClient client. +func NewWorkflowRunsClient(subscriptionID string) WorkflowRunsClient { + return NewWorkflowRunsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowRunsClientWithBaseURI creates an instance of the WorkflowRunsClient client. +func NewWorkflowRunsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunsClient { + return WorkflowRunsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Cancel cancels a workflow run. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +func (client WorkflowRunsClient) Cancel(ctx context.Context, resourceGroupName string, workflowName string, runName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunsClient.Cancel") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CancelPreparer(ctx, resourceGroupName, workflowName, runName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunsClient", "Cancel", nil, "Failure preparing request") + return + } + + resp, err := client.CancelSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.WorkflowRunsClient", "Cancel", resp, "Failure sending request") + return + } + + result, err = client.CancelResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunsClient", "Cancel", resp, "Failure responding to request") + } + + return +} + +// CancelPreparer prepares the Cancel request. +func (client WorkflowRunsClient) CancelPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/runs/{runName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSender sends the Cancel request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowRunsClient) CancelSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CancelResponder handles the response to the Cancel request. The method always +// closes the http.Response Body. +func (client WorkflowRunsClient) CancelResponder(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 a workflow run. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +func (client WorkflowRunsClient) Get(ctx context.Context, resourceGroupName string, workflowName string, runName string) (result WorkflowRun, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunsClient.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, workflowName, runName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowRunsClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/runs/{runName}", 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 WorkflowRunsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowRunsClient) GetResponder(resp *http.Response) (result WorkflowRun, 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 workflow runs. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// top - the number of items to be included in the result. +// filter - the filter to apply on the operation. Options for filters include: Status, StartTime, and +// ClientTrackingId. +func (client WorkflowRunsClient) List(ctx context.Context, resourceGroupName string, workflowName string, top *int32, filter string) (result WorkflowRunListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunsClient.List") + defer func() { + sc := -1 + if result.wrlr.Response.Response != nil { + sc = result.wrlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workflowName, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.wrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunsClient", "List", resp, "Failure sending request") + return + } + + result.wrlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkflowRunsClient) ListPreparer(ctx context.Context, resourceGroupName string, workflowName string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + 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.Logic/workflows/{workflowName}/runs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowRunsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkflowRunsClient) ListResponder(resp *http.Response) (result WorkflowRunListResult, 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 WorkflowRunsClient) listNextResults(ctx context.Context, lastResults WorkflowRunListResult) (result WorkflowRunListResult, err error) { + req, err := lastResults.workflowRunListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.WorkflowRunsClient", "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, "logic.WorkflowRunsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkflowRunsClient) ListComplete(ctx context.Context, resourceGroupName string, workflowName string, top *int32, filter string) (result WorkflowRunListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowRunsClient.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, workflowName, top, filter) + return +} diff --git a/services/preview/logic/mgmt/2019-05-01/logic/workflows.go b/services/preview/logic/mgmt/2019-05-01/logic/workflows.go new file mode 100644 index 000000000000..198e11baabf0 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/workflows.go @@ -0,0 +1,1300 @@ +package logic + +// 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" +) + +// WorkflowsClient is the REST API for Azure Logic Apps. +type WorkflowsClient struct { + BaseClient +} + +// NewWorkflowsClient creates an instance of the WorkflowsClient client. +func NewWorkflowsClient(subscriptionID string) WorkflowsClient { + return NewWorkflowsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowsClientWithBaseURI creates an instance of the WorkflowsClient client. +func NewWorkflowsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowsClient { + return WorkflowsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a workflow. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// workflow - the workflow. +func (client WorkflowsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workflowName string, workflow Workflow) (result Workflow, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.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, workflowName, workflow) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkflowsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workflowName string, workflow Workflow) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}", pathParameters), + autorest.WithJSON(workflow), + 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 WorkflowsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) CreateOrUpdateResponder(resp *http.Response) (result Workflow, 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 workflow. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +func (client WorkflowsClient) Delete(ctx context.Context, resourceGroupName string, workflowName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, workflowName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WorkflowsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workflowName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}", 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 WorkflowsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) 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 +} + +// Disable disables a workflow. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +func (client WorkflowsClient) Disable(ctx context.Context, resourceGroupName string, workflowName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.Disable") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DisablePreparer(ctx, resourceGroupName, workflowName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Disable", nil, "Failure preparing request") + return + } + + resp, err := client.DisableSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Disable", resp, "Failure sending request") + return + } + + result, err = client.DisableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Disable", resp, "Failure responding to request") + } + + return +} + +// DisablePreparer prepares the Disable request. +func (client WorkflowsClient) DisablePreparer(ctx context.Context, resourceGroupName string, workflowName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/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 WorkflowsClient) DisableSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DisableResponder handles the response to the Disable request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) 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 a workflow. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +func (client WorkflowsClient) Enable(ctx context.Context, resourceGroupName string, workflowName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.Enable") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.EnablePreparer(ctx, resourceGroupName, workflowName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Enable", nil, "Failure preparing request") + return + } + + resp, err := client.EnableSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Enable", resp, "Failure sending request") + return + } + + result, err = client.EnableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Enable", resp, "Failure responding to request") + } + + return +} + +// EnablePreparer prepares the Enable request. +func (client WorkflowsClient) EnablePreparer(ctx context.Context, resourceGroupName string, workflowName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/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 WorkflowsClient) EnableSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// EnableResponder handles the response to the Enable request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) 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 +} + +// GenerateUpgradedDefinition generates the upgraded definition for a workflow. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// parameters - parameters for generating an upgraded definition. +func (client WorkflowsClient) GenerateUpgradedDefinition(ctx context.Context, resourceGroupName string, workflowName string, parameters GenerateUpgradedDefinitionParameters) (result SetObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.GenerateUpgradedDefinition") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GenerateUpgradedDefinitionPreparer(ctx, resourceGroupName, workflowName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "GenerateUpgradedDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateUpgradedDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "GenerateUpgradedDefinition", resp, "Failure sending request") + return + } + + result, err = client.GenerateUpgradedDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "GenerateUpgradedDefinition", resp, "Failure responding to request") + } + + return +} + +// GenerateUpgradedDefinitionPreparer prepares the GenerateUpgradedDefinition request. +func (client WorkflowsClient) GenerateUpgradedDefinitionPreparer(ctx context.Context, resourceGroupName string, workflowName string, parameters GenerateUpgradedDefinitionParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/generateUpgradedDefinition", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateUpgradedDefinitionSender sends the GenerateUpgradedDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowsClient) GenerateUpgradedDefinitionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GenerateUpgradedDefinitionResponder handles the response to the GenerateUpgradedDefinition request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) GenerateUpgradedDefinitionResponder(resp *http.Response) (result SetObject, 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 +} + +// Get gets a workflow. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +func (client WorkflowsClient) Get(ctx context.Context, resourceGroupName string, workflowName string) (result Workflow, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.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, workflowName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowsClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}", 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 WorkflowsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) GetResponder(resp *http.Response) (result Workflow, 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 a list of workflows by resource group. +// Parameters: +// resourceGroupName - the resource group name. +// top - the number of items to be included in the result. +// filter - the filter to apply on the operation. Options for filters include: State, Trigger, and +// ReferencedResourceId. +func (client WorkflowsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, top *int32, filter string) (result WorkflowListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.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, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "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, "logic.WorkflowsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.wlr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client WorkflowsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + 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.Logic/workflows", 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 WorkflowsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) ListByResourceGroupResponder(resp *http.Response) (result WorkflowListResult, 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 WorkflowsClient) listByResourceGroupNextResults(ctx context.Context, lastResults WorkflowListResult) (result WorkflowListResult, err error) { + req, err := lastResults.workflowListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.WorkflowsClient", "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, "logic.WorkflowsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkflowsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, top *int32, filter string) (result WorkflowListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.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, top, filter) + return +} + +// ListBySubscription gets a list of workflows by subscription. +// Parameters: +// top - the number of items to be included in the result. +// filter - the filter to apply on the operation. Options for filters include: State, Trigger, and +// ReferencedResourceId. +func (client WorkflowsClient) ListBySubscription(ctx context.Context, top *int32, filter string) (result WorkflowListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.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, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "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, "logic.WorkflowsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.wlr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client WorkflowsClient) ListBySubscriptionPreparer(ctx context.Context, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + 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.Logic/workflows", 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 WorkflowsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) ListBySubscriptionResponder(resp *http.Response) (result WorkflowListResult, 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 WorkflowsClient) listBySubscriptionNextResults(ctx context.Context, lastResults WorkflowListResult) (result WorkflowListResult, err error) { + req, err := lastResults.workflowListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.WorkflowsClient", "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, "logic.WorkflowsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkflowsClient) ListBySubscriptionComplete(ctx context.Context, top *int32, filter string) (result WorkflowListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.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, top, filter) + return +} + +// ListCallbackURL get the workflow callback Url. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// listCallbackURL - which callback url to list. +func (client WorkflowsClient) ListCallbackURL(ctx context.Context, resourceGroupName string, workflowName string, listCallbackURL GetCallbackURLParameters) (result WorkflowTriggerCallbackURL, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.ListCallbackURL") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListCallbackURLPreparer(ctx, resourceGroupName, workflowName, listCallbackURL) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "ListCallbackURL", nil, "Failure preparing request") + return + } + + resp, err := client.ListCallbackURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "ListCallbackURL", resp, "Failure sending request") + return + } + + result, err = client.ListCallbackURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "ListCallbackURL", resp, "Failure responding to request") + } + + return +} + +// ListCallbackURLPreparer prepares the ListCallbackURL request. +func (client WorkflowsClient) ListCallbackURLPreparer(ctx context.Context, resourceGroupName string, workflowName string, listCallbackURL GetCallbackURLParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/listCallbackUrl", pathParameters), + autorest.WithJSON(listCallbackURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCallbackURLSender sends the ListCallbackURL request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowsClient) ListCallbackURLSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListCallbackURLResponder handles the response to the ListCallbackURL request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) ListCallbackURLResponder(resp *http.Response) (result WorkflowTriggerCallbackURL, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSwagger gets an OpenAPI definition for the workflow. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +func (client WorkflowsClient) ListSwagger(ctx context.Context, resourceGroupName string, workflowName string) (result SetObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.ListSwagger") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListSwaggerPreparer(ctx, resourceGroupName, workflowName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "ListSwagger", nil, "Failure preparing request") + return + } + + resp, err := client.ListSwaggerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "ListSwagger", resp, "Failure sending request") + return + } + + result, err = client.ListSwaggerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "ListSwagger", resp, "Failure responding to request") + } + + return +} + +// ListSwaggerPreparer prepares the ListSwagger request. +func (client WorkflowsClient) ListSwaggerPreparer(ctx context.Context, resourceGroupName string, workflowName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/listSwagger", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSwaggerSender sends the ListSwagger request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowsClient) ListSwaggerSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListSwaggerResponder handles the response to the ListSwagger request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) ListSwaggerResponder(resp *http.Response) (result SetObject, 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 +} + +// Move moves an existing workflow. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// move - the workflow to move. +func (client WorkflowsClient) Move(ctx context.Context, resourceGroupName string, workflowName string, move Workflow) (result WorkflowsMoveFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.Move") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.MovePreparer(ctx, resourceGroupName, workflowName, move) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Move", nil, "Failure preparing request") + return + } + + result, err = client.MoveSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Move", result.Response(), "Failure sending request") + return + } + + return +} + +// MovePreparer prepares the Move request. +func (client WorkflowsClient) MovePreparer(ctx context.Context, resourceGroupName string, workflowName string, move Workflow) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/move", pathParameters), + autorest.WithJSON(move), + 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 WorkflowsClient) MoveSender(req *http.Request) (future WorkflowsMoveFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + 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 WorkflowsClient) MoveResponder(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 +} + +// RegenerateAccessKey regenerates the callback URL access key for request triggers. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// keyType - the access key type. +func (client WorkflowsClient) RegenerateAccessKey(ctx context.Context, resourceGroupName string, workflowName string, keyType RegenerateActionParameter) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.RegenerateAccessKey") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RegenerateAccessKeyPreparer(ctx, resourceGroupName, workflowName, keyType) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "RegenerateAccessKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateAccessKeySender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "RegenerateAccessKey", resp, "Failure sending request") + return + } + + result, err = client.RegenerateAccessKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "RegenerateAccessKey", resp, "Failure responding to request") + } + + return +} + +// RegenerateAccessKeyPreparer prepares the RegenerateAccessKey request. +func (client WorkflowsClient) RegenerateAccessKeyPreparer(ctx context.Context, resourceGroupName string, workflowName string, keyType RegenerateActionParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/regenerateAccessKey", pathParameters), + autorest.WithJSON(keyType), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateAccessKeySender sends the RegenerateAccessKey request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowsClient) RegenerateAccessKeySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// RegenerateAccessKeyResponder handles the response to the RegenerateAccessKey request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) RegenerateAccessKeyResponder(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 workflow. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// workflow - the workflow. +func (client WorkflowsClient) Update(ctx context.Context, resourceGroupName string, workflowName string, workflow Workflow) (result Workflow, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.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, workflowName, workflow) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WorkflowsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workflowName string, workflow Workflow) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}", pathParameters), + autorest.WithJSON(workflow), + 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 WorkflowsClient) UpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) UpdateResponder(resp *http.Response) (result Workflow, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ValidateByLocation validates the workflow definition. +// Parameters: +// resourceGroupName - the resource group name. +// location - the workflow location. +// workflowName - the workflow name. +func (client WorkflowsClient) ValidateByLocation(ctx context.Context, resourceGroupName string, location string, workflowName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.ValidateByLocation") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ValidateByLocationPreparer(ctx, resourceGroupName, location, workflowName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "ValidateByLocation", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateByLocationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "ValidateByLocation", resp, "Failure sending request") + return + } + + result, err = client.ValidateByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "ValidateByLocation", resp, "Failure responding to request") + } + + return +} + +// ValidateByLocationPreparer prepares the ValidateByLocation request. +func (client WorkflowsClient) ValidateByLocationPreparer(ctx context.Context, resourceGroupName string, location string, workflowName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/locations/{location}/workflows/{workflowName}/validate", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateByLocationSender sends the ValidateByLocation request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowsClient) ValidateByLocationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ValidateByLocationResponder handles the response to the ValidateByLocation request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) ValidateByLocationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ValidateByResourceGroup validates the workflow. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// validate - the workflow. +func (client WorkflowsClient) ValidateByResourceGroup(ctx context.Context, resourceGroupName string, workflowName string, validate Workflow) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.ValidateByResourceGroup") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ValidateByResourceGroupPreparer(ctx, resourceGroupName, workflowName, validate) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "ValidateByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateByResourceGroupSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "ValidateByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ValidateByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowsClient", "ValidateByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ValidateByResourceGroupPreparer prepares the ValidateByResourceGroup request. +func (client WorkflowsClient) ValidateByResourceGroupPreparer(ctx context.Context, resourceGroupName string, workflowName string, validate Workflow) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/validate", pathParameters), + autorest.WithJSON(validate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateByResourceGroupSender sends the ValidateByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowsClient) ValidateByResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ValidateByResourceGroupResponder handles the response to the ValidateByResourceGroup request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) ValidateByResourceGroupResponder(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/logic/mgmt/2019-05-01/logic/workflowtriggerhistories.go b/services/preview/logic/mgmt/2019-05-01/logic/workflowtriggerhistories.go new file mode 100644 index 000000000000..0fdc8ec78f30 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/workflowtriggerhistories.go @@ -0,0 +1,330 @@ +package logic + +// 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" +) + +// WorkflowTriggerHistoriesClient is the REST API for Azure Logic Apps. +type WorkflowTriggerHistoriesClient struct { + BaseClient +} + +// NewWorkflowTriggerHistoriesClient creates an instance of the WorkflowTriggerHistoriesClient client. +func NewWorkflowTriggerHistoriesClient(subscriptionID string) WorkflowTriggerHistoriesClient { + return NewWorkflowTriggerHistoriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowTriggerHistoriesClientWithBaseURI creates an instance of the WorkflowTriggerHistoriesClient client. +func NewWorkflowTriggerHistoriesClientWithBaseURI(baseURI string, subscriptionID string) WorkflowTriggerHistoriesClient { + return WorkflowTriggerHistoriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a workflow trigger history. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// triggerName - the workflow trigger name. +// historyName - the workflow trigger history name. Corresponds to the run name for triggers that resulted in a +// run. +func (client WorkflowTriggerHistoriesClient) Get(ctx context.Context, resourceGroupName string, workflowName string, triggerName string, historyName string) (result WorkflowTriggerHistory, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggerHistoriesClient.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, workflowName, triggerName, historyName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggerHistoriesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggerHistoriesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggerHistoriesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowTriggerHistoriesClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string, triggerName string, historyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "historyName": autorest.Encode("path", historyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}", 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 WorkflowTriggerHistoriesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowTriggerHistoriesClient) GetResponder(resp *http.Response) (result WorkflowTriggerHistory, 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 workflow trigger histories. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// triggerName - the workflow trigger name. +// top - the number of items to be included in the result. +// filter - the filter to apply on the operation. Options for filters include: Status, StartTime, and +// ClientTrackingId. +func (client WorkflowTriggerHistoriesClient) List(ctx context.Context, resourceGroupName string, workflowName string, triggerName string, top *int32, filter string) (result WorkflowTriggerHistoryListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggerHistoriesClient.List") + defer func() { + sc := -1 + if result.wthlr.Response.Response != nil { + sc = result.wthlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workflowName, triggerName, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggerHistoriesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.wthlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggerHistoriesClient", "List", resp, "Failure sending request") + return + } + + result.wthlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggerHistoriesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkflowTriggerHistoriesClient) ListPreparer(ctx context.Context, resourceGroupName string, workflowName string, triggerName string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + 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.Logic/workflows/{workflowName}/triggers/{triggerName}/histories", 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 WorkflowTriggerHistoriesClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkflowTriggerHistoriesClient) ListResponder(resp *http.Response) (result WorkflowTriggerHistoryListResult, 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 WorkflowTriggerHistoriesClient) listNextResults(ctx context.Context, lastResults WorkflowTriggerHistoryListResult) (result WorkflowTriggerHistoryListResult, err error) { + req, err := lastResults.workflowTriggerHistoryListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.WorkflowTriggerHistoriesClient", "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, "logic.WorkflowTriggerHistoriesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggerHistoriesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkflowTriggerHistoriesClient) ListComplete(ctx context.Context, resourceGroupName string, workflowName string, triggerName string, top *int32, filter string) (result WorkflowTriggerHistoryListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggerHistoriesClient.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, workflowName, triggerName, top, filter) + return +} + +// Resubmit resubmits a workflow run based on the trigger history. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// triggerName - the workflow trigger name. +// historyName - the workflow trigger history name. Corresponds to the run name for triggers that resulted in a +// run. +func (client WorkflowTriggerHistoriesClient) Resubmit(ctx context.Context, resourceGroupName string, workflowName string, triggerName string, historyName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggerHistoriesClient.Resubmit") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResubmitPreparer(ctx, resourceGroupName, workflowName, triggerName, historyName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggerHistoriesClient", "Resubmit", nil, "Failure preparing request") + return + } + + resp, err := client.ResubmitSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggerHistoriesClient", "Resubmit", resp, "Failure sending request") + return + } + + result, err = client.ResubmitResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggerHistoriesClient", "Resubmit", resp, "Failure responding to request") + } + + return +} + +// ResubmitPreparer prepares the Resubmit request. +func (client WorkflowTriggerHistoriesClient) ResubmitPreparer(ctx context.Context, resourceGroupName string, workflowName string, triggerName string, historyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "historyName": autorest.Encode("path", historyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}/resubmit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResubmitSender sends the Resubmit request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowTriggerHistoriesClient) ResubmitSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ResubmitResponder handles the response to the Resubmit request. The method always +// closes the http.Response Body. +func (client WorkflowTriggerHistoriesClient) ResubmitResponder(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/logic/mgmt/2019-05-01/logic/workflowtriggers.go b/services/preview/logic/mgmt/2019-05-01/logic/workflowtriggers.go new file mode 100644 index 000000000000..b7ede0e419fb --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/workflowtriggers.go @@ -0,0 +1,646 @@ +package logic + +// 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" +) + +// WorkflowTriggersClient is the REST API for Azure Logic Apps. +type WorkflowTriggersClient struct { + BaseClient +} + +// NewWorkflowTriggersClient creates an instance of the WorkflowTriggersClient client. +func NewWorkflowTriggersClient(subscriptionID string) WorkflowTriggersClient { + return NewWorkflowTriggersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowTriggersClientWithBaseURI creates an instance of the WorkflowTriggersClient client. +func NewWorkflowTriggersClientWithBaseURI(baseURI string, subscriptionID string) WorkflowTriggersClient { + return WorkflowTriggersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a workflow trigger. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// triggerName - the workflow trigger name. +func (client WorkflowTriggersClient) Get(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (result WorkflowTrigger, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggersClient.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, workflowName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowTriggersClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/triggers/{triggerName}", 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 WorkflowTriggersClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowTriggersClient) GetResponder(resp *http.Response) (result WorkflowTrigger, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSchemaJSON get the trigger schema as JSON. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// triggerName - the workflow trigger name. +func (client WorkflowTriggersClient) GetSchemaJSON(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (result JSONSchema, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggersClient.GetSchemaJSON") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetSchemaJSONPreparer(ctx, resourceGroupName, workflowName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "GetSchemaJSON", nil, "Failure preparing request") + return + } + + resp, err := client.GetSchemaJSONSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "GetSchemaJSON", resp, "Failure sending request") + return + } + + result, err = client.GetSchemaJSONResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "GetSchemaJSON", resp, "Failure responding to request") + } + + return +} + +// GetSchemaJSONPreparer prepares the GetSchemaJSON request. +func (client WorkflowTriggersClient) GetSchemaJSONPreparer(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/triggers/{triggerName}/schemas/json", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSchemaJSONSender sends the GetSchemaJSON request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowTriggersClient) GetSchemaJSONSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetSchemaJSONResponder handles the response to the GetSchemaJSON request. The method always +// closes the http.Response Body. +func (client WorkflowTriggersClient) GetSchemaJSONResponder(resp *http.Response) (result JSONSchema, 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 workflow triggers. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// top - the number of items to be included in the result. +// filter - the filter to apply on the operation. +func (client WorkflowTriggersClient) List(ctx context.Context, resourceGroupName string, workflowName string, top *int32, filter string) (result WorkflowTriggerListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggersClient.List") + defer func() { + sc := -1 + if result.wtlr.Response.Response != nil { + sc = result.wtlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workflowName, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.wtlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "List", resp, "Failure sending request") + return + } + + result.wtlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkflowTriggersClient) ListPreparer(ctx context.Context, resourceGroupName string, workflowName string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + 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.Logic/workflows/{workflowName}/triggers", 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 WorkflowTriggersClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkflowTriggersClient) ListResponder(resp *http.Response) (result WorkflowTriggerListResult, 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 WorkflowTriggersClient) listNextResults(ctx context.Context, lastResults WorkflowTriggerListResult) (result WorkflowTriggerListResult, err error) { + req, err := lastResults.workflowTriggerListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "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, "logic.WorkflowTriggersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkflowTriggersClient) ListComplete(ctx context.Context, resourceGroupName string, workflowName string, top *int32, filter string) (result WorkflowTriggerListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggersClient.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, workflowName, top, filter) + return +} + +// ListCallbackURL get the callback URL for a workflow trigger. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// triggerName - the workflow trigger name. +func (client WorkflowTriggersClient) ListCallbackURL(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (result WorkflowTriggerCallbackURL, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggersClient.ListCallbackURL") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListCallbackURLPreparer(ctx, resourceGroupName, workflowName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "ListCallbackURL", nil, "Failure preparing request") + return + } + + resp, err := client.ListCallbackURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "ListCallbackURL", resp, "Failure sending request") + return + } + + result, err = client.ListCallbackURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "ListCallbackURL", resp, "Failure responding to request") + } + + return +} + +// ListCallbackURLPreparer prepares the ListCallbackURL request. +func (client WorkflowTriggersClient) ListCallbackURLPreparer(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/triggers/{triggerName}/listCallbackUrl", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCallbackURLSender sends the ListCallbackURL request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowTriggersClient) ListCallbackURLSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListCallbackURLResponder handles the response to the ListCallbackURL request. The method always +// closes the http.Response Body. +func (client WorkflowTriggersClient) ListCallbackURLResponder(resp *http.Response) (result WorkflowTriggerCallbackURL, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reset resets a workflow trigger. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// triggerName - the workflow trigger name. +func (client WorkflowTriggersClient) Reset(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggersClient.Reset") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResetPreparer(ctx, resourceGroupName, workflowName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "Reset", nil, "Failure preparing request") + return + } + + resp, err := client.ResetSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "Reset", resp, "Failure sending request") + return + } + + result, err = client.ResetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "Reset", resp, "Failure responding to request") + } + + return +} + +// ResetPreparer prepares the Reset request. +func (client WorkflowTriggersClient) ResetPreparer(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/triggers/{triggerName}/reset", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetSender sends the Reset request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowTriggersClient) ResetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ResetResponder handles the response to the Reset request. The method always +// closes the http.Response Body. +func (client WorkflowTriggersClient) ResetResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Run runs a workflow trigger. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// triggerName - the workflow trigger name. +func (client WorkflowTriggersClient) Run(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (result SetObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggersClient.Run") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RunPreparer(ctx, resourceGroupName, workflowName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "Run", nil, "Failure preparing request") + return + } + + resp, err := client.RunSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "Run", resp, "Failure sending request") + return + } + + result, err = client.RunResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "Run", resp, "Failure responding to request") + } + + return +} + +// RunPreparer prepares the Run request. +func (client WorkflowTriggersClient) RunPreparer(ctx context.Context, resourceGroupName string, workflowName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/triggers/{triggerName}/run", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RunSender sends the Run request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowTriggersClient) RunSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// RunResponder handles the response to the Run request. The method always +// closes the http.Response Body. +func (client WorkflowTriggersClient) RunResponder(resp *http.Response) (result SetObject, 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 +} + +// SetState sets the state of a workflow trigger. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// triggerName - the workflow trigger name. +// setState - the workflow trigger state. +func (client WorkflowTriggersClient) SetState(ctx context.Context, resourceGroupName string, workflowName string, triggerName string, setState SetTriggerStateActionDefinition) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowTriggersClient.SetState") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: setState, + Constraints: []validation.Constraint{{Target: "setState.Source", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("logic.WorkflowTriggersClient", "SetState", err.Error()) + } + + req, err := client.SetStatePreparer(ctx, resourceGroupName, workflowName, triggerName, setState) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "SetState", nil, "Failure preparing request") + return + } + + resp, err := client.SetStateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "SetState", resp, "Failure sending request") + return + } + + result, err = client.SetStateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowTriggersClient", "SetState", resp, "Failure responding to request") + } + + return +} + +// SetStatePreparer prepares the SetState request. +func (client WorkflowTriggersClient) SetStatePreparer(ctx context.Context, resourceGroupName string, workflowName string, triggerName string, setState SetTriggerStateActionDefinition) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/triggers/{triggerName}/setState", pathParameters), + autorest.WithJSON(setState), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SetStateSender sends the SetState request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowTriggersClient) SetStateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// SetStateResponder handles the response to the SetState request. The method always +// closes the http.Response Body. +func (client WorkflowTriggersClient) SetStateResponder(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/logic/mgmt/2019-05-01/logic/workflowversions.go b/services/preview/logic/mgmt/2019-05-01/logic/workflowversions.go new file mode 100644 index 000000000000..55ad06a5d8da --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/workflowversions.go @@ -0,0 +1,239 @@ +package logic + +// 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" +) + +// WorkflowVersionsClient is the REST API for Azure Logic Apps. +type WorkflowVersionsClient struct { + BaseClient +} + +// NewWorkflowVersionsClient creates an instance of the WorkflowVersionsClient client. +func NewWorkflowVersionsClient(subscriptionID string) WorkflowVersionsClient { + return NewWorkflowVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowVersionsClientWithBaseURI creates an instance of the WorkflowVersionsClient client. +func NewWorkflowVersionsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowVersionsClient { + return WorkflowVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a workflow version. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// versionID - the workflow versionId. +func (client WorkflowVersionsClient) Get(ctx context.Context, resourceGroupName string, workflowName string, versionID string) (result WorkflowVersion, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowVersionsClient.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, workflowName, versionID) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowVersionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowVersionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowVersionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string, versionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "versionId": autorest.Encode("path", versionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/versions/{versionId}", 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 WorkflowVersionsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowVersionsClient) GetResponder(resp *http.Response) (result WorkflowVersion, 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 workflow versions. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// top - the number of items to be included in the result. +func (client WorkflowVersionsClient) List(ctx context.Context, resourceGroupName string, workflowName string, top *int32) (result WorkflowVersionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowVersionsClient.List") + defer func() { + sc := -1 + if result.wvlr.Response.Response != nil { + sc = result.wvlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workflowName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowVersionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.wvlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowVersionsClient", "List", resp, "Failure sending request") + return + } + + result.wvlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowVersionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkflowVersionsClient) ListPreparer(ctx context.Context, resourceGroupName string, workflowName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions", 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 WorkflowVersionsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkflowVersionsClient) ListResponder(resp *http.Response) (result WorkflowVersionListResult, 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 WorkflowVersionsClient) listNextResults(ctx context.Context, lastResults WorkflowVersionListResult) (result WorkflowVersionListResult, err error) { + req, err := lastResults.workflowVersionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "logic.WorkflowVersionsClient", "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, "logic.WorkflowVersionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowVersionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkflowVersionsClient) ListComplete(ctx context.Context, resourceGroupName string, workflowName string, top *int32) (result WorkflowVersionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowVersionsClient.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, workflowName, top) + return +} diff --git a/services/preview/logic/mgmt/2019-05-01/logic/workflowversiontriggers.go b/services/preview/logic/mgmt/2019-05-01/logic/workflowversiontriggers.go new file mode 100644 index 000000000000..c0d03358fe80 --- /dev/null +++ b/services/preview/logic/mgmt/2019-05-01/logic/workflowversiontriggers.go @@ -0,0 +1,128 @@ +package logic + +// 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" +) + +// WorkflowVersionTriggersClient is the REST API for Azure Logic Apps. +type WorkflowVersionTriggersClient struct { + BaseClient +} + +// NewWorkflowVersionTriggersClient creates an instance of the WorkflowVersionTriggersClient client. +func NewWorkflowVersionTriggersClient(subscriptionID string) WorkflowVersionTriggersClient { + return NewWorkflowVersionTriggersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowVersionTriggersClientWithBaseURI creates an instance of the WorkflowVersionTriggersClient client. +func NewWorkflowVersionTriggersClientWithBaseURI(baseURI string, subscriptionID string) WorkflowVersionTriggersClient { + return WorkflowVersionTriggersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListCallbackURL get the callback url for a trigger of a workflow version. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// versionID - the workflow versionId. +// triggerName - the workflow trigger name. +// parameters - the callback URL parameters. +func (client WorkflowVersionTriggersClient) ListCallbackURL(ctx context.Context, resourceGroupName string, workflowName string, versionID string, triggerName string, parameters *GetCallbackURLParameters) (result WorkflowTriggerCallbackURL, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowVersionTriggersClient.ListCallbackURL") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListCallbackURLPreparer(ctx, resourceGroupName, workflowName, versionID, triggerName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowVersionTriggersClient", "ListCallbackURL", nil, "Failure preparing request") + return + } + + resp, err := client.ListCallbackURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowVersionTriggersClient", "ListCallbackURL", resp, "Failure sending request") + return + } + + result, err = client.ListCallbackURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowVersionTriggersClient", "ListCallbackURL", resp, "Failure responding to request") + } + + return +} + +// ListCallbackURLPreparer prepares the ListCallbackURL request. +func (client WorkflowVersionTriggersClient) ListCallbackURLPreparer(ctx context.Context, resourceGroupName string, workflowName string, versionID string, triggerName string, parameters *GetCallbackURLParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + "versionId": autorest.Encode("path", versionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2019-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.Logic/workflows/{workflowName}/versions/{versionId}/triggers/{triggerName}/listCallbackUrl", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCallbackURLSender sends the ListCallbackURL request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowVersionTriggersClient) ListCallbackURLSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListCallbackURLResponder handles the response to the ListCallbackURL request. The method always +// closes the http.Response Body. +func (client WorkflowVersionTriggersClient) ListCallbackURLResponder(resp *http.Response) (result WorkflowTriggerCallbackURL, 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/machinelearning/mgmt/2018-03-01-preview/services/client.go b/services/preview/machinelearning/mgmt/2018-03-01-preview/services/client.go deleted file mode 100644 index 72d151cc813d..000000000000 --- a/services/preview/machinelearning/mgmt/2018-03-01-preview/services/client.go +++ /dev/null @@ -1,51 +0,0 @@ -// Package services implements the Azure ARM Services service API version 2018-03-01-preview. -// -// These APIs allow end users to operate on Azure Machine Learning Workspace resources. -package services - -// 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 Services - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Services. -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. -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} diff --git a/services/preview/machinelearning/mgmt/2018-03-01-preview/services/machinelearningcompute.go b/services/preview/machinelearning/mgmt/2018-03-01-preview/services/machinelearningcompute.go deleted file mode 100644 index 059318d2a1de..000000000000 --- a/services/preview/machinelearning/mgmt/2018-03-01-preview/services/machinelearningcompute.go +++ /dev/null @@ -1,559 +0,0 @@ -package services - -// 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. -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, "services.MachineLearningComputeClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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 = "2018-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.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 = autorest.SendWithSender(client, 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. -func (client MachineLearningComputeClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (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) - if err != nil { - err = autorest.NewErrorWithError(err, "services.MachineLearningComputeClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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) (*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 = "2018-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.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 = autorest.SendWithSender(client, 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, "services.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, "services.MachineLearningComputeClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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 = "2018-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.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 autorest.SendWithSender(client, 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, "services.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, "services.MachineLearningComputeClient", "ListByWorkspace", resp, "Failure sending request") - return - } - - result.pcrl, err = client.ListByWorkspaceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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 = "2018-03-01-preview" - 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 autorest.SendWithSender(client, 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, "services.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, "services.MachineLearningComputeClient", "listByWorkspaceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByWorkspaceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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, "services.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, "services.MachineLearningComputeClient", "ListKeys", resp, "Failure sending request") - return - } - - result, err = client.ListKeysResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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 = "2018-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.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 autorest.SendWithSender(client, 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 -} - -// SystemUpdate system Update On 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. -func (client MachineLearningComputeClient) SystemUpdate(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result MachineLearningComputeSystemUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.SystemUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SystemUpdatePreparer(ctx, resourceGroupName, workspaceName, computeName) - if err != nil { - err = autorest.NewErrorWithError(err, "services.MachineLearningComputeClient", "SystemUpdate", nil, "Failure preparing request") - return - } - - result, err = client.SystemUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "services.MachineLearningComputeClient", "SystemUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// SystemUpdatePreparer prepares the SystemUpdate request. -func (client MachineLearningComputeClient) SystemUpdatePreparer(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 = "2018-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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SystemUpdateSender sends the SystemUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client MachineLearningComputeClient) SystemUpdateSender(req *http.Request) (future MachineLearningComputeSystemUpdateFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// SystemUpdateResponder handles the response to the SystemUpdate request. The method always -// closes the http.Response Body. -func (client MachineLearningComputeClient) SystemUpdateResponder(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/machinelearning/mgmt/2018-03-01-preview/services/models.go b/services/preview/machinelearning/mgmt/2018-03-01-preview/services/models.go deleted file mode 100644 index 63d803061871..000000000000 --- a/services/preview/machinelearning/mgmt/2018-03-01-preview/services/models.go +++ /dev/null @@ -1,1759 +0,0 @@ -package services - -// 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/machinelearning/mgmt/2018-03-01-preview/services" - -// ComputeType enumerates the values for compute type. -type ComputeType string - -const ( - // ComputeTypeAKS ... - ComputeTypeAKS ComputeType = "AKS" - // ComputeTypeBatchAI ... - ComputeTypeBatchAI ComputeType = "BatchAI" - // ComputeTypeDataFactory ... - ComputeTypeDataFactory ComputeType = "DataFactory" - // 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, ComputeTypeBatchAI, ComputeTypeDataFactory, ComputeTypeHDInsight, ComputeTypeVirtualMachine} -} - -// ComputeTypeBasicCompute enumerates the values for compute type basic compute. -type ComputeTypeBasicCompute string - -const ( - // ComputeTypeAKS1 ... - ComputeTypeAKS1 ComputeTypeBasicCompute = "AKS" - // ComputeTypeBatchAI1 ... - ComputeTypeBatchAI1 ComputeTypeBasicCompute = "BatchAI" - // ComputeTypeCompute ... - ComputeTypeCompute ComputeTypeBasicCompute = "Compute" - // ComputeTypeDataFactory1 ... - ComputeTypeDataFactory1 ComputeTypeBasicCompute = "DataFactory" - // 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, ComputeTypeBatchAI1, ComputeTypeCompute, ComputeTypeDataFactory1, ComputeTypeHDInsight1, ComputeTypeVirtualMachine1} -} - -// ComputeTypeBasicComputeSecrets enumerates the values for compute type basic compute secrets. -type ComputeTypeBasicComputeSecrets string - -const ( - // ComputeTypeBasicComputeSecretsComputeTypeAKS ... - ComputeTypeBasicComputeSecretsComputeTypeAKS ComputeTypeBasicComputeSecrets = "AKS" - // ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets ... - ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets ComputeTypeBasicComputeSecrets = "ComputeSecrets" - // ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine ... - ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine ComputeTypeBasicComputeSecrets = "VirtualMachine" -) - -// PossibleComputeTypeBasicComputeSecretsValues returns an array of possible values for the ComputeTypeBasicComputeSecrets const type. -func PossibleComputeTypeBasicComputeSecretsValues() []ComputeTypeBasicComputeSecrets { - return []ComputeTypeBasicComputeSecrets{ComputeTypeBasicComputeSecretsComputeTypeAKS, ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets, ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine} -} - -// 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" - // 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, Succeeded, Unknown, Updating} -} - -// 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} -} - -// Status enumerates the values for status. -type Status string - -const ( - // Disabled ... - Disabled Status = "Disabled" - // Enabled ... - Enabled Status = "Enabled" -) - -// PossibleStatusValues returns an array of possible values for the Status const type. -func PossibleStatusValues() []Status { - return []Status{Disabled, Enabled} -} - -// 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: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - 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 compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]MachineLearningServiceError `json:"provisioningErrors,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeBatchAI1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1' - 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 -} - -// AsBatchAI is the BasicCompute implementation for AKS. -func (a AKS) AsBatchAI() (*BatchAI, 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 -} - -// 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' - 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 -} - -// 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 -} - -// AKSProperties AKS properties -type AKSProperties struct { - // ClusterFqdn - Cluster full qualified domain name - ClusterFqdn *string `json:"clusterFqdn,omitempty"` - // SystemServices - 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"` -} - -// BatchAI a Machine Learning compute based on Azure BatchAI. -type BatchAI struct { - // Properties - BatchAI properties - Properties *BatchAIProperties `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: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - 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 compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]MachineLearningServiceError `json:"provisioningErrors,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeBatchAI1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1' - ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` -} - -// MarshalJSON is the custom marshaler for BatchAI. -func (ba BatchAI) MarshalJSON() ([]byte, error) { - ba.ComputeType = ComputeTypeBatchAI1 - objectMap := make(map[string]interface{}) - if ba.Properties != nil { - objectMap["properties"] = ba.Properties - } - if ba.ComputeLocation != nil { - objectMap["computeLocation"] = ba.ComputeLocation - } - if ba.Description != nil { - objectMap["description"] = ba.Description - } - if ba.ResourceID != nil { - objectMap["resourceId"] = ba.ResourceID - } - if ba.ComputeType != "" { - objectMap["computeType"] = ba.ComputeType - } - return json.Marshal(objectMap) -} - -// AsAKS is the BasicCompute implementation for BatchAI. -func (ba BatchAI) AsAKS() (*AKS, bool) { - return nil, false -} - -// AsBatchAI is the BasicCompute implementation for BatchAI. -func (ba BatchAI) AsBatchAI() (*BatchAI, bool) { - return &ba, true -} - -// AsVirtualMachine is the BasicCompute implementation for BatchAI. -func (ba BatchAI) AsVirtualMachine() (*VirtualMachine, bool) { - return nil, false -} - -// AsHDInsight is the BasicCompute implementation for BatchAI. -func (ba BatchAI) AsHDInsight() (*HDInsight, bool) { - return nil, false -} - -// AsDataFactory is the BasicCompute implementation for BatchAI. -func (ba BatchAI) AsDataFactory() (*DataFactory, bool) { - return nil, false -} - -// AsCompute is the BasicCompute implementation for BatchAI. -func (ba BatchAI) AsCompute() (*Compute, bool) { - return nil, false -} - -// AsBasicCompute is the BasicCompute implementation for BatchAI. -func (ba BatchAI) AsBasicCompute() (BasicCompute, bool) { - return &ba, true -} - -// BatchAIProperties batchAI properties -type BatchAIProperties struct { - // VMSize - Virtual Machine Size - VMSize *string `json:"vmSize,omitempty"` - // VMPriority - Virtual Machine priority - VMPriority *string `json:"vmPriority,omitempty"` - // ScaleSettings - Scale settings for BatchAI - ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` -} - -// BasicCompute machine Learning compute object. -type BasicCompute interface { - AsAKS() (*AKS, bool) - AsBatchAI() (*BatchAI, bool) - AsVirtualMachine() (*VirtualMachine, bool) - AsHDInsight() (*HDInsight, bool) - AsDataFactory() (*DataFactory, 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: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - 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 compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]MachineLearningServiceError `json:"provisioningErrors,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeBatchAI1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1' - 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(ComputeTypeBatchAI1): - var ba BatchAI - err := json.Unmarshal(body, &ba) - return ba, 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 - 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 -} - -// AsBatchAI is the BasicCompute implementation for Compute. -func (c Compute) AsBatchAI() (*BatchAI, 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 -} - -// 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 -} - -// 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 - READ-ONLY; 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"` -} - -// MarshalJSON is the custom marshaler for ComputeResource. -func (cr ComputeResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = cr.Properties - if cr.Location != nil { - objectMap["location"] = cr.Location - } - if cr.Tags != nil { - objectMap["tags"] = cr.Tags - } - 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 - } - } - } - - 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) - 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' - 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 - 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 -} - -// 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 -} - -// 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: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - 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 compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]MachineLearningServiceError `json:"provisioningErrors,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeBatchAI1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1' - 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 -} - -// AsBatchAI is the BasicCompute implementation for DataFactory. -func (df DataFactory) AsBatchAI() (*BatchAI, 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 -} - -// 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 -} - -// 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 - Error code. - Code *string `json:"code,omitempty"` - // Message - Error message. - Message *string `json:"message,omitempty"` - // Details - 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: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - 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 compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]MachineLearningServiceError `json:"provisioningErrors,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeBatchAI1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1' - 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 -} - -// AsBatchAI is the BasicCompute implementation for HDInsight. -func (hi HDInsight) AsBatchAI() (*BatchAI, 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 -} - -// 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' - Type ResourceIdentityType `json:"type,omitempty"` -} - -// 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"` -} - -// 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, "services.MachineLearningComputeCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("services.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, "services.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, "services.MachineLearningComputeDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("services.MachineLearningComputeDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// MachineLearningComputeSystemUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type MachineLearningComputeSystemUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *MachineLearningComputeSystemUpdateFuture) 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, "services.MachineLearningComputeSystemUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("services.MachineLearningComputeSystemUpdateFuture") - return - } - ar.Response = future.Response() - return -} - -// MachineLearningServiceError wrapper for error response to follow ARM guidelines. -type MachineLearningServiceError struct { - // Error - The error response. - Error *ErrorResponse `json:"error,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"` -} - -// PrincipalCredentials service principal credentials. -type PrincipalCredentials struct { - // ClientID - Client Id - ClientID *string `json:"clientId,omitempty"` - // ClientSecret - Client secret - ClientSecret *string `json:"clientSecret,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 - READ-ONLY; 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"` -} - -// 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) -} - -// ScaleSettings scale settings for BatchAI 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"` - // AutoScaleEnabled - Enable or disable auto scale - AutoScaleEnabled *bool `json:"autoScaleEnabled,omitempty"` -} - -// SslConfiguration the SSL configuration for scoring -type SslConfiguration struct { - // Status - Enable or disable SSL for scoring. Possible values include: 'Disabled', 'Enabled' - Status Status `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"` -} - -// 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: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - 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 compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]MachineLearningServiceError `json:"provisioningErrors,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeBatchAI1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1' - 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 -} - -// AsBatchAI is the BasicCompute implementation for VirtualMachine. -func (VM VirtualMachine) AsBatchAI() (*BatchAI, 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 -} - -// 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' - 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 -} - -// 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 -} - -// 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 - READ-ONLY; 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"` -} - -// 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.Location != nil { - objectMap["location"] = w.Location - } - if w.Tags != nil { - objectMap["tags"] = w.Tags - } - 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 - } - } - } - - 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"` - // BatchaiWorkspace - ARM id of the Batch AI workspace associated with this workspace. This cannot be changed once the workspace has been created - BatchaiWorkspace *string `json:"batchaiWorkspace,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: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - ProvisioningState ProvisioningState `json:"provisioningState,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"` -} - -// 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"` - // 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.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 "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/preview/machinelearning/mgmt/2018-03-01-preview/services/servicesapi/interfaces.go b/services/preview/machinelearning/mgmt/2018-03-01-preview/services/servicesapi/interfaces.go deleted file mode 100644 index 91c033cac3c6..000000000000 --- a/services/preview/machinelearning/mgmt/2018-03-01-preview/services/servicesapi/interfaces.go +++ /dev/null @@ -1,57 +0,0 @@ -package servicesapi - -// 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/machinelearning/mgmt/2018-03-01-preview/services" - "github.com/Azure/go-autorest/autorest" -) - -// OperationsClientAPI contains the set of methods on the OperationsClient type. -type OperationsClientAPI interface { - List(ctx context.Context) (result services.OperationListResult, err error) -} - -var _ OperationsClientAPI = (*services.OperationsClient)(nil) - -// WorkspacesClientAPI contains the set of methods on the WorkspacesClient type. -type WorkspacesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters services.Workspace) (result services.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 services.Workspace, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string, skiptoken string) (result services.WorkspaceListResultPage, err error) - ListBySubscription(ctx context.Context, skiptoken string) (result services.WorkspaceListResultPage, err error) - ListKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result services.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 services.WorkspaceUpdateParameters) (result services.Workspace, err error) -} - -var _ WorkspacesClientAPI = (*services.WorkspacesClient)(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 services.ComputeResource) (result services.MachineLearningComputeCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result services.MachineLearningComputeDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result services.ComputeResource, err error) - ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, skiptoken string) (result services.PaginatedComputeResourcesListPage, err error) - ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result services.ComputeSecretsModel, err error) - SystemUpdate(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result services.MachineLearningComputeSystemUpdateFuture, err error) -} - -var _ MachineLearningComputeClientAPI = (*services.MachineLearningComputeClient)(nil) diff --git a/services/preview/machinelearning/mgmt/2018-03-01-preview/services/version.go b/services/preview/machinelearning/mgmt/2018-03-01-preview/services/version.go deleted file mode 100644 index 80c355d065aa..000000000000 --- a/services/preview/machinelearning/mgmt/2018-03-01-preview/services/version.go +++ /dev/null @@ -1,30 +0,0 @@ -package services - -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.Number + " services/2018-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/machinelearning/mgmt/2018-03-01-preview/services/workspaces.go b/services/preview/machinelearning/mgmt/2018-03-01-preview/services/workspaces.go deleted file mode 100644 index 8ce1b42dbda2..000000000000 --- a/services/preview/machinelearning/mgmt/2018-03-01-preview/services/workspaces.go +++ /dev/null @@ -1,741 +0,0 @@ -package services - -// 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" -) - -// 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. -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 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) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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, "services.WorkspacesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "services.WorkspacesClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - 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 = "2018-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.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) (*http.Response, error) { - return autorest.SendWithSender(client, 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 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, "services.WorkspacesClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "services.WorkspacesClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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 = "2018-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.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 autorest.SendWithSender(client, 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, "services.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, "services.WorkspacesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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 = "2018-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.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 autorest.SendWithSender(client, 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, "services.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, "services.WorkspacesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.wlr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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 = "2018-03-01-preview" - 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 autorest.SendWithSender(client, 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, "services.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, "services.WorkspacesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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, "services.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, "services.WorkspacesClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.wlr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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 = "2018-03-01-preview" - 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 autorest.SendWithSender(client, 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, "services.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, "services.WorkspacesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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, "services.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, "services.WorkspacesClient", "ListKeys", resp, "Failure sending request") - return - } - - result, err = client.ListKeysResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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 = "2018-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.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 autorest.SendWithSender(client, 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, "services.WorkspacesClient", "ResyncKeys", nil, "Failure preparing request") - return - } - - resp, err := client.ResyncKeysSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "services.WorkspacesClient", "ResyncKeys", resp, "Failure sending request") - return - } - - result, err = client.ResyncKeysResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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 = "2018-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.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 autorest.SendWithSender(client, 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, "services.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, "services.WorkspacesClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "services.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 = "2018-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.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 autorest.SendWithSender(client, 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/maintenance/mgmt/2018-06-01-preview/maintenance/applyupdates.go b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/applyupdates.go new file mode 100755 index 000000000000..522184b9d626 --- /dev/null +++ b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/applyupdates.go @@ -0,0 +1,377 @@ +package maintenance + +// 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" +) + +// ApplyUpdatesClient is the azure Maintenance Management Client +type ApplyUpdatesClient struct { + BaseClient +} + +// NewApplyUpdatesClient creates an instance of the ApplyUpdatesClient client. +func NewApplyUpdatesClient(subscriptionID string) ApplyUpdatesClient { + return NewApplyUpdatesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewApplyUpdatesClientWithBaseURI creates an instance of the ApplyUpdatesClient client. +func NewApplyUpdatesClientWithBaseURI(baseURI string, subscriptionID string) ApplyUpdatesClient { + return ApplyUpdatesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate apply maintenance updates to resource +// Parameters: +// resourceGroupName - resource group name +// providerName - resource provider name +// resourceType - resource type +// resourceName - resource identifier +func (client ApplyUpdatesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string) (result ApplyUpdate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplyUpdatesClient.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, providerName, resourceType, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ApplyUpdatesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ApplyUpdatesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ApplyUpdatesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ApplyUpdatesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/default", pathParameters), + 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 ApplyUpdatesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ApplyUpdatesClient) CreateOrUpdateResponder(resp *http.Response) (result ApplyUpdate, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateParent apply maintenance updates to resource with parent +// Parameters: +// resourceGroupName - resource group name +// providerName - resource provider name +// resourceParentType - resource parent type +// resourceParentName - resource parent identifier +// resourceType - resource type +// resourceName - resource identifier +func (client ApplyUpdatesClient) CreateOrUpdateParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string) (result ApplyUpdate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplyUpdatesClient.CreateOrUpdateParent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdateParentPreparer(ctx, resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ApplyUpdatesClient", "CreateOrUpdateParent", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateParentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ApplyUpdatesClient", "CreateOrUpdateParent", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateParentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ApplyUpdatesClient", "CreateOrUpdateParent", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateParentPreparer prepares the CreateOrUpdateParent request. +func (client ApplyUpdatesClient) CreateOrUpdateParentPreparer(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceParentName": autorest.Encode("path", resourceParentName), + "resourceParentType": autorest.Encode("path", resourceParentType), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateParentSender sends the CreateOrUpdateParent request. The method will close the +// http.Response Body if it receives an error. +func (client ApplyUpdatesClient) CreateOrUpdateParentSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateParentResponder handles the response to the CreateOrUpdateParent request. The method always +// closes the http.Response Body. +func (client ApplyUpdatesClient) CreateOrUpdateParentResponder(resp *http.Response) (result ApplyUpdate, 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 track maintenance updates to resource +// Parameters: +// resourceGroupName - resource group name +// providerName - resource provider name +// resourceType - resource type +// resourceName - resource identifier +// applyUpdateName - applyUpdate Id +func (client ApplyUpdatesClient) Get(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, applyUpdateName string) (result ApplyUpdate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplyUpdatesClient.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, providerName, resourceType, resourceName, applyUpdateName) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ApplyUpdatesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ApplyUpdatesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ApplyUpdatesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ApplyUpdatesClient) GetPreparer(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, applyUpdateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applyUpdateName": autorest.Encode("path", applyUpdateName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}", 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 ApplyUpdatesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ApplyUpdatesClient) GetResponder(resp *http.Response) (result ApplyUpdate, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetParent track maintenance updates to resource with parent +// Parameters: +// resourceGroupName - resource group name +// resourceParentType - resource parent type +// resourceParentName - resource parent identifier +// providerName - resource provider name +// resourceType - resource type +// resourceName - resource identifier +// applyUpdateName - applyUpdate Id +func (client ApplyUpdatesClient) GetParent(ctx context.Context, resourceGroupName string, resourceParentType string, resourceParentName string, providerName string, resourceType string, resourceName string, applyUpdateName string) (result ApplyUpdate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplyUpdatesClient.GetParent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetParentPreparer(ctx, resourceGroupName, resourceParentType, resourceParentName, providerName, resourceType, resourceName, applyUpdateName) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ApplyUpdatesClient", "GetParent", nil, "Failure preparing request") + return + } + + resp, err := client.GetParentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ApplyUpdatesClient", "GetParent", resp, "Failure sending request") + return + } + + result, err = client.GetParentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ApplyUpdatesClient", "GetParent", resp, "Failure responding to request") + } + + return +} + +// GetParentPreparer prepares the GetParent request. +func (client ApplyUpdatesClient) GetParentPreparer(ctx context.Context, resourceGroupName string, resourceParentType string, resourceParentName string, providerName string, resourceType string, resourceName string, applyUpdateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applyUpdateName": autorest.Encode("path", applyUpdateName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceParentName": autorest.Encode("path", resourceParentName), + "resourceParentType": autorest.Encode("path", resourceParentType), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetParentSender sends the GetParent request. The method will close the +// http.Response Body if it receives an error. +func (client ApplyUpdatesClient) GetParentSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetParentResponder handles the response to the GetParent request. The method always +// closes the http.Response Body. +func (client ApplyUpdatesClient) GetParentResponder(resp *http.Response) (result ApplyUpdate, 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/maintenance/mgmt/2018-06-01-preview/maintenance/client.go b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/client.go new file mode 100755 index 000000000000..6401c280e644 --- /dev/null +++ b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/client.go @@ -0,0 +1,51 @@ +// Package maintenance implements the Azure ARM Maintenance service API version 2018-06-01-preview. +// +// Azure Maintenance Management Client +package maintenance + +// 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 Maintenance + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Maintenance. +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. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/configurationassignments.go b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/configurationassignments.go new file mode 100755 index 000000000000..d2dbf2ff19c0 --- /dev/null +++ b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/configurationassignments.go @@ -0,0 +1,553 @@ +package maintenance + +// 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" +) + +// ConfigurationAssignmentsClient is the azure Maintenance Management Client +type ConfigurationAssignmentsClient struct { + BaseClient +} + +// NewConfigurationAssignmentsClient creates an instance of the ConfigurationAssignmentsClient client. +func NewConfigurationAssignmentsClient(subscriptionID string) ConfigurationAssignmentsClient { + return NewConfigurationAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConfigurationAssignmentsClientWithBaseURI creates an instance of the ConfigurationAssignmentsClient client. +func NewConfigurationAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationAssignmentsClient { + return ConfigurationAssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate register configuration for resource. +// Parameters: +// resourceGroupName - resource group name +// providerName - resource provider name +// resourceType - resource type +// resourceName - resource identifier +// configurationAssignmentName - configuration assignment name +// configurationAssignment - the configurationAssignment +func (client ConfigurationAssignmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, configurationAssignmentName string, configurationAssignment ConfigurationAssignment) (result ConfigurationAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationAssignmentsClient.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, providerName, resourceType, resourceName, configurationAssignmentName, configurationAssignment) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ConfigurationAssignmentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, configurationAssignmentName string, configurationAssignment ConfigurationAssignment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationAssignmentName": autorest.Encode("path", configurationAssignmentName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceType": autorest.Encode("path", resourceType), + "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.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}", pathParameters), + autorest.WithJSON(configurationAssignment), + 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 ConfigurationAssignmentsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ConfigurationAssignmentsClient) CreateOrUpdateResponder(resp *http.Response) (result ConfigurationAssignment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateParent register configuration for resource. +// Parameters: +// resourceGroupName - resource group name +// providerName - resource provider name +// resourceParentType - resource parent type +// resourceParentName - resource parent identifier +// resourceType - resource type +// resourceName - resource identifier +// configurationAssignmentName - configuration assignment name +// configurationAssignment - the configurationAssignment +func (client ConfigurationAssignmentsClient) CreateOrUpdateParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, configurationAssignmentName string, configurationAssignment ConfigurationAssignment) (result ConfigurationAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationAssignmentsClient.CreateOrUpdateParent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdateParentPreparer(ctx, resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName, configurationAssignment) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "CreateOrUpdateParent", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateParentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "CreateOrUpdateParent", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateParentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "CreateOrUpdateParent", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateParentPreparer prepares the CreateOrUpdateParent request. +func (client ConfigurationAssignmentsClient) CreateOrUpdateParentPreparer(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, configurationAssignmentName string, configurationAssignment ConfigurationAssignment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationAssignmentName": autorest.Encode("path", configurationAssignmentName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceParentName": autorest.Encode("path", resourceParentName), + "resourceParentType": autorest.Encode("path", resourceParentType), + "resourceType": autorest.Encode("path", resourceType), + "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.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}", pathParameters), + autorest.WithJSON(configurationAssignment), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateParentSender sends the CreateOrUpdateParent request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationAssignmentsClient) CreateOrUpdateParentSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateParentResponder handles the response to the CreateOrUpdateParent request. The method always +// closes the http.Response Body. +func (client ConfigurationAssignmentsClient) CreateOrUpdateParentResponder(resp *http.Response) (result ConfigurationAssignment, 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 unregister configuration for resource. +// Parameters: +// resourceGroupName - resource group name +// providerName - resource provider name +// resourceType - resource type +// resourceName - resource identifier +// configurationAssignmentName - unique configuration assignment name +func (client ConfigurationAssignmentsClient) Delete(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, configurationAssignmentName string) (result ConfigurationAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationAssignmentsClient.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, resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ConfigurationAssignmentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, configurationAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationAssignmentName": autorest.Encode("path", configurationAssignmentName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}", 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 ConfigurationAssignmentsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ConfigurationAssignmentsClient) DeleteResponder(resp *http.Response) (result ConfigurationAssignment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteParent unregister configuration for resource. +// Parameters: +// resourceGroupName - resource group name +// providerName - resource provider name +// resourceParentType - resource parent type +// resourceParentName - resource parent identifier +// resourceType - resource type +// resourceName - resource identifier +// configurationAssignmentName - unique configuration assignment name +func (client ConfigurationAssignmentsClient) DeleteParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, configurationAssignmentName string) (result ConfigurationAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationAssignmentsClient.DeleteParent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteParentPreparer(ctx, resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "DeleteParent", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteParentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "DeleteParent", resp, "Failure sending request") + return + } + + result, err = client.DeleteParentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "DeleteParent", resp, "Failure responding to request") + } + + return +} + +// DeleteParentPreparer prepares the DeleteParent request. +func (client ConfigurationAssignmentsClient) DeleteParentPreparer(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, configurationAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationAssignmentName": autorest.Encode("path", configurationAssignmentName), + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceParentName": autorest.Encode("path", resourceParentName), + "resourceParentType": autorest.Encode("path", resourceParentType), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteParentSender sends the DeleteParent request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationAssignmentsClient) DeleteParentSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteParentResponder handles the response to the DeleteParent request. The method always +// closes the http.Response Body. +func (client ConfigurationAssignmentsClient) DeleteParentResponder(resp *http.Response) (result ConfigurationAssignment, 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 configurationAssignments for resource. +// Parameters: +// resourceGroupName - resource group name +// providerName - resource provider name +// resourceType - resource type +// resourceName - resource identifier +func (client ConfigurationAssignmentsClient) List(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string) (result ListConfigurationAssignmentsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationAssignmentsClient.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, providerName, resourceType, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ConfigurationAssignmentsClient) ListPreparer(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments", 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 ConfigurationAssignmentsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ConfigurationAssignmentsClient) ListResponder(resp *http.Response) (result ListConfigurationAssignmentsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListParent list configurationAssignments for resource. +// Parameters: +// resourceGroupName - resource group name +// providerName - resource provider name +// resourceParentType - resource parent type +// resourceParentName - resource parent identifier +// resourceType - resource type +// resourceName - resource identifier +func (client ConfigurationAssignmentsClient) ListParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string) (result ListConfigurationAssignmentsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationAssignmentsClient.ListParent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListParentPreparer(ctx, resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "ListParent", nil, "Failure preparing request") + return + } + + resp, err := client.ListParentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "ListParent", resp, "Failure sending request") + return + } + + result, err = client.ListParentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationAssignmentsClient", "ListParent", resp, "Failure responding to request") + } + + return +} + +// ListParentPreparer prepares the ListParent request. +func (client ConfigurationAssignmentsClient) ListParentPreparer(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceParentName": autorest.Encode("path", resourceParentName), + "resourceParentType": autorest.Encode("path", resourceParentType), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListParentSender sends the ListParent request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationAssignmentsClient) ListParentSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListParentResponder handles the response to the ListParent request. The method always +// closes the http.Response Body. +func (client ConfigurationAssignmentsClient) ListParentResponder(resp *http.Response) (result ListConfigurationAssignmentsResult, 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/maintenance/mgmt/2018-06-01-preview/maintenance/configurations.go b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/configurations.go new file mode 100755 index 000000000000..35504da43e2b --- /dev/null +++ b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/configurations.go @@ -0,0 +1,427 @@ +package maintenance + +// 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" +) + +// ConfigurationsClient is the azure Maintenance Management Client +type ConfigurationsClient struct { + BaseClient +} + +// NewConfigurationsClient creates an instance of the ConfigurationsClient client. +func NewConfigurationsClient(subscriptionID string) ConfigurationsClient { + return NewConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConfigurationsClientWithBaseURI creates an instance of the ConfigurationsClient client. +func NewConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationsClient { + return ConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// resourceGroupName - resource Group Name +// resourceName - resource Identifier +// configuration - the configuration +func (client ConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, configuration Configuration) (result Configuration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationsClient.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, resourceName, configuration) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, configuration Configuration) (*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 = "2018-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.Maintenance/maintenanceConfigurations/{resourceName}", pathParameters), + autorest.WithJSON(configuration), + 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 ConfigurationsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result Configuration, 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 sends the delete request. +// Parameters: +// resourceGroupName - resource Group Name +// resourceName - resource Identifier +func (client ConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result Configuration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationsClient.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, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ConfigurationsClient) 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 = "2018-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.Maintenance/maintenanceConfigurations/{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 ConfigurationsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ConfigurationsClient) DeleteResponder(resp *http.Response) (result Configuration, 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 sends the get request. +// Parameters: +// resourceGroupName - resource Group Name +// resourceName - resource Identifier +func (client ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result Configuration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationsClient.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, "maintenance.ConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConfigurationsClient) 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 = "2018-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.Maintenance/maintenanceConfigurations/{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 ConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ConfigurationsClient) GetResponder(resp *http.Response) (result Configuration, 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 ConfigurationsClient) List(ctx context.Context) (result ListMaintenanceConfigurationsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationsClient.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, "maintenance.ConfigurationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ConfigurationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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.Maintenance/maintenanceConfigurations", 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 ConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ConfigurationsClient) ListResponder(resp *http.Response) (result ListMaintenanceConfigurationsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMethod sends the update method request. +// Parameters: +// resourceGroupName - resource Group Name +// resourceName - resource Identifier +// configuration - the configuration +func (client ConfigurationsClient) UpdateMethod(ctx context.Context, resourceGroupName string, resourceName string, configuration Configuration) (result Configuration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationsClient.UpdateMethod") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateMethodPreparer(ctx, resourceGroupName, resourceName, configuration) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationsClient", "UpdateMethod", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateMethodSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationsClient", "UpdateMethod", resp, "Failure sending request") + return + } + + result, err = client.UpdateMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.ConfigurationsClient", "UpdateMethod", resp, "Failure responding to request") + } + + return +} + +// UpdateMethodPreparer prepares the UpdateMethod request. +func (client ConfigurationsClient) UpdateMethodPreparer(ctx context.Context, resourceGroupName string, resourceName string, configuration Configuration) (*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 = "2018-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.Maintenance/maintenanceConfigurations/{resourceName}", pathParameters), + autorest.WithJSON(configuration), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMethodSender sends the UpdateMethod request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationsClient) UpdateMethodSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// UpdateMethodResponder handles the response to the UpdateMethod request. The method always +// closes the http.Response Body. +func (client ConfigurationsClient) UpdateMethodResponder(resp *http.Response) (result Configuration, 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/maintenance/mgmt/2018-06-01-preview/maintenance/maintenanceapi/interfaces.go b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/maintenanceapi/interfaces.go new file mode 100755 index 000000000000..43eb719280a2 --- /dev/null +++ b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/maintenanceapi/interfaces.go @@ -0,0 +1,71 @@ +package maintenanceapi + +// 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/maintenance/mgmt/2018-06-01-preview/maintenance" +) + +// ApplyUpdatesClientAPI contains the set of methods on the ApplyUpdatesClient type. +type ApplyUpdatesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string) (result maintenance.ApplyUpdate, err error) + CreateOrUpdateParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string) (result maintenance.ApplyUpdate, err error) + Get(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, applyUpdateName string) (result maintenance.ApplyUpdate, err error) + GetParent(ctx context.Context, resourceGroupName string, resourceParentType string, resourceParentName string, providerName string, resourceType string, resourceName string, applyUpdateName string) (result maintenance.ApplyUpdate, err error) +} + +var _ ApplyUpdatesClientAPI = (*maintenance.ApplyUpdatesClient)(nil) + +// ConfigurationAssignmentsClientAPI contains the set of methods on the ConfigurationAssignmentsClient type. +type ConfigurationAssignmentsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, configurationAssignmentName string, configurationAssignment maintenance.ConfigurationAssignment) (result maintenance.ConfigurationAssignment, err error) + CreateOrUpdateParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, configurationAssignmentName string, configurationAssignment maintenance.ConfigurationAssignment) (result maintenance.ConfigurationAssignment, err error) + Delete(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, configurationAssignmentName string) (result maintenance.ConfigurationAssignment, err error) + DeleteParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, configurationAssignmentName string) (result maintenance.ConfigurationAssignment, err error) + List(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string) (result maintenance.ListConfigurationAssignmentsResult, err error) + ListParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string) (result maintenance.ListConfigurationAssignmentsResult, err error) +} + +var _ ConfigurationAssignmentsClientAPI = (*maintenance.ConfigurationAssignmentsClient)(nil) + +// ConfigurationsClientAPI contains the set of methods on the ConfigurationsClient type. +type ConfigurationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, configuration maintenance.Configuration) (result maintenance.Configuration, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string) (result maintenance.Configuration, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string) (result maintenance.Configuration, err error) + List(ctx context.Context) (result maintenance.ListMaintenanceConfigurationsResult, err error) + UpdateMethod(ctx context.Context, resourceGroupName string, resourceName string, configuration maintenance.Configuration) (result maintenance.Configuration, err error) +} + +var _ ConfigurationsClientAPI = (*maintenance.ConfigurationsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result maintenance.OperationsListResult, err error) +} + +var _ OperationsClientAPI = (*maintenance.OperationsClient)(nil) + +// UpdatesClientAPI contains the set of methods on the UpdatesClient type. +type UpdatesClientAPI interface { + List(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string) (result maintenance.ListUpdatesResult, err error) + ListParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string) (result maintenance.ListUpdatesResult, err error) +} + +var _ UpdatesClientAPI = (*maintenance.UpdatesClient)(nil) diff --git a/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/models.go b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/models.go new file mode 100755 index 000000000000..34796e7b49c1 --- /dev/null +++ b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/models.go @@ -0,0 +1,581 @@ +package maintenance + +// 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" + "github.com/Azure/go-autorest/autorest/date" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance" + +// ImpactType enumerates the values for impact type. +type ImpactType string + +const ( + // Freeze ... + Freeze ImpactType = "Freeze" + // None ... + None ImpactType = "None" + // Redeploy ... + Redeploy ImpactType = "Redeploy" + // Restart ... + Restart ImpactType = "Restart" +) + +// PossibleImpactTypeValues returns an array of possible values for the ImpactType const type. +func PossibleImpactTypeValues() []ImpactType { + return []ImpactType{Freeze, None, Redeploy, Restart} +} + +// Scope enumerates the values for scope. +type Scope string + +const ( + // ScopeAll ... + ScopeAll Scope = "All" + // ScopeHost ... + ScopeHost Scope = "Host" + // ScopeInResource ... + ScopeInResource Scope = "InResource" + // ScopeResource ... + ScopeResource Scope = "Resource" +) + +// PossibleScopeValues returns an array of possible values for the Scope const type. +func PossibleScopeValues() []Scope { + return []Scope{ScopeAll, ScopeHost, ScopeInResource, ScopeResource} +} + +// UpdateStatus enumerates the values for update status. +type UpdateStatus string + +const ( + // Completed ... + Completed UpdateStatus = "Completed" + // InProgress ... + InProgress UpdateStatus = "InProgress" + // Pending ... + Pending UpdateStatus = "Pending" + // RetryLater ... + RetryLater UpdateStatus = "RetryLater" + // RetryNow ... + RetryNow UpdateStatus = "RetryNow" +) + +// PossibleUpdateStatusValues returns an array of possible values for the UpdateStatus const type. +func PossibleUpdateStatusValues() []UpdateStatus { + return []UpdateStatus{Completed, InProgress, Pending, RetryLater, RetryNow} +} + +// ApplyUpdate apply Update request +type ApplyUpdate struct { + autorest.Response `json:"-"` + // ApplyUpdateProperties - Properties of the apply update + *ApplyUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified identifier of the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplyUpdate. +func (au ApplyUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if au.ApplyUpdateProperties != nil { + objectMap["properties"] = au.ApplyUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplyUpdate struct. +func (au *ApplyUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applyUpdateProperties ApplyUpdateProperties + err = json.Unmarshal(*v, &applyUpdateProperties) + if err != nil { + return err + } + au.ApplyUpdateProperties = &applyUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + au.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + au.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + au.Type = &typeVar + } + } + } + + return nil +} + +// ApplyUpdateProperties properties for apply update +type ApplyUpdateProperties struct { + // Status - The status. Possible values include: 'Pending', 'InProgress', 'Completed', 'RetryNow', 'RetryLater' + Status UpdateStatus `json:"status,omitempty"` + // ResourceID - The resourceId + ResourceID *string `json:"resourceId,omitempty"` + // LastUpdateTime - Last Update time + LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` +} + +// Configuration maintenance configuration record type +type Configuration struct { + autorest.Response `json:"-"` + // Location - Gets or sets location of the resource + Location *string `json:"location,omitempty"` + // Tags - Gets or sets tags of the resource + Tags map[string]*string `json:"tags"` + // ConfigurationProperties - Gets or sets properties of the resource + *ConfigurationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified identifier of the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Configuration. +func (c Configuration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.Location != nil { + objectMap["location"] = c.Location + } + if c.Tags != nil { + objectMap["tags"] = c.Tags + } + if c.ConfigurationProperties != nil { + objectMap["properties"] = c.ConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Configuration struct. +func (c *Configuration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + c.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + c.Tags = tags + } + case "properties": + if v != nil { + var configurationProperties ConfigurationProperties + err = json.Unmarshal(*v, &configurationProperties) + if err != nil { + return err + } + c.ConfigurationProperties = &configurationProperties + } + 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 +} + +// ConfigurationAssignment configuration Assignment +type ConfigurationAssignment struct { + autorest.Response `json:"-"` + // Location - Location of the resource + Location *string `json:"location,omitempty"` + // ConfigurationAssignmentProperties - Properties of the configuration assignment + *ConfigurationAssignmentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified identifier of the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConfigurationAssignment. +func (ca ConfigurationAssignment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ca.Location != nil { + objectMap["location"] = ca.Location + } + if ca.ConfigurationAssignmentProperties != nil { + objectMap["properties"] = ca.ConfigurationAssignmentProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConfigurationAssignment struct. +func (ca *ConfigurationAssignment) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ca.Location = &location + } + case "properties": + if v != nil { + var configurationAssignmentProperties ConfigurationAssignmentProperties + err = json.Unmarshal(*v, &configurationAssignmentProperties) + if err != nil { + return err + } + ca.ConfigurationAssignmentProperties = &configurationAssignmentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ca.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ca.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ca.Type = &typeVar + } + } + } + + return nil +} + +// ConfigurationAssignmentProperties properties for configuration assignment +type ConfigurationAssignmentProperties struct { + // MaintenanceConfigurationID - The maintenance configuration Id + MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + // ResourceID - The unique resourceId + ResourceID *string `json:"resourceId,omitempty"` +} + +// ConfigurationProperties properties for maintenance configuration +type ConfigurationProperties struct { + // Namespace - Gets or sets namespace of the resource + Namespace *string `json:"namespace,omitempty"` + // ExtensionProperties - Gets or sets extensionProperties of the maintenanceConfiguration + ExtensionProperties map[string]*string `json:"extensionProperties"` + // MaintenanceScope - Gets or sets maintenanceScope of the configuration. Possible values include: 'ScopeAll', 'ScopeHost', 'ScopeResource', 'ScopeInResource' + MaintenanceScope Scope `json:"maintenanceScope,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConfigurationProperties. +func (cp ConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.Namespace != nil { + objectMap["namespace"] = cp.Namespace + } + if cp.ExtensionProperties != nil { + objectMap["extensionProperties"] = cp.ExtensionProperties + } + if cp.MaintenanceScope != "" { + objectMap["maintenanceScope"] = cp.MaintenanceScope + } + return json.Marshal(objectMap) +} + +// Error an error response received from the Azure Maintenance service. +type Error struct { + // Error - Details of the error + Error *ErrorDetails `json:"error,omitempty"` +} + +// ErrorDetails an error response details received from the Azure Maintenance service. +type ErrorDetails struct { + // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + Code *string `json:"code,omitempty"` + // Message - Human-readable representation of the error. + Message *string `json:"message,omitempty"` +} + +// ListConfigurationAssignmentsResult response for ConfigurationAssignments list +type ListConfigurationAssignmentsResult struct { + autorest.Response `json:"-"` + // Value - The list of configuration Assignments + Value *[]ConfigurationAssignment `json:"value,omitempty"` +} + +// ListMaintenanceConfigurationsResult response for MaintenanceConfigurations list +type ListMaintenanceConfigurationsResult struct { + autorest.Response `json:"-"` + // Value - The list of maintenance Configurations + Value *[]Configuration `json:"value,omitempty"` +} + +// ListUpdatesResult response for Updates list +type ListUpdatesResult struct { + autorest.Response `json:"-"` + // Value - The pending updates + Value *[]Update `json:"value,omitempty"` +} + +// Operation represents an operation returned by the GetOperations request +type Operation struct { + // Name - Name of the operation + Name *string `json:"name,omitempty"` + // Display - Display name of the operation + Display *OperationInfo `json:"display,omitempty"` + // Origin - Origin of the operation + Origin *string `json:"origin,omitempty"` + // Properties - Properties of the operation + Properties interface{} `json:"properties,omitempty"` +} + +// OperationInfo information about an operation +type OperationInfo struct { + // Provider - Name of the provider + Provider *string `json:"provider,omitempty"` + // Resource - Name of the resource type + Resource *string `json:"resource,omitempty"` + // Operation - Name of the operation + Operation *string `json:"operation,omitempty"` + // Description - Description of the operation + Description *string `json:"description,omitempty"` +} + +// OperationsListResult result of the List Operations operation +type OperationsListResult struct { + autorest.Response `json:"-"` + // Value - A collection of operations + Value *[]Operation `json:"value,omitempty"` +} + +// Resource definition of a Resource +type Resource struct { + // ID - READ-ONLY; Fully qualified identifier of the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the resource + Type *string `json:"type,omitempty"` +} + +// Update maintenance update on a resource +type Update struct { + // MaintenanceScope - The impact area. Possible values include: 'ScopeAll', 'ScopeHost', 'ScopeResource', 'ScopeInResource' + MaintenanceScope Scope `json:"maintenanceScope,omitempty"` + // ImpactType - The impact type. Possible values include: 'None', 'Freeze', 'Restart', 'Redeploy' + ImpactType ImpactType `json:"impactType,omitempty"` + // Status - The status. Possible values include: 'Pending', 'InProgress', 'Completed', 'RetryNow', 'RetryLater' + Status UpdateStatus `json:"status,omitempty"` + // ImpactDurationInSec - Duration of impact in seconds + ImpactDurationInSec *int32 `json:"impactDurationInSec,omitempty"` + // NotBefore - Time when Azure will start force updates if not self-updated by customer before this time + NotBefore *date.Time `json:"notBefore,omitempty"` + // UpdateProperties - Properties of the apply update + *UpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Update. +func (u Update) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if u.MaintenanceScope != "" { + objectMap["maintenanceScope"] = u.MaintenanceScope + } + if u.ImpactType != "" { + objectMap["impactType"] = u.ImpactType + } + if u.Status != "" { + objectMap["status"] = u.Status + } + if u.ImpactDurationInSec != nil { + objectMap["impactDurationInSec"] = u.ImpactDurationInSec + } + if u.NotBefore != nil { + objectMap["notBefore"] = u.NotBefore + } + if u.UpdateProperties != nil { + objectMap["properties"] = u.UpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Update struct. +func (u *Update) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "maintenanceScope": + if v != nil { + var maintenanceScope Scope + err = json.Unmarshal(*v, &maintenanceScope) + if err != nil { + return err + } + u.MaintenanceScope = maintenanceScope + } + case "impactType": + if v != nil { + var impactType ImpactType + err = json.Unmarshal(*v, &impactType) + if err != nil { + return err + } + u.ImpactType = impactType + } + case "status": + if v != nil { + var status UpdateStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + u.Status = status + } + case "impactDurationInSec": + if v != nil { + var impactDurationInSec int32 + err = json.Unmarshal(*v, &impactDurationInSec) + if err != nil { + return err + } + u.ImpactDurationInSec = &impactDurationInSec + } + case "notBefore": + if v != nil { + var notBefore date.Time + err = json.Unmarshal(*v, ¬Before) + if err != nil { + return err + } + u.NotBefore = ¬Before + } + case "properties": + if v != nil { + var updateProperties UpdateProperties + err = json.Unmarshal(*v, &updateProperties) + if err != nil { + return err + } + u.UpdateProperties = &updateProperties + } + } + } + + return nil +} + +// UpdateProperties properties for update +type UpdateProperties struct { + // ResourceID - The resourceId + ResourceID *string `json:"resourceId,omitempty"` +} diff --git a/services/preview/machinelearning/mgmt/2018-03-01-preview/services/operations.go b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/operations.go old mode 100644 new mode 100755 similarity index 76% rename from services/preview/machinelearning/mgmt/2018-03-01-preview/services/operations.go rename to services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/operations.go index c37ea63911b8..0f45be5df825 --- a/services/preview/machinelearning/mgmt/2018-03-01-preview/services/operations.go +++ b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/operations.go @@ -1,4 +1,4 @@ -package services +package maintenance // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,7 +25,7 @@ import ( "net/http" ) -// OperationsClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. +// OperationsClient is the azure Maintenance Management Client type OperationsClient struct { BaseClient } @@ -40,8 +40,8 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera 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) { +// List list the available operations supported by the Microsoft.Maintenance resource provider +func (client OperationsClient) List(ctx context.Context) (result OperationsListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -54,20 +54,20 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe } req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "services.OperationsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "maintenance.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, "services.OperationsClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "maintenance.OperationsClient", "List", resp, "Failure sending request") return } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "services.OperationsClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "maintenance.OperationsClient", "List", resp, "Failure responding to request") } return @@ -75,7 +75,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-03-01-preview" + const APIVersion = "2018-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -83,7 +83,7 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.MachineLearningServices/operations"), + autorest.WithPath("/providers/Microsoft.Maintenance/operations"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -91,13 +91,13 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, // 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 autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) } // 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) { +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationsListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/updates.go b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/updates.go new file mode 100755 index 000000000000..1647a556fffb --- /dev/null +++ b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/updates.go @@ -0,0 +1,207 @@ +package maintenance + +// 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" +) + +// UpdatesClient is the azure Maintenance Management Client +type UpdatesClient struct { + BaseClient +} + +// NewUpdatesClient creates an instance of the UpdatesClient client. +func NewUpdatesClient(subscriptionID string) UpdatesClient { + return NewUpdatesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUpdatesClientWithBaseURI creates an instance of the UpdatesClient client. +func NewUpdatesClientWithBaseURI(baseURI string, subscriptionID string) UpdatesClient { + return UpdatesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List get updates to resources. +// Parameters: +// resourceGroupName - resource group name +// providerName - resource provider name +// resourceType - resource type +// resourceName - resource identifier +func (client UpdatesClient) List(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string) (result ListUpdatesResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UpdatesClient.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, providerName, resourceType, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.UpdatesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.UpdatesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.UpdatesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client UpdatesClient) ListPreparer(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/updates", 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 UpdatesClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client UpdatesClient) ListResponder(resp *http.Response) (result ListUpdatesResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListParent get updates to resources. +// Parameters: +// resourceGroupName - resource group name +// providerName - resource provider name +// resourceParentType - resource parent type +// resourceParentName - resource parent identifier +// resourceType - resource type +// resourceName - resource identifier +func (client UpdatesClient) ListParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string) (result ListUpdatesResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UpdatesClient.ListParent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListParentPreparer(ctx, resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.UpdatesClient", "ListParent", nil, "Failure preparing request") + return + } + + resp, err := client.ListParentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maintenance.UpdatesClient", "ListParent", resp, "Failure sending request") + return + } + + result, err = client.ListParentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maintenance.UpdatesClient", "ListParent", resp, "Failure responding to request") + } + + return +} + +// ListParentPreparer prepares the ListParent request. +func (client UpdatesClient) ListParentPreparer(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerName": autorest.Encode("path", providerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceParentName": autorest.Encode("path", resourceParentName), + "resourceParentType": autorest.Encode("path", resourceParentType), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/updates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListParentSender sends the ListParent request. The method will close the +// http.Response Body if it receives an error. +func (client UpdatesClient) ListParentSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListParentResponder handles the response to the ListParent request. The method always +// closes the http.Response Body. +func (client UpdatesClient) ListParentResponder(resp *http.Response) (result ListUpdatesResult, 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/maintenance/mgmt/2018-06-01-preview/maintenance/version.go b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/version.go new file mode 100755 index 000000000000..dd7474e61c38 --- /dev/null +++ b/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/version.go @@ -0,0 +1,30 @@ +package maintenance + +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.Number + " maintenance/2018-06-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/managednetwork/mgmt/2019-06-01-preview/managednetwork/models.go b/services/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/models.go index 5b1fc536f0d2..c3a952335c4c 100644 --- a/services/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/models.go +++ b/services/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/models.go @@ -107,6 +107,8 @@ type Group struct { 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"` } // MarshalJSON is the custom marshaler for Group. @@ -118,6 +120,9 @@ func (g Group) MarshalJSON() ([]byte, error) { if g.Kind != "" { objectMap["kind"] = g.Kind } + if g.Location != nil { + objectMap["location"] = g.Location + } return json.Marshal(objectMap) } @@ -175,6 +180,15 @@ func (g *Group) UnmarshalJSON(body []byte) error { } g.Type = &typeVar } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + g.Location = &location + } } } @@ -563,16 +577,16 @@ type ManagedNetwork struct { autorest.Response `json:"-"` // Properties - The MNC properties *Properties `json:"properties,omitempty"` - // Tags - Resource tags. - Tags *[]string `json:"tags,omitempty"` - // Location - The geo-location where the resource lives - Location *string `json:"location,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"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` } // MarshalJSON is the custom marshaler for ManagedNetwork. @@ -610,21 +624,12 @@ func (mn *ManagedNetwork) UnmarshalJSON(body []byte) error { } case "tags": if v != nil { - var tags []string + var tags map[string]*string err = json.Unmarshal(*v, &tags) if err != nil { return err } - mn.Tags = &tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - mn.Location = &location + mn.Tags = tags } case "id": if v != nil { @@ -653,6 +658,15 @@ func (mn *ManagedNetwork) UnmarshalJSON(body []byte) error { } mn.Type = &typeVar } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mn.Location = &location + } } } @@ -955,6 +969,8 @@ type PeeringPolicy struct { 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"` } // PeeringPolicyListResult result of the request to list Managed Network Peering Policies. It contains a @@ -1141,6 +1157,8 @@ type ProxyResource struct { 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"` } // Resource the general resource model definition @@ -1151,6 +1169,8 @@ type Resource struct { 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"` } // ResourceID generic pointer to a resource @@ -1190,6 +1210,8 @@ type ScopeAssignment struct { 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"` } // MarshalJSON is the custom marshaler for ScopeAssignment. @@ -1198,6 +1220,9 @@ func (sa ScopeAssignment) MarshalJSON() ([]byte, error) { if sa.ScopeAssignmentProperties != nil { objectMap["properties"] = sa.ScopeAssignmentProperties } + if sa.Location != nil { + objectMap["location"] = sa.Location + } return json.Marshal(objectMap) } @@ -1246,6 +1271,15 @@ func (sa *ScopeAssignment) UnmarshalJSON(body []byte) error { } sa.Type = &typeVar } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sa.Location = &location + } } } @@ -1411,20 +1445,41 @@ type ScopeAssignmentProperties struct { // TrackedResource the resource model definition for a ARM tracked top level resource type TrackedResource struct { - // Tags - Resource tags. - Tags *[]string `json:"tags,omitempty"` - // Location - The geo-location where the resource lives - Location *string `json:"location,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"` + // Location - The geo-location where the resource lives + Location *string `json:"location,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) } // Update update Tags of Managed Network type Update struct { - // Tags - Updates the tags property of the Managed Network - Tags *[]string `json:"tags,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Update. +func (u Update) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if u.Tags != nil { + objectMap["tags"] = u.Tags + } + return json.Marshal(objectMap) } diff --git a/services/preview/peering/mgmt/2019-03-01-preview/peering/client.go b/services/preview/peering/mgmt/2019-03-01-preview/peering/client.go deleted file mode 100644 index b12ac635c7b3..000000000000 --- a/services/preview/peering/mgmt/2019-03-01-preview/peering/client.go +++ /dev/null @@ -1,51 +0,0 @@ -// Package peering implements the Azure ARM Peering service API version 2019-03-01-preview. -// -// APIs to manage Peering resources through the Azure Resource Manager. -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 ( - "github.com/Azure/go-autorest/autorest" -) - -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. -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} diff --git a/services/preview/peering/mgmt/2019-03-01-preview/peering/legacypeerings.go b/services/preview/peering/mgmt/2019-03-01-preview/peering/legacypeerings.go deleted file mode 100644 index eab80163f4f1..000000000000 --- a/services/preview/peering/mgmt/2019-03-01-preview/peering/legacypeerings.go +++ /dev/null @@ -1,156 +0,0 @@ -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 aPIs to manage Peering resources through the Azure Resource Manager. -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. -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. -func (client LegacyPeeringsClient) List(ctx context.Context, peeringLocation string, kind string) (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) - 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) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "kind": autorest.Encode("query", kind), - "peeringLocation": autorest.Encode("query", peeringLocation), - } - - 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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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) (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) - return -} diff --git a/services/preview/peering/mgmt/2019-03-01-preview/peering/locations.go b/services/preview/peering/mgmt/2019-03-01-preview/peering/locations.go deleted file mode 100644 index adadd431ec57..000000000000 --- a/services/preview/peering/mgmt/2019-03-01-preview/peering/locations.go +++ /dev/null @@ -1,154 +0,0 @@ -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 aPIs to manage Peering resources through the Azure Resource Manager. -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. -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. -func (client LocationsClient) List(ctx context.Context, kind 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) - 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) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "kind": autorest.Encode("query", kind), - } - - 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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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) (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) - return -} diff --git a/services/preview/peering/mgmt/2019-03-01-preview/peering/models.go b/services/preview/peering/mgmt/2019-03-01-preview/peering/models.go deleted file mode 100644 index 2d4d3178dd89..000000000000 --- a/services/preview/peering/mgmt/2019-03-01-preview/peering/models.go +++ /dev/null @@ -1,1350 +0,0 @@ -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/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/peering/mgmt/2019-03-01-preview/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} -} - -// 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} -} - -// Name enumerates the values for name. -type Name string - -const ( - // BasicDirectFree ... - BasicDirectFree Name = "Basic_Direct_Free" - // BasicExchangeFree ... - BasicExchangeFree Name = "Basic_Exchange_Free" - // PremiumDirectFree ... - PremiumDirectFree Name = "Premium_Direct_Free" - // PremiumExchangeMetered ... - PremiumExchangeMetered Name = "Premium_Exchange_Metered" -) - -// PossibleNameValues returns an array of possible values for the Name const type. -func PossibleNameValues() []Name { - return []Name{BasicDirectFree, BasicExchangeFree, PremiumDirectFree, PremiumExchangeMetered} -} - -// 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} -} - -// 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" - // 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, 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" - // 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, 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 - READ-ONLY; The IPv4 session address on Microsoft's end. - MicrosoftSessionIPv4Address *string `json:"microsoftSessionIPv4Address,omitempty"` - // MicrosoftSessionIPv6Address - READ-ONLY; 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', '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', '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"` -} - -// ContactInfo the contact information of the peer. -type ContactInfo struct { - // Emails - The list of email addresses. - Emails *[]string `json:"emails,omitempty"` - // Phone - The list of contact numbers. - 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 - The bandwidth that is actually provisioned. - ProvisionedBandwidthInMbps *int32 `json:"provisionedBandwidthInMbps,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"` -} - -// 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"` - // 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"` -} - -// ErrorResponse the error response that indicates why an operation has failed. -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"` -} - -// 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"` -} - -// 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"` - // PeerContactInfo - The contact information of the peer. - PeerContactInfo *ContactInfo `json:"peerContactInfo,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"` -} - -// 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 - 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"` -} - -// 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"` -} - -// 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) -} - -// Sku the SKU that defines the tier and kind of the peering. -type Sku struct { - // Name - The name of the peering SKU. Possible values include: 'BasicExchangeFree', 'BasicDirectFree', 'PremiumDirectFree', 'PremiumExchangeMetered' - Name Name `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"` -} - -// SubResource the sub resource. -type SubResource struct { - // ID - The identifier of the referenced resource. - ID *string `json:"id,omitempty"` -} diff --git a/services/preview/peering/mgmt/2019-03-01-preview/peering/peerasns.go b/services/preview/peering/mgmt/2019-03-01-preview/peering/peerasns.go deleted file mode 100644 index 65a17567fdfc..000000000000 --- a/services/preview/peering/mgmt/2019-03-01-preview/peering/peerasns.go +++ /dev/null @@ -1,379 +0,0 @@ -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 aPIs to manage Peering resources through the Azure Resource Manager. -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. -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 = "2019-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}/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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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 = "2019-03-01-preview" - 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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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 = "2019-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.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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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 = "2019-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.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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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/preview/peering/mgmt/2019-03-01-preview/peering/peeringapi/interfaces.go b/services/preview/peering/mgmt/2019-03-01-preview/peering/peeringapi/interfaces.go deleted file mode 100644 index d25356b6f951..000000000000 --- a/services/preview/peering/mgmt/2019-03-01-preview/peering/peeringapi/interfaces.go +++ /dev/null @@ -1,67 +0,0 @@ -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/preview/peering/mgmt/2019-03-01-preview/peering" - "github.com/Azure/go-autorest/autorest" -) - -// LegacyPeeringsClientAPI contains the set of methods on the LegacyPeeringsClient type. -type LegacyPeeringsClientAPI interface { - List(ctx context.Context, peeringLocation string, kind string) (result peering.ListResultPage, 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) -} - -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) -} - -var _ PeerAsnsClientAPI = (*peering.PeerAsnsClient)(nil) - -// LocationsClientAPI contains the set of methods on the LocationsClient type. -type LocationsClientAPI interface { - List(ctx context.Context, kind string) (result peering.LocationListResultPage, err error) -} - -var _ LocationsClientAPI = (*peering.LocationsClient)(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) - ListBySubscription(ctx context.Context) (result peering.ListResultPage, err error) - Update(ctx context.Context, resourceGroupName string, peeringName string, tags peering.ResourceTags) (result peering.Model, err error) -} - -var _ PeeringsClientAPI = (*peering.PeeringsClient)(nil) diff --git a/services/preview/peering/mgmt/2019-03-01-preview/peering/peerings.go b/services/preview/peering/mgmt/2019-03-01-preview/peering/peerings.go deleted file mode 100644 index 9211239a343e..000000000000 --- a/services/preview/peering/mgmt/2019-03-01-preview/peering/peerings.go +++ /dev/null @@ -1,586 +0,0 @@ -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 aPIs to manage Peering resources through the Azure Resource Manager. -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. -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 = "2019-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.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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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 = "2019-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.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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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 = "2019-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.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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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 = "2019-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.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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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 = "2019-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.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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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 = "2019-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.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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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/preview/peering/mgmt/2019-03-01-preview/peering/version.go b/services/preview/peering/mgmt/2019-03-01-preview/peering/version.go deleted file mode 100644 index 45bb00c0ff28..000000000000 --- a/services/preview/peering/mgmt/2019-03-01-preview/peering/version.go +++ /dev/null @@ -1,30 +0,0 @@ -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.Number + " peering/2019-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/portal/mgmt/2015-11-01-preview/portal/dashboards.go b/services/preview/portal/mgmt/2015-11-01-preview/portal/dashboards.go deleted file mode 100644 index 86d1c0cea26e..000000000000 --- a/services/preview/portal/mgmt/2015-11-01-preview/portal/dashboards.go +++ /dev/null @@ -1,611 +0,0 @@ -package portal - -// 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" -) - -// DashboardsClient is the allows creation and deletion of Azure Shared Dashboards. -type DashboardsClient struct { - BaseClient -} - -// NewDashboardsClient creates an instance of the DashboardsClient client. -func NewDashboardsClient(subscriptionID string) DashboardsClient { - return NewDashboardsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDashboardsClientWithBaseURI creates an instance of the DashboardsClient client. -func NewDashboardsClientWithBaseURI(baseURI string, subscriptionID string) DashboardsClient { - return DashboardsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a Dashboard. -// Parameters: -// resourceGroupName - the name of the resource group. -// dashboardName - the name of the dashboard. -// dashboard - the parameters required to create or update a dashboard. -func (client DashboardsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, dashboardName string, dashboard Dashboard) (result Dashboard, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DashboardsClient.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: dashboardName, - Constraints: []validation.Constraint{{Target: "dashboardName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "dashboardName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: dashboard, - Constraints: []validation.Constraint{{Target: "dashboard.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("portal.DashboardsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, dashboardName, dashboard) - if err != nil { - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DashboardsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, dashboardName string, dashboard Dashboard) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "dashboardName": autorest.Encode("path", dashboardName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-11-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - dashboard.ID = nil - dashboard.Name = nil - dashboard.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.Portal/dashboards/{dashboardName}", pathParameters), - autorest.WithJSON(dashboard), - 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 DashboardsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DashboardsClient) CreateOrUpdateResponder(resp *http.Response) (result Dashboard, 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 Dashboard. -// Parameters: -// resourceGroupName - the name of the resource group. -// dashboardName - the name of the dashboard. -func (client DashboardsClient) Delete(ctx context.Context, resourceGroupName string, dashboardName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DashboardsClient.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: dashboardName, - Constraints: []validation.Constraint{{Target: "dashboardName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "dashboardName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewError("portal.DashboardsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, dashboardName) - if err != nil { - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DashboardsClient) DeletePreparer(ctx context.Context, resourceGroupName string, dashboardName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "dashboardName": autorest.Encode("path", dashboardName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-11-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.Portal/dashboards/{dashboardName}", 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 DashboardsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DashboardsClient) 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 Dashboard. -// Parameters: -// resourceGroupName - the name of the resource group. -// dashboardName - the name of the dashboard. -func (client DashboardsClient) Get(ctx context.Context, resourceGroupName string, dashboardName string) (result Dashboard, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DashboardsClient.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: dashboardName, - Constraints: []validation.Constraint{{Target: "dashboardName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "dashboardName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewError("portal.DashboardsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, dashboardName) - if err != nil { - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client DashboardsClient) GetPreparer(ctx context.Context, resourceGroupName string, dashboardName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "dashboardName": autorest.Encode("path", dashboardName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-11-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.Portal/dashboards/{dashboardName}", 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 DashboardsClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DashboardsClient) GetResponder(resp *http.Response) (result Dashboard, 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 the Dashboards within a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DashboardsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DashboardListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DashboardsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.dlr.Response.Response != nil { - sc = result.dlr.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, "portal.DashboardsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.dlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.dlr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "ListByResourceGroup", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DashboardsClient) 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 = "2015-11-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.Portal/dashboards", 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 DashboardsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DashboardsClient) ListByResourceGroupResponder(resp *http.Response) (result DashboardListResult, 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 DashboardsClient) listByResourceGroupNextResults(ctx context.Context, lastResults DashboardListResult) (result DashboardListResult, err error) { - req, err := lastResults.dashboardListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "portal.DashboardsClient", "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, "portal.DashboardsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DashboardsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DashboardListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DashboardsClient.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 gets all the dashboards within a subscription. -func (client DashboardsClient) ListBySubscription(ctx context.Context) (result DashboardListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DashboardsClient.ListBySubscription") - defer func() { - sc := -1 - if result.dlr.Response.Response != nil { - sc = result.dlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.dlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.dlr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "ListBySubscription", resp, "Failure responding to request") - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client DashboardsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-11-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Portal/dashboards", 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 DashboardsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client DashboardsClient) ListBySubscriptionResponder(resp *http.Response) (result DashboardListResult, 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 DashboardsClient) listBySubscriptionNextResults(ctx context.Context, lastResults DashboardListResult) (result DashboardListResult, err error) { - req, err := lastResults.dashboardListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "portal.DashboardsClient", "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, "portal.DashboardsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client DashboardsClient) ListBySubscriptionComplete(ctx context.Context) (result DashboardListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DashboardsClient.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 an existing Dashboard. -// Parameters: -// resourceGroupName - the name of the resource group. -// dashboardName - the name of the dashboard. -// dashboard - the updatable fields of a Dashboard. -func (client DashboardsClient) Update(ctx context.Context, resourceGroupName string, dashboardName string, dashboard PatchableDashboard) (result Dashboard, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DashboardsClient.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: dashboardName, - Constraints: []validation.Constraint{{Target: "dashboardName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "dashboardName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewError("portal.DashboardsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, dashboardName, dashboard) - if err != nil { - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "portal.DashboardsClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DashboardsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, dashboardName string, dashboard PatchableDashboard) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "dashboardName": autorest.Encode("path", dashboardName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-11-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.Portal/dashboards/{dashboardName}", pathParameters), - autorest.WithJSON(dashboard), - 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 DashboardsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DashboardsClient) UpdateResponder(resp *http.Response) (result Dashboard, 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/portal/mgmt/2015-11-01-preview/portal/models.go b/services/preview/portal/mgmt/2015-11-01-preview/portal/models.go deleted file mode 100644 index c6929c1e2b61..000000000000 --- a/services/preview/portal/mgmt/2015-11-01-preview/portal/models.go +++ /dev/null @@ -1,615 +0,0 @@ -package portal - -// 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/portal/mgmt/2015-11-01-preview/portal" - -// Dashboard the shared dashboard resource definition. -type Dashboard struct { - autorest.Response `json:"-"` - // DashboardProperties - The shared dashboard properties. - *DashboardProperties `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 Dashboard. -func (d Dashboard) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if d.DashboardProperties != nil { - objectMap["properties"] = d.DashboardProperties - } - if d.Location != nil { - objectMap["location"] = d.Location - } - if d.Tags != nil { - objectMap["tags"] = d.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Dashboard struct. -func (d *Dashboard) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dashboardProperties DashboardProperties - err = json.Unmarshal(*v, &dashboardProperties) - if err != nil { - return err - } - d.DashboardProperties = &dashboardProperties - } - 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 - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - d.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - d.Tags = tags - } - } - } - - return nil -} - -// DashboardLens a dashboard lens. -type DashboardLens struct { - // Order - The lens order. - Order *int32 `json:"order,omitempty"` - // Parts - The dashboard parts. - Parts map[string]*DashboardParts `json:"parts"` - // Metadata - The dashboard len's metadata. - Metadata map[string]interface{} `json:"metadata"` -} - -// MarshalJSON is the custom marshaler for DashboardLens. -func (dl DashboardLens) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dl.Order != nil { - objectMap["order"] = dl.Order - } - if dl.Parts != nil { - objectMap["parts"] = dl.Parts - } - if dl.Metadata != nil { - objectMap["metadata"] = dl.Metadata - } - return json.Marshal(objectMap) -} - -// DashboardListResult list of dashboards. -type DashboardListResult struct { - autorest.Response `json:"-"` - // Value - The array of custom resource provider manifests. - Value *[]Dashboard `json:"value,omitempty"` - // NextLink - The URL to use for getting the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// DashboardListResultIterator provides access to a complete listing of Dashboard values. -type DashboardListResultIterator struct { - i int - page DashboardListResultPage -} - -// 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 *DashboardListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DashboardListResultIterator.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 *DashboardListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DashboardListResultIterator) 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 DashboardListResultIterator) Response() DashboardListResult { - 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 DashboardListResultIterator) Value() Dashboard { - if !iter.page.NotDone() { - return Dashboard{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DashboardListResultIterator type. -func NewDashboardListResultIterator(page DashboardListResultPage) DashboardListResultIterator { - return DashboardListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dlr DashboardListResult) IsEmpty() bool { - return dlr.Value == nil || len(*dlr.Value) == 0 -} - -// dashboardListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dlr DashboardListResult) dashboardListResultPreparer(ctx context.Context) (*http.Request, error) { - if dlr.NextLink == nil || len(to.String(dlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dlr.NextLink))) -} - -// DashboardListResultPage contains a page of Dashboard values. -type DashboardListResultPage struct { - fn func(context.Context, DashboardListResult) (DashboardListResult, error) - dlr DashboardListResult -} - -// 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 *DashboardListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DashboardListResultPage.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.dlr) - if err != nil { - return err - } - page.dlr = 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 *DashboardListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DashboardListResultPage) NotDone() bool { - return !page.dlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DashboardListResultPage) Response() DashboardListResult { - return page.dlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DashboardListResultPage) Values() []Dashboard { - if page.dlr.IsEmpty() { - return nil - } - return *page.dlr.Value -} - -// Creates a new instance of the DashboardListResultPage type. -func NewDashboardListResultPage(getNextPage func(context.Context, DashboardListResult) (DashboardListResult, error)) DashboardListResultPage { - return DashboardListResultPage{fn: getNextPage} -} - -// DashboardParts a dashboard part. -type DashboardParts struct { - // Position - The dashboard's part position. - Position *DashboardPartsPosition `json:"position,omitempty"` - // Metadata - The dashboard part's metadata. - Metadata map[string]interface{} `json:"metadata"` -} - -// MarshalJSON is the custom marshaler for DashboardParts. -func (dp DashboardParts) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dp.Position != nil { - objectMap["position"] = dp.Position - } - if dp.Metadata != nil { - objectMap["metadata"] = dp.Metadata - } - return json.Marshal(objectMap) -} - -// DashboardPartsPosition the dashboard's part position. -type DashboardPartsPosition struct { - // X - The dashboard's part x coordinate. - X *float64 `json:"x,omitempty"` - // Y - The dashboard's part y coordinate. - Y *float64 `json:"y,omitempty"` - // RowSpan - The dashboard's part row span. - RowSpan *float64 `json:"rowSpan,omitempty"` - // ColSpan - The dashboard's part column span. - ColSpan *float64 `json:"colSpan,omitempty"` - // Metadata - The dashboard part's metadata. - Metadata map[string]interface{} `json:"metadata"` -} - -// MarshalJSON is the custom marshaler for DashboardPartsPosition. -func (dp DashboardPartsPosition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dp.X != nil { - objectMap["x"] = dp.X - } - if dp.Y != nil { - objectMap["y"] = dp.Y - } - if dp.RowSpan != nil { - objectMap["rowSpan"] = dp.RowSpan - } - if dp.ColSpan != nil { - objectMap["colSpan"] = dp.ColSpan - } - if dp.Metadata != nil { - objectMap["metadata"] = dp.Metadata - } - return json.Marshal(objectMap) -} - -// DashboardProperties the shared dashboard properties. -type DashboardProperties struct { - // Lenses - The dashboard lenses. - Lenses map[string]*DashboardLens `json:"lenses"` - // Metadata - The dashboard metadata. - Metadata map[string]interface{} `json:"metadata"` -} - -// MarshalJSON is the custom marshaler for DashboardProperties. -func (dp DashboardProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dp.Lenses != nil { - objectMap["lenses"] = dp.Lenses - } - if dp.Metadata != nil { - objectMap["metadata"] = dp.Metadata - } - return json.Marshal(objectMap) -} - -// ErrorDefinition error definition. -type ErrorDefinition struct { - // Code - READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; Description of the error. - Message *string `json:"message,omitempty"` - // Details - READ-ONLY; Internal error details. - Details *[]ErrorDefinition `json:"details,omitempty"` -} - -// ErrorResponse error response. -type ErrorResponse struct { - // Error - The error details. - Error *ErrorDefinition `json:"error,omitempty"` -} - -// PatchableDashboard the shared dashboard resource definition. -type PatchableDashboard struct { - // DashboardProperties - The shared dashboard properties. - *DashboardProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for PatchableDashboard. -func (pd PatchableDashboard) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pd.DashboardProperties != nil { - objectMap["properties"] = pd.DashboardProperties - } - if pd.Tags != nil { - objectMap["tags"] = pd.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PatchableDashboard struct. -func (pd *PatchableDashboard) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dashboardProperties DashboardProperties - err = json.Unmarshal(*v, &dashboardProperties) - if err != nil { - return err - } - pd.DashboardProperties = &dashboardProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pd.Tags = tags - } - } - } - - return nil -} - -// ResourceProviderOperation supported operations of this resource provider. -type ResourceProviderOperation struct { - // Name - Operation name, in format of {provider}/{resource}/{operation} - Name *string `json:"name,omitempty"` - // IsDataAction - Indicates whether the operation applies to data-plane. - IsDataAction *string `json:"isDataAction,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 Custom Providers. - 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 results 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"` - // NextLink - The URL to use for getting the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResourceProviderOperationListIterator provides access to a complete listing of ResourceProviderOperation -// values. -type ResourceProviderOperationListIterator struct { - i int - page ResourceProviderOperationListPage -} - -// 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 *ResourceProviderOperationListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceProviderOperationListIterator.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 *ResourceProviderOperationListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResourceProviderOperationListIterator) 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 ResourceProviderOperationListIterator) Response() ResourceProviderOperationList { - 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 ResourceProviderOperationListIterator) Value() ResourceProviderOperation { - if !iter.page.NotDone() { - return ResourceProviderOperation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResourceProviderOperationListIterator type. -func NewResourceProviderOperationListIterator(page ResourceProviderOperationListPage) ResourceProviderOperationListIterator { - return ResourceProviderOperationListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rpol ResourceProviderOperationList) IsEmpty() bool { - return rpol.Value == nil || len(*rpol.Value) == 0 -} - -// resourceProviderOperationListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rpol ResourceProviderOperationList) resourceProviderOperationListPreparer(ctx context.Context) (*http.Request, error) { - if rpol.NextLink == nil || len(to.String(rpol.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rpol.NextLink))) -} - -// ResourceProviderOperationListPage contains a page of ResourceProviderOperation values. -type ResourceProviderOperationListPage struct { - fn func(context.Context, ResourceProviderOperationList) (ResourceProviderOperationList, error) - rpol ResourceProviderOperationList -} - -// 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 *ResourceProviderOperationListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceProviderOperationListPage.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.rpol) - if err != nil { - return err - } - page.rpol = 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 *ResourceProviderOperationListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResourceProviderOperationListPage) NotDone() bool { - return !page.rpol.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResourceProviderOperationListPage) Response() ResourceProviderOperationList { - return page.rpol -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResourceProviderOperationListPage) Values() []ResourceProviderOperation { - if page.rpol.IsEmpty() { - return nil - } - return *page.rpol.Value -} - -// Creates a new instance of the ResourceProviderOperationListPage type. -func NewResourceProviderOperationListPage(getNextPage func(context.Context, ResourceProviderOperationList) (ResourceProviderOperationList, error)) ResourceProviderOperationListPage { - return ResourceProviderOperationListPage{fn: getNextPage} -} diff --git a/services/preview/portal/mgmt/2015-11-01-preview/portal/portalapi/interfaces.go b/services/preview/portal/mgmt/2015-11-01-preview/portal/portalapi/interfaces.go deleted file mode 100644 index 6b1485c93fcb..000000000000 --- a/services/preview/portal/mgmt/2015-11-01-preview/portal/portalapi/interfaces.go +++ /dev/null @@ -1,43 +0,0 @@ -package portalapi - -// 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/portal/mgmt/2015-11-01-preview/portal" - "github.com/Azure/go-autorest/autorest" -) - -// OperationsClientAPI contains the set of methods on the OperationsClient type. -type OperationsClientAPI interface { - List(ctx context.Context) (result portal.ResourceProviderOperationListPage, err error) -} - -var _ OperationsClientAPI = (*portal.OperationsClient)(nil) - -// DashboardsClientAPI contains the set of methods on the DashboardsClient type. -type DashboardsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, dashboardName string, dashboard portal.Dashboard) (result portal.Dashboard, err error) - Delete(ctx context.Context, resourceGroupName string, dashboardName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, dashboardName string) (result portal.Dashboard, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string) (result portal.DashboardListResultPage, err error) - ListBySubscription(ctx context.Context) (result portal.DashboardListResultPage, err error) - Update(ctx context.Context, resourceGroupName string, dashboardName string, dashboard portal.PatchableDashboard) (result portal.Dashboard, err error) -} - -var _ DashboardsClientAPI = (*portal.DashboardsClient)(nil) diff --git a/services/preview/portal/mgmt/2015-11-01-preview/portal/version.go b/services/preview/portal/mgmt/2015-11-01-preview/portal/version.go deleted file mode 100644 index 6db01fdc129b..000000000000 --- a/services/preview/portal/mgmt/2015-11-01-preview/portal/version.go +++ /dev/null @@ -1,30 +0,0 @@ -package portal - -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.Number + " portal/2015-11-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/reservations/mgmt/2019-04-01/reservations/client.go b/services/preview/reservations/mgmt/2019-04-01/reservations/client.go index dcb86a49a12b..27662ed4f1de 100644 --- a/services/preview/reservations/mgmt/2019-04-01/reservations/client.go +++ b/services/preview/reservations/mgmt/2019-04-01/reservations/client.go @@ -52,7 +52,8 @@ func NewWithBaseURI(baseURI string) BaseClient { } } -// GetAppliedReservationList get applicable `Reservation`s that are applied to this subscription. +// GetAppliedReservationList get applicable `Reservation`s that are applied to this subscription or a resource group +// under this subscription. // Parameters: // subscriptionID - id of the subscription func (client BaseClient) GetAppliedReservationList(ctx context.Context, subscriptionID string) (result AppliedReservations, err error) { diff --git a/services/preview/reservations/mgmt/2019-04-01/reservations/models.go b/services/preview/reservations/mgmt/2019-04-01/reservations/models.go index 6cc43ecb16d1..6e01aed5501e 100644 --- a/services/preview/reservations/mgmt/2019-04-01/reservations/models.go +++ b/services/preview/reservations/mgmt/2019-04-01/reservations/models.go @@ -182,6 +182,40 @@ func PossibleInstanceFlexibilityValues() []InstanceFlexibility { return []InstanceFlexibility{Off, On} } +// PaymentStatus enumerates the values for payment status. +type PaymentStatus string + +const ( + // Cancelled ... + Cancelled PaymentStatus = "Cancelled" + // Failed ... + Failed PaymentStatus = "Failed" + // Scheduled ... + Scheduled PaymentStatus = "Scheduled" + // Succeeded ... + Succeeded PaymentStatus = "Succeeded" +) + +// PossiblePaymentStatusValues returns an array of possible values for the PaymentStatus const type. +func PossiblePaymentStatusValues() []PaymentStatus { + return []PaymentStatus{Cancelled, Failed, Scheduled, Succeeded} +} + +// ReservationBillingPlan enumerates the values for reservation billing plan. +type ReservationBillingPlan string + +const ( + // Monthly ... + Monthly ReservationBillingPlan = "Monthly" + // Upfront ... + Upfront ReservationBillingPlan = "Upfront" +) + +// PossibleReservationBillingPlanValues returns an array of possible values for the ReservationBillingPlan const type. +func PossibleReservationBillingPlanValues() []ReservationBillingPlan { + return []ReservationBillingPlan{Monthly, Upfront} +} + // ReservationTerm enumerates the values for reservation term. type ReservationTerm string @@ -357,6 +391,7 @@ type CalculatePriceResponseProperties struct { SkuDescription *string `json:"skuDescription,omitempty"` // PricingCurrencyTotal - Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. PricingCurrencyTotal *CalculatePriceResponsePropertiesPricingCurrencyTotal `json:"pricingCurrencyTotal,omitempty"` + PaymentSchedule *[]PaymentDetail `json:"paymentSchedule,omitempty"` } // CalculatePriceResponsePropertiesBillingCurrencyTotal currency and amount that customer will be charged @@ -379,6 +414,8 @@ type Catalog struct { ResourceType *string `json:"resourceType,omitempty"` // Name - READ-ONLY; The name of SKU Name *string `json:"name,omitempty"` + // BillingPlans - The billing plan options available for this SKU. + BillingPlans *[]CatalogBillingPlansItem `json:"billingPlans,omitempty"` // Terms - READ-ONLY; Available reservation terms for this resource Terms *[]ReservationTerm `json:"terms,omitempty"` // Locations - READ-ONLY @@ -389,6 +426,62 @@ type Catalog struct { Restrictions *[]SkuRestriction `json:"restrictions,omitempty"` } +// CatalogBillingPlansItem ... +type CatalogBillingPlansItem struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string][]ReservationBillingPlan `json:""` + // Name - The term for the billing SKU is available for. Possible values include: 'P1Y', 'P3Y' + Name ReservationTerm `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for CatalogBillingPlansItem. +func (cPi CatalogBillingPlansItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cPi.Name != "" { + objectMap["name"] = cPi.Name + } + for k, v := range cPi.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CatalogBillingPlansItem struct. +func (cPi *CatalogBillingPlansItem) UnmarshalJSON(body []byte) 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 []ReservationBillingPlan + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if cPi.AdditionalProperties == nil { + cPi.AdditionalProperties = make(map[string][]ReservationBillingPlan) + } + cPi.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name ReservationTerm + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cPi.Name = name + } + } + } + + return nil +} + // Error ... type Error struct { Error *ExtendedErrorInfo `json:"error,omitempty"` @@ -778,6 +871,17 @@ type OperationResponse struct { Origin *string `json:"origin,omitempty"` } +// OrderBillingPlanInformation information describing the type of billing plan for this reservation. +type OrderBillingPlanInformation struct { + // PricingCurrencyTotal - Amount of money to be paid for the Order. Tax is not included. + PricingCurrencyTotal *Price `json:"pricingCurrencyTotal,omitempty"` + // StartDate - Date when the billing plan has started. + StartDate *date.Date `json:"startDate,omitempty"` + // NextPaymentDueDate - For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off. + NextPaymentDueDate *date.Date `json:"nextPaymentDueDate,omitempty"` + Transactions *[]PaymentDetail `json:"transactions,omitempty"` +} + // OrderList ... type OrderList struct { autorest.Response `json:"-"` @@ -937,8 +1041,11 @@ type OrderProperties struct { // Term - Possible values include: 'P1Y', 'P3Y' Term ReservationTerm `json:"term,omitempty"` // ProvisioningState - Current state of the reservation. - ProvisioningState *string `json:"provisioningState,omitempty"` - ReservationsProperty *[]Response `json:"reservations,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + // BillingPlan - Possible values include: 'Upfront', 'Monthly' + BillingPlan ReservationBillingPlan `json:"billingPlan,omitempty"` + PlanInformation *OrderBillingPlanInformation `json:"planInformation,omitempty"` + ReservationsProperty *[]Response `json:"reservations,omitempty"` } // OrderPurchaseFuture an abstraction for monitoring and retrieving the results of a long-running @@ -1111,6 +1218,30 @@ type PatchPropertiesRenewProperties struct { PurchaseProperties *PurchaseRequest `json:"purchaseProperties,omitempty"` } +// PaymentDetail information about payment related to a reservation order. +type PaymentDetail struct { + // DueDate - Date when the payment needs to be done. + DueDate *date.Date `json:"dueDate,omitempty"` + // PaymentDate - Date when the transaction is completed. Is null when it is scheduled. + PaymentDate *date.Date `json:"paymentDate,omitempty"` + // PricingCurrencyTotal - Amount in pricing currency. Tax not included. + PricingCurrencyTotal *Price `json:"pricingCurrencyTotal,omitempty"` + // BillingCurrencyTotal - Amount charged in Billing currency. Tax not included. Is null for future payments + BillingCurrencyTotal *Price `json:"billingCurrencyTotal,omitempty"` + // BillingAccount - Shows the Account that is charged for this payment. + BillingAccount *string `json:"billingAccount,omitempty"` + // Status - Possible values include: 'Succeeded', 'Failed', 'Scheduled', 'Cancelled' + Status PaymentStatus `json:"status,omitempty"` + ExtendedStatusInfo *ExtendedStatusInfo `json:"extendedStatusInfo,omitempty"` +} + +// Price ... +type Price struct { + // CurrencyCode - The ISO 4217 3-letter currency code for the currency used by this purchase record. + CurrencyCode *string `json:"currencyCode,omitempty"` + Amount *float64 `json:"amount,omitempty"` +} + // Properties ... type Properties struct { autorest.Response `json:"-"` @@ -1138,12 +1269,14 @@ type PropertiesType struct { // ExpiryDate - This is the date when the Reservation will expire. ExpiryDate *date.Date `json:"expiryDate,omitempty"` // SkuDescription - Description of the SKU in english. - SkuDescription *string `json:"skuDescription,omitempty"` - ExtendedStatusInfo *ExtendedStatusInfo `json:"extendedStatusInfo,omitempty"` - SplitProperties *SplitPropertiesType `json:"splitProperties,omitempty"` - MergeProperties *MergePropertiesType `json:"mergeProperties,omitempty"` - BillingScopeID *string `json:"billingScopeId,omitempty"` - Renew *bool `json:"renew,omitempty"` + SkuDescription *string `json:"skuDescription,omitempty"` + ExtendedStatusInfo *ExtendedStatusInfo `json:"extendedStatusInfo,omitempty"` + // BillingPlan - Possible values include: 'Upfront', 'Monthly' + BillingPlan ReservationBillingPlan `json:"billingPlan,omitempty"` + SplitProperties *SplitPropertiesType `json:"splitProperties,omitempty"` + MergeProperties *MergePropertiesType `json:"mergeProperties,omitempty"` + BillingScopeID *string `json:"billingScopeId,omitempty"` + Renew *bool `json:"renew,omitempty"` // RenewSource - Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. RenewSource *string `json:"renewSource,omitempty"` // RenewDestination - Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. @@ -1224,8 +1357,10 @@ type PurchaseRequestProperties struct { ReservedResourceType ReservedResourceType `json:"reservedResourceType,omitempty"` BillingScopeID *string `json:"billingScopeId,omitempty"` // Term - Possible values include: 'P1Y', 'P3Y' - Term ReservationTerm `json:"term,omitempty"` - Quantity *int32 `json:"quantity,omitempty"` + Term ReservationTerm `json:"term,omitempty"` + // BillingPlan - Possible values include: 'Upfront', 'Monthly' + BillingPlan ReservationBillingPlan `json:"billingPlan,omitempty"` + Quantity *int32 `json:"quantity,omitempty"` // DisplayName - Friendly name of the Reservation DisplayName *string `json:"displayName,omitempty"` // AppliedScopeType - Possible values include: 'Single', 'Shared' diff --git a/services/preview/reservations/mgmt/2019-04-01/reservations/order.go b/services/preview/reservations/mgmt/2019-04-01/reservations/order.go index 912230259b4b..fae3f04b0d82 100644 --- a/services/preview/reservations/mgmt/2019-04-01/reservations/order.go +++ b/services/preview/reservations/mgmt/2019-04-01/reservations/order.go @@ -115,7 +115,8 @@ func (client OrderClient) CalculateResponder(resp *http.Response) (result Calcul // Get get the details of the `ReservationOrder`. // Parameters: // reservationOrderID - order Id of the reservation -func (client OrderClient) Get(ctx context.Context, reservationOrderID string) (result OrderResponse, err error) { +// expand - may be used to expand the planInformation. +func (client OrderClient) Get(ctx context.Context, reservationOrderID string, expand string) (result OrderResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OrderClient.Get") defer func() { @@ -126,7 +127,7 @@ func (client OrderClient) Get(ctx context.Context, reservationOrderID string) (r tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, reservationOrderID) + req, err := client.GetPreparer(ctx, reservationOrderID, expand) if err != nil { err = autorest.NewErrorWithError(err, "reservations.OrderClient", "Get", nil, "Failure preparing request") return @@ -148,7 +149,7 @@ func (client OrderClient) Get(ctx context.Context, reservationOrderID string) (r } // GetPreparer prepares the Get request. -func (client OrderClient) GetPreparer(ctx context.Context, reservationOrderID string) (*http.Request, error) { +func (client OrderClient) GetPreparer(ctx context.Context, reservationOrderID string, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ "reservationOrderId": autorest.Encode("path", reservationOrderID), } @@ -157,6 +158,9 @@ func (client OrderClient) GetPreparer(ctx context.Context, reservationOrderID st queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } preparer := autorest.CreatePreparer( autorest.AsGet(), diff --git a/services/preview/reservations/mgmt/2019-04-01/reservations/reservationsapi/interfaces.go b/services/preview/reservations/mgmt/2019-04-01/reservations/reservationsapi/interfaces.go index 70e8f000f936..35f3341eaf2d 100644 --- a/services/preview/reservations/mgmt/2019-04-01/reservations/reservationsapi/interfaces.go +++ b/services/preview/reservations/mgmt/2019-04-01/reservations/reservationsapi/interfaces.go @@ -46,7 +46,7 @@ var _ ClientAPI = (*reservations.Client)(nil) // OrderClientAPI contains the set of methods on the OrderClient type. type OrderClientAPI interface { Calculate(ctx context.Context, body reservations.PurchaseRequest) (result reservations.CalculatePriceResponse, err error) - Get(ctx context.Context, reservationOrderID string) (result reservations.OrderResponse, err error) + Get(ctx context.Context, reservationOrderID string, expand string) (result reservations.OrderResponse, err error) List(ctx context.Context) (result reservations.OrderListPage, err error) Purchase(ctx context.Context, reservationOrderID string, body reservations.PurchaseRequest) (result reservations.OrderPurchaseFuture, err error) } diff --git a/services/preview/resources/mgmt/2016-09-01-preview/managedapplications/models.go b/services/preview/resources/mgmt/2016-09-01-preview/managedapplications/models.go index 09de4b7b94c0..8cce0884e39b 100644 --- a/services/preview/resources/mgmt/2016-09-01-preview/managedapplications/models.go +++ b/services/preview/resources/mgmt/2016-09-01-preview/managedapplications/models.go @@ -285,7 +285,7 @@ type ApplianceArtifact struct { Name *string `json:"name,omitempty"` // URI - The appliance artifact blob uri. URI *string `json:"uri,omitempty"` - // Type - The the appliance artifact type. Possible values include: 'Template', 'Custom' + // Type - The appliance artifact type. Possible values include: 'Template', 'Custom' Type ApplianceArtifactType `json:"type,omitempty"` } diff --git a/services/preview/security/mgmt/v1.0/security/models.go b/services/preview/security/mgmt/v1.0/security/models.go index 6b41a0671d75..f19291c333e0 100644 --- a/services/preview/security/mgmt/v1.0/security/models.go +++ b/services/preview/security/mgmt/v1.0/security/models.go @@ -96,6 +96,25 @@ func PossibleAlertsToAdminsValues() []AlertsToAdmins { return []AlertsToAdmins{AlertsToAdminsOff, AlertsToAdminsOn} } +// AssessedResourceType enumerates the values for assessed resource type. +type AssessedResourceType string + +const ( + // AssessedResourceTypeAdditionalData ... + AssessedResourceTypeAdditionalData AssessedResourceType = "AdditionalData" + // AssessedResourceTypeContainerRegistryVulnerability ... + AssessedResourceTypeContainerRegistryVulnerability AssessedResourceType = "ContainerRegistryVulnerability" + // AssessedResourceTypeServerVulnerabilityAssessment ... + AssessedResourceTypeServerVulnerabilityAssessment AssessedResourceType = "ServerVulnerabilityAssessment" + // AssessedResourceTypeSQLServerVulnerability ... + AssessedResourceTypeSQLServerVulnerability AssessedResourceType = "SqlServerVulnerability" +) + +// PossibleAssessedResourceTypeValues returns an array of possible values for the AssessedResourceType const type. +func PossibleAssessedResourceTypeValues() []AssessedResourceType { + return []AssessedResourceType{AssessedResourceTypeAdditionalData, AssessedResourceTypeContainerRegistryVulnerability, AssessedResourceTypeServerVulnerabilityAssessment, AssessedResourceTypeSQLServerVulnerability} +} + // AutoProvision enumerates the values for auto provision. type AutoProvision string @@ -212,11 +231,13 @@ const ( Audit EnforcementMode = "Audit" // Enforce ... Enforce EnforcementMode = "Enforce" + // None ... + None EnforcementMode = "None" ) // PossibleEnforcementModeValues returns an array of possible values for the EnforcementMode const type. func PossibleEnforcementModeValues() []EnforcementMode { - return []EnforcementMode{Audit, Enforce} + return []EnforcementMode{Audit, Enforce, None} } // EnforcementMode1 enumerates the values for enforcement mode 1. @@ -227,11 +248,47 @@ const ( EnforcementMode1Audit EnforcementMode1 = "Audit" // EnforcementMode1Enforce ... EnforcementMode1Enforce EnforcementMode1 = "Enforce" + // EnforcementMode1None ... + EnforcementMode1None EnforcementMode1 = "None" ) // PossibleEnforcementMode1Values returns an array of possible values for the EnforcementMode1 const type. func PossibleEnforcementMode1Values() []EnforcementMode1 { - return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce} + return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce, EnforcementMode1None} +} + +// Exe enumerates the values for exe. +type Exe string + +const ( + // ExeAudit ... + ExeAudit Exe = "Audit" + // ExeEnforce ... + ExeEnforce Exe = "Enforce" + // ExeNone ... + ExeNone Exe = "None" +) + +// PossibleExeValues returns an array of possible values for the Exe const type. +func PossibleExeValues() []Exe { + return []Exe{ExeAudit, ExeEnforce, ExeNone} +} + +// Executable enumerates the values for executable. +type Executable string + +const ( + // ExecutableAudit ... + ExecutableAudit Executable = "Audit" + // ExecutableEnforce ... + ExecutableEnforce Executable = "Enforce" + // ExecutableNone ... + ExecutableNone Executable = "None" +) + +// PossibleExecutableValues returns an array of possible values for the Executable const type. +func PossibleExecutableValues() []Executable { + return []Executable{ExecutableAudit, ExecutableEnforce, ExecutableNone} } // ExternalSecuritySolutionKind enumerates the values for external security solution kind. @@ -274,23 +331,23 @@ func PossibleFamilyValues() []Family { type FileType string const ( - // Dll ... - Dll FileType = "Dll" - // Exe ... - Exe FileType = "Exe" - // Executable ... - Executable FileType = "Executable" - // Msi ... - Msi FileType = "Msi" - // Script ... - Script FileType = "Script" - // Unknown ... - Unknown FileType = "Unknown" + // FileTypeDll ... + FileTypeDll FileType = "Dll" + // FileTypeExe ... + FileTypeExe FileType = "Exe" + // FileTypeExecutable ... + FileTypeExecutable FileType = "Executable" + // FileTypeMsi ... + FileTypeMsi FileType = "Msi" + // FileTypeScript ... + FileTypeScript FileType = "Script" + // FileTypeUnknown ... + FileTypeUnknown FileType = "Unknown" ) // PossibleFileTypeValues returns an array of possible values for the FileType const type. func PossibleFileTypeValues() []FileType { - return []FileType{Dll, Exe, Executable, Msi, Script, Unknown} + return []FileType{FileTypeDll, FileTypeExe, FileTypeExecutable, FileTypeMsi, FileTypeScript, FileTypeUnknown} } // Issue enumerates the values for issue. @@ -335,6 +392,23 @@ func PossibleKindEnumValues() []KindEnum { return []KindEnum{KindAAD, KindATA, KindCEF, KindExternalSecuritySolution} } +// Msi enumerates the values for msi. +type Msi string + +const ( + // MsiAudit ... + MsiAudit Msi = "Audit" + // MsiEnforce ... + MsiEnforce Msi = "Enforce" + // MsiNone ... + MsiNone Msi = "None" +) + +// PossibleMsiValues returns an array of possible values for the Msi const type. +func PossibleMsiValues() []Msi { + return []Msi{MsiAudit, MsiEnforce, MsiNone} +} + // PricingTier enumerates the values for pricing tier. type PricingTier string @@ -439,6 +513,23 @@ func PossibleReportedSeverityValues() []ReportedSeverity { return []ReportedSeverity{High, Information, Low, Silent} } +// Script enumerates the values for script. +type Script string + +const ( + // ScriptAudit ... + ScriptAudit Script = "Audit" + // ScriptEnforce ... + ScriptEnforce Script = "Enforce" + // ScriptNone ... + ScriptNone Script = "None" +) + +// PossibleScriptValues returns an array of possible values for the Script const type. +func PossibleScriptValues() []Script { + return []Script{ScriptAudit, ScriptEnforce, ScriptNone} +} + // SettingKind enumerates the values for setting kind. type SettingKind string @@ -454,25 +545,59 @@ func PossibleSettingKindValues() []SettingKind { return []SettingKind{SettingKindAlertSuppressionSetting, SettingKindDataExportSetting} } +// Severity enumerates the values for severity. +type Severity string + +const ( + // SeverityHigh ... + SeverityHigh Severity = "High" + // SeverityLow ... + SeverityLow Severity = "Low" + // SeverityMedium ... + SeverityMedium Severity = "Medium" +) + +// PossibleSeverityValues returns an array of possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{SeverityHigh, SeverityLow, SeverityMedium} +} + +// Source enumerates the values for source. +type Source string + +const ( + // SourceAws ... + SourceAws Source = "Aws" + // SourceAzure ... + SourceAzure Source = "Azure" + // SourceResourceDetails ... + SourceResourceDetails Source = "ResourceDetails" +) + +// PossibleSourceValues returns an array of possible values for the Source const type. +func PossibleSourceValues() []Source { + return []Source{SourceAws, SourceAzure, SourceResourceDetails} +} + // SourceSystem enumerates the values for source system. type SourceSystem string const ( - // AzureAppLocker ... - AzureAppLocker SourceSystem = "Azure_AppLocker" - // AzureAuditD ... - AzureAuditD SourceSystem = "Azure_AuditD" - // NonAzureAppLocker ... - NonAzureAppLocker SourceSystem = "NonAzure_AppLocker" - // NonAzureAuditD ... - NonAzureAuditD SourceSystem = "NonAzure_AuditD" - // None ... - None SourceSystem = "None" + // SourceSystemAzureAppLocker ... + SourceSystemAzureAppLocker SourceSystem = "Azure_AppLocker" + // SourceSystemAzureAuditD ... + SourceSystemAzureAuditD SourceSystem = "Azure_AuditD" + // SourceSystemNonAzureAppLocker ... + SourceSystemNonAzureAppLocker SourceSystem = "NonAzure_AppLocker" + // SourceSystemNonAzureAuditD ... + SourceSystemNonAzureAuditD SourceSystem = "NonAzure_AuditD" + // SourceSystemNone ... + SourceSystemNone SourceSystem = "None" ) // PossibleSourceSystemValues returns an array of possible values for the SourceSystem const type. func PossibleSourceSystemValues() []SourceSystem { - return []SourceSystem{AzureAppLocker, AzureAuditD, NonAzureAppLocker, NonAzureAuditD, None} + return []SourceSystem{SourceSystemAzureAppLocker, SourceSystemAzureAuditD, SourceSystemNonAzureAppLocker, SourceSystemNonAzureAuditD, SourceSystemNone} } // State enumerates the values for state. @@ -527,6 +652,23 @@ func PossibleStatusReasonValues() []StatusReason { return []StatusReason{Expired, NewerRequestInitiated, UserRequested} } +// SubAssessmentStatusCode enumerates the values for sub assessment status code. +type SubAssessmentStatusCode string + +const ( + // Healthy The resource is healthy + Healthy SubAssessmentStatusCode = "Healthy" + // NotApplicable Assessment for this resource did not happen + NotApplicable SubAssessmentStatusCode = "NotApplicable" + // Unhealthy The resource has a security issue that needs to be addressed + Unhealthy SubAssessmentStatusCode = "Unhealthy" +) + +// PossibleSubAssessmentStatusCodeValues returns an array of possible values for the SubAssessmentStatusCode const type. +func PossibleSubAssessmentStatusCodeValues() []SubAssessmentStatusCode { + return []SubAssessmentStatusCode{Healthy, NotApplicable, Unhealthy} +} + // TransportProtocol enumerates the values for transport protocol. type TransportProtocol string @@ -911,6 +1053,100 @@ func NewAdaptiveNetworkHardeningsListPage(getNextPage func(context.Context, Adap return AdaptiveNetworkHardeningsListPage{fn: getNextPage} } +// BasicAdditionalData details of the sub-assessment +type BasicAdditionalData interface { + AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) + AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) + AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) + AsAdditionalData() (*AdditionalData, bool) +} + +// AdditionalData details of the sub-assessment +type AdditionalData struct { + // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' + AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +} + +func unmarshalBasicAdditionalData(body []byte) (BasicAdditionalData, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["assessedResourceType"] { + case string(AssessedResourceTypeSQLServerVulnerability): + var ssvp SQLServerVulnerabilityProperties + err := json.Unmarshal(body, &ssvp) + return ssvp, err + case string(AssessedResourceTypeContainerRegistryVulnerability): + var crvp ContainerRegistryVulnerabilityProperties + err := json.Unmarshal(body, &crvp) + return crvp, err + case string(AssessedResourceTypeServerVulnerabilityAssessment): + var svp ServerVulnerabilityProperties + err := json.Unmarshal(body, &svp) + return svp, err + default: + var ad AdditionalData + err := json.Unmarshal(body, &ad) + return ad, err + } +} +func unmarshalBasicAdditionalDataArray(body []byte) ([]BasicAdditionalData, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + adArray := make([]BasicAdditionalData, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ad, err := unmarshalBasicAdditionalData(*rawMessage) + if err != nil { + return nil, err + } + adArray[index] = ad + } + return adArray, nil +} + +// MarshalJSON is the custom marshaler for AdditionalData. +func (ad AdditionalData) MarshalJSON() ([]byte, error) { + ad.AssessedResourceType = AssessedResourceTypeAdditionalData + objectMap := make(map[string]interface{}) + if ad.AssessedResourceType != "" { + objectMap["assessedResourceType"] = ad.AssessedResourceType + } + return json.Marshal(objectMap) +} + +// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { + return nil, false +} + +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsAdditionalData is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsAdditionalData() (*AdditionalData, bool) { + return &ad, true +} + +// AsBasicAdditionalData is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &ad, true +} + // AdvancedThreatProtectionProperties the Advanced Threat Protection settings. type AdvancedThreatProtectionProperties struct { // IsEnabled - Indicates whether Advanced Threat Protection is enabled. @@ -1671,14 +1907,15 @@ func (awg *AppWhitelistingGroup) UnmarshalJSON(body []byte) error { // AppWhitelistingGroupData represents a VM/server group and set of rules that are Recommended by Azure // Security Center to be allowed type AppWhitelistingGroupData struct { - // EnforcementMode - Possible values include: 'Audit', 'Enforce' + // EnforcementMode - Possible values include: 'Audit', 'Enforce', 'None' EnforcementMode EnforcementMode `json:"enforcementMode,omitempty"` + ProtectionMode *ProtectionMode `json:"protectionMode,omitempty"` // ConfigurationStatus - Possible values include: 'ConfigurationStatus2Configured', 'ConfigurationStatus2NotConfigured', 'ConfigurationStatus2InProgress', 'ConfigurationStatus2Failed', 'ConfigurationStatus2NoStatus' ConfigurationStatus ConfigurationStatus2 `json:"configurationStatus,omitempty"` // RecommendationStatus - Possible values include: 'RecommendationStatusRecommended', 'RecommendationStatusNotRecommended', 'RecommendationStatusNotAvailable', 'RecommendationStatusNoStatus' RecommendationStatus RecommendationStatus `json:"recommendationStatus,omitempty"` Issues *[]AppWhitelistingIssueSummary `json:"issues,omitempty"` - // SourceSystem - Possible values include: 'AzureAppLocker', 'AzureAuditD', 'NonAzureAppLocker', 'NonAzureAuditD', 'None' + // SourceSystem - Possible values include: 'SourceSystemAzureAppLocker', 'SourceSystemAzureAuditD', 'SourceSystemNonAzureAppLocker', 'SourceSystemNonAzureAuditD', 'SourceSystemNone' SourceSystem SourceSystem `json:"sourceSystem,omitempty"` VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` @@ -1701,8 +1938,10 @@ type AppWhitelistingIssueSummary struct { // AppWhitelistingPutGroupData the altered data of the recommended VM/server group policy type AppWhitelistingPutGroupData struct { - // EnforcementMode - Possible values include: 'EnforcementMode1Audit', 'EnforcementMode1Enforce' - EnforcementMode EnforcementMode1 `json:"enforcementMode,omitempty"` + // EnforcementMode - The enforcement mode of the group. Can also be defined per collection type by using ProtectionMode. Possible values include: 'EnforcementMode1Audit', 'EnforcementMode1Enforce', 'EnforcementMode1None' + EnforcementMode EnforcementMode1 `json:"enforcementMode,omitempty"` + // ProtectionMode - The protection mode of the group per collection type. Can also be defined for all collection types by using EnforcementMode + ProtectionMode *ProtectionMode `json:"protectionMode,omitempty"` VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` } @@ -2238,6 +2477,84 @@ type AutoProvisioningSettingProperties struct { AutoProvision AutoProvision `json:"autoProvision,omitempty"` } +// AwsResourceDetails details of the resource that was assessed +type AwsResourceDetails struct { + // AccountID - READ-ONLY; AWS account ID + AccountID *string `json:"accountId,omitempty"` + // AwsResourceID - READ-ONLY; AWS resource ID. can be ARN or other + AwsResourceID *string `json:"awsResourceId,omitempty"` + // Source - Possible values include: 'SourceResourceDetails', 'SourceAzure', 'SourceAws' + Source Source `json:"source,omitempty"` +} + +// MarshalJSON is the custom marshaler for AwsResourceDetails. +func (ard AwsResourceDetails) MarshalJSON() ([]byte, error) { + ard.Source = SourceAws + objectMap := make(map[string]interface{}) + if ard.Source != "" { + objectMap["source"] = ard.Source + } + return json.Marshal(objectMap) +} + +// AsAzureResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. +func (ard AwsResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { + return nil, false +} + +// AsAwsResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. +func (ard AwsResourceDetails) AsAwsResourceDetails() (*AwsResourceDetails, bool) { + return &ard, true +} + +// AsResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. +func (ard AwsResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { + return nil, false +} + +// AsBasicResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. +func (ard AwsResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { + return &ard, true +} + +// AzureResourceDetails details of the resource that was assessed +type AzureResourceDetails struct { + // ID - READ-ONLY; Azure resource ID of the assessed resource + ID *string `json:"id,omitempty"` + // Source - Possible values include: 'SourceResourceDetails', 'SourceAzure', 'SourceAws' + Source Source `json:"source,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureResourceDetails. +func (ard AzureResourceDetails) MarshalJSON() ([]byte, error) { + ard.Source = SourceAzure + objectMap := make(map[string]interface{}) + if ard.Source != "" { + objectMap["source"] = ard.Source + } + return json.Marshal(objectMap) +} + +// AsAzureResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { + return &ard, true +} + +// AsAwsResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsAwsResourceDetails() (*AwsResourceDetails, bool) { + return nil, false +} + +// AsResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { + return nil, false +} + +// AsBasicResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { + return &ard, true +} + // CefExternalSecuritySolution represents a security solution which sends CEF logs to an OMS workspace type CefExternalSecuritySolution struct { Properties *CefSolutionProperties `json:"properties,omitempty"` @@ -2954,6 +3271,64 @@ type ContactProperties struct { AlertsToAdmins AlertsToAdmins `json:"alertsToAdmins,omitempty"` } +// ContainerRegistryVulnerabilityProperties additional context fields for container registry Vulnerability +// assessment +type ContainerRegistryVulnerabilityProperties struct { + // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, Vulnerability + 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"` + // PublishedTime - READ-ONLY; Published time + PublishedTime *date.Time `json:"publishedTime,omitempty"` + // VendorReferences - READ-ONLY + VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` + // RepositoryName - READ-ONLY; Name of the repository which the vulnerable image belongs to + RepositoryName *string `json:"repositoryName,omitempty"` + // ImageDigest - READ-ONLY; Digest of the vulnerable image + ImageDigest *string `json:"imageDigest,omitempty"` + // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' + AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) MarshalJSON() ([]byte, error) { + crvp.AssessedResourceType = AssessedResourceTypeContainerRegistryVulnerability + objectMap := make(map[string]interface{}) + if crvp.AssessedResourceType != "" { + objectMap["assessedResourceType"] = crvp.AssessedResourceType + } + return json.Marshal(objectMap) +} + +// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { + return &crvp, true +} + +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsAdditionalData is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { + return nil, false +} + +// AsBasicAdditionalData is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &crvp, true +} + // CustomAlertRule a custom alert rule type CustomAlertRule struct { // DisplayName - READ-ONLY; The display name of the custom alert. @@ -2966,6 +3341,20 @@ type CustomAlertRule struct { RuleType *string `json:"ruleType,omitempty"` } +// CVE CVE details +type CVE struct { + // Title - READ-ONLY; CVE title + Title *string `json:"title,omitempty"` + // Link - READ-ONLY; Link url + Link *string `json:"link,omitempty"` +} + +// CVSS CVSS details +type CVSS struct { + // Base - READ-ONLY; CVSS base + Base *float64 `json:"base,omitempty"` +} + // DataExportSetting represents a data export setting type DataExportSetting struct { // DataExportSettingProperties - Data export setting data @@ -4468,6 +4857,8 @@ type JitNetworkAccessPolicyInitiatePort struct { type JitNetworkAccessPolicyInitiateRequest struct { // VirtualMachines - A list of virtual machines & ports to open access for VirtualMachines *[]JitNetworkAccessPolicyInitiateVirtualMachine `json:"virtualMachines,omitempty"` + // Justification - The justification for making the initiate request + Justification *string `json:"justification,omitempty"` } // JitNetworkAccessPolicyInitiateVirtualMachine ... @@ -4518,6 +4909,8 @@ type JitNetworkAccessRequest struct { StartTimeUtc *date.Time `json:"startTimeUtc,omitempty"` // Requestor - The identity of the person who made the request Requestor *string `json:"requestor,omitempty"` + // Justification - The justification for making the initiate request + Justification *string `json:"justification,omitempty"` } // JitNetworkAccessRequestPort ... @@ -4751,7 +5144,7 @@ type PathRecommendation struct { Common *bool `json:"common,omitempty"` UserSids *[]string `json:"userSids,omitempty"` Usernames *[]UserRecommendation `json:"usernames,omitempty"` - // FileType - Possible values include: 'Exe', 'Dll', 'Msi', 'Script', 'Executable', 'Unknown' + // FileType - Possible values include: 'FileTypeExe', 'FileTypeDll', 'FileTypeMsi', 'FileTypeScript', 'FileTypeExecutable', 'FileTypeUnknown' FileType FileType `json:"fileType,omitempty"` // ConfigurationStatus - Possible values include: 'ConfigurationStatus1Configured', 'ConfigurationStatus1NotConfigured', 'ConfigurationStatus1InProgress', 'ConfigurationStatus1Failed', 'ConfigurationStatus1NoStatus' ConfigurationStatus ConfigurationStatus1 `json:"configurationStatus,omitempty"` @@ -4982,6 +5375,19 @@ type PricingProperties struct { PricingTier PricingTier `json:"pricingTier,omitempty"` } +// ProtectionMode the protection mode of the collection/file types. Exe/Msi/Script are used for Windows, +// Executable is used for Linux. +type ProtectionMode struct { + // Exe - Possible values include: 'ExeAudit', 'ExeEnforce', 'ExeNone' + Exe Exe `json:"exe,omitempty"` + // Msi - Possible values include: 'MsiAudit', 'MsiEnforce', 'MsiNone' + Msi Msi `json:"msi,omitempty"` + // Script - Possible values include: 'ScriptAudit', 'ScriptEnforce', 'ScriptNone' + Script Script `json:"script,omitempty"` + // Executable - Possible values include: 'ExecutableAudit', 'ExecutableEnforce', 'ExecutableNone' + Executable Executable `json:"executable,omitempty"` +} + // PublisherInfo represents the publisher information of a process/rule type PublisherInfo struct { // PublisherName - The Subject field of the x.509 certificate used to sign the code, using the following fields - O = Organization, L = Locality, S = State or Province, and C = Country @@ -5710,6 +6116,90 @@ type Resource struct { Type *string `json:"type,omitempty"` } +// BasicResourceDetails details of the resource that was assessed +type BasicResourceDetails interface { + AsAzureResourceDetails() (*AzureResourceDetails, bool) + AsAwsResourceDetails() (*AwsResourceDetails, bool) + AsResourceDetails() (*ResourceDetails, bool) +} + +// ResourceDetails details of the resource that was assessed +type ResourceDetails struct { + // Source - Possible values include: 'SourceResourceDetails', 'SourceAzure', 'SourceAws' + Source Source `json:"source,omitempty"` +} + +func unmarshalBasicResourceDetails(body []byte) (BasicResourceDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["source"] { + case string(SourceAzure): + var ard AzureResourceDetails + err := json.Unmarshal(body, &ard) + return ard, err + case string(SourceAws): + var ard AwsResourceDetails + err := json.Unmarshal(body, &ard) + return ard, err + default: + var rd ResourceDetails + err := json.Unmarshal(body, &rd) + return rd, err + } +} +func unmarshalBasicResourceDetailsArray(body []byte) ([]BasicResourceDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rdArray := make([]BasicResourceDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rd, err := unmarshalBasicResourceDetails(*rawMessage) + if err != nil { + return nil, err + } + rdArray[index] = rd + } + return rdArray, nil +} + +// MarshalJSON is the custom marshaler for ResourceDetails. +func (rd ResourceDetails) MarshalJSON() ([]byte, error) { + rd.Source = SourceResourceDetails + objectMap := make(map[string]interface{}) + if rd.Source != "" { + objectMap["source"] = rd.Source + } + return json.Marshal(objectMap) +} + +// AsAzureResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { + return nil, false +} + +// AsAwsResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsAwsResourceDetails() (*AwsResourceDetails, bool) { + return nil, false +} + +// AsResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { + return &rd, true +} + +// AsBasicResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { + return &rd, true +} + // Rule describes remote addresses that is recommended to communicate with the Azure resource on some // (Protocol, Port, Direction). All other remote addresses are recommended to be blocked type Rule struct { @@ -5735,6 +6225,61 @@ type SensitivityLabel struct { 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 +} + +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return &svp, true +} + +// AsAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { + return nil, false +} + +// AsBasicAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &svp, true +} + // Setting represents a security setting in Azure Security Center. type Setting struct { autorest.Response `json:"-"` @@ -5906,6 +6451,405 @@ func NewSettingsListPage(getNextPage func(context.Context, SettingsList) (Settin return SettingsListPage{fn: getNextPage} } +// SQLServerVulnerabilityProperties details of the resource that was assessed +type SQLServerVulnerabilityProperties struct { + // Type - READ-ONLY; The resource type the sub assessment refers to in its resource details + Type *string `json:"type,omitempty"` + // Query - READ-ONLY; The T-SQL query that runs on your SQL database to perform the particular check + Query *string `json:"query,omitempty"` + // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' + AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { + ssvp.AssessedResourceType = AssessedResourceTypeSQLServerVulnerability + objectMap := make(map[string]interface{}) + if ssvp.AssessedResourceType != "" { + objectMap["assessedResourceType"] = ssvp.AssessedResourceType + } + return json.Marshal(objectMap) +} + +// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { + return &ssvp, true +} + +// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { + return nil, false +} + +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsAdditionalData is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { + return nil, false +} + +// AsBasicAdditionalData is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &ssvp, true +} + +// SubAssessment security sub-assessment on a resource +type SubAssessment struct { + autorest.Response `json:"-"` + *SubAssessmentProperties `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 SubAssessment. +func (sa SubAssessment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sa.SubAssessmentProperties != nil { + objectMap["properties"] = sa.SubAssessmentProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SubAssessment struct. +func (sa *SubAssessment) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var subAssessmentProperties SubAssessmentProperties + err = json.Unmarshal(*v, &subAssessmentProperties) + if err != nil { + return err + } + sa.SubAssessmentProperties = &subAssessmentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sa.Type = &typeVar + } + } + } + + return nil +} + +// SubAssessmentList list of security sub-assessments +type SubAssessmentList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY + Value *[]SubAssessment `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// SubAssessmentListIterator provides access to a complete listing of SubAssessment values. +type SubAssessmentListIterator struct { + i int + page SubAssessmentListPage +} + +// 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 *SubAssessmentListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentListIterator.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 *SubAssessmentListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SubAssessmentListIterator) 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 SubAssessmentListIterator) Response() SubAssessmentList { + 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 SubAssessmentListIterator) Value() SubAssessment { + if !iter.page.NotDone() { + return SubAssessment{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SubAssessmentListIterator type. +func NewSubAssessmentListIterator(page SubAssessmentListPage) SubAssessmentListIterator { + return SubAssessmentListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sal SubAssessmentList) IsEmpty() bool { + return sal.Value == nil || len(*sal.Value) == 0 +} + +// subAssessmentListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sal SubAssessmentList) subAssessmentListPreparer(ctx context.Context) (*http.Request, error) { + if sal.NextLink == nil || len(to.String(sal.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sal.NextLink))) +} + +// SubAssessmentListPage contains a page of SubAssessment values. +type SubAssessmentListPage struct { + fn func(context.Context, SubAssessmentList) (SubAssessmentList, error) + sal SubAssessmentList +} + +// 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 *SubAssessmentListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentListPage.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.sal) + if err != nil { + return err + } + page.sal = 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 *SubAssessmentListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SubAssessmentListPage) NotDone() bool { + return !page.sal.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SubAssessmentListPage) Response() SubAssessmentList { + return page.sal +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SubAssessmentListPage) Values() []SubAssessment { + if page.sal.IsEmpty() { + return nil + } + return *page.sal.Value +} + +// Creates a new instance of the SubAssessmentListPage type. +func NewSubAssessmentListPage(getNextPage func(context.Context, SubAssessmentList) (SubAssessmentList, error)) SubAssessmentListPage { + return SubAssessmentListPage{fn: getNextPage} +} + +// SubAssessmentProperties describes properties of an sub-assessment. +type SubAssessmentProperties struct { + // ID - READ-ONLY; Vulnerability ID + ID *string `json:"id,omitempty"` + // DisplayName - READ-ONLY; User friendly display name of the sub-assessment + DisplayName *string `json:"displayName,omitempty"` + Status *SubAssessmentStatus `json:"status,omitempty"` + // Remediation - READ-ONLY; Information on how to remediate this sub-assessment + Remediation *string `json:"remediation,omitempty"` + // Impact - READ-ONLY; Description of the impact of this sub-assessment + Impact *string `json:"impact,omitempty"` + // Category - READ-ONLY; Category of the sub-assessment + Category *string `json:"category,omitempty"` + // Description - READ-ONLY; Human readable description of the assessment status + Description *string `json:"description,omitempty"` + // TimeGenerated - READ-ONLY; The date and time the sub-assessment was generated + TimeGenerated *date.Time `json:"timeGenerated,omitempty"` + ResourceDetails BasicResourceDetails `json:"resourceDetails,omitempty"` + AdditionalData BasicAdditionalData `json:"additionalData,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SubAssessmentProperties struct. +func (sap *SubAssessmentProperties) UnmarshalJSON(body []byte) error { + 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 + } + sap.ID = &ID + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + sap.DisplayName = &displayName + } + case "status": + if v != nil { + var status SubAssessmentStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + sap.Status = &status + } + case "remediation": + if v != nil { + var remediation string + err = json.Unmarshal(*v, &remediation) + if err != nil { + return err + } + sap.Remediation = &remediation + } + case "impact": + if v != nil { + var impact string + err = json.Unmarshal(*v, &impact) + if err != nil { + return err + } + sap.Impact = &impact + } + case "category": + if v != nil { + var category string + err = json.Unmarshal(*v, &category) + if err != nil { + return err + } + sap.Category = &category + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + sap.Description = &description + } + case "timeGenerated": + if v != nil { + var timeGenerated date.Time + err = json.Unmarshal(*v, &timeGenerated) + if err != nil { + return err + } + sap.TimeGenerated = &timeGenerated + } + case "resourceDetails": + if v != nil { + resourceDetails, err := unmarshalBasicResourceDetails(*v) + if err != nil { + return err + } + sap.ResourceDetails = resourceDetails + } + case "additionalData": + if v != nil { + additionalData, err := unmarshalBasicAdditionalData(*v) + if err != nil { + return err + } + sap.AdditionalData = additionalData + } + } + } + + return nil +} + +// SubAssessmentStatus status of the sub-assessment +type SubAssessmentStatus struct { + // Code - READ-ONLY; Programmatic code for the status of the assessment. Possible values include: 'Healthy', 'Unhealthy', 'NotApplicable' + Code SubAssessmentStatusCode `json:"code,omitempty"` + // Cause - READ-ONLY; Programmatic code for the cause of the assessment status + Cause *string `json:"cause,omitempty"` + // Description - READ-ONLY; Human readable description of the assessment status + Description *string `json:"description,omitempty"` + // Severity - READ-ONLY; The sub-assessment severity level. Possible values include: 'SeverityLow', 'SeverityMedium', 'SeverityHigh' + Severity Severity `json:"severity,omitempty"` +} + // Task security task that we recommend to do in order to strengthen security type Task struct { autorest.Response `json:"-"` @@ -6502,6 +7446,14 @@ type UserRecommendation struct { RecommendationAction RecommendationAction1 `json:"recommendationAction,omitempty"` } +// VendorReference vendor reference +type VendorReference struct { + // Title - READ-ONLY; Link title + Title *string `json:"title,omitempty"` + // Link - READ-ONLY; Link url + Link *string `json:"link,omitempty"` +} + // VMRecommendation represents a machine that is part of a VM/server group type VMRecommendation struct { // ConfigurationStatus - Possible values include: 'Configured', 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' 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 06c5df144765..811063e3ef89 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,15 @@ import ( "github.com/Azure/go-autorest/autorest" ) +// 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) + List(ctx context.Context, scope string, assessmentName string) (result security.SubAssessmentListPage, err error) + ListAll(ctx context.Context, scope string) (result security.SubAssessmentListPage, err error) +} + +var _ SubAssessmentsClientAPI = (*security.SubAssessmentsClient)(nil) + // RegulatoryComplianceStandardsClientAPI contains the set of methods on the RegulatoryComplianceStandardsClient type. type RegulatoryComplianceStandardsClientAPI interface { Get(ctx context.Context, regulatoryComplianceStandardName string) (result security.RegulatoryComplianceStandard, err error) diff --git a/services/preview/security/mgmt/v1.0/security/subassessments.go b/services/preview/security/mgmt/v1.0/security/subassessments.go new file mode 100644 index 000000000000..4fa19d8e398d --- /dev/null +++ b/services/preview/security/mgmt/v1.0/security/subassessments.go @@ -0,0 +1,348 @@ +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/tracing" + "net/http" +) + +// SubAssessmentsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type SubAssessmentsClient struct { + BaseClient +} + +// NewSubAssessmentsClient creates an instance of the SubAssessmentsClient client. +func NewSubAssessmentsClient(subscriptionID string, ascLocation string) SubAssessmentsClient { + return NewSubAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSubAssessmentsClientWithBaseURI creates an instance of the SubAssessmentsClient client. +func NewSubAssessmentsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SubAssessmentsClient { + return SubAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get get a security sub-assessment on your scanned resource +// Parameters: +// scope - scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or +// management group (/providers/Microsoft.Management/managementGroups/mgName). +// assessmentName - the Assessment Key - Unique key for the assessment type +// subAssessmentName - the Sub-Assessment Key - Unique key for the sub-assessment type +func (client SubAssessmentsClient) Get(ctx context.Context, scope string, assessmentName string, subAssessmentName string) (result SubAssessment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.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, scope, assessmentName, subAssessmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "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.SubAssessmentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SubAssessmentsClient) GetPreparer(ctx context.Context, scope string, assessmentName string, subAssessmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assessmentName": autorest.Encode("path", assessmentName), + "scope": autorest.Encode("path", scope), + "subAssessmentName": autorest.Encode("path", subAssessmentName), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}", 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 SubAssessmentsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SubAssessmentsClient) GetResponder(resp *http.Response) (result SubAssessment, 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 get security sub-assessments on all your scanned resources inside a scope +// Parameters: +// scope - scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or +// management group (/providers/Microsoft.Management/managementGroups/mgName). +// assessmentName - the Assessment Key - Unique key for the assessment type +func (client SubAssessmentsClient) List(ctx context.Context, scope string, assessmentName string) (result SubAssessmentListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.List") + defer func() { + sc := -1 + if result.sal.Response.Response != nil { + sc = result.sal.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, scope, assessmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sal.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "List", resp, "Failure sending request") + return + } + + result.sal, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SubAssessmentsClient) ListPreparer(ctx context.Context, scope string, assessmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assessmentName": autorest.Encode("path", assessmentName), + "scope": autorest.Encode("path", scope), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments", 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 SubAssessmentsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SubAssessmentsClient) ListResponder(resp *http.Response) (result SubAssessmentList, 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 SubAssessmentsClient) listNextResults(ctx context.Context, lastResults SubAssessmentList) (result SubAssessmentList, err error) { + req, err := lastResults.subAssessmentListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "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.SubAssessmentsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SubAssessmentsClient) ListComplete(ctx context.Context, scope string, assessmentName string) (result SubAssessmentListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.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, scope, assessmentName) + return +} + +// ListAll get security sub-assessments on all your scanned resources inside a subscription scope +// Parameters: +// scope - scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or +// management group (/providers/Microsoft.Management/managementGroups/mgName). +func (client SubAssessmentsClient) ListAll(ctx context.Context, scope string) (result SubAssessmentListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.ListAll") + defer func() { + sc := -1 + if result.sal.Response.Response != nil { + sc = result.sal.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listAllNextResults + req, err := client.ListAllPreparer(ctx, scope) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "ListAll", nil, "Failure preparing request") + return + } + + resp, err := client.ListAllSender(req) + if err != nil { + result.sal.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "ListAll", resp, "Failure sending request") + return + } + + result.sal, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "ListAll", resp, "Failure responding to request") + } + + return +} + +// ListAllPreparer prepares the ListAll request. +func (client SubAssessmentsClient) ListAllPreparer(ctx context.Context, scope string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "scope": autorest.Encode("path", scope), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/subAssessments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAllSender sends the ListAll request. The method will close the +// http.Response Body if it receives an error. +func (client SubAssessmentsClient) ListAllSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListAllResponder handles the response to the ListAll request. The method always +// closes the http.Response Body. +func (client SubAssessmentsClient) ListAllResponder(resp *http.Response) (result SubAssessmentList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAllNextResults retrieves the next set of results, if any. +func (client SubAssessmentsClient) listAllNextResults(ctx context.Context, lastResults SubAssessmentList) (result SubAssessmentList, err error) { + req, err := lastResults.subAssessmentListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "listAllNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAllSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "listAllNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "listAllNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAllComplete enumerates all values, automatically crossing page boundaries as required. +func (client SubAssessmentsClient) ListAllComplete(ctx context.Context, scope string) (result SubAssessmentListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.ListAll") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListAll(ctx, scope) + return +} diff --git a/services/preview/security/mgmt/v2.0/security/models.go b/services/preview/security/mgmt/v2.0/security/models.go index 01ae7161a81d..b6c26676de8d 100644 --- a/services/preview/security/mgmt/v2.0/security/models.go +++ b/services/preview/security/mgmt/v2.0/security/models.go @@ -96,6 +96,25 @@ func PossibleAlertsToAdminsValues() []AlertsToAdmins { return []AlertsToAdmins{AlertsToAdminsOff, AlertsToAdminsOn} } +// AssessedResourceType enumerates the values for assessed resource type. +type AssessedResourceType string + +const ( + // AssessedResourceTypeAdditionalData ... + AssessedResourceTypeAdditionalData AssessedResourceType = "AdditionalData" + // AssessedResourceTypeContainerRegistryVulnerability ... + AssessedResourceTypeContainerRegistryVulnerability AssessedResourceType = "ContainerRegistryVulnerability" + // AssessedResourceTypeServerVulnerabilityAssessment ... + AssessedResourceTypeServerVulnerabilityAssessment AssessedResourceType = "ServerVulnerabilityAssessment" + // AssessedResourceTypeSQLServerVulnerability ... + AssessedResourceTypeSQLServerVulnerability AssessedResourceType = "SqlServerVulnerability" +) + +// PossibleAssessedResourceTypeValues returns an array of possible values for the AssessedResourceType const type. +func PossibleAssessedResourceTypeValues() []AssessedResourceType { + return []AssessedResourceType{AssessedResourceTypeAdditionalData, AssessedResourceTypeContainerRegistryVulnerability, AssessedResourceTypeServerVulnerabilityAssessment, AssessedResourceTypeSQLServerVulnerability} +} + // AutoProvision enumerates the values for auto provision. type AutoProvision string @@ -225,11 +244,13 @@ const ( Audit EnforcementMode = "Audit" // Enforce ... Enforce EnforcementMode = "Enforce" + // None ... + None EnforcementMode = "None" ) // PossibleEnforcementModeValues returns an array of possible values for the EnforcementMode const type. func PossibleEnforcementModeValues() []EnforcementMode { - return []EnforcementMode{Audit, Enforce} + return []EnforcementMode{Audit, Enforce, None} } // EnforcementMode1 enumerates the values for enforcement mode 1. @@ -240,11 +261,47 @@ const ( EnforcementMode1Audit EnforcementMode1 = "Audit" // EnforcementMode1Enforce ... EnforcementMode1Enforce EnforcementMode1 = "Enforce" + // EnforcementMode1None ... + EnforcementMode1None EnforcementMode1 = "None" ) // PossibleEnforcementMode1Values returns an array of possible values for the EnforcementMode1 const type. func PossibleEnforcementMode1Values() []EnforcementMode1 { - return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce} + return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce, EnforcementMode1None} +} + +// Exe enumerates the values for exe. +type Exe string + +const ( + // ExeAudit ... + ExeAudit Exe = "Audit" + // ExeEnforce ... + ExeEnforce Exe = "Enforce" + // ExeNone ... + ExeNone Exe = "None" +) + +// PossibleExeValues returns an array of possible values for the Exe const type. +func PossibleExeValues() []Exe { + return []Exe{ExeAudit, ExeEnforce, ExeNone} +} + +// Executable enumerates the values for executable. +type Executable string + +const ( + // ExecutableAudit ... + ExecutableAudit Executable = "Audit" + // ExecutableEnforce ... + ExecutableEnforce Executable = "Enforce" + // ExecutableNone ... + ExecutableNone Executable = "None" +) + +// PossibleExecutableValues returns an array of possible values for the Executable const type. +func PossibleExecutableValues() []Executable { + return []Executable{ExecutableAudit, ExecutableEnforce, ExecutableNone} } // ExportData enumerates the values for export data. @@ -300,23 +357,23 @@ func PossibleFamilyValues() []Family { type FileType string const ( - // Dll ... - Dll FileType = "Dll" - // Exe ... - Exe FileType = "Exe" - // Executable ... - Executable FileType = "Executable" - // Msi ... - Msi FileType = "Msi" - // Script ... - Script FileType = "Script" - // Unknown ... - Unknown FileType = "Unknown" + // FileTypeDll ... + FileTypeDll FileType = "Dll" + // FileTypeExe ... + FileTypeExe FileType = "Exe" + // FileTypeExecutable ... + FileTypeExecutable FileType = "Executable" + // FileTypeMsi ... + FileTypeMsi FileType = "Msi" + // FileTypeScript ... + FileTypeScript FileType = "Script" + // FileTypeUnknown ... + FileTypeUnknown FileType = "Unknown" ) // PossibleFileTypeValues returns an array of possible values for the FileType const type. func PossibleFileTypeValues() []FileType { - return []FileType{Dll, Exe, Executable, Msi, Script, Unknown} + return []FileType{FileTypeDll, FileTypeExe, FileTypeExecutable, FileTypeMsi, FileTypeScript, FileTypeUnknown} } // Issue enumerates the values for issue. @@ -361,6 +418,23 @@ func PossibleKindEnumValues() []KindEnum { return []KindEnum{KindAAD, KindATA, KindCEF, KindExternalSecuritySolution} } +// Msi enumerates the values for msi. +type Msi string + +const ( + // MsiAudit ... + MsiAudit Msi = "Audit" + // MsiEnforce ... + MsiEnforce Msi = "Enforce" + // MsiNone ... + MsiNone Msi = "None" +) + +// PossibleMsiValues returns an array of possible values for the Msi const type. +func PossibleMsiValues() []Msi { + return []Msi{MsiAudit, MsiEnforce, MsiNone} +} + // PricingTier enumerates the values for pricing tier. type PricingTier string @@ -535,6 +609,23 @@ func PossibleReportedSeverityValues() []ReportedSeverity { return []ReportedSeverity{High, Informational, Low, Medium} } +// Script enumerates the values for script. +type Script string + +const ( + // ScriptAudit ... + ScriptAudit Script = "Audit" + // ScriptEnforce ... + ScriptEnforce Script = "Enforce" + // ScriptNone ... + ScriptNone Script = "None" +) + +// PossibleScriptValues returns an array of possible values for the Script const type. +func PossibleScriptValues() []Script { + return []Script{ScriptAudit, ScriptEnforce, ScriptNone} +} + // SettingKind enumerates the values for setting kind. type SettingKind string @@ -550,6 +641,23 @@ func PossibleSettingKindValues() []SettingKind { return []SettingKind{SettingKindAlertSuppressionSetting, SettingKindDataExportSetting} } +// Severity enumerates the values for severity. +type Severity string + +const ( + // SeverityHigh ... + SeverityHigh Severity = "High" + // SeverityLow ... + SeverityLow Severity = "Low" + // SeverityMedium ... + SeverityMedium Severity = "Medium" +) + +// PossibleSeverityValues returns an array of possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{SeverityHigh, SeverityLow, SeverityMedium} +} + // SolutionStatus enumerates the values for solution status. type SolutionStatus string @@ -565,25 +673,42 @@ func PossibleSolutionStatusValues() []SolutionStatus { return []SolutionStatus{SolutionStatusDisabled, SolutionStatusEnabled} } +// Source enumerates the values for source. +type Source string + +const ( + // SourceAws ... + SourceAws Source = "Aws" + // SourceAzure ... + SourceAzure Source = "Azure" + // SourceResourceDetails ... + SourceResourceDetails Source = "ResourceDetails" +) + +// PossibleSourceValues returns an array of possible values for the Source const type. +func PossibleSourceValues() []Source { + return []Source{SourceAws, SourceAzure, SourceResourceDetails} +} + // SourceSystem enumerates the values for source system. type SourceSystem string const ( - // AzureAppLocker ... - AzureAppLocker SourceSystem = "Azure_AppLocker" - // AzureAuditD ... - AzureAuditD SourceSystem = "Azure_AuditD" - // NonAzureAppLocker ... - NonAzureAppLocker SourceSystem = "NonAzure_AppLocker" - // NonAzureAuditD ... - NonAzureAuditD SourceSystem = "NonAzure_AuditD" - // None ... - None SourceSystem = "None" + // SourceSystemAzureAppLocker ... + SourceSystemAzureAppLocker SourceSystem = "Azure_AppLocker" + // SourceSystemAzureAuditD ... + SourceSystemAzureAuditD SourceSystem = "Azure_AuditD" + // SourceSystemNonAzureAppLocker ... + SourceSystemNonAzureAppLocker SourceSystem = "NonAzure_AppLocker" + // SourceSystemNonAzureAuditD ... + SourceSystemNonAzureAuditD SourceSystem = "NonAzure_AuditD" + // SourceSystemNone ... + SourceSystemNone SourceSystem = "None" ) // PossibleSourceSystemValues returns an array of possible values for the SourceSystem const type. func PossibleSourceSystemValues() []SourceSystem { - return []SourceSystem{AzureAppLocker, AzureAuditD, NonAzureAppLocker, NonAzureAuditD, None} + return []SourceSystem{SourceSystemAzureAppLocker, SourceSystemAzureAuditD, SourceSystemNonAzureAppLocker, SourceSystemNonAzureAuditD, SourceSystemNone} } // State enumerates the values for state. @@ -638,6 +763,23 @@ func PossibleStatusReasonValues() []StatusReason { return []StatusReason{Expired, NewerRequestInitiated, UserRequested} } +// SubAssessmentStatusCode enumerates the values for sub assessment status code. +type SubAssessmentStatusCode string + +const ( + // Healthy The resource is healthy + Healthy SubAssessmentStatusCode = "Healthy" + // NotApplicable Assessment for this resource did not happen + NotApplicable SubAssessmentStatusCode = "NotApplicable" + // Unhealthy The resource has a security issue that needs to be addressed + Unhealthy SubAssessmentStatusCode = "Unhealthy" +) + +// PossibleSubAssessmentStatusCodeValues returns an array of possible values for the SubAssessmentStatusCode const type. +func PossibleSubAssessmentStatusCodeValues() []SubAssessmentStatusCode { + return []SubAssessmentStatusCode{Healthy, NotApplicable, Unhealthy} +} + // TransportProtocol enumerates the values for transport protocol. type TransportProtocol string @@ -1022,6 +1164,100 @@ func NewAdaptiveNetworkHardeningsListPage(getNextPage func(context.Context, Adap return AdaptiveNetworkHardeningsListPage{fn: getNextPage} } +// BasicAdditionalData details of the sub-assessment +type BasicAdditionalData interface { + AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) + AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) + AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) + AsAdditionalData() (*AdditionalData, bool) +} + +// AdditionalData details of the sub-assessment +type AdditionalData struct { + // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' + AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +} + +func unmarshalBasicAdditionalData(body []byte) (BasicAdditionalData, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["assessedResourceType"] { + case string(AssessedResourceTypeSQLServerVulnerability): + var ssvp SQLServerVulnerabilityProperties + err := json.Unmarshal(body, &ssvp) + return ssvp, err + case string(AssessedResourceTypeContainerRegistryVulnerability): + var crvp ContainerRegistryVulnerabilityProperties + err := json.Unmarshal(body, &crvp) + return crvp, err + case string(AssessedResourceTypeServerVulnerabilityAssessment): + var svp ServerVulnerabilityProperties + err := json.Unmarshal(body, &svp) + return svp, err + default: + var ad AdditionalData + err := json.Unmarshal(body, &ad) + return ad, err + } +} +func unmarshalBasicAdditionalDataArray(body []byte) ([]BasicAdditionalData, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + adArray := make([]BasicAdditionalData, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ad, err := unmarshalBasicAdditionalData(*rawMessage) + if err != nil { + return nil, err + } + adArray[index] = ad + } + return adArray, nil +} + +// MarshalJSON is the custom marshaler for AdditionalData. +func (ad AdditionalData) MarshalJSON() ([]byte, error) { + ad.AssessedResourceType = AssessedResourceTypeAdditionalData + objectMap := make(map[string]interface{}) + if ad.AssessedResourceType != "" { + objectMap["assessedResourceType"] = ad.AssessedResourceType + } + return json.Marshal(objectMap) +} + +// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { + return nil, false +} + +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsAdditionalData is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsAdditionalData() (*AdditionalData, bool) { + return &ad, true +} + +// AsBasicAdditionalData is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &ad, true +} + // AdvancedThreatProtectionProperties the Advanced Threat Protection settings. type AdvancedThreatProtectionProperties struct { // IsEnabled - Indicates whether Advanced Threat Protection is enabled. @@ -1782,14 +2018,15 @@ func (awg *AppWhitelistingGroup) UnmarshalJSON(body []byte) error { // AppWhitelistingGroupData represents a VM/server group and set of rules that are Recommended by Azure // Security Center to be allowed type AppWhitelistingGroupData struct { - // EnforcementMode - Possible values include: 'Audit', 'Enforce' + // EnforcementMode - Possible values include: 'Audit', 'Enforce', 'None' EnforcementMode EnforcementMode `json:"enforcementMode,omitempty"` + ProtectionMode *ProtectionMode `json:"protectionMode,omitempty"` // ConfigurationStatus - Possible values include: 'ConfigurationStatus2Configured', 'ConfigurationStatus2NotConfigured', 'ConfigurationStatus2InProgress', 'ConfigurationStatus2Failed', 'ConfigurationStatus2NoStatus' ConfigurationStatus ConfigurationStatus2 `json:"configurationStatus,omitempty"` // RecommendationStatus - Possible values include: 'RecommendationStatusRecommended', 'RecommendationStatusNotRecommended', 'RecommendationStatusNotAvailable', 'RecommendationStatusNoStatus' RecommendationStatus RecommendationStatus `json:"recommendationStatus,omitempty"` Issues *[]AppWhitelistingIssueSummary `json:"issues,omitempty"` - // SourceSystem - Possible values include: 'AzureAppLocker', 'AzureAuditD', 'NonAzureAppLocker', 'NonAzureAuditD', 'None' + // SourceSystem - Possible values include: 'SourceSystemAzureAppLocker', 'SourceSystemAzureAuditD', 'SourceSystemNonAzureAppLocker', 'SourceSystemNonAzureAuditD', 'SourceSystemNone' SourceSystem SourceSystem `json:"sourceSystem,omitempty"` VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` @@ -1812,8 +2049,10 @@ type AppWhitelistingIssueSummary struct { // AppWhitelistingPutGroupData the altered data of the recommended VM/server group policy type AppWhitelistingPutGroupData struct { - // EnforcementMode - Possible values include: 'EnforcementMode1Audit', 'EnforcementMode1Enforce' - EnforcementMode EnforcementMode1 `json:"enforcementMode,omitempty"` + // EnforcementMode - The enforcement mode of the group. Can also be defined per collection type by using ProtectionMode. Possible values include: 'EnforcementMode1Audit', 'EnforcementMode1Enforce', 'EnforcementMode1None' + EnforcementMode EnforcementMode1 `json:"enforcementMode,omitempty"` + // ProtectionMode - The protection mode of the group per collection type. Can also be defined for all collection types by using EnforcementMode + ProtectionMode *ProtectionMode `json:"protectionMode,omitempty"` VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` } @@ -2349,6 +2588,84 @@ type AutoProvisioningSettingProperties struct { AutoProvision AutoProvision `json:"autoProvision,omitempty"` } +// AwsResourceDetails details of the resource that was assessed +type AwsResourceDetails struct { + // AccountID - READ-ONLY; AWS account ID + AccountID *string `json:"accountId,omitempty"` + // AwsResourceID - READ-ONLY; AWS resource ID. can be ARN or other + AwsResourceID *string `json:"awsResourceId,omitempty"` + // Source - Possible values include: 'SourceResourceDetails', 'SourceAzure', 'SourceAws' + Source Source `json:"source,omitempty"` +} + +// MarshalJSON is the custom marshaler for AwsResourceDetails. +func (ard AwsResourceDetails) MarshalJSON() ([]byte, error) { + ard.Source = SourceAws + objectMap := make(map[string]interface{}) + if ard.Source != "" { + objectMap["source"] = ard.Source + } + return json.Marshal(objectMap) +} + +// AsAzureResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. +func (ard AwsResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { + return nil, false +} + +// AsAwsResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. +func (ard AwsResourceDetails) AsAwsResourceDetails() (*AwsResourceDetails, bool) { + return &ard, true +} + +// AsResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. +func (ard AwsResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { + return nil, false +} + +// AsBasicResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. +func (ard AwsResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { + return &ard, true +} + +// AzureResourceDetails details of the resource that was assessed +type AzureResourceDetails struct { + // ID - READ-ONLY; Azure resource ID of the assessed resource + ID *string `json:"id,omitempty"` + // Source - Possible values include: 'SourceResourceDetails', 'SourceAzure', 'SourceAws' + Source Source `json:"source,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureResourceDetails. +func (ard AzureResourceDetails) MarshalJSON() ([]byte, error) { + ard.Source = SourceAzure + objectMap := make(map[string]interface{}) + if ard.Source != "" { + objectMap["source"] = ard.Source + } + return json.Marshal(objectMap) +} + +// AsAzureResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { + return &ard, true +} + +// AsAwsResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsAwsResourceDetails() (*AwsResourceDetails, bool) { + return nil, false +} + +// AsResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { + return nil, false +} + +// AsBasicResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { + return &ard, true +} + // CefExternalSecuritySolution represents a security solution which sends CEF logs to an OMS workspace type CefExternalSecuritySolution struct { Properties *CefSolutionProperties `json:"properties,omitempty"` @@ -3065,6 +3382,64 @@ type ContactProperties struct { AlertsToAdmins AlertsToAdmins `json:"alertsToAdmins,omitempty"` } +// ContainerRegistryVulnerabilityProperties additional context fields for container registry Vulnerability +// assessment +type ContainerRegistryVulnerabilityProperties struct { + // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, Vulnerability + 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"` + // PublishedTime - READ-ONLY; Published time + PublishedTime *date.Time `json:"publishedTime,omitempty"` + // VendorReferences - READ-ONLY + VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` + // RepositoryName - READ-ONLY; Name of the repository which the vulnerable image belongs to + RepositoryName *string `json:"repositoryName,omitempty"` + // ImageDigest - READ-ONLY; Digest of the vulnerable image + ImageDigest *string `json:"imageDigest,omitempty"` + // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' + AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) MarshalJSON() ([]byte, error) { + crvp.AssessedResourceType = AssessedResourceTypeContainerRegistryVulnerability + objectMap := make(map[string]interface{}) + if crvp.AssessedResourceType != "" { + objectMap["assessedResourceType"] = crvp.AssessedResourceType + } + return json.Marshal(objectMap) +} + +// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { + return &crvp, true +} + +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsAdditionalData is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { + return nil, false +} + +// AsBasicAdditionalData is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &crvp, true +} + // CustomAlertRule a custom alert rule type CustomAlertRule struct { // DisplayName - READ-ONLY; The display name of the custom alert. @@ -3077,6 +3452,20 @@ type CustomAlertRule struct { RuleType *string `json:"ruleType,omitempty"` } +// CVE CVE details +type CVE struct { + // Title - READ-ONLY; CVE title + Title *string `json:"title,omitempty"` + // Link - READ-ONLY; Link url + Link *string `json:"link,omitempty"` +} + +// CVSS CVSS details +type CVSS struct { + // Base - READ-ONLY; CVSS base + Base *float64 `json:"base,omitempty"` +} + // DataExportSetting represents a data export setting type DataExportSetting struct { // DataExportSettingProperties - Data export setting data @@ -5539,6 +5928,8 @@ type JitNetworkAccessPolicyInitiatePort struct { type JitNetworkAccessPolicyInitiateRequest struct { // VirtualMachines - A list of virtual machines & ports to open access for VirtualMachines *[]JitNetworkAccessPolicyInitiateVirtualMachine `json:"virtualMachines,omitempty"` + // Justification - The justification for making the initiate request + Justification *string `json:"justification,omitempty"` } // JitNetworkAccessPolicyInitiateVirtualMachine ... @@ -5589,6 +5980,8 @@ type JitNetworkAccessRequest struct { StartTimeUtc *date.Time `json:"startTimeUtc,omitempty"` // Requestor - The identity of the person who made the request Requestor *string `json:"requestor,omitempty"` + // Justification - The justification for making the initiate request + Justification *string `json:"justification,omitempty"` } // JitNetworkAccessRequestPort ... @@ -5822,7 +6215,7 @@ type PathRecommendation struct { Common *bool `json:"common,omitempty"` UserSids *[]string `json:"userSids,omitempty"` Usernames *[]UserRecommendation `json:"usernames,omitempty"` - // FileType - Possible values include: 'Exe', 'Dll', 'Msi', 'Script', 'Executable', 'Unknown' + // FileType - Possible values include: 'FileTypeExe', 'FileTypeDll', 'FileTypeMsi', 'FileTypeScript', 'FileTypeExecutable', 'FileTypeUnknown' FileType FileType `json:"fileType,omitempty"` // ConfigurationStatus - Possible values include: 'ConfigurationStatus1Configured', 'ConfigurationStatus1NotConfigured', 'ConfigurationStatus1InProgress', 'ConfigurationStatus1Failed', 'ConfigurationStatus1NoStatus' ConfigurationStatus ConfigurationStatus1 `json:"configurationStatus,omitempty"` @@ -5918,6 +6311,19 @@ type PricingProperties struct { FreeTrialRemainingTime *string `json:"freeTrialRemainingTime,omitempty"` } +// ProtectionMode the protection mode of the collection/file types. Exe/Msi/Script are used for Windows, +// Executable is used for Linux. +type ProtectionMode struct { + // Exe - Possible values include: 'ExeAudit', 'ExeEnforce', 'ExeNone' + Exe Exe `json:"exe,omitempty"` + // Msi - Possible values include: 'MsiAudit', 'MsiEnforce', 'MsiNone' + Msi Msi `json:"msi,omitempty"` + // Script - Possible values include: 'ScriptAudit', 'ScriptEnforce', 'ScriptNone' + Script Script `json:"script,omitempty"` + // Executable - Possible values include: 'ExecutableAudit', 'ExecutableEnforce', 'ExecutableNone' + Executable Executable `json:"executable,omitempty"` +} + // PublisherInfo represents the publisher information of a process/rule type PublisherInfo struct { // PublisherName - The Subject field of the x.509 certificate used to sign the code, using the following fields - O = Organization, L = Locality, S = State or Province, and C = Country @@ -6656,6 +7062,90 @@ type Resource struct { Type *string `json:"type,omitempty"` } +// BasicResourceDetails details of the resource that was assessed +type BasicResourceDetails interface { + AsAzureResourceDetails() (*AzureResourceDetails, bool) + AsAwsResourceDetails() (*AwsResourceDetails, bool) + AsResourceDetails() (*ResourceDetails, bool) +} + +// ResourceDetails details of the resource that was assessed +type ResourceDetails struct { + // Source - Possible values include: 'SourceResourceDetails', 'SourceAzure', 'SourceAws' + Source Source `json:"source,omitempty"` +} + +func unmarshalBasicResourceDetails(body []byte) (BasicResourceDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["source"] { + case string(SourceAzure): + var ard AzureResourceDetails + err := json.Unmarshal(body, &ard) + return ard, err + case string(SourceAws): + var ard AwsResourceDetails + err := json.Unmarshal(body, &ard) + return ard, err + default: + var rd ResourceDetails + err := json.Unmarshal(body, &rd) + return rd, err + } +} +func unmarshalBasicResourceDetailsArray(body []byte) ([]BasicResourceDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rdArray := make([]BasicResourceDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rd, err := unmarshalBasicResourceDetails(*rawMessage) + if err != nil { + return nil, err + } + rdArray[index] = rd + } + return rdArray, nil +} + +// MarshalJSON is the custom marshaler for ResourceDetails. +func (rd ResourceDetails) MarshalJSON() ([]byte, error) { + rd.Source = SourceResourceDetails + objectMap := make(map[string]interface{}) + if rd.Source != "" { + objectMap["source"] = rd.Source + } + return json.Marshal(objectMap) +} + +// AsAzureResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { + return nil, false +} + +// AsAwsResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsAwsResourceDetails() (*AwsResourceDetails, bool) { + return nil, false +} + +// AsResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { + return &rd, true +} + +// AsBasicResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { + return &rd, true +} + // Rule describes remote addresses that is recommended to communicate with the Azure resource on some // (Protocol, Port, Direction). All other remote addresses are recommended to be blocked type Rule struct { @@ -6681,6 +7171,61 @@ type SensitivityLabel struct { 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 +} + +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return &svp, true +} + +// AsAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { + return nil, false +} + +// AsBasicAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &svp, true +} + // Setting represents a security setting in Azure Security Center. type Setting struct { autorest.Response `json:"-"` @@ -6852,6 +7397,405 @@ func NewSettingsListPage(getNextPage func(context.Context, SettingsList) (Settin return SettingsListPage{fn: getNextPage} } +// SQLServerVulnerabilityProperties details of the resource that was assessed +type SQLServerVulnerabilityProperties struct { + // Type - READ-ONLY; The resource type the sub assessment refers to in its resource details + Type *string `json:"type,omitempty"` + // Query - READ-ONLY; The T-SQL query that runs on your SQL database to perform the particular check + Query *string `json:"query,omitempty"` + // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' + AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { + ssvp.AssessedResourceType = AssessedResourceTypeSQLServerVulnerability + objectMap := make(map[string]interface{}) + if ssvp.AssessedResourceType != "" { + objectMap["assessedResourceType"] = ssvp.AssessedResourceType + } + return json.Marshal(objectMap) +} + +// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { + return &ssvp, true +} + +// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { + return nil, false +} + +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsAdditionalData is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { + return nil, false +} + +// AsBasicAdditionalData is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &ssvp, true +} + +// SubAssessment security sub-assessment on a resource +type SubAssessment struct { + autorest.Response `json:"-"` + *SubAssessmentProperties `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 SubAssessment. +func (sa SubAssessment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sa.SubAssessmentProperties != nil { + objectMap["properties"] = sa.SubAssessmentProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SubAssessment struct. +func (sa *SubAssessment) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var subAssessmentProperties SubAssessmentProperties + err = json.Unmarshal(*v, &subAssessmentProperties) + if err != nil { + return err + } + sa.SubAssessmentProperties = &subAssessmentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sa.Type = &typeVar + } + } + } + + return nil +} + +// SubAssessmentList list of security sub-assessments +type SubAssessmentList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY + Value *[]SubAssessment `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// SubAssessmentListIterator provides access to a complete listing of SubAssessment values. +type SubAssessmentListIterator struct { + i int + page SubAssessmentListPage +} + +// 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 *SubAssessmentListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentListIterator.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 *SubAssessmentListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SubAssessmentListIterator) 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 SubAssessmentListIterator) Response() SubAssessmentList { + 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 SubAssessmentListIterator) Value() SubAssessment { + if !iter.page.NotDone() { + return SubAssessment{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SubAssessmentListIterator type. +func NewSubAssessmentListIterator(page SubAssessmentListPage) SubAssessmentListIterator { + return SubAssessmentListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sal SubAssessmentList) IsEmpty() bool { + return sal.Value == nil || len(*sal.Value) == 0 +} + +// subAssessmentListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sal SubAssessmentList) subAssessmentListPreparer(ctx context.Context) (*http.Request, error) { + if sal.NextLink == nil || len(to.String(sal.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sal.NextLink))) +} + +// SubAssessmentListPage contains a page of SubAssessment values. +type SubAssessmentListPage struct { + fn func(context.Context, SubAssessmentList) (SubAssessmentList, error) + sal SubAssessmentList +} + +// 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 *SubAssessmentListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentListPage.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.sal) + if err != nil { + return err + } + page.sal = 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 *SubAssessmentListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SubAssessmentListPage) NotDone() bool { + return !page.sal.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SubAssessmentListPage) Response() SubAssessmentList { + return page.sal +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SubAssessmentListPage) Values() []SubAssessment { + if page.sal.IsEmpty() { + return nil + } + return *page.sal.Value +} + +// Creates a new instance of the SubAssessmentListPage type. +func NewSubAssessmentListPage(getNextPage func(context.Context, SubAssessmentList) (SubAssessmentList, error)) SubAssessmentListPage { + return SubAssessmentListPage{fn: getNextPage} +} + +// SubAssessmentProperties describes properties of an sub-assessment. +type SubAssessmentProperties struct { + // ID - READ-ONLY; Vulnerability ID + ID *string `json:"id,omitempty"` + // DisplayName - READ-ONLY; User friendly display name of the sub-assessment + DisplayName *string `json:"displayName,omitempty"` + Status *SubAssessmentStatus `json:"status,omitempty"` + // Remediation - READ-ONLY; Information on how to remediate this sub-assessment + Remediation *string `json:"remediation,omitempty"` + // Impact - READ-ONLY; Description of the impact of this sub-assessment + Impact *string `json:"impact,omitempty"` + // Category - READ-ONLY; Category of the sub-assessment + Category *string `json:"category,omitempty"` + // Description - READ-ONLY; Human readable description of the assessment status + Description *string `json:"description,omitempty"` + // TimeGenerated - READ-ONLY; The date and time the sub-assessment was generated + TimeGenerated *date.Time `json:"timeGenerated,omitempty"` + ResourceDetails BasicResourceDetails `json:"resourceDetails,omitempty"` + AdditionalData BasicAdditionalData `json:"additionalData,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SubAssessmentProperties struct. +func (sap *SubAssessmentProperties) UnmarshalJSON(body []byte) error { + 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 + } + sap.ID = &ID + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + sap.DisplayName = &displayName + } + case "status": + if v != nil { + var status SubAssessmentStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + sap.Status = &status + } + case "remediation": + if v != nil { + var remediation string + err = json.Unmarshal(*v, &remediation) + if err != nil { + return err + } + sap.Remediation = &remediation + } + case "impact": + if v != nil { + var impact string + err = json.Unmarshal(*v, &impact) + if err != nil { + return err + } + sap.Impact = &impact + } + case "category": + if v != nil { + var category string + err = json.Unmarshal(*v, &category) + if err != nil { + return err + } + sap.Category = &category + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + sap.Description = &description + } + case "timeGenerated": + if v != nil { + var timeGenerated date.Time + err = json.Unmarshal(*v, &timeGenerated) + if err != nil { + return err + } + sap.TimeGenerated = &timeGenerated + } + case "resourceDetails": + if v != nil { + resourceDetails, err := unmarshalBasicResourceDetails(*v) + if err != nil { + return err + } + sap.ResourceDetails = resourceDetails + } + case "additionalData": + if v != nil { + additionalData, err := unmarshalBasicAdditionalData(*v) + if err != nil { + return err + } + sap.AdditionalData = additionalData + } + } + } + + return nil +} + +// SubAssessmentStatus status of the sub-assessment +type SubAssessmentStatus struct { + // Code - READ-ONLY; Programmatic code for the status of the assessment. Possible values include: 'Healthy', 'Unhealthy', 'NotApplicable' + Code SubAssessmentStatusCode `json:"code,omitempty"` + // Cause - READ-ONLY; Programmatic code for the cause of the assessment status + Cause *string `json:"cause,omitempty"` + // Description - READ-ONLY; Human readable description of the assessment status + Description *string `json:"description,omitempty"` + // Severity - READ-ONLY; The sub-assessment severity level. Possible values include: 'SeverityLow', 'SeverityMedium', 'SeverityHigh' + Severity Severity `json:"severity,omitempty"` +} + // TagsResource a container holding only the Tags for a resource, allowing the user to update the tags. type TagsResource struct { // Tags - Resource tags @@ -7494,6 +8438,14 @@ type UserRecommendation struct { RecommendationAction RecommendationAction1 `json:"recommendationAction,omitempty"` } +// VendorReference vendor reference +type VendorReference struct { + // Title - READ-ONLY; Link title + Title *string `json:"title,omitempty"` + // Link - READ-ONLY; Link url + Link *string `json:"link,omitempty"` +} + // VMRecommendation represents a machine that is part of a VM/server group type VMRecommendation struct { // ConfigurationStatus - Possible values include: 'Configured', 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' 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 dde4288d926e..dec22bd03f50 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,15 @@ import ( "github.com/Azure/go-autorest/autorest" ) +// 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) + List(ctx context.Context, scope string, assessmentName string) (result security.SubAssessmentListPage, err error) + ListAll(ctx context.Context, scope string) (result security.SubAssessmentListPage, err error) +} + +var _ SubAssessmentsClientAPI = (*security.SubAssessmentsClient)(nil) + // RegulatoryComplianceStandardsClientAPI contains the set of methods on the RegulatoryComplianceStandardsClient type. type RegulatoryComplianceStandardsClientAPI interface { Get(ctx context.Context, regulatoryComplianceStandardName string) (result security.RegulatoryComplianceStandard, err error) diff --git a/services/preview/security/mgmt/v2.0/security/subassessments.go b/services/preview/security/mgmt/v2.0/security/subassessments.go new file mode 100644 index 000000000000..4fa19d8e398d --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/subassessments.go @@ -0,0 +1,348 @@ +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/tracing" + "net/http" +) + +// SubAssessmentsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type SubAssessmentsClient struct { + BaseClient +} + +// NewSubAssessmentsClient creates an instance of the SubAssessmentsClient client. +func NewSubAssessmentsClient(subscriptionID string, ascLocation string) SubAssessmentsClient { + return NewSubAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSubAssessmentsClientWithBaseURI creates an instance of the SubAssessmentsClient client. +func NewSubAssessmentsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SubAssessmentsClient { + return SubAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get get a security sub-assessment on your scanned resource +// Parameters: +// scope - scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or +// management group (/providers/Microsoft.Management/managementGroups/mgName). +// assessmentName - the Assessment Key - Unique key for the assessment type +// subAssessmentName - the Sub-Assessment Key - Unique key for the sub-assessment type +func (client SubAssessmentsClient) Get(ctx context.Context, scope string, assessmentName string, subAssessmentName string) (result SubAssessment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.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, scope, assessmentName, subAssessmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "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.SubAssessmentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SubAssessmentsClient) GetPreparer(ctx context.Context, scope string, assessmentName string, subAssessmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assessmentName": autorest.Encode("path", assessmentName), + "scope": autorest.Encode("path", scope), + "subAssessmentName": autorest.Encode("path", subAssessmentName), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}", 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 SubAssessmentsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SubAssessmentsClient) GetResponder(resp *http.Response) (result SubAssessment, 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 get security sub-assessments on all your scanned resources inside a scope +// Parameters: +// scope - scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or +// management group (/providers/Microsoft.Management/managementGroups/mgName). +// assessmentName - the Assessment Key - Unique key for the assessment type +func (client SubAssessmentsClient) List(ctx context.Context, scope string, assessmentName string) (result SubAssessmentListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.List") + defer func() { + sc := -1 + if result.sal.Response.Response != nil { + sc = result.sal.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, scope, assessmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sal.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "List", resp, "Failure sending request") + return + } + + result.sal, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SubAssessmentsClient) ListPreparer(ctx context.Context, scope string, assessmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assessmentName": autorest.Encode("path", assessmentName), + "scope": autorest.Encode("path", scope), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments", 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 SubAssessmentsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SubAssessmentsClient) ListResponder(resp *http.Response) (result SubAssessmentList, 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 SubAssessmentsClient) listNextResults(ctx context.Context, lastResults SubAssessmentList) (result SubAssessmentList, err error) { + req, err := lastResults.subAssessmentListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "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.SubAssessmentsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SubAssessmentsClient) ListComplete(ctx context.Context, scope string, assessmentName string) (result SubAssessmentListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.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, scope, assessmentName) + return +} + +// ListAll get security sub-assessments on all your scanned resources inside a subscription scope +// Parameters: +// scope - scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or +// management group (/providers/Microsoft.Management/managementGroups/mgName). +func (client SubAssessmentsClient) ListAll(ctx context.Context, scope string) (result SubAssessmentListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.ListAll") + defer func() { + sc := -1 + if result.sal.Response.Response != nil { + sc = result.sal.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listAllNextResults + req, err := client.ListAllPreparer(ctx, scope) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "ListAll", nil, "Failure preparing request") + return + } + + resp, err := client.ListAllSender(req) + if err != nil { + result.sal.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "ListAll", resp, "Failure sending request") + return + } + + result.sal, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "ListAll", resp, "Failure responding to request") + } + + return +} + +// ListAllPreparer prepares the ListAll request. +func (client SubAssessmentsClient) ListAllPreparer(ctx context.Context, scope string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "scope": autorest.Encode("path", scope), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/subAssessments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAllSender sends the ListAll request. The method will close the +// http.Response Body if it receives an error. +func (client SubAssessmentsClient) ListAllSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListAllResponder handles the response to the ListAll request. The method always +// closes the http.Response Body. +func (client SubAssessmentsClient) ListAllResponder(resp *http.Response) (result SubAssessmentList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAllNextResults retrieves the next set of results, if any. +func (client SubAssessmentsClient) listAllNextResults(ctx context.Context, lastResults SubAssessmentList) (result SubAssessmentList, err error) { + req, err := lastResults.subAssessmentListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "listAllNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAllSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "listAllNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "listAllNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAllComplete enumerates all values, automatically crossing page boundaries as required. +func (client SubAssessmentsClient) ListAllComplete(ctx context.Context, scope string) (result SubAssessmentListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.ListAll") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListAll(ctx, scope) + return +} diff --git a/services/preview/security/mgmt/v3.0/security/devicesecuritygroups.go b/services/preview/security/mgmt/v3.0/security/devicesecuritygroups.go new file mode 100644 index 000000000000..00a09f9bf766 --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/devicesecuritygroups.go @@ -0,0 +1,386 @@ +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/tracing" + "net/http" +) + +// DeviceSecurityGroupsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type DeviceSecurityGroupsClient struct { + BaseClient +} + +// NewDeviceSecurityGroupsClient creates an instance of the DeviceSecurityGroupsClient client. +func NewDeviceSecurityGroupsClient(subscriptionID string, ascLocation string) DeviceSecurityGroupsClient { + return NewDeviceSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewDeviceSecurityGroupsClientWithBaseURI creates an instance of the DeviceSecurityGroupsClient client. +func NewDeviceSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DeviceSecurityGroupsClient { + return DeviceSecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// CreateOrUpdate use this method to creates or updates the device security group on a specified IoT Hub resource. +// Parameters: +// resourceID - the identifier of the resource. +// deviceSecurityGroupName - the name of the device security group. Note that the name of the device security +// group is case insensitive. +// deviceSecurityGroup - security group object. +func (client DeviceSecurityGroupsClient) CreateOrUpdate(ctx context.Context, resourceID string, deviceSecurityGroupName string, deviceSecurityGroup DeviceSecurityGroup) (result DeviceSecurityGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupsClient.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, resourceID, deviceSecurityGroupName, deviceSecurityGroup) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DeviceSecurityGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.DeviceSecurityGroupsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DeviceSecurityGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DeviceSecurityGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceID string, deviceSecurityGroupName string, deviceSecurityGroup DeviceSecurityGroup) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceSecurityGroupName": autorest.Encode("path", deviceSecurityGroupName), + "resourceId": autorest.Encode("path", resourceID), + } + + 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("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", pathParameters), + autorest.WithJSON(deviceSecurityGroup), + 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 DeviceSecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DeviceSecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result DeviceSecurityGroup, 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 user this method to deletes the device security group. +// Parameters: +// resourceID - the identifier of the resource. +// deviceSecurityGroupName - the name of the device security group. Note that the name of the device security +// group is case insensitive. +func (client DeviceSecurityGroupsClient) Delete(ctx context.Context, resourceID string, deviceSecurityGroupName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceID, deviceSecurityGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DeviceSecurityGroupsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.DeviceSecurityGroupsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DeviceSecurityGroupsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DeviceSecurityGroupsClient) DeletePreparer(ctx context.Context, resourceID string, deviceSecurityGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceSecurityGroupName": autorest.Encode("path", deviceSecurityGroupName), + "resourceId": autorest.Encode("path", resourceID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", 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 DeviceSecurityGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DeviceSecurityGroupsClient) 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 use this method to get the device security group for the specified IoT Hub resource. +// Parameters: +// resourceID - the identifier of the resource. +// deviceSecurityGroupName - the name of the device security group. Note that the name of the device security +// group is case insensitive. +func (client DeviceSecurityGroupsClient) Get(ctx context.Context, resourceID string, deviceSecurityGroupName string) (result DeviceSecurityGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupsClient.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, resourceID, deviceSecurityGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DeviceSecurityGroupsClient", "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.DeviceSecurityGroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DeviceSecurityGroupsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DeviceSecurityGroupsClient) GetPreparer(ctx context.Context, resourceID string, deviceSecurityGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceSecurityGroupName": autorest.Encode("path", deviceSecurityGroupName), + "resourceId": autorest.Encode("path", resourceID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", 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 DeviceSecurityGroupsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DeviceSecurityGroupsClient) GetResponder(resp *http.Response) (result DeviceSecurityGroup, 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 use this method get the list of device security groups for the specified IoT Hub resource. +// Parameters: +// resourceID - the identifier of the resource. +func (client DeviceSecurityGroupsClient) List(ctx context.Context, resourceID string) (result DeviceSecurityGroupListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupsClient.List") + defer func() { + sc := -1 + if result.dsgl.Response.Response != nil { + sc = result.dsgl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceID) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DeviceSecurityGroupsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.dsgl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.DeviceSecurityGroupsClient", "List", resp, "Failure sending request") + return + } + + result.dsgl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DeviceSecurityGroupsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DeviceSecurityGroupsClient) ListPreparer(ctx context.Context, resourceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceId": autorest.Encode("path", resourceID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups", 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 DeviceSecurityGroupsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DeviceSecurityGroupsClient) ListResponder(resp *http.Response) (result DeviceSecurityGroupList, 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 DeviceSecurityGroupsClient) listNextResults(ctx context.Context, lastResults DeviceSecurityGroupList) (result DeviceSecurityGroupList, err error) { + req, err := lastResults.deviceSecurityGroupListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.DeviceSecurityGroupsClient", "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.DeviceSecurityGroupsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DeviceSecurityGroupsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client DeviceSecurityGroupsClient) ListComplete(ctx context.Context, resourceID string) (result DeviceSecurityGroupListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupsClient.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, resourceID) + return +} diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go index 69320fae227d..10b731aa211f 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go @@ -41,15 +41,15 @@ func NewIotSecuritySolutionClientWithBaseURI(baseURI string, subscriptionID stri return IotSecuritySolutionClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} } -// Create create new solution manager +// CreateOrUpdate use this method to create or update yours IoT Security solution // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -// solutionName - the solution manager name +// solutionName - the name of the IoT Security solution. // iotSecuritySolutionData - the security solution data -func (client IotSecuritySolutionClient) Create(ctx context.Context, resourceGroupName string, solutionName string, iotSecuritySolutionData IoTSecuritySolutionModel) (result IoTSecuritySolutionModel, err error) { +func (client IotSecuritySolutionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, solutionName string, iotSecuritySolutionData IoTSecuritySolutionModel) (result IoTSecuritySolutionModel, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionClient.Create") + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionClient.CreateOrUpdate") defer func() { sc := -1 if result.Response.Response != nil { @@ -75,32 +75,32 @@ func (client IotSecuritySolutionClient) Create(ctx context.Context, resourceGrou {Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties.UserDefinedResources.QuerySubscriptions", Name: validation.Null, Rule: true, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewError("security.IotSecuritySolutionClient", "Create", err.Error()) + return result, validation.NewError("security.IotSecuritySolutionClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreatePreparer(ctx, resourceGroupName, solutionName, iotSecuritySolutionData) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, solutionName, iotSecuritySolutionData) if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Create", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "CreateOrUpdate", nil, "Failure preparing request") return } - resp, err := client.CreateSender(req) + resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Create", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "CreateOrUpdate", resp, "Failure sending request") return } - result, err = client.CreateResponder(resp) + result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Create", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "CreateOrUpdate", resp, "Failure responding to request") } return } -// CreatePreparer prepares the Create request. -func (client IotSecuritySolutionClient) CreatePreparer(ctx context.Context, resourceGroupName string, solutionName string, iotSecuritySolutionData IoTSecuritySolutionModel) (*http.Request, error) { +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IotSecuritySolutionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, solutionName string, iotSecuritySolutionData IoTSecuritySolutionModel) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "solutionName": autorest.Encode("path", solutionName), @@ -125,16 +125,16 @@ func (client IotSecuritySolutionClient) CreatePreparer(ctx context.Context, reso return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateSender sends the Create request. The method will close the +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client IotSecuritySolutionClient) CreateSender(req *http.Request) (*http.Response, error) { +func (client IotSecuritySolutionClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// CreateResponder handles the response to the Create request. The method always +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client IotSecuritySolutionClient) CreateResponder(resp *http.Response) (result IoTSecuritySolutionModel, err error) { +func (client IotSecuritySolutionClient) CreateOrUpdateResponder(resp *http.Response) (result IoTSecuritySolutionModel, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -145,11 +145,11 @@ func (client IotSecuritySolutionClient) CreateResponder(resp *http.Response) (re return } -// Delete create new solution manager +// Delete use this method to delete yours IoT Security solution // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -// solutionName - the solution manager name +// solutionName - the name of the IoT Security solution. func (client IotSecuritySolutionClient) Delete(ctx context.Context, resourceGroupName string, solutionName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionClient.Delete") @@ -232,11 +232,11 @@ func (client IotSecuritySolutionClient) DeleteResponder(resp *http.Response) (re return } -// Get details of a specific iot security solution +// Get user this method to get details of a specific IoT Security solution based on solution name // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -// solutionName - the solution manager name +// solutionName - the name of the IoT Security solution. func (client IotSecuritySolutionClient) Get(ctx context.Context, resourceGroupName string, solutionName string) (result IoTSecuritySolutionModel, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionClient.Get") @@ -320,12 +320,261 @@ func (client IotSecuritySolutionClient) GetResponder(resp *http.Response) (resul return } -// Update update existing Security Solution tags or user defined resources. To update other fields use the -// CreateOrUpdate method +// ListByResourceGroup use this method to get the list IoT Security solutions organized by resource group. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -// solutionName - the solution manager name +// filter - filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. +func (client IotSecuritySolutionClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result IoTSecuritySolutionsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.itssl.Response.Response != nil { + sc = result.itssl.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}}}}); err != nil { + return result, validation.NewError("security.IotSecuritySolutionClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.itssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.itssl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client IotSecuritySolutionClient) 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-08-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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions", 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 IotSecuritySolutionClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client IotSecuritySolutionClient) ListByResourceGroupResponder(resp *http.Response) (result IoTSecuritySolutionsList, 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 IotSecuritySolutionClient) listByResourceGroupNextResults(ctx context.Context, lastResults IoTSecuritySolutionsList) (result IoTSecuritySolutionsList, err error) { + req, err := lastResults.ioTSecuritySolutionsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "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, "security.IotSecuritySolutionClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client IotSecuritySolutionClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string) (result IoTSecuritySolutionsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionClient.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 use this method to get the list of IoT Security solutions by subscription. +// Parameters: +// filter - filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. +func (client IotSecuritySolutionClient) ListBySubscription(ctx context.Context, filter string) (result IoTSecuritySolutionsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionClient.ListBySubscription") + defer func() { + sc := -1 + if result.itssl.Response.Response != nil { + sc = result.itssl.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.IotSecuritySolutionClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.itssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.itssl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client IotSecuritySolutionClient) ListBySubscriptionPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions", 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 IotSecuritySolutionClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client IotSecuritySolutionClient) ListBySubscriptionResponder(resp *http.Response) (result IoTSecuritySolutionsList, 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 IotSecuritySolutionClient) listBySubscriptionNextResults(ctx context.Context, lastResults IoTSecuritySolutionsList) (result IoTSecuritySolutionsList, err error) { + req, err := lastResults.ioTSecuritySolutionsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "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.IotSecuritySolutionClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client IotSecuritySolutionClient) ListBySubscriptionComplete(ctx context.Context, filter string) (result IoTSecuritySolutionsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionClient.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 use this method to update existing IoT Security solution tags or user defined resources. To update other +// fields use the CreateOrUpdate method. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the name of the IoT Security solution. // updateIotSecuritySolutionData - the security solution data func (client IotSecuritySolutionClient) Update(ctx context.Context, resourceGroupName string, solutionName string, updateIotSecuritySolutionData UpdateIotSecuritySolutionData) (result IoTSecuritySolutionModel, err error) { if tracing.IsEnabled() { diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionanalytics.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionanalytics.go new file mode 100644 index 000000000000..85c4adbf8b00 --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionanalytics.go @@ -0,0 +1,219 @@ +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" +) + +// IotSecuritySolutionAnalyticsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type IotSecuritySolutionAnalyticsClient struct { + BaseClient +} + +// NewIotSecuritySolutionAnalyticsClient creates an instance of the IotSecuritySolutionAnalyticsClient client. +func NewIotSecuritySolutionAnalyticsClient(subscriptionID string, ascLocation string) IotSecuritySolutionAnalyticsClient { + return NewIotSecuritySolutionAnalyticsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewIotSecuritySolutionAnalyticsClientWithBaseURI creates an instance of the IotSecuritySolutionAnalyticsClient +// client. +func NewIotSecuritySolutionAnalyticsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionAnalyticsClient { + return IotSecuritySolutionAnalyticsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get use this method to get IoT Security Analytics metrics. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the name of the IoT Security solution. +func (client IotSecuritySolutionAnalyticsClient) Get(ctx context.Context, resourceGroupName string, solutionName string) (result IoTSecuritySolutionAnalyticsModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionAnalyticsClient.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}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IotSecuritySolutionAnalyticsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, solutionName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionAnalyticsClient", "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.IotSecuritySolutionAnalyticsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionAnalyticsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IotSecuritySolutionAnalyticsClient) GetPreparer(ctx context.Context, resourceGroupName string, solutionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "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.Security/iotSecuritySolutions/{solutionName}/analyticsModels/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 IotSecuritySolutionAnalyticsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IotSecuritySolutionAnalyticsClient) GetResponder(resp *http.Response) (result IoTSecuritySolutionAnalyticsModel, 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 use this method to get IoT security Analytics metrics in an array. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the name of the IoT Security solution. +func (client IotSecuritySolutionAnalyticsClient) List(ctx context.Context, resourceGroupName string, solutionName string) (result IoTSecuritySolutionAnalyticsModelList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionAnalyticsClient.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.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}}}}); err != nil { + return result, validation.NewError("security.IotSecuritySolutionAnalyticsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, solutionName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionAnalyticsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionAnalyticsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionAnalyticsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IotSecuritySolutionAnalyticsClient) ListPreparer(ctx context.Context, resourceGroupName string, solutionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "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.Security/iotSecuritySolutions/{solutionName}/analyticsModels", 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 IotSecuritySolutionAnalyticsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IotSecuritySolutionAnalyticsClient) ListResponder(resp *http.Response) (result IoTSecuritySolutionAnalyticsModelList, 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/iotsecuritysolutionsanalyticsaggregatedalert.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go index 27eddd6c8c14..b84aaf8df622 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go @@ -26,33 +26,33 @@ import ( "net/http" ) -// IoTSecuritySolutionsAnalyticsAggregatedAlertClient is the API spec for Microsoft.Security (Azure Security Center) +// IotSecuritySolutionsAnalyticsAggregatedAlertClient is the API spec for Microsoft.Security (Azure Security Center) // resource provider -type IoTSecuritySolutionsAnalyticsAggregatedAlertClient struct { +type IotSecuritySolutionsAnalyticsAggregatedAlertClient struct { BaseClient } -// NewIoTSecuritySolutionsAnalyticsAggregatedAlertClient creates an instance of the -// IoTSecuritySolutionsAnalyticsAggregatedAlertClient client. -func NewIoTSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertClient { - return NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +// NewIotSecuritySolutionsAnalyticsAggregatedAlertClient creates an instance of the +// IotSecuritySolutionsAnalyticsAggregatedAlertClient client. +func NewIotSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsAggregatedAlertClient { + return NewIotSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) } -// NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI creates an instance of the -// IoTSecuritySolutionsAnalyticsAggregatedAlertClient client. -func NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertClient { - return IoTSecuritySolutionsAnalyticsAggregatedAlertClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +// NewIotSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI creates an instance of the +// IotSecuritySolutionsAnalyticsAggregatedAlertClient client. +func NewIotSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsAggregatedAlertClient { + return IotSecuritySolutionsAnalyticsAggregatedAlertClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} } -// Dismiss security Analytics of a security solution +// Dismiss use this method to dismiss an aggregated IoT Security Solution Alert. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -// solutionName - the solution manager name -// aggregatedAlertName - identifier of the aggregated alert -func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) Dismiss(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (result autorest.Response, err error) { +// solutionName - the name of the IoT Security solution. +// aggregatedAlertName - identifier of the aggregated alert. +func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) Dismiss(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsAggregatedAlertClient.Dismiss") + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionsAnalyticsAggregatedAlertClient.Dismiss") defer func() { sc := -1 if result.Response != nil { @@ -68,32 +68,32 @@ func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) Dismiss(ctx con Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Dismiss", err.Error()) + return result, validation.NewError("security.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "Dismiss", err.Error()) } req, err := client.DismissPreparer(ctx, resourceGroupName, solutionName, aggregatedAlertName) if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Dismiss", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "Dismiss", nil, "Failure preparing request") return } resp, err := client.DismissSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Dismiss", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "Dismiss", resp, "Failure sending request") return } result, err = client.DismissResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Dismiss", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "Dismiss", resp, "Failure responding to request") } return } // DismissPreparer prepares the Dismiss request. -func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) DismissPreparer(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (*http.Request, error) { +func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) DismissPreparer(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "aggregatedAlertName": autorest.Encode("path", aggregatedAlertName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -116,14 +116,14 @@ func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) DismissPreparer // DismissSender sends the Dismiss request. The method will close the // http.Response Body if it receives an error. -func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) DismissSender(req *http.Request) (*http.Response, error) { +func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) DismissSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } // DismissResponder handles the response to the Dismiss request. The method always // closes the http.Response Body. -func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) DismissResponder(resp *http.Response) (result autorest.Response, err error) { +func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) DismissResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -133,15 +133,16 @@ func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) DismissResponde return } -// Get security Analytics of a security solution +// Get use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is +// performed by alert name. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -// solutionName - the solution manager name -// aggregatedAlertName - identifier of the aggregated alert -func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (result IoTSecurityAggregatedAlert, err error) { +// solutionName - the name of the IoT Security solution. +// aggregatedAlertName - identifier of the aggregated alert. +func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (result IoTSecurityAggregatedAlert, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsAggregatedAlertClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionsAnalyticsAggregatedAlertClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -157,32 +158,32 @@ func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) Get(ctx context Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Get", err.Error()) + return result, validation.NewError("security.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, solutionName, aggregatedAlertName) if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "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.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) GetPreparer(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (*http.Request, error) { +func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) GetPreparer(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "aggregatedAlertName": autorest.Encode("path", aggregatedAlertName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -205,14 +206,14 @@ func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) GetPreparer(ctx // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) GetSender(req *http.Request) (*http.Response, error) { +func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) GetSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) GetResponder(resp *http.Response) (result IoTSecurityAggregatedAlert, err error) { +func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) GetResponder(resp *http.Response) (result IoTSecurityAggregatedAlert, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -222,3 +223,133 @@ func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) GetResponder(re result.Response = autorest.Response{Response: resp} return } + +// List use this method to get the aggregated alert list of yours IoT Security solution. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the name of the IoT Security solution. +// top - number of results to retrieve. +func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result IoTSecurityAggregatedAlertListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionsAnalyticsAggregatedAlertClient.List") + defer func() { + sc := -1 + if result.itsaal.Response.Response != nil { + sc = result.itsaal.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}}}}); err != nil { + return result, validation.NewError("security.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, solutionName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.itsaal.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "List", resp, "Failure sending request") + return + } + + result.itsaal, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) ListPreparer(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts", 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 IotSecuritySolutionsAnalyticsAggregatedAlertClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) ListResponder(resp *http.Response) (result IoTSecurityAggregatedAlertList, 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 IotSecuritySolutionsAnalyticsAggregatedAlertClient) listNextResults(ctx context.Context, lastResults IoTSecurityAggregatedAlertList) (result IoTSecurityAggregatedAlertList, err error) { + req, err := lastResults.ioTSecurityAggregatedAlertListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "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.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsAggregatedAlertClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) ListComplete(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result IoTSecurityAggregatedAlertListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionsAnalyticsAggregatedAlertClient.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, solutionName, top) + return +} diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go index ead902a83498..e48bacc087da 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go @@ -26,33 +26,34 @@ import ( "net/http" ) -// IoTSecuritySolutionsAnalyticsRecommendationClient is the API spec for Microsoft.Security (Azure Security Center) +// IotSecuritySolutionsAnalyticsRecommendationClient is the API spec for Microsoft.Security (Azure Security Center) // resource provider -type IoTSecuritySolutionsAnalyticsRecommendationClient struct { +type IotSecuritySolutionsAnalyticsRecommendationClient struct { BaseClient } -// NewIoTSecuritySolutionsAnalyticsRecommendationClient creates an instance of the -// IoTSecuritySolutionsAnalyticsRecommendationClient client. -func NewIoTSecuritySolutionsAnalyticsRecommendationClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationClient { - return NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +// NewIotSecuritySolutionsAnalyticsRecommendationClient creates an instance of the +// IotSecuritySolutionsAnalyticsRecommendationClient client. +func NewIotSecuritySolutionsAnalyticsRecommendationClient(subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsRecommendationClient { + return NewIotSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) } -// NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI creates an instance of the -// IoTSecuritySolutionsAnalyticsRecommendationClient client. -func NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationClient { - return IoTSecuritySolutionsAnalyticsRecommendationClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +// NewIotSecuritySolutionsAnalyticsRecommendationClientWithBaseURI creates an instance of the +// IotSecuritySolutionsAnalyticsRecommendationClient client. +func NewIotSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsRecommendationClient { + return IotSecuritySolutionsAnalyticsRecommendationClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} } -// Get security Analytics of a security solution +// Get use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This +// aggregation is performed by recommendation name. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -// solutionName - the solution manager name -// aggregatedRecommendationName - identifier of the aggregated recommendation -func (client IoTSecuritySolutionsAnalyticsRecommendationClient) Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedRecommendationName string) (result IoTSecurityAggregatedRecommendation, err error) { +// solutionName - the name of the IoT Security solution. +// aggregatedRecommendationName - name of the recommendation aggregated for this query. +func (client IotSecuritySolutionsAnalyticsRecommendationClient) Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedRecommendationName string) (result IoTSecurityAggregatedRecommendation, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsRecommendationClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionsAnalyticsRecommendationClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -68,32 +69,32 @@ func (client IoTSecuritySolutionsAnalyticsRecommendationClient) Get(ctx context. Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.IoTSecuritySolutionsAnalyticsRecommendationClient", "Get", err.Error()) + return result, validation.NewError("security.IotSecuritySolutionsAnalyticsRecommendationClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, solutionName, aggregatedRecommendationName) if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsRecommendationClient", "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.IoTSecuritySolutionsAnalyticsRecommendationClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsRecommendationClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsRecommendationClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client IoTSecuritySolutionsAnalyticsRecommendationClient) GetPreparer(ctx context.Context, resourceGroupName string, solutionName string, aggregatedRecommendationName string) (*http.Request, error) { +func (client IotSecuritySolutionsAnalyticsRecommendationClient) GetPreparer(ctx context.Context, resourceGroupName string, solutionName string, aggregatedRecommendationName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "aggregatedRecommendationName": autorest.Encode("path", aggregatedRecommendationName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -116,14 +117,14 @@ func (client IoTSecuritySolutionsAnalyticsRecommendationClient) GetPreparer(ctx // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client IoTSecuritySolutionsAnalyticsRecommendationClient) GetSender(req *http.Request) (*http.Response, error) { +func (client IotSecuritySolutionsAnalyticsRecommendationClient) GetSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client IoTSecuritySolutionsAnalyticsRecommendationClient) GetResponder(resp *http.Response) (result IoTSecurityAggregatedRecommendation, err error) { +func (client IotSecuritySolutionsAnalyticsRecommendationClient) GetResponder(resp *http.Response) (result IoTSecurityAggregatedRecommendation, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -133,3 +134,134 @@ func (client IoTSecuritySolutionsAnalyticsRecommendationClient) GetResponder(res result.Response = autorest.Response{Response: resp} return } + +// List use this method to get the list of aggregated security analytics recommendations of yours IoT Security +// solution. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the name of the IoT Security solution. +// top - number of results to retrieve. +func (client IotSecuritySolutionsAnalyticsRecommendationClient) List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result IoTSecurityAggregatedRecommendationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionsAnalyticsRecommendationClient.List") + defer func() { + sc := -1 + if result.itsarl.Response.Response != nil { + sc = result.itsarl.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}}}}); err != nil { + return result, validation.NewError("security.IotSecuritySolutionsAnalyticsRecommendationClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, solutionName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsRecommendationClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.itsarl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsRecommendationClient", "List", resp, "Failure sending request") + return + } + + result.itsarl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsRecommendationClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IotSecuritySolutionsAnalyticsRecommendationClient) ListPreparer(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations", 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 IotSecuritySolutionsAnalyticsRecommendationClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IotSecuritySolutionsAnalyticsRecommendationClient) ListResponder(resp *http.Response) (result IoTSecurityAggregatedRecommendationList, 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 IotSecuritySolutionsAnalyticsRecommendationClient) listNextResults(ctx context.Context, lastResults IoTSecurityAggregatedRecommendationList) (result IoTSecurityAggregatedRecommendationList, err error) { + req, err := lastResults.ioTSecurityAggregatedRecommendationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsRecommendationClient", "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.IotSecuritySolutionsAnalyticsRecommendationClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionsAnalyticsRecommendationClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IotSecuritySolutionsAnalyticsRecommendationClient) ListComplete(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result IoTSecurityAggregatedRecommendationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionsAnalyticsRecommendationClient.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, solutionName, top) + return +} diff --git a/services/preview/security/mgmt/v3.0/security/models.go b/services/preview/security/mgmt/v3.0/security/models.go index 5e32802273f0..1f0482eb5644 100644 --- a/services/preview/security/mgmt/v3.0/security/models.go +++ b/services/preview/security/mgmt/v3.0/security/models.go @@ -95,6 +95,25 @@ func PossibleAlertsToAdminsValues() []AlertsToAdmins { return []AlertsToAdmins{AlertsToAdminsOff, AlertsToAdminsOn} } +// AssessedResourceType enumerates the values for assessed resource type. +type AssessedResourceType string + +const ( + // AssessedResourceTypeAdditionalData ... + AssessedResourceTypeAdditionalData AssessedResourceType = "AdditionalData" + // AssessedResourceTypeContainerRegistryVulnerability ... + AssessedResourceTypeContainerRegistryVulnerability AssessedResourceType = "ContainerRegistryVulnerability" + // AssessedResourceTypeServerVulnerabilityAssessment ... + AssessedResourceTypeServerVulnerabilityAssessment AssessedResourceType = "ServerVulnerabilityAssessment" + // AssessedResourceTypeSQLServerVulnerability ... + AssessedResourceTypeSQLServerVulnerability AssessedResourceType = "SqlServerVulnerability" +) + +// PossibleAssessedResourceTypeValues returns an array of possible values for the AssessedResourceType const type. +func PossibleAssessedResourceTypeValues() []AssessedResourceType { + return []AssessedResourceType{AssessedResourceTypeAdditionalData, AssessedResourceTypeContainerRegistryVulnerability, AssessedResourceTypeServerVulnerabilityAssessment, AssessedResourceTypeSQLServerVulnerability} +} + // AutoProvision enumerates the values for auto provision. type AutoProvision string @@ -209,11 +228,13 @@ const ( Audit EnforcementMode = "Audit" // Enforce ... Enforce EnforcementMode = "Enforce" + // None ... + None EnforcementMode = "None" ) // PossibleEnforcementModeValues returns an array of possible values for the EnforcementMode const type. func PossibleEnforcementModeValues() []EnforcementMode { - return []EnforcementMode{Audit, Enforce} + return []EnforcementMode{Audit, Enforce, None} } // EnforcementMode1 enumerates the values for enforcement mode 1. @@ -224,11 +245,47 @@ const ( EnforcementMode1Audit EnforcementMode1 = "Audit" // EnforcementMode1Enforce ... EnforcementMode1Enforce EnforcementMode1 = "Enforce" + // EnforcementMode1None ... + EnforcementMode1None EnforcementMode1 = "None" ) // PossibleEnforcementMode1Values returns an array of possible values for the EnforcementMode1 const type. func PossibleEnforcementMode1Values() []EnforcementMode1 { - return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce} + return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce, EnforcementMode1None} +} + +// Exe enumerates the values for exe. +type Exe string + +const ( + // ExeAudit ... + ExeAudit Exe = "Audit" + // ExeEnforce ... + ExeEnforce Exe = "Enforce" + // ExeNone ... + ExeNone Exe = "None" +) + +// PossibleExeValues returns an array of possible values for the Exe const type. +func PossibleExeValues() []Exe { + return []Exe{ExeAudit, ExeEnforce, ExeNone} +} + +// Executable enumerates the values for executable. +type Executable string + +const ( + // ExecutableAudit ... + ExecutableAudit Executable = "Audit" + // ExecutableEnforce ... + ExecutableEnforce Executable = "Enforce" + // ExecutableNone ... + ExecutableNone Executable = "None" +) + +// PossibleExecutableValues returns an array of possible values for the Executable const type. +func PossibleExecutableValues() []Executable { + return []Executable{ExecutableAudit, ExecutableEnforce, ExecutableNone} } // ExportData enumerates the values for export data. @@ -284,23 +341,23 @@ func PossibleFamilyValues() []Family { type FileType string const ( - // Dll ... - Dll FileType = "Dll" - // Exe ... - Exe FileType = "Exe" - // Executable ... - Executable FileType = "Executable" - // Msi ... - Msi FileType = "Msi" - // Script ... - Script FileType = "Script" - // Unknown ... - Unknown FileType = "Unknown" + // FileTypeDll ... + FileTypeDll FileType = "Dll" + // FileTypeExe ... + FileTypeExe FileType = "Exe" + // FileTypeExecutable ... + FileTypeExecutable FileType = "Executable" + // FileTypeMsi ... + FileTypeMsi FileType = "Msi" + // FileTypeScript ... + FileTypeScript FileType = "Script" + // FileTypeUnknown ... + FileTypeUnknown FileType = "Unknown" ) // PossibleFileTypeValues returns an array of possible values for the FileType const type. func PossibleFileTypeValues() []FileType { - return []FileType{Dll, Exe, Executable, Msi, Script, Unknown} + return []FileType{FileTypeDll, FileTypeExe, FileTypeExecutable, FileTypeMsi, FileTypeScript, FileTypeUnknown} } // Issue enumerates the values for issue. @@ -345,6 +402,23 @@ func PossibleKindEnumValues() []KindEnum { return []KindEnum{KindAAD, KindATA, KindCEF, KindExternalSecuritySolution} } +// Msi enumerates the values for msi. +type Msi string + +const ( + // MsiAudit ... + MsiAudit Msi = "Audit" + // MsiEnforce ... + MsiEnforce Msi = "Enforce" + // MsiNone ... + MsiNone Msi = "None" +) + +// PossibleMsiValues returns an array of possible values for the Msi const type. +func PossibleMsiValues() []Msi { + return []Msi{MsiAudit, MsiEnforce, MsiNone} +} + // PricingTier enumerates the values for pricing tier. type PricingTier string @@ -559,6 +633,23 @@ func PossibleResourceStatusValues() []ResourceStatus { return []ResourceStatus{Healthy, NotApplicable, NotHealthy, OffByPolicy} } +// Script enumerates the values for script. +type Script string + +const ( + // ScriptAudit ... + ScriptAudit Script = "Audit" + // ScriptEnforce ... + ScriptEnforce Script = "Enforce" + // ScriptNone ... + ScriptNone Script = "None" +) + +// PossibleScriptValues returns an array of possible values for the Script const type. +func PossibleScriptValues() []Script { + return []Script{ScriptAudit, ScriptEnforce, ScriptNone} +} + // SettingKind enumerates the values for setting kind. type SettingKind string @@ -574,6 +665,23 @@ func PossibleSettingKindValues() []SettingKind { return []SettingKind{SettingKindAlertSuppressionSetting, SettingKindDataExportSetting} } +// Severity enumerates the values for severity. +type Severity string + +const ( + // SeverityHigh ... + SeverityHigh Severity = "High" + // SeverityLow ... + SeverityLow Severity = "Low" + // SeverityMedium ... + SeverityMedium Severity = "Medium" +) + +// PossibleSeverityValues returns an array of possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{SeverityHigh, SeverityLow, SeverityMedium} +} + // SolutionStatus enumerates the values for solution status. type SolutionStatus string @@ -589,25 +697,42 @@ func PossibleSolutionStatusValues() []SolutionStatus { return []SolutionStatus{SolutionStatusDisabled, SolutionStatusEnabled} } +// Source enumerates the values for source. +type Source string + +const ( + // SourceAws ... + SourceAws Source = "Aws" + // SourceAzure ... + SourceAzure Source = "Azure" + // SourceResourceDetails ... + SourceResourceDetails Source = "ResourceDetails" +) + +// PossibleSourceValues returns an array of possible values for the Source const type. +func PossibleSourceValues() []Source { + return []Source{SourceAws, SourceAzure, SourceResourceDetails} +} + // SourceSystem enumerates the values for source system. type SourceSystem string const ( - // AzureAppLocker ... - AzureAppLocker SourceSystem = "Azure_AppLocker" - // AzureAuditD ... - AzureAuditD SourceSystem = "Azure_AuditD" - // NonAzureAppLocker ... - NonAzureAppLocker SourceSystem = "NonAzure_AppLocker" - // NonAzureAuditD ... - NonAzureAuditD SourceSystem = "NonAzure_AuditD" - // None ... - None SourceSystem = "None" + // SourceSystemAzureAppLocker ... + SourceSystemAzureAppLocker SourceSystem = "Azure_AppLocker" + // SourceSystemAzureAuditD ... + SourceSystemAzureAuditD SourceSystem = "Azure_AuditD" + // SourceSystemNonAzureAppLocker ... + SourceSystemNonAzureAppLocker SourceSystem = "NonAzure_AppLocker" + // SourceSystemNonAzureAuditD ... + SourceSystemNonAzureAuditD SourceSystem = "NonAzure_AuditD" + // SourceSystemNone ... + SourceSystemNone SourceSystem = "None" ) // PossibleSourceSystemValues returns an array of possible values for the SourceSystem const type. func PossibleSourceSystemValues() []SourceSystem { - return []SourceSystem{AzureAppLocker, AzureAuditD, NonAzureAppLocker, NonAzureAuditD, None} + return []SourceSystem{SourceSystemAzureAppLocker, SourceSystemAzureAuditD, SourceSystemNonAzureAppLocker, SourceSystemNonAzureAuditD, SourceSystemNone} } // State enumerates the values for state. @@ -662,6 +787,23 @@ func PossibleStatusReasonValues() []StatusReason { return []StatusReason{Expired, NewerRequestInitiated, UserRequested} } +// SubAssessmentStatusCode enumerates the values for sub assessment status code. +type SubAssessmentStatusCode string + +const ( + // SubAssessmentStatusCodeHealthy The resource is healthy + SubAssessmentStatusCodeHealthy SubAssessmentStatusCode = "Healthy" + // SubAssessmentStatusCodeNotApplicable Assessment for this resource did not happen + SubAssessmentStatusCodeNotApplicable SubAssessmentStatusCode = "NotApplicable" + // SubAssessmentStatusCodeUnhealthy The resource has a security issue that needs to be addressed + SubAssessmentStatusCodeUnhealthy SubAssessmentStatusCode = "Unhealthy" +) + +// PossibleSubAssessmentStatusCodeValues returns an array of possible values for the SubAssessmentStatusCode const type. +func PossibleSubAssessmentStatusCodeValues() []SubAssessmentStatusCode { + return []SubAssessmentStatusCode{SubAssessmentStatusCodeHealthy, SubAssessmentStatusCodeNotApplicable, SubAssessmentStatusCodeUnhealthy} +} + // Type enumerates the values for type. type Type string @@ -685,6 +827,21 @@ func PossibleTypeValues() []Type { return []Type{BinarySignature, File, FileHash, ProductSignature, PublisherSignature, VersionAndAboveSignature} } +// ValueType enumerates the values for value type. +type ValueType string + +const ( + // IPCidr An IP range in CIDR format (e.g. '192.168.0.1/8'). + IPCidr ValueType = "IpCidr" + // String Any string value. + String ValueType = "String" +) + +// PossibleValueTypeValues returns an array of possible values for the ValueType const type. +func PossibleValueTypeValues() []ValueType { + return []ValueType{IPCidr, String} +} + // AadConnectivityState1 describes an Azure resource with kind type AadConnectivityState1 struct { // ConnectivityState - Possible values include: 'Discovered', 'NotLicensed', 'Connected' @@ -754,6 +911,100 @@ type AadSolutionProperties struct { ConnectivityState AadConnectivityState `json:"connectivityState,omitempty"` } +// BasicAdditionalData details of the sub-assessment +type BasicAdditionalData interface { + AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) + AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) + AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) + AsAdditionalData() (*AdditionalData, bool) +} + +// AdditionalData details of the sub-assessment +type AdditionalData struct { + // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' + AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +} + +func unmarshalBasicAdditionalData(body []byte) (BasicAdditionalData, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["assessedResourceType"] { + case string(AssessedResourceTypeSQLServerVulnerability): + var ssvp SQLServerVulnerabilityProperties + err := json.Unmarshal(body, &ssvp) + return ssvp, err + case string(AssessedResourceTypeContainerRegistryVulnerability): + var crvp ContainerRegistryVulnerabilityProperties + err := json.Unmarshal(body, &crvp) + return crvp, err + case string(AssessedResourceTypeServerVulnerabilityAssessment): + var svp ServerVulnerabilityProperties + err := json.Unmarshal(body, &svp) + return svp, err + default: + var ad AdditionalData + err := json.Unmarshal(body, &ad) + return ad, err + } +} +func unmarshalBasicAdditionalDataArray(body []byte) ([]BasicAdditionalData, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + adArray := make([]BasicAdditionalData, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ad, err := unmarshalBasicAdditionalData(*rawMessage) + if err != nil { + return nil, err + } + adArray[index] = ad + } + return adArray, nil +} + +// MarshalJSON is the custom marshaler for AdditionalData. +func (ad AdditionalData) MarshalJSON() ([]byte, error) { + ad.AssessedResourceType = AssessedResourceTypeAdditionalData + objectMap := make(map[string]interface{}) + if ad.AssessedResourceType != "" { + objectMap["assessedResourceType"] = ad.AssessedResourceType + } + return json.Marshal(objectMap) +} + +// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { + return nil, false +} + +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsAdditionalData is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsAdditionalData() (*AdditionalData, bool) { + return &ad, true +} + +// AsBasicAdditionalData is the BasicAdditionalData implementation for AdditionalData. +func (ad AdditionalData) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &ad, true +} + // AdvancedThreatProtectionProperties the Advanced Threat Protection settings. type AdvancedThreatProtectionProperties struct { // IsEnabled - Indicates whether Advanced Threat Protection is enabled. @@ -1411,6 +1662,23 @@ type AllowedConnectionsResourceProperties struct { ConnectableResources *[]ConnectableResource `json:"connectableResources,omitempty"` } +// AllowlistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) +// is allowed. +type AllowlistCustomAlertRule struct { + // AllowlistValues - The values to allow. The format of the values depends on the rule type. + AllowlistValues *[]string `json:"allowlistValues,omitempty"` + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' + ValueType ValueType `json:"valueType,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - The type of the custom alert rule. + RuleType *string `json:"ruleType,omitempty"` +} + // AppWhitelistingGroup ... type AppWhitelistingGroup struct { autorest.Response `json:"-"` @@ -1497,14 +1765,15 @@ func (awg *AppWhitelistingGroup) UnmarshalJSON(body []byte) error { // AppWhitelistingGroupData represents a VM/server group and set of rules that are Recommended by Azure // Security Center to be allowed type AppWhitelistingGroupData struct { - // EnforcementMode - Possible values include: 'Audit', 'Enforce' + // EnforcementMode - Possible values include: 'Audit', 'Enforce', 'None' EnforcementMode EnforcementMode `json:"enforcementMode,omitempty"` + ProtectionMode *ProtectionMode `json:"protectionMode,omitempty"` // ConfigurationStatus - Possible values include: 'ConfigurationStatus2Configured', 'ConfigurationStatus2NotConfigured', 'ConfigurationStatus2InProgress', 'ConfigurationStatus2Failed', 'ConfigurationStatus2NoStatus' ConfigurationStatus ConfigurationStatus2 `json:"configurationStatus,omitempty"` // RecommendationStatus - Possible values include: 'RecommendationStatusRecommended', 'RecommendationStatusNotRecommended', 'RecommendationStatusNotAvailable', 'RecommendationStatusNoStatus' RecommendationStatus RecommendationStatus `json:"recommendationStatus,omitempty"` Issues *[]AppWhitelistingIssueSummary `json:"issues,omitempty"` - // SourceSystem - Possible values include: 'AzureAppLocker', 'AzureAuditD', 'NonAzureAppLocker', 'NonAzureAuditD', 'None' + // SourceSystem - Possible values include: 'SourceSystemAzureAppLocker', 'SourceSystemAzureAuditD', 'SourceSystemNonAzureAppLocker', 'SourceSystemNonAzureAuditD', 'SourceSystemNone' SourceSystem SourceSystem `json:"sourceSystem,omitempty"` VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` @@ -1527,8 +1796,10 @@ type AppWhitelistingIssueSummary struct { // AppWhitelistingPutGroupData the altered data of the recommended VM/server group policy type AppWhitelistingPutGroupData struct { - // EnforcementMode - Possible values include: 'EnforcementMode1Audit', 'EnforcementMode1Enforce' - EnforcementMode EnforcementMode1 `json:"enforcementMode,omitempty"` + // EnforcementMode - The enforcement mode of the group. Can also be defined per collection type by using ProtectionMode. Possible values include: 'EnforcementMode1Audit', 'EnforcementMode1Enforce', 'EnforcementMode1None' + EnforcementMode EnforcementMode1 `json:"enforcementMode,omitempty"` + // ProtectionMode - The protection mode of the group per collection type. Can also be defined for all collection types by using EnforcementMode + ProtectionMode *ProtectionMode `json:"protectionMode,omitempty"` VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` } @@ -2064,6 +2335,84 @@ type AutoProvisioningSettingProperties struct { AutoProvision AutoProvision `json:"autoProvision,omitempty"` } +// AwsResourceDetails details of the resource that was assessed +type AwsResourceDetails struct { + // AccountID - READ-ONLY; AWS account ID + AccountID *string `json:"accountId,omitempty"` + // AwsResourceID - READ-ONLY; AWS resource ID. can be ARN or other + AwsResourceID *string `json:"awsResourceId,omitempty"` + // Source - Possible values include: 'SourceResourceDetails', 'SourceAzure', 'SourceAws' + Source Source `json:"source,omitempty"` +} + +// MarshalJSON is the custom marshaler for AwsResourceDetails. +func (ard AwsResourceDetails) MarshalJSON() ([]byte, error) { + ard.Source = SourceAws + objectMap := make(map[string]interface{}) + if ard.Source != "" { + objectMap["source"] = ard.Source + } + return json.Marshal(objectMap) +} + +// AsAzureResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. +func (ard AwsResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { + return nil, false +} + +// AsAwsResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. +func (ard AwsResourceDetails) AsAwsResourceDetails() (*AwsResourceDetails, bool) { + return &ard, true +} + +// AsResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. +func (ard AwsResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { + return nil, false +} + +// AsBasicResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. +func (ard AwsResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { + return &ard, true +} + +// AzureResourceDetails details of the resource that was assessed +type AzureResourceDetails struct { + // ID - READ-ONLY; Azure resource ID of the assessed resource + ID *string `json:"id,omitempty"` + // Source - Possible values include: 'SourceResourceDetails', 'SourceAzure', 'SourceAws' + Source Source `json:"source,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureResourceDetails. +func (ard AzureResourceDetails) MarshalJSON() ([]byte, error) { + ard.Source = SourceAzure + objectMap := make(map[string]interface{}) + if ard.Source != "" { + objectMap["source"] = ard.Source + } + return json.Marshal(objectMap) +} + +// AsAzureResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { + return &ard, true +} + +// AsAwsResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsAwsResourceDetails() (*AwsResourceDetails, bool) { + return nil, false +} + +// AsResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { + return nil, false +} + +// AsBasicResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { + return &ard, true +} + // CefExternalSecuritySolution represents a security solution which sends CEF logs to an OMS workspace type CefExternalSecuritySolution struct { Properties *CefSolutionProperties `json:"properties,omitempty"` @@ -3005,6 +3354,90 @@ type ContactProperties struct { AlertsToAdmins AlertsToAdmins `json:"alertsToAdmins,omitempty"` } +// ContainerRegistryVulnerabilityProperties additional context fields for container registry Vulnerability +// assessment +type ContainerRegistryVulnerabilityProperties struct { + // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, Vulnerability + 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"` + // PublishedTime - READ-ONLY; Published time + PublishedTime *date.Time `json:"publishedTime,omitempty"` + // VendorReferences - READ-ONLY + VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` + // RepositoryName - READ-ONLY; Name of the repository which the vulnerable image belongs to + RepositoryName *string `json:"repositoryName,omitempty"` + // ImageDigest - READ-ONLY; Digest of the vulnerable image + ImageDigest *string `json:"imageDigest,omitempty"` + // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' + AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) MarshalJSON() ([]byte, error) { + crvp.AssessedResourceType = AssessedResourceTypeContainerRegistryVulnerability + objectMap := make(map[string]interface{}) + if crvp.AssessedResourceType != "" { + objectMap["assessedResourceType"] = crvp.AssessedResourceType + } + return json.Marshal(objectMap) +} + +// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { + return &crvp, true +} + +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsAdditionalData is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { + return nil, false +} + +// AsBasicAdditionalData is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &crvp, true +} + +// CustomAlertRule a custom alert rule. +type CustomAlertRule struct { + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - The type of the custom alert rule. + RuleType *string `json:"ruleType,omitempty"` +} + +// CVE CVE details +type CVE struct { + // Title - READ-ONLY; CVE title + Title *string `json:"title,omitempty"` + // Link - READ-ONLY; Link url + Link *string `json:"link,omitempty"` +} + +// CVSS CVSS details +type CVSS struct { + // Base - READ-ONLY; CVSS base + Base *float64 `json:"base,omitempty"` +} + // DataExportSetting represents a data export setting type DataExportSetting struct { // DataExportSettingProperties - Data export setting data @@ -3097,31 +3530,47 @@ type DataExportSettingProperties struct { Enabled *bool `json:"enabled,omitempty"` } -// DiscoveredSecuritySolution ... -type DiscoveredSecuritySolution struct { +// DenylistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is +// denied. +type DenylistCustomAlertRule struct { + // DenylistValues - The values to deny. The format of the values depends on the rule type. + DenylistValues *[]string `json:"denylistValues,omitempty"` + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' + ValueType ValueType `json:"valueType,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - The type of the custom alert rule. + RuleType *string `json:"ruleType,omitempty"` +} + +// DeviceSecurityGroup the device security group resource +type DeviceSecurityGroup struct { autorest.Response `json:"-"` + // DeviceSecurityGroupProperties - Device Security group data + *DeviceSecurityGroupProperties `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 - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - *DiscoveredSecuritySolutionProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for DiscoveredSecuritySolution. -func (dss DiscoveredSecuritySolution) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DeviceSecurityGroup. +func (dsg DeviceSecurityGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dss.DiscoveredSecuritySolutionProperties != nil { - objectMap["properties"] = dss.DiscoveredSecuritySolutionProperties + if dsg.DeviceSecurityGroupProperties != nil { + objectMap["properties"] = dsg.DeviceSecurityGroupProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DiscoveredSecuritySolution struct. -func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroup struct. +func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3129,6 +3578,15 @@ func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + var deviceSecurityGroupProperties DeviceSecurityGroupProperties + err = json.Unmarshal(*v, &deviceSecurityGroupProperties) + if err != nil { + return err + } + dsg.DeviceSecurityGroupProperties = &deviceSecurityGroupProperties + } case "id": if v != nil { var ID string @@ -3136,7 +3594,7 @@ func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { if err != nil { return err } - dss.ID = &ID + dsg.ID = &ID } case "name": if v != nil { @@ -3145,7 +3603,7 @@ func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { if err != nil { return err } - dss.Name = &name + dsg.Name = &name } case "type": if v != nil { @@ -3154,25 +3612,7 @@ func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { if err != nil { return err } - dss.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dss.Location = &location - } - case "properties": - if v != nil { - var discoveredSecuritySolutionProperties DiscoveredSecuritySolutionProperties - err = json.Unmarshal(*v, &discoveredSecuritySolutionProperties) - if err != nil { - return err - } - dss.DiscoveredSecuritySolutionProperties = &discoveredSecuritySolutionProperties + dsg.Type = &typeVar } } } @@ -3180,26 +3620,26 @@ func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { return nil } -// DiscoveredSecuritySolutionList ... -type DiscoveredSecuritySolutionList struct { +// DeviceSecurityGroupList list of device security groups +type DeviceSecurityGroupList struct { autorest.Response `json:"-"` - Value *[]DiscoveredSecuritySolution `json:"value,omitempty"` + // Value - List of device security group objects + Value *[]DeviceSecurityGroup `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } -// DiscoveredSecuritySolutionListIterator provides access to a complete listing of -// DiscoveredSecuritySolution values. -type DiscoveredSecuritySolutionListIterator struct { +// DeviceSecurityGroupListIterator provides access to a complete listing of DeviceSecurityGroup values. +type DeviceSecurityGroupListIterator struct { i int - page DiscoveredSecuritySolutionListPage + page DeviceSecurityGroupListPage } // 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 *DiscoveredSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *DeviceSecurityGroupListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -3224,62 +3664,62 @@ func (iter *DiscoveredSecuritySolutionListIterator) NextWithContext(ctx context. // 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 *DiscoveredSecuritySolutionListIterator) Next() error { +func (iter *DeviceSecurityGroupListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiscoveredSecuritySolutionListIterator) NotDone() bool { +func (iter DeviceSecurityGroupListIterator) 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 DiscoveredSecuritySolutionListIterator) Response() DiscoveredSecuritySolutionList { +func (iter DeviceSecurityGroupListIterator) Response() DeviceSecurityGroupList { 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 DiscoveredSecuritySolutionListIterator) Value() DiscoveredSecuritySolution { +func (iter DeviceSecurityGroupListIterator) Value() DeviceSecurityGroup { if !iter.page.NotDone() { - return DiscoveredSecuritySolution{} + return DeviceSecurityGroup{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the DiscoveredSecuritySolutionListIterator type. -func NewDiscoveredSecuritySolutionListIterator(page DiscoveredSecuritySolutionListPage) DiscoveredSecuritySolutionListIterator { - return DiscoveredSecuritySolutionListIterator{page: page} +// Creates a new instance of the DeviceSecurityGroupListIterator type. +func NewDeviceSecurityGroupListIterator(page DeviceSecurityGroupListPage) DeviceSecurityGroupListIterator { + return DeviceSecurityGroupListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (dssl DiscoveredSecuritySolutionList) IsEmpty() bool { - return dssl.Value == nil || len(*dssl.Value) == 0 +func (dsgl DeviceSecurityGroupList) IsEmpty() bool { + return dsgl.Value == nil || len(*dsgl.Value) == 0 } -// discoveredSecuritySolutionListPreparer prepares a request to retrieve the next set of results. +// deviceSecurityGroupListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (dssl DiscoveredSecuritySolutionList) discoveredSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { - if dssl.NextLink == nil || len(to.String(dssl.NextLink)) < 1 { +func (dsgl DeviceSecurityGroupList) deviceSecurityGroupListPreparer(ctx context.Context) (*http.Request, error) { + if dsgl.NextLink == nil || len(to.String(dsgl.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(dssl.NextLink))) + autorest.WithBaseURL(to.String(dsgl.NextLink))) } -// DiscoveredSecuritySolutionListPage contains a page of DiscoveredSecuritySolution values. -type DiscoveredSecuritySolutionListPage struct { - fn func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error) - dssl DiscoveredSecuritySolutionList +// DeviceSecurityGroupListPage contains a page of DeviceSecurityGroup values. +type DeviceSecurityGroupListPage struct { + fn func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error) + dsgl DeviceSecurityGroupList } // 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 *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { +func (page *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -3288,46 +3728,287 @@ func (page *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dssl) + next, err := page.fn(ctx, page.dsgl) if err != nil { return err } - page.dssl = next + page.dsgl = 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 *DiscoveredSecuritySolutionListPage) Next() error { +func (page *DeviceSecurityGroupListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiscoveredSecuritySolutionListPage) NotDone() bool { - return !page.dssl.IsEmpty() +func (page DeviceSecurityGroupListPage) NotDone() bool { + return !page.dsgl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page DiscoveredSecuritySolutionListPage) Response() DiscoveredSecuritySolutionList { - return page.dssl +func (page DeviceSecurityGroupListPage) Response() DeviceSecurityGroupList { + return page.dsgl } // Values returns the slice of values for the current page or nil if there are no values. -func (page DiscoveredSecuritySolutionListPage) Values() []DiscoveredSecuritySolution { - if page.dssl.IsEmpty() { +func (page DeviceSecurityGroupListPage) Values() []DeviceSecurityGroup { + if page.dsgl.IsEmpty() { return nil } - return *page.dssl.Value + return *page.dsgl.Value } -// Creates a new instance of the DiscoveredSecuritySolutionListPage type. -func NewDiscoveredSecuritySolutionListPage(getNextPage func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error)) DiscoveredSecuritySolutionListPage { - return DiscoveredSecuritySolutionListPage{fn: getNextPage} +// Creates a new instance of the DeviceSecurityGroupListPage type. +func NewDeviceSecurityGroupListPage(getNextPage func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error)) DeviceSecurityGroupListPage { + return DeviceSecurityGroupListPage{fn: getNextPage} } -// DiscoveredSecuritySolutionProperties ... -type DiscoveredSecuritySolutionProperties struct { +// DeviceSecurityGroupProperties describes properties of a security group. +type DeviceSecurityGroupProperties struct { + // ThresholdRules - The list of custom alert threshold rules. + ThresholdRules *[]ThresholdCustomAlertRule `json:"thresholdRules,omitempty"` + // TimeWindowRules - The list of custom alert time-window rules. + TimeWindowRules *[]TimeWindowCustomAlertRule `json:"timeWindowRules,omitempty"` + // AllowlistRules - The allow-list custom alert rules. + AllowlistRules *[]AllowlistCustomAlertRule `json:"allowlistRules,omitempty"` + // DenylistRules - The deny-list custom alert rules. + DenylistRules *[]DenylistCustomAlertRule `json:"denylistRules,omitempty"` +} + +// DiscoveredSecuritySolution ... +type DiscoveredSecuritySolution struct { + autorest.Response `json:"-"` + // 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 - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + *DiscoveredSecuritySolutionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiscoveredSecuritySolution. +func (dss DiscoveredSecuritySolution) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dss.DiscoveredSecuritySolutionProperties != nil { + objectMap["properties"] = dss.DiscoveredSecuritySolutionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiscoveredSecuritySolution struct. +func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { + 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 + } + dss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dss.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dss.Location = &location + } + case "properties": + if v != nil { + var discoveredSecuritySolutionProperties DiscoveredSecuritySolutionProperties + err = json.Unmarshal(*v, &discoveredSecuritySolutionProperties) + if err != nil { + return err + } + dss.DiscoveredSecuritySolutionProperties = &discoveredSecuritySolutionProperties + } + } + } + + return nil +} + +// DiscoveredSecuritySolutionList ... +type DiscoveredSecuritySolutionList struct { + autorest.Response `json:"-"` + Value *[]DiscoveredSecuritySolution `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// DiscoveredSecuritySolutionListIterator provides access to a complete listing of +// DiscoveredSecuritySolution values. +type DiscoveredSecuritySolutionListIterator struct { + i int + page DiscoveredSecuritySolutionListPage +} + +// 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 *DiscoveredSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListIterator.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 *DiscoveredSecuritySolutionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiscoveredSecuritySolutionListIterator) 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 DiscoveredSecuritySolutionListIterator) Response() DiscoveredSecuritySolutionList { + 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 DiscoveredSecuritySolutionListIterator) Value() DiscoveredSecuritySolution { + if !iter.page.NotDone() { + return DiscoveredSecuritySolution{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DiscoveredSecuritySolutionListIterator type. +func NewDiscoveredSecuritySolutionListIterator(page DiscoveredSecuritySolutionListPage) DiscoveredSecuritySolutionListIterator { + return DiscoveredSecuritySolutionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dssl DiscoveredSecuritySolutionList) IsEmpty() bool { + return dssl.Value == nil || len(*dssl.Value) == 0 +} + +// discoveredSecuritySolutionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dssl DiscoveredSecuritySolutionList) discoveredSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { + if dssl.NextLink == nil || len(to.String(dssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dssl.NextLink))) +} + +// DiscoveredSecuritySolutionListPage contains a page of DiscoveredSecuritySolution values. +type DiscoveredSecuritySolutionListPage struct { + fn func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error) + dssl DiscoveredSecuritySolutionList +} + +// 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 *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListPage.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.dssl) + if err != nil { + return err + } + page.dssl = 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 *DiscoveredSecuritySolutionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiscoveredSecuritySolutionListPage) NotDone() bool { + return !page.dssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiscoveredSecuritySolutionListPage) Response() DiscoveredSecuritySolutionList { + return page.dssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiscoveredSecuritySolutionListPage) Values() []DiscoveredSecuritySolution { + if page.dssl.IsEmpty() { + return nil + } + return *page.dssl.Value +} + +// Creates a new instance of the DiscoveredSecuritySolutionListPage type. +func NewDiscoveredSecuritySolutionListPage(getNextPage func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error)) DiscoveredSecuritySolutionListPage { + return DiscoveredSecuritySolutionListPage{fn: getNextPage} +} + +// DiscoveredSecuritySolutionProperties ... +type DiscoveredSecuritySolutionProperties struct { // SecurityFamily - The security family of the discovered solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' SecurityFamily Family `json:"securityFamily,omitempty"` // Offer - The security solutions' image offer @@ -4006,7 +4687,7 @@ type IoTSecurityAggregatedAlert struct { Type *string `json:"type,omitempty"` // Tags - Resource tags Tags map[string]*string `json:"tags"` - // IoTSecurityAggregatedAlertProperties - Security Solution Aggregated Alert data + // IoTSecurityAggregatedAlertProperties - IoT Security solution aggregated alert details. *IoTSecurityAggregatedAlertProperties `json:"properties,omitempty"` } @@ -4082,12 +4763,12 @@ func (itsaa *IoTSecurityAggregatedAlert) UnmarshalJSON(body []byte) error { return nil } -// IoTSecurityAggregatedAlertList list of IoT aggregated security alerts +// IoTSecurityAggregatedAlertList list of IoT Security solution aggregated alert data. type IoTSecurityAggregatedAlertList struct { autorest.Response `json:"-"` - // Value - List of aggregated alerts data + // Value - List of aggregated alerts data. Value *[]IoTSecurityAggregatedAlert `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. + // NextLink - READ-ONLY; When there is too much alert data for one page, use this URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } @@ -4229,35 +4910,35 @@ func NewIoTSecurityAggregatedAlertListPage(getNextPage func(context.Context, IoT return IoTSecurityAggregatedAlertListPage{fn: getNextPage} } -// IoTSecurityAggregatedAlertProperties security Solution Aggregated Alert data +// IoTSecurityAggregatedAlertProperties ioT Security solution aggregated alert details. type IoTSecurityAggregatedAlertProperties struct { - // AlertType - READ-ONLY; Name of the alert type + // AlertType - READ-ONLY; Name of the alert type. AlertType *string `json:"alertType,omitempty"` - // AlertDisplayName - READ-ONLY; Display name of the alert type + // AlertDisplayName - READ-ONLY; Display name of the alert type. AlertDisplayName *string `json:"alertDisplayName,omitempty"` - // AggregatedDateUtc - READ-ONLY; The date the incidents were detected by the vendor + // AggregatedDateUtc - READ-ONLY; Date of detection. AggregatedDateUtc *date.Date `json:"aggregatedDateUtc,omitempty"` - // VendorName - READ-ONLY; Name of the vendor that discovered the incident + // VendorName - READ-ONLY; Name of the organization that raised the alert. VendorName *string `json:"vendorName,omitempty"` - // ReportedSeverity - READ-ONLY; Estimated severity of this alert. Possible values include: 'Informational', 'Low', 'Medium', 'High' + // ReportedSeverity - READ-ONLY; Assessed alert severity. Possible values include: 'Informational', 'Low', 'Medium', 'High' ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` - // RemediationSteps - READ-ONLY; Recommended steps for remediation + // RemediationSteps - READ-ONLY; Recommended steps for remediation. RemediationSteps *string `json:"remediationSteps,omitempty"` - // Description - READ-ONLY; Description of the incident and what it means + // Description - READ-ONLY; Description of the suspected vulnerability and meaning. Description *string `json:"description,omitempty"` - // Count - READ-ONLY; Occurrence number of the alert within the aggregated date + // Count - READ-ONLY; Number of alerts occurrences within the aggregated time window. Count *int32 `json:"count,omitempty"` - // EffectedResourceType - READ-ONLY; Azure resource ID of the resource that got the alerts + // EffectedResourceType - READ-ONLY; Azure resource ID of the resource that received the alerts. EffectedResourceType *string `json:"effectedResourceType,omitempty"` - // SystemSource - READ-ONLY; The type of the alerted resource (Azure, Non-Azure) + // SystemSource - READ-ONLY; The type of the alerted resource (Azure, Non-Azure). SystemSource *string `json:"systemSource,omitempty"` - // ActionTaken - READ-ONLY; The action that was taken as a response to the alert (Active, Blocked etc.) + // ActionTaken - READ-ONLY; IoT Security solution alert response. ActionTaken *string `json:"actionTaken,omitempty"` - // LogAnalyticsQuery - READ-ONLY; query in log analytics to get the list of affected devices/alerts + // LogAnalyticsQuery - READ-ONLY; Log analytics query for getting the list of affected devices/alerts. LogAnalyticsQuery *string `json:"logAnalyticsQuery,omitempty"` } -// IoTSecurityAggregatedRecommendation security Solution Recommendation Information +// IoTSecurityAggregatedRecommendation ioT Security solution recommendation information. type IoTSecurityAggregatedRecommendation struct { autorest.Response `json:"-"` // ID - READ-ONLY; Resource Id @@ -4344,12 +5025,12 @@ func (itsar *IoTSecurityAggregatedRecommendation) UnmarshalJSON(body []byte) err return nil } -// IoTSecurityAggregatedRecommendationList list of IoT aggregated security recommendations +// IoTSecurityAggregatedRecommendationList list of IoT Security solution aggregated recommendations. type IoTSecurityAggregatedRecommendationList struct { autorest.Response `json:"-"` - // Value - List of aggregated alerts data + // Value - List of aggregated recommendations data. Value *[]IoTSecurityAggregatedRecommendation `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. + // NextLink - READ-ONLY; When there is too much alert data for one page, use this URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } @@ -4492,82 +5173,63 @@ func NewIoTSecurityAggregatedRecommendationListPage(getNextPage func(context.Con return IoTSecurityAggregatedRecommendationListPage{fn: getNextPage} } -// IoTSecurityAggregatedRecommendationProperties security Solution Recommendation Information +// IoTSecurityAggregatedRecommendationProperties ioT Security solution aggregated recommendation +// information type IoTSecurityAggregatedRecommendationProperties struct { - // RecommendationName - Name of the recommendation + // RecommendationName - Name of the recommendation. RecommendationName *string `json:"recommendationName,omitempty"` // RecommendationDisplayName - READ-ONLY; Display name of the recommendation type. RecommendationDisplayName *string `json:"recommendationDisplayName,omitempty"` - // Description - READ-ONLY; Description of the incident and what it means + // Description - READ-ONLY; Description of the suspected vulnerability and meaning. Description *string `json:"description,omitempty"` - // RecommendationTypeID - READ-ONLY; The recommendation-type GUID. + // RecommendationTypeID - READ-ONLY; Recommendation-type GUID. RecommendationTypeID *string `json:"recommendationTypeId,omitempty"` - // DetectedBy - READ-ONLY; Name of the vendor that discovered the issue + // DetectedBy - READ-ONLY; Name of the organization that made the recommendation. DetectedBy *string `json:"detectedBy,omitempty"` // RemediationSteps - READ-ONLY; Recommended steps for remediation RemediationSteps *string `json:"remediationSteps,omitempty"` - // ReportedSeverity - READ-ONLY; Estimated severity of this recommendation. Possible values include: 'Informational', 'Low', 'Medium', 'High' + // ReportedSeverity - READ-ONLY; Assessed recommendation severity. Possible values include: 'Informational', 'Low', 'Medium', 'High' ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` - // HealthyDevices - READ-ONLY; the number of the healthy devices within the solution + // HealthyDevices - READ-ONLY; Number of healthy devices within the IoT Security solution. HealthyDevices *int32 `json:"healthyDevices,omitempty"` - // UnhealthyDeviceCount - READ-ONLY; the number of the unhealthy devices within the solution + // UnhealthyDeviceCount - READ-ONLY; Number of unhealthy devices within the IoT Security solution. UnhealthyDeviceCount *int32 `json:"unhealthyDeviceCount,omitempty"` - // LogAnalyticsQuery - READ-ONLY; query in log analytics to get the list of affected devices/alerts + // LogAnalyticsQuery - READ-ONLY; Log analytics query for getting the list of affected devices/alerts. LogAnalyticsQuery *string `json:"logAnalyticsQuery,omitempty"` } -// IoTSecurityAlertedDevice statistic information about the number of alerts per device during the last -// period +// IoTSecurityAlertedDevice statistical information about the number of alerts per device during last set +// number of days. type IoTSecurityAlertedDevice struct { - // DeviceID - READ-ONLY; Name of the alert type + // DeviceID - READ-ONLY; Device identifier. DeviceID *string `json:"deviceId,omitempty"` - // AlertsCount - READ-ONLY; the number of alerts raised for this device + // AlertsCount - READ-ONLY; Number of alerts raised for this device. AlertsCount *int32 `json:"alertsCount,omitempty"` } -// IoTSecurityAlertedDevicesList list of devices with the count of raised alerts -type IoTSecurityAlertedDevicesList struct { - // Value - List of aggregated alerts data - Value *[]IoTSecurityAlertedDevice `json:"value,omitempty"` -} - -// IoTSecurityDeviceAlert statistic information about the number of alerts per alert type during the last -// period +// IoTSecurityDeviceAlert statistical information about the number of alerts per alert type during last set +// number of days type IoTSecurityDeviceAlert struct { // AlertDisplayName - READ-ONLY; Display name of the alert AlertDisplayName *string `json:"alertDisplayName,omitempty"` - // ReportedSeverity - READ-ONLY; Estimated severity of this alert. Possible values include: 'Informational', 'Low', 'Medium', 'High' + // ReportedSeverity - READ-ONLY; Assessed Alert severity. Possible values include: 'Informational', 'Low', 'Medium', 'High' ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` - // AlertsCount - READ-ONLY; the number of alerts raised for this alert type + // AlertsCount - READ-ONLY; Number of alerts raised for this alert type. AlertsCount *int32 `json:"alertsCount,omitempty"` } -// IoTSecurityDeviceAlertsList list of alerts with the count of raised alerts -type IoTSecurityDeviceAlertsList struct { - // Value - List of top alerts data - Value *[]IoTSecurityDeviceAlert `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` -} - -// IoTSecurityDeviceRecommendation statistic information about the number of recommendations per -// recommendation type +// IoTSecurityDeviceRecommendation statistical information about the number of recommendations per device, +// per recommendation type. type IoTSecurityDeviceRecommendation struct { - // RecommendationDisplayName - READ-ONLY; Display name of the recommendation + // RecommendationDisplayName - READ-ONLY; Display name of the recommendation. RecommendationDisplayName *string `json:"recommendationDisplayName,omitempty"` - // ReportedSeverity - READ-ONLY; Estimated severity of this recommendation. Possible values include: 'Informational', 'Low', 'Medium', 'High' + // ReportedSeverity - READ-ONLY; Assessed recommendation severity. Possible values include: 'Informational', 'Low', 'Medium', 'High' ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` - // DevicesCount - READ-ONLY; the number of device with this recommendation + // DevicesCount - READ-ONLY; Number of devices with this recommendation. DevicesCount *int32 `json:"devicesCount,omitempty"` } -// IoTSecurityDeviceRecommendationsList list of recommendations with the count of devices -type IoTSecurityDeviceRecommendationsList struct { - // Value - List of aggregated recommendation data - Value *[]IoTSecurityDeviceRecommendation `json:"value,omitempty"` -} - -// IoTSecuritySolutionAnalyticsModel security Analytics of a security solution +// IoTSecuritySolutionAnalyticsModel security analytics of your IoT Security solution type IoTSecuritySolutionAnalyticsModel struct { autorest.Response `json:"-"` // IoTSecuritySolutionAnalyticsModelProperties - Security Solution Aggregated Alert data @@ -4640,40 +5302,40 @@ func (itssam *IoTSecuritySolutionAnalyticsModel) UnmarshalJSON(body []byte) erro return nil } -// IoTSecuritySolutionAnalyticsModelList list of Security Analytics of a security solution +// IoTSecuritySolutionAnalyticsModelList list of Security analytics of your IoT Security solution type IoTSecuritySolutionAnalyticsModelList struct { autorest.Response `json:"-"` - // Value - List of Security Analytics of a security solution + // Value - List of Security analytics of your IoT Security solution Value *[]IoTSecuritySolutionAnalyticsModel `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. + // NextLink - READ-ONLY; When there is too much alert data for one page, use this URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } -// IoTSecuritySolutionAnalyticsModelProperties security Analytics of a security solution properties +// IoTSecuritySolutionAnalyticsModelProperties security analytics properties of your IoT Security solution type IoTSecuritySolutionAnalyticsModelProperties struct { - // Metrics - READ-ONLY; Security Analytics of a security solution + // Metrics - READ-ONLY; Security analytics of your IoT Security solution. Metrics *IoTSeverityMetrics `json:"metrics,omitempty"` - // UnhealthyDeviceCount - READ-ONLY; number of unhealthy devices + // UnhealthyDeviceCount - READ-ONLY; Number of unhealthy devices within your IoT Security solution. UnhealthyDeviceCount *int32 `json:"unhealthyDeviceCount,omitempty"` - // DevicesMetrics - READ-ONLY; The list of devices metrics by the aggregated date. + // DevicesMetrics - READ-ONLY; List of device metrics by the aggregation date. DevicesMetrics *[]IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem `json:"devicesMetrics,omitempty"` - // TopAlertedDevices - The list of top 3 devices with the most attacked. - TopAlertedDevices *IoTSecurityAlertedDevicesList `json:"topAlertedDevices,omitempty"` - // MostPrevalentDeviceAlerts - The list of most prevalent 3 alerts. - MostPrevalentDeviceAlerts *IoTSecurityDeviceAlertsList `json:"mostPrevalentDeviceAlerts,omitempty"` - // MostPrevalentDeviceRecommendations - The list of most prevalent 3 recommendations. - MostPrevalentDeviceRecommendations *IoTSecurityDeviceRecommendationsList `json:"mostPrevalentDeviceRecommendations,omitempty"` + // TopAlertedDevices - List of the 3 devices with the most alerts. + TopAlertedDevices *[]IoTSecurityAlertedDevice `json:"topAlertedDevices,omitempty"` + // MostPrevalentDeviceAlerts - List of the 3 most prevalent device alerts. + MostPrevalentDeviceAlerts *[]IoTSecurityDeviceAlert `json:"mostPrevalentDeviceAlerts,omitempty"` + // MostPrevalentDeviceRecommendations - List of the 3 most prevalent device recommendations. + MostPrevalentDeviceRecommendations *[]IoTSecurityDeviceRecommendation `json:"mostPrevalentDeviceRecommendations,omitempty"` } // IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem ... type IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem struct { - // Date - the date of the metrics + // Date - Aggregation of IoT Security solution device alert metrics by date. Date *date.Time `json:"date,omitempty"` - // DevicesMetrics - devices alerts count by severity. + // DevicesMetrics - Device alert count by severity. DevicesMetrics *IoTSeverityMetrics `json:"devicesMetrics,omitempty"` } -// IoTSecuritySolutionModel security Solution +// IoTSecuritySolutionModel ioT Security solution configuration and resource information. type IoTSecuritySolutionModel struct { autorest.Response `json:"-"` // ID - READ-ONLY; Resource Id @@ -4780,9 +5442,9 @@ type IoTSecuritySolutionProperties struct { Workspace *string `json:"workspace,omitempty"` // DisplayName - Resource display name. DisplayName *string `json:"displayName,omitempty"` - // Status - Security solution status. Possible values include: 'SolutionStatusEnabled', 'SolutionStatusDisabled' + // Status - Status of the IoT Security solution. Possible values include: 'SolutionStatusEnabled', 'SolutionStatusDisabled' Status SolutionStatus `json:"status,omitempty"` - // Export - List of additional export to workspace data options + // Export - List of additional options for exporting to workspace data. Export *[]ExportData `json:"export,omitempty"` // DisabledDataSources - Disabled data sources. Disabling these data sources compromises the system. DisabledDataSources *[]DataSource `json:"disabledDataSources,omitempty"` @@ -4794,10 +5456,10 @@ type IoTSecuritySolutionProperties struct { RecommendationsConfiguration *[]RecommendationConfigurationProperties `json:"recommendationsConfiguration,omitempty"` } -// IoTSecuritySolutionsList list of iot solutions +// IoTSecuritySolutionsList list of IoT Security solutions. type IoTSecuritySolutionsList struct { autorest.Response `json:"-"` - // Value - List of security solutions + // Value - List of IoT Security solutions Value *[]IoTSecuritySolutionModel `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` @@ -4941,13 +5603,13 @@ func NewIoTSecuritySolutionsListPage(getNextPage func(context.Context, IoTSecuri return IoTSecuritySolutionsListPage{fn: getNextPage} } -// IoTSeverityMetrics severity metrics +// IoTSeverityMetrics ioT Security solution analytics severity metrics. type IoTSeverityMetrics struct { - // High - count of high severity items + // High - Count of high severity alerts/recommendations. High *int32 `json:"high,omitempty"` - // Medium - count of medium severity items + // Medium - Count of medium severity alerts/recommendations. Medium *int32 `json:"medium,omitempty"` - // Low - count of low severity items + // Low - Count of low severity alerts/recommendations. Low *int32 `json:"low,omitempty"` } @@ -5207,6 +5869,8 @@ type JitNetworkAccessPolicyInitiatePort struct { type JitNetworkAccessPolicyInitiateRequest struct { // VirtualMachines - A list of virtual machines & ports to open access for VirtualMachines *[]JitNetworkAccessPolicyInitiateVirtualMachine `json:"virtualMachines,omitempty"` + // Justification - The justification for making the initiate request + Justification *string `json:"justification,omitempty"` } // JitNetworkAccessPolicyInitiateVirtualMachine ... @@ -5257,6 +5921,8 @@ type JitNetworkAccessRequest struct { StartTimeUtc *date.Time `json:"startTimeUtc,omitempty"` // Requestor - The identity of the person who made the request Requestor *string `json:"requestor,omitempty"` + // Justification - The justification for making the initiate request + Justification *string `json:"justification,omitempty"` } // JitNetworkAccessRequestPort ... @@ -5290,9 +5956,23 @@ type Kind struct { Kind *string `json:"kind,omitempty"` } -// Location describes an Azure resource with location -type Location struct { - // Location - READ-ONLY; Location where the resource is stored +// ListCustomAlertRule a List custom alert rule. +type ListCustomAlertRule struct { + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' + ValueType ValueType `json:"valueType,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - The type of the custom alert rule. + RuleType *string `json:"ruleType,omitempty"` +} + +// Location describes an Azure resource with location +type Location struct { + // Location - READ-ONLY; Location where the resource is stored Location *string `json:"location,omitempty"` } @@ -5476,7 +6156,7 @@ type PathRecommendation struct { Common *bool `json:"common,omitempty"` UserSids *[]string `json:"userSids,omitempty"` Usernames *[]UserRecommendation `json:"usernames,omitempty"` - // FileType - Possible values include: 'Exe', 'Dll', 'Msi', 'Script', 'Executable', 'Unknown' + // FileType - Possible values include: 'FileTypeExe', 'FileTypeDll', 'FileTypeMsi', 'FileTypeScript', 'FileTypeExecutable', 'FileTypeUnknown' FileType FileType `json:"fileType,omitempty"` // ConfigurationStatus - Possible values include: 'ConfigurationStatus1Configured', 'ConfigurationStatus1NotConfigured', 'ConfigurationStatus1InProgress', 'ConfigurationStatus1Failed', 'ConfigurationStatus1NoStatus' ConfigurationStatus ConfigurationStatus1 `json:"configurationStatus,omitempty"` @@ -5572,6 +6252,19 @@ type PricingProperties struct { FreeTrialRemainingTime *string `json:"freeTrialRemainingTime,omitempty"` } +// ProtectionMode the protection mode of the collection/file types. Exe/Msi/Script are used for Windows, +// Executable is used for Linux. +type ProtectionMode struct { + // Exe - Possible values include: 'ExeAudit', 'ExeEnforce', 'ExeNone' + Exe Exe `json:"exe,omitempty"` + // Msi - Possible values include: 'MsiAudit', 'MsiEnforce', 'MsiNone' + Msi Msi `json:"msi,omitempty"` + // Script - Possible values include: 'ScriptAudit', 'ScriptEnforce', 'ScriptNone' + Script Script `json:"script,omitempty"` + // Executable - Possible values include: 'ExecutableAudit', 'ExecutableEnforce', 'ExecutableNone' + Executable Executable `json:"executable,omitempty"` +} + // PublisherInfo represents the publisher information of a process/rule type PublisherInfo struct { // PublisherName - The Subject field of the x.509 certificate used to sign the code, using the following fields - O = Organization, L = Locality, S = State or Province, and C = Country @@ -5584,13 +6277,13 @@ type PublisherInfo struct { Version *string `json:"version,omitempty"` } -// RecommendationConfigurationProperties recommendation configuration +// RecommendationConfigurationProperties the type of IoT Security recommendation. type RecommendationConfigurationProperties struct { - // RecommendationType - The recommendation type. Possible values include: 'IoTACRAuthentication', 'IoTAgentSendsUnutilizedMessages', 'IoTBaseline', 'IoTEdgeHubMemOptimize', 'IoTEdgeLoggingOptions', 'IoTInconsistentModuleSettings', 'IoTInstallAgent', 'IoTIPFilterDenyAll', 'IoTIPFilterPermissiveRule', 'IoTOpenPorts', 'IoTPermissiveFirewallPolicy', 'IoTPermissiveInputFirewallRules', 'IoTPermissiveOutputFirewallRules', 'IoTPrivilegedDockerOptions', 'IoTSharedCredentials', 'IoTVulnerableTLSCipherSuite' + // RecommendationType - The type of IoT Security recommendation. Possible values include: 'IoTACRAuthentication', 'IoTAgentSendsUnutilizedMessages', 'IoTBaseline', 'IoTEdgeHubMemOptimize', 'IoTEdgeLoggingOptions', 'IoTInconsistentModuleSettings', 'IoTInstallAgent', 'IoTIPFilterDenyAll', 'IoTIPFilterPermissiveRule', 'IoTOpenPorts', 'IoTPermissiveFirewallPolicy', 'IoTPermissiveInputFirewallRules', 'IoTPermissiveOutputFirewallRules', 'IoTPrivilegedDockerOptions', 'IoTSharedCredentials', 'IoTVulnerableTLSCipherSuite' RecommendationType RecommendationType `json:"recommendationType,omitempty"` // Name - READ-ONLY Name *string `json:"name,omitempty"` - // Status - Recommendation status. The recommendation is not generated when the status is disabled. Possible values include: 'Disabled', 'Enabled' + // Status - Recommendation status. When the recommendation status is disabled recommendations are not generated. Possible values include: 'Disabled', 'Enabled' Status RecommendationConfigStatus `json:"status,omitempty"` } @@ -6310,6 +7003,90 @@ type Resource struct { Type *string `json:"type,omitempty"` } +// BasicResourceDetails details of the resource that was assessed +type BasicResourceDetails interface { + AsAzureResourceDetails() (*AzureResourceDetails, bool) + AsAwsResourceDetails() (*AwsResourceDetails, bool) + AsResourceDetails() (*ResourceDetails, bool) +} + +// ResourceDetails details of the resource that was assessed +type ResourceDetails struct { + // Source - Possible values include: 'SourceResourceDetails', 'SourceAzure', 'SourceAws' + Source Source `json:"source,omitempty"` +} + +func unmarshalBasicResourceDetails(body []byte) (BasicResourceDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["source"] { + case string(SourceAzure): + var ard AzureResourceDetails + err := json.Unmarshal(body, &ard) + return ard, err + case string(SourceAws): + var ard AwsResourceDetails + err := json.Unmarshal(body, &ard) + return ard, err + default: + var rd ResourceDetails + err := json.Unmarshal(body, &rd) + return rd, err + } +} +func unmarshalBasicResourceDetailsArray(body []byte) ([]BasicResourceDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rdArray := make([]BasicResourceDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rd, err := unmarshalBasicResourceDetails(*rawMessage) + if err != nil { + return nil, err + } + rdArray[index] = rd + } + return rdArray, nil +} + +// MarshalJSON is the custom marshaler for ResourceDetails. +func (rd ResourceDetails) MarshalJSON() ([]byte, error) { + rd.Source = SourceResourceDetails + objectMap := make(map[string]interface{}) + if rd.Source != "" { + objectMap["source"] = rd.Source + } + return json.Marshal(objectMap) +} + +// AsAzureResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { + return nil, false +} + +// AsAwsResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsAwsResourceDetails() (*AwsResourceDetails, bool) { + return nil, false +} + +// AsResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { + return &rd, true +} + +// AsBasicResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { + return &rd, true +} + // SensitivityLabel the sensitivity label. type SensitivityLabel struct { // DisplayName - The name of the sensitivity label. @@ -6404,6 +7181,61 @@ type ServerVulnerabilityAssessmentsList struct { Value *[]ServerVulnerabilityAssessment `json:"value,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 +} + +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return &svp, true +} + +// AsAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { + return nil, false +} + +// AsBasicAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &svp, true +} + // Setting represents a security setting in Azure Security Center. type Setting struct { autorest.Response `json:"-"` @@ -6575,6 +7407,405 @@ func NewSettingsListPage(getNextPage func(context.Context, SettingsList) (Settin return SettingsListPage{fn: getNextPage} } +// SQLServerVulnerabilityProperties details of the resource that was assessed +type SQLServerVulnerabilityProperties struct { + // Type - READ-ONLY; The resource type the sub assessment refers to in its resource details + Type *string `json:"type,omitempty"` + // Query - READ-ONLY; The T-SQL query that runs on your SQL database to perform the particular check + Query *string `json:"query,omitempty"` + // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' + AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { + ssvp.AssessedResourceType = AssessedResourceTypeSQLServerVulnerability + objectMap := make(map[string]interface{}) + if ssvp.AssessedResourceType != "" { + objectMap["assessedResourceType"] = ssvp.AssessedResourceType + } + return json.Marshal(objectMap) +} + +// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { + return &ssvp, true +} + +// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { + return nil, false +} + +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsAdditionalData is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { + return nil, false +} + +// AsBasicAdditionalData is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. +func (ssvp SQLServerVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &ssvp, true +} + +// SubAssessment security sub-assessment on a resource +type SubAssessment struct { + autorest.Response `json:"-"` + *SubAssessmentProperties `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 SubAssessment. +func (sa SubAssessment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sa.SubAssessmentProperties != nil { + objectMap["properties"] = sa.SubAssessmentProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SubAssessment struct. +func (sa *SubAssessment) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var subAssessmentProperties SubAssessmentProperties + err = json.Unmarshal(*v, &subAssessmentProperties) + if err != nil { + return err + } + sa.SubAssessmentProperties = &subAssessmentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sa.Type = &typeVar + } + } + } + + return nil +} + +// SubAssessmentList list of security sub-assessments +type SubAssessmentList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY + Value *[]SubAssessment `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// SubAssessmentListIterator provides access to a complete listing of SubAssessment values. +type SubAssessmentListIterator struct { + i int + page SubAssessmentListPage +} + +// 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 *SubAssessmentListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentListIterator.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 *SubAssessmentListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SubAssessmentListIterator) 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 SubAssessmentListIterator) Response() SubAssessmentList { + 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 SubAssessmentListIterator) Value() SubAssessment { + if !iter.page.NotDone() { + return SubAssessment{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SubAssessmentListIterator type. +func NewSubAssessmentListIterator(page SubAssessmentListPage) SubAssessmentListIterator { + return SubAssessmentListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sal SubAssessmentList) IsEmpty() bool { + return sal.Value == nil || len(*sal.Value) == 0 +} + +// subAssessmentListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sal SubAssessmentList) subAssessmentListPreparer(ctx context.Context) (*http.Request, error) { + if sal.NextLink == nil || len(to.String(sal.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sal.NextLink))) +} + +// SubAssessmentListPage contains a page of SubAssessment values. +type SubAssessmentListPage struct { + fn func(context.Context, SubAssessmentList) (SubAssessmentList, error) + sal SubAssessmentList +} + +// 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 *SubAssessmentListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentListPage.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.sal) + if err != nil { + return err + } + page.sal = 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 *SubAssessmentListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SubAssessmentListPage) NotDone() bool { + return !page.sal.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SubAssessmentListPage) Response() SubAssessmentList { + return page.sal +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SubAssessmentListPage) Values() []SubAssessment { + if page.sal.IsEmpty() { + return nil + } + return *page.sal.Value +} + +// Creates a new instance of the SubAssessmentListPage type. +func NewSubAssessmentListPage(getNextPage func(context.Context, SubAssessmentList) (SubAssessmentList, error)) SubAssessmentListPage { + return SubAssessmentListPage{fn: getNextPage} +} + +// SubAssessmentProperties describes properties of an sub-assessment. +type SubAssessmentProperties struct { + // ID - READ-ONLY; Vulnerability ID + ID *string `json:"id,omitempty"` + // DisplayName - READ-ONLY; User friendly display name of the sub-assessment + DisplayName *string `json:"displayName,omitempty"` + Status *SubAssessmentStatus `json:"status,omitempty"` + // Remediation - READ-ONLY; Information on how to remediate this sub-assessment + Remediation *string `json:"remediation,omitempty"` + // Impact - READ-ONLY; Description of the impact of this sub-assessment + Impact *string `json:"impact,omitempty"` + // Category - READ-ONLY; Category of the sub-assessment + Category *string `json:"category,omitempty"` + // Description - READ-ONLY; Human readable description of the assessment status + Description *string `json:"description,omitempty"` + // TimeGenerated - READ-ONLY; The date and time the sub-assessment was generated + TimeGenerated *date.Time `json:"timeGenerated,omitempty"` + ResourceDetails BasicResourceDetails `json:"resourceDetails,omitempty"` + AdditionalData BasicAdditionalData `json:"additionalData,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SubAssessmentProperties struct. +func (sap *SubAssessmentProperties) UnmarshalJSON(body []byte) error { + 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 + } + sap.ID = &ID + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + sap.DisplayName = &displayName + } + case "status": + if v != nil { + var status SubAssessmentStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + sap.Status = &status + } + case "remediation": + if v != nil { + var remediation string + err = json.Unmarshal(*v, &remediation) + if err != nil { + return err + } + sap.Remediation = &remediation + } + case "impact": + if v != nil { + var impact string + err = json.Unmarshal(*v, &impact) + if err != nil { + return err + } + sap.Impact = &impact + } + case "category": + if v != nil { + var category string + err = json.Unmarshal(*v, &category) + if err != nil { + return err + } + sap.Category = &category + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + sap.Description = &description + } + case "timeGenerated": + if v != nil { + var timeGenerated date.Time + err = json.Unmarshal(*v, &timeGenerated) + if err != nil { + return err + } + sap.TimeGenerated = &timeGenerated + } + case "resourceDetails": + if v != nil { + resourceDetails, err := unmarshalBasicResourceDetails(*v) + if err != nil { + return err + } + sap.ResourceDetails = resourceDetails + } + case "additionalData": + if v != nil { + additionalData, err := unmarshalBasicAdditionalData(*v) + if err != nil { + return err + } + sap.AdditionalData = additionalData + } + } + } + + return nil +} + +// SubAssessmentStatus status of the sub-assessment +type SubAssessmentStatus struct { + // Code - READ-ONLY; Programmatic code for the status of the assessment. Possible values include: 'SubAssessmentStatusCodeHealthy', 'SubAssessmentStatusCodeUnhealthy', 'SubAssessmentStatusCodeNotApplicable' + Code SubAssessmentStatusCode `json:"code,omitempty"` + // Cause - READ-ONLY; Programmatic code for the cause of the assessment status + Cause *string `json:"cause,omitempty"` + // Description - READ-ONLY; Human readable description of the assessment status + Description *string `json:"description,omitempty"` + // Severity - READ-ONLY; The sub-assessment severity level. Possible values include: 'SeverityLow', 'SeverityMedium', 'SeverityHigh' + Severity Severity `json:"severity,omitempty"` +} + // TagsResource a container holding only the Tags for a resource, allowing the user to update the tags. type TagsResource struct { // Tags - Resource tags @@ -6875,6 +8106,42 @@ type TaskProperties struct { SubState *string `json:"subState,omitempty"` } +// ThresholdCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) +// is within the given range. +type ThresholdCustomAlertRule struct { + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - The type of the custom alert rule. + RuleType *string `json:"ruleType,omitempty"` +} + +// TimeWindowCustomAlertRule a custom alert rule that checks if the number of activities (depends on the +// custom alert type) in a time window is within the given range. +type TimeWindowCustomAlertRule struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - The type of the custom alert rule. + RuleType *string `json:"ruleType,omitempty"` +} + // TopologyList ... type TopologyList struct { autorest.Response `json:"-"` @@ -7144,8 +8411,8 @@ type TopologySingleResourceParent struct { // UpdateIotSecuritySolutionData ... type UpdateIotSecuritySolutionData struct { - UserDefinedResources *UserDefinedResourcesProperties `json:"userDefinedResources,omitempty"` - RecommendationsConfiguration *[]RecommendationConfigurationProperties `json:"recommendationsConfiguration,omitempty"` + // UpdateIoTSecuritySolutionProperties - Security Solution data + *UpdateIoTSecuritySolutionProperties `json:"properties,omitempty"` // Tags - Resource tags Tags map[string]*string `json:"tags"` } @@ -7153,11 +8420,8 @@ type UpdateIotSecuritySolutionData struct { // MarshalJSON is the custom marshaler for UpdateIotSecuritySolutionData. func (uissd UpdateIotSecuritySolutionData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if uissd.UserDefinedResources != nil { - objectMap["userDefinedResources"] = uissd.UserDefinedResources - } - if uissd.RecommendationsConfiguration != nil { - objectMap["recommendationsConfiguration"] = uissd.RecommendationsConfiguration + if uissd.UpdateIoTSecuritySolutionProperties != nil { + objectMap["properties"] = uissd.UpdateIoTSecuritySolutionProperties } if uissd.Tags != nil { objectMap["tags"] = uissd.Tags @@ -7165,7 +8429,46 @@ func (uissd UpdateIotSecuritySolutionData) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UserDefinedResourcesProperties properties of the solution's user defined resources. +// UnmarshalJSON is the custom unmarshaler for UpdateIotSecuritySolutionData struct. +func (uissd *UpdateIotSecuritySolutionData) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var updateIoTSecuritySolutionProperties UpdateIoTSecuritySolutionProperties + err = json.Unmarshal(*v, &updateIoTSecuritySolutionProperties) + if err != nil { + return err + } + uissd.UpdateIoTSecuritySolutionProperties = &updateIoTSecuritySolutionProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + uissd.Tags = tags + } + } + } + + return nil +} + +// UpdateIoTSecuritySolutionProperties update Security Solution setting data +type UpdateIoTSecuritySolutionProperties struct { + UserDefinedResources *UserDefinedResourcesProperties `json:"userDefinedResources,omitempty"` + RecommendationsConfiguration *[]RecommendationConfigurationProperties `json:"recommendationsConfiguration,omitempty"` +} + +// UserDefinedResourcesProperties properties of the IoT Security solution's user defined resources. type UserDefinedResourcesProperties struct { // Query - Azure Resource Graph query which represents the security solution's user defined resources. Required to start with "where type != "Microsoft.Devices/IotHubs"" Query *string `json:"query,omitempty"` @@ -7181,6 +8484,14 @@ type UserRecommendation struct { RecommendationAction RecommendationAction1 `json:"recommendationAction,omitempty"` } +// VendorReference vendor reference +type VendorReference struct { + // Title - READ-ONLY; Link title + Title *string `json:"title,omitempty"` + // Link - READ-ONLY; Link url + Link *string `json:"link,omitempty"` +} + // VMRecommendation represents a machine that is part of a VM/server group type VMRecommendation struct { // ConfigurationStatus - Possible values include: 'Configured', 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' 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 c795ece3011d..3b70713dc7cb 100644 --- a/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go @@ -63,66 +63,52 @@ type SettingsClientAPI interface { var _ SettingsClientAPI = (*security.SettingsClient)(nil) -// IoTSecuritySolutionsClientAPI contains the set of methods on the IoTSecuritySolutionsClient type. -type IoTSecuritySolutionsClientAPI interface { - List(ctx context.Context, filter string) (result security.IoTSecuritySolutionsListPage, err error) +// DeviceSecurityGroupsClientAPI contains the set of methods on the DeviceSecurityGroupsClient type. +type DeviceSecurityGroupsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceID string, deviceSecurityGroupName string, deviceSecurityGroup security.DeviceSecurityGroup) (result security.DeviceSecurityGroup, err error) + Delete(ctx context.Context, resourceID string, deviceSecurityGroupName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceID string, deviceSecurityGroupName string) (result security.DeviceSecurityGroup, err error) + List(ctx context.Context, resourceID string) (result security.DeviceSecurityGroupListPage, err error) } -var _ IoTSecuritySolutionsClientAPI = (*security.IoTSecuritySolutionsClient)(nil) - -// IoTSecuritySolutionsResourceGroupClientAPI contains the set of methods on the IoTSecuritySolutionsResourceGroupClient type. -type IoTSecuritySolutionsResourceGroupClientAPI interface { - List(ctx context.Context, resourceGroupName string, filter string) (result security.IoTSecuritySolutionsListPage, err error) -} - -var _ IoTSecuritySolutionsResourceGroupClientAPI = (*security.IoTSecuritySolutionsResourceGroupClient)(nil) +var _ DeviceSecurityGroupsClientAPI = (*security.DeviceSecurityGroupsClient)(nil) // IotSecuritySolutionClientAPI contains the set of methods on the IotSecuritySolutionClient type. type IotSecuritySolutionClientAPI interface { - Create(ctx context.Context, resourceGroupName string, solutionName string, iotSecuritySolutionData security.IoTSecuritySolutionModel) (result security.IoTSecuritySolutionModel, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, solutionName string, iotSecuritySolutionData security.IoTSecuritySolutionModel) (result security.IoTSecuritySolutionModel, err error) Delete(ctx context.Context, resourceGroupName string, solutionName string) (result autorest.Response, err error) Get(ctx context.Context, resourceGroupName string, solutionName string) (result security.IoTSecuritySolutionModel, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result security.IoTSecuritySolutionsListPage, err error) + ListBySubscription(ctx context.Context, filter string) (result security.IoTSecuritySolutionsListPage, err error) Update(ctx context.Context, resourceGroupName string, solutionName string, updateIotSecuritySolutionData security.UpdateIotSecuritySolutionData) (result security.IoTSecuritySolutionModel, err error) } var _ IotSecuritySolutionClientAPI = (*security.IotSecuritySolutionClient)(nil) -// IoTSecuritySolutionsAnalyticsClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsClient type. -type IoTSecuritySolutionsAnalyticsClientAPI interface { - GetAll(ctx context.Context, resourceGroupName string, solutionName string) (result security.IoTSecuritySolutionAnalyticsModelList, err error) - GetDefault(ctx context.Context, resourceGroupName string, solutionName string) (result security.IoTSecuritySolutionAnalyticsModel, err error) -} - -var _ IoTSecuritySolutionsAnalyticsClientAPI = (*security.IoTSecuritySolutionsAnalyticsClient)(nil) - -// IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsAggregatedAlertsClient type. -type IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI interface { - List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result security.IoTSecurityAggregatedAlertListPage, err error) +// IotSecuritySolutionAnalyticsClientAPI contains the set of methods on the IotSecuritySolutionAnalyticsClient type. +type IotSecuritySolutionAnalyticsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, solutionName string) (result security.IoTSecuritySolutionAnalyticsModel, err error) + List(ctx context.Context, resourceGroupName string, solutionName string) (result security.IoTSecuritySolutionAnalyticsModelList, err error) } -var _ IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI = (*security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient)(nil) +var _ IotSecuritySolutionAnalyticsClientAPI = (*security.IotSecuritySolutionAnalyticsClient)(nil) -// IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsAggregatedAlertClient type. -type IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI interface { +// IotSecuritySolutionsAnalyticsAggregatedAlertClientAPI contains the set of methods on the IotSecuritySolutionsAnalyticsAggregatedAlertClient type. +type IotSecuritySolutionsAnalyticsAggregatedAlertClientAPI interface { Dismiss(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (result autorest.Response, err error) Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (result security.IoTSecurityAggregatedAlert, err error) + List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result security.IoTSecurityAggregatedAlertListPage, err error) } -var _ IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI = (*security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient)(nil) +var _ IotSecuritySolutionsAnalyticsAggregatedAlertClientAPI = (*security.IotSecuritySolutionsAnalyticsAggregatedAlertClient)(nil) -// IoTSecuritySolutionsAnalyticsRecommendationClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsRecommendationClient type. -type IoTSecuritySolutionsAnalyticsRecommendationClientAPI interface { +// IotSecuritySolutionsAnalyticsRecommendationClientAPI contains the set of methods on the IotSecuritySolutionsAnalyticsRecommendationClient type. +type IotSecuritySolutionsAnalyticsRecommendationClientAPI interface { Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedRecommendationName string) (result security.IoTSecurityAggregatedRecommendation, err error) -} - -var _ IoTSecuritySolutionsAnalyticsRecommendationClientAPI = (*security.IoTSecuritySolutionsAnalyticsRecommendationClient)(nil) - -// IoTSecuritySolutionsAnalyticsRecommendationsClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsRecommendationsClient type. -type IoTSecuritySolutionsAnalyticsRecommendationsClientAPI interface { List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result security.IoTSecurityAggregatedRecommendationListPage, err error) } -var _ IoTSecuritySolutionsAnalyticsRecommendationsClientAPI = (*security.IoTSecuritySolutionsAnalyticsRecommendationsClient)(nil) +var _ IotSecuritySolutionsAnalyticsRecommendationClientAPI = (*security.IotSecuritySolutionsAnalyticsRecommendationClient)(nil) // AllowedConnectionsClientAPI contains the set of methods on the AllowedConnectionsClient type. type AllowedConnectionsClientAPI interface { @@ -300,3 +286,12 @@ type ServerVulnerabilityAssessmentClientAPI interface { } 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) + List(ctx context.Context, scope string, assessmentName string) (result security.SubAssessmentListPage, err error) + ListAll(ctx context.Context, scope string) (result security.SubAssessmentListPage, err error) +} + +var _ SubAssessmentsClientAPI = (*security.SubAssessmentsClient)(nil) diff --git a/services/preview/security/mgmt/v3.0/security/subassessments.go b/services/preview/security/mgmt/v3.0/security/subassessments.go new file mode 100644 index 000000000000..4fa19d8e398d --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/subassessments.go @@ -0,0 +1,348 @@ +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/tracing" + "net/http" +) + +// SubAssessmentsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type SubAssessmentsClient struct { + BaseClient +} + +// NewSubAssessmentsClient creates an instance of the SubAssessmentsClient client. +func NewSubAssessmentsClient(subscriptionID string, ascLocation string) SubAssessmentsClient { + return NewSubAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSubAssessmentsClientWithBaseURI creates an instance of the SubAssessmentsClient client. +func NewSubAssessmentsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SubAssessmentsClient { + return SubAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get get a security sub-assessment on your scanned resource +// Parameters: +// scope - scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or +// management group (/providers/Microsoft.Management/managementGroups/mgName). +// assessmentName - the Assessment Key - Unique key for the assessment type +// subAssessmentName - the Sub-Assessment Key - Unique key for the sub-assessment type +func (client SubAssessmentsClient) Get(ctx context.Context, scope string, assessmentName string, subAssessmentName string) (result SubAssessment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.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, scope, assessmentName, subAssessmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "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.SubAssessmentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SubAssessmentsClient) GetPreparer(ctx context.Context, scope string, assessmentName string, subAssessmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assessmentName": autorest.Encode("path", assessmentName), + "scope": autorest.Encode("path", scope), + "subAssessmentName": autorest.Encode("path", subAssessmentName), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}", 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 SubAssessmentsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SubAssessmentsClient) GetResponder(resp *http.Response) (result SubAssessment, 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 get security sub-assessments on all your scanned resources inside a scope +// Parameters: +// scope - scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or +// management group (/providers/Microsoft.Management/managementGroups/mgName). +// assessmentName - the Assessment Key - Unique key for the assessment type +func (client SubAssessmentsClient) List(ctx context.Context, scope string, assessmentName string) (result SubAssessmentListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.List") + defer func() { + sc := -1 + if result.sal.Response.Response != nil { + sc = result.sal.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, scope, assessmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sal.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "List", resp, "Failure sending request") + return + } + + result.sal, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SubAssessmentsClient) ListPreparer(ctx context.Context, scope string, assessmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assessmentName": autorest.Encode("path", assessmentName), + "scope": autorest.Encode("path", scope), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments", 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 SubAssessmentsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SubAssessmentsClient) ListResponder(resp *http.Response) (result SubAssessmentList, 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 SubAssessmentsClient) listNextResults(ctx context.Context, lastResults SubAssessmentList) (result SubAssessmentList, err error) { + req, err := lastResults.subAssessmentListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "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.SubAssessmentsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SubAssessmentsClient) ListComplete(ctx context.Context, scope string, assessmentName string) (result SubAssessmentListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.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, scope, assessmentName) + return +} + +// ListAll get security sub-assessments on all your scanned resources inside a subscription scope +// Parameters: +// scope - scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or +// management group (/providers/Microsoft.Management/managementGroups/mgName). +func (client SubAssessmentsClient) ListAll(ctx context.Context, scope string) (result SubAssessmentListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.ListAll") + defer func() { + sc := -1 + if result.sal.Response.Response != nil { + sc = result.sal.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listAllNextResults + req, err := client.ListAllPreparer(ctx, scope) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "ListAll", nil, "Failure preparing request") + return + } + + resp, err := client.ListAllSender(req) + if err != nil { + result.sal.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "ListAll", resp, "Failure sending request") + return + } + + result.sal, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "ListAll", resp, "Failure responding to request") + } + + return +} + +// ListAllPreparer prepares the ListAll request. +func (client SubAssessmentsClient) ListAllPreparer(ctx context.Context, scope string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "scope": autorest.Encode("path", scope), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/subAssessments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAllSender sends the ListAll request. The method will close the +// http.Response Body if it receives an error. +func (client SubAssessmentsClient) ListAllSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListAllResponder handles the response to the ListAll request. The method always +// closes the http.Response Body. +func (client SubAssessmentsClient) ListAllResponder(resp *http.Response) (result SubAssessmentList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAllNextResults retrieves the next set of results, if any. +func (client SubAssessmentsClient) listAllNextResults(ctx context.Context, lastResults SubAssessmentList) (result SubAssessmentList, err error) { + req, err := lastResults.subAssessmentListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "listAllNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAllSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "listAllNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SubAssessmentsClient", "listAllNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAllComplete enumerates all values, automatically crossing page boundaries as required. +func (client SubAssessmentsClient) ListAllComplete(ctx context.Context, scope string) (result SubAssessmentListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentsClient.ListAll") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListAll(ctx, scope) + return +} diff --git a/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/alertrules.go b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/alertrules.go index a71925e078ea..b63ac2177cbe 100644 --- a/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/alertrules.go +++ b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/alertrules.go @@ -150,7 +150,7 @@ func (client AlertRulesClient) CreateOrUpdateResponder(resp *http.Response) (res // ruleID - alert rule ID // actionID - action ID // action - the action -func (client AlertRulesClient) CreateOrUpdateAction(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, ruleID string, actionID string, action Action) (result Action, err error) { +func (client AlertRulesClient) CreateOrUpdateAction(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, ruleID string, actionID string, action ActionRequest) (result ActionResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.CreateOrUpdateAction") defer func() { @@ -196,7 +196,7 @@ func (client AlertRulesClient) CreateOrUpdateAction(ctx context.Context, resourc } // CreateOrUpdateActionPreparer prepares the CreateOrUpdateAction request. -func (client AlertRulesClient) CreateOrUpdateActionPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, ruleID string, actionID string, action Action) (*http.Request, error) { +func (client AlertRulesClient) CreateOrUpdateActionPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, ruleID string, actionID string, action ActionRequest) (*http.Request, error) { pathParameters := map[string]interface{}{ "actionId": autorest.Encode("path", actionID), "operationalInsightsResourceProvider": autorest.Encode("path", operationalInsightsResourceProvider), @@ -230,7 +230,7 @@ func (client AlertRulesClient) CreateOrUpdateActionSender(req *http.Request) (*h // CreateOrUpdateActionResponder handles the response to the CreateOrUpdateAction request. The method always // closes the http.Response Body. -func (client AlertRulesClient) CreateOrUpdateActionResponder(resp *http.Response) (result Action, err error) { +func (client AlertRulesClient) CreateOrUpdateActionResponder(resp *http.Response) (result ActionResponse, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -538,7 +538,7 @@ func (client AlertRulesClient) GetResponder(resp *http.Response) (result AlertRu // workspaceName - the name of the workspace. // ruleID - alert rule ID // actionID - action ID -func (client AlertRulesClient) GetAction(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, ruleID string, actionID string) (result Action, err error) { +func (client AlertRulesClient) GetAction(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, ruleID string, actionID string) (result ActionResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.GetAction") defer func() { @@ -616,7 +616,7 @@ func (client AlertRulesClient) GetActionSender(req *http.Request) (*http.Respons // GetActionResponder handles the response to the GetAction request. The method always // closes the http.Response Body. -func (client AlertRulesClient) GetActionResponder(resp *http.Response) (result Action, err error) { +func (client AlertRulesClient) GetActionResponder(resp *http.Response) (result ActionResponse, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/bookmarkrelations.go b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/bookmarkrelations.go new file mode 100644 index 000000000000..ffd332f7403e --- /dev/null +++ b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/bookmarkrelations.go @@ -0,0 +1,490 @@ +package securityinsight + +// 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" +) + +// BookmarkRelationsClient is the API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider +type BookmarkRelationsClient struct { + BaseClient +} + +// NewBookmarkRelationsClient creates an instance of the BookmarkRelationsClient client. +func NewBookmarkRelationsClient(subscriptionID string) BookmarkRelationsClient { + return NewBookmarkRelationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewBookmarkRelationsClientWithBaseURI creates an instance of the BookmarkRelationsClient client. +func NewBookmarkRelationsClientWithBaseURI(baseURI string, subscriptionID string) BookmarkRelationsClient { + return BookmarkRelationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdateRelation creates the bookmark relation. +// 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. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationsClient.CreateOrUpdateRelation") + defer func() { + 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.BookmarkRelationsClient", "CreateOrUpdateRelation", err.Error()) + } + + req, err := client.CreateOrUpdateRelationPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, bookmarkID, relationName, relationInputModel) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "CreateOrUpdateRelation", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateRelationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "CreateOrUpdateRelation", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateRelationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "CreateOrUpdateRelation", resp, "Failure responding to request") + } + + return +} + +// 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) { + pathParameters := map[string]interface{}{ + "bookmarkId": autorest.Encode("path", bookmarkID), + "operationalInsightsResourceProvider": autorest.Encode("path", operationalInsightsResourceProvider), + "relationName": autorest.Encode("path", relationName), + "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.AsContentType("application/json; charset=utf-8"), + 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.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateRelationSender sends the CreateOrUpdateRelation request. The method will close the +// http.Response Body if it receives an error. +func (client BookmarkRelationsClient) CreateOrUpdateRelationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteRelation delete the bookmark relation. +// 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. +// bookmarkID - bookmark ID +// relationName - relation Name +func (client BookmarkRelationsClient) DeleteRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationsClient.DeleteRelation") + 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.BookmarkRelationsClient", "DeleteRelation", err.Error()) + } + + req, err := client.DeleteRelationPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, bookmarkID, relationName) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "DeleteRelation", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteRelationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "DeleteRelation", resp, "Failure sending request") + return + } + + result, err = client.DeleteRelationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "DeleteRelation", resp, "Failure responding to request") + } + + return +} + +// DeleteRelationPreparer prepares the DeleteRelation request. +func (client BookmarkRelationsClient) DeleteRelationPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "bookmarkId": autorest.Encode("path", bookmarkID), + "operationalInsightsResourceProvider": autorest.Encode("path", operationalInsightsResourceProvider), + "relationName": autorest.Encode("path", relationName), + "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.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteRelationSender sends the DeleteRelation request. The method will close the +// http.Response Body if it receives an error. +func (client BookmarkRelationsClient) DeleteRelationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteRelationResponder handles the response to the DeleteRelation request. The method always +// closes the http.Response Body. +func (client BookmarkRelationsClient) DeleteRelationResponder(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 +} + +// GetRelation gets a bookmark relation. +// 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. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationsClient.GetRelation") + defer func() { + 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.BookmarkRelationsClient", "GetRelation", err.Error()) + } + + req, err := client.GetRelationPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, bookmarkID, relationName) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "GetRelation", nil, "Failure preparing request") + return + } + + resp, err := client.GetRelationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "GetRelation", resp, "Failure sending request") + return + } + + result, err = client.GetRelationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "GetRelation", resp, "Failure responding to request") + } + + return +} + +// GetRelationPreparer prepares the GetRelation request. +func (client BookmarkRelationsClient) GetRelationPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "bookmarkId": autorest.Encode("path", bookmarkID), + "operationalInsightsResourceProvider": autorest.Encode("path", operationalInsightsResourceProvider), + "relationName": autorest.Encode("path", relationName), + "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/bookmarks/{bookmarkId}/relations/{relationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetRelationSender sends the GetRelation request. The method will close the +// http.Response Body if it receives an error. +func (client BookmarkRelationsClient) GetRelationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + 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 bookmark relations. +// 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. +// bookmarkID - bookmark ID +// filter - filters the results, based on a Boolean condition. Optional. +// orderby - sorts the results. Optional. +// top - returns only the first n results. Optional. +// 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) { + 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 + } + 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.BookmarkRelationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, bookmarkID, filter, orderby, top, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.brl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "List", resp, "Failure sending request") + return + } + + result.brl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client BookmarkRelationsClient) ListPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, filter string, orderby string, top *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "bookmarkId": autorest.Encode("path", bookmarkID), + "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, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + 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/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations", 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 BookmarkRelationsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + 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 BookmarkRelationsClient) listNextResults(ctx context.Context, lastResults BookmarkRelationList) (result BookmarkRelationList, err error) { + req, err := lastResults.bookmarkRelationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "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, "securityinsight.BookmarkRelationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationsClient.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, operationalInsightsResourceProvider, workspaceName, bookmarkID, filter, orderby, top, skipToken) + return +} diff --git a/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/bookmarks.go b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/bookmarks.go index d324696ba926..20f8c8a83f39 100644 --- a/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/bookmarks.go +++ b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/bookmarks.go @@ -73,12 +73,12 @@ func (client BookmarksClient) CreateOrUpdate(ctx context.Context, resourceGroupN {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: bookmark, Constraints: []validation.Constraint{{Target: "bookmark.BookmarkProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "bookmark.BookmarkProperties.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "bookmark.BookmarkProperties.CreatedBy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "bookmark.BookmarkProperties.CreatedBy.ObjectID", Name: validation.Null, Rule: true, Chain: nil}}}, + Chain: []validation.Constraint{{Target: "bookmark.BookmarkProperties.CreatedBy", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "bookmark.BookmarkProperties.CreatedBy.ObjectID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "bookmark.BookmarkProperties.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "bookmark.BookmarkProperties.Query", Name: validation.Null, Rule: true, Chain: nil}, {Target: "bookmark.BookmarkProperties.UpdatedBy", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "bookmark.BookmarkProperties.UpdatedBy.ObjectID", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "bookmark.BookmarkProperties.Query", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("securityinsight.BookmarksClient", "CreateOrUpdate", err.Error()) } diff --git a/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/caserelations.go b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/caserelations.go new file mode 100644 index 000000000000..1c20302d892a --- /dev/null +++ b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/caserelations.go @@ -0,0 +1,490 @@ +package securityinsight + +// 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" +) + +// CaseRelationsClient is the API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider +type CaseRelationsClient struct { + BaseClient +} + +// NewCaseRelationsClient creates an instance of the CaseRelationsClient client. +func NewCaseRelationsClient(subscriptionID string) CaseRelationsClient { + return NewCaseRelationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCaseRelationsClientWithBaseURI creates an instance of the CaseRelationsClient client. +func NewCaseRelationsClientWithBaseURI(baseURI string, subscriptionID string) CaseRelationsClient { + return CaseRelationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdateRelation creates or updates the case relation. +// 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. +// caseID - case ID +// relationName - relation Name +// relationInputModel - the relation input model +func (client CaseRelationsClient) CreateOrUpdateRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, caseID string, relationName string, relationInputModel RelationsModelInput) (result CaseRelation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CaseRelationsClient.CreateOrUpdateRelation") + defer func() { + 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.CaseRelationsClient", "CreateOrUpdateRelation", err.Error()) + } + + req, err := client.CreateOrUpdateRelationPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, caseID, relationName, relationInputModel) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.CaseRelationsClient", "CreateOrUpdateRelation", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateRelationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.CaseRelationsClient", "CreateOrUpdateRelation", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateRelationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.CaseRelationsClient", "CreateOrUpdateRelation", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateRelationPreparer prepares the CreateOrUpdateRelation request. +func (client CaseRelationsClient) CreateOrUpdateRelationPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, caseID string, relationName string, relationInputModel RelationsModelInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "caseId": autorest.Encode("path", caseID), + "operationalInsightsResourceProvider": autorest.Encode("path", operationalInsightsResourceProvider), + "relationName": autorest.Encode("path", relationName), + "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.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/cases/{caseId}/relations/{relationName}", pathParameters), + autorest.WithJSON(relationInputModel), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateRelationSender sends the CreateOrUpdateRelation request. The method will close the +// http.Response Body if it receives an error. +func (client CaseRelationsClient) CreateOrUpdateRelationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateRelationResponder handles the response to the CreateOrUpdateRelation request. The method always +// closes the http.Response Body. +func (client CaseRelationsClient) CreateOrUpdateRelationResponder(resp *http.Response) (result CaseRelation, 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 +} + +// DeleteRelation delete the case relation. +// 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. +// caseID - case ID +// relationName - relation Name +func (client CaseRelationsClient) DeleteRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, caseID string, relationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CaseRelationsClient.DeleteRelation") + 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.CaseRelationsClient", "DeleteRelation", err.Error()) + } + + req, err := client.DeleteRelationPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, caseID, relationName) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.CaseRelationsClient", "DeleteRelation", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteRelationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "securityinsight.CaseRelationsClient", "DeleteRelation", resp, "Failure sending request") + return + } + + result, err = client.DeleteRelationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.CaseRelationsClient", "DeleteRelation", resp, "Failure responding to request") + } + + return +} + +// DeleteRelationPreparer prepares the DeleteRelation request. +func (client CaseRelationsClient) DeleteRelationPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, caseID string, relationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "caseId": autorest.Encode("path", caseID), + "operationalInsightsResourceProvider": autorest.Encode("path", operationalInsightsResourceProvider), + "relationName": autorest.Encode("path", relationName), + "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.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/cases/{caseId}/relations/{relationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteRelationSender sends the DeleteRelation request. The method will close the +// http.Response Body if it receives an error. +func (client CaseRelationsClient) DeleteRelationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteRelationResponder handles the response to the DeleteRelation request. The method always +// closes the http.Response Body. +func (client CaseRelationsClient) DeleteRelationResponder(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 +} + +// GetRelation gets a case relation. +// 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. +// caseID - case ID +// relationName - relation Name +func (client CaseRelationsClient) GetRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, caseID string, relationName string) (result CaseRelation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CaseRelationsClient.GetRelation") + defer func() { + 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.CaseRelationsClient", "GetRelation", err.Error()) + } + + req, err := client.GetRelationPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, caseID, relationName) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.CaseRelationsClient", "GetRelation", nil, "Failure preparing request") + return + } + + resp, err := client.GetRelationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.CaseRelationsClient", "GetRelation", resp, "Failure sending request") + return + } + + result, err = client.GetRelationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.CaseRelationsClient", "GetRelation", resp, "Failure responding to request") + } + + return +} + +// GetRelationPreparer prepares the GetRelation request. +func (client CaseRelationsClient) GetRelationPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, caseID string, relationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "caseId": autorest.Encode("path", caseID), + "operationalInsightsResourceProvider": autorest.Encode("path", operationalInsightsResourceProvider), + "relationName": autorest.Encode("path", relationName), + "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/cases/{caseId}/relations/{relationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetRelationSender sends the GetRelation request. The method will close the +// http.Response Body if it receives an error. +func (client CaseRelationsClient) GetRelationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetRelationResponder handles the response to the GetRelation request. The method always +// closes the http.Response Body. +func (client CaseRelationsClient) GetRelationResponder(resp *http.Response) (result CaseRelation, 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 case relations. +// 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. +// caseID - case ID +// filter - filters the results, based on a Boolean condition. Optional. +// orderby - sorts the results. Optional. +// top - returns only the first n results. Optional. +// 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 CaseRelationsClient) List(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, caseID string, filter string, orderby string, top *int32, skipToken string) (result CaseRelationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CaseRelationsClient.List") + defer func() { + sc := -1 + if result.crl.Response.Response != nil { + sc = result.crl.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.CaseRelationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, caseID, filter, orderby, top, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.CaseRelationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.crl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.CaseRelationsClient", "List", resp, "Failure sending request") + return + } + + result.crl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.CaseRelationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client CaseRelationsClient) ListPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, caseID string, filter string, orderby string, top *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "caseId": autorest.Encode("path", caseID), + "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, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + 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/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/cases/{caseId}/relations", 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 CaseRelationsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client CaseRelationsClient) ListResponder(resp *http.Response) (result CaseRelationList, 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 CaseRelationsClient) listNextResults(ctx context.Context, lastResults CaseRelationList) (result CaseRelationList, err error) { + req, err := lastResults.caseRelationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "securityinsight.CaseRelationsClient", "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, "securityinsight.CaseRelationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.CaseRelationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client CaseRelationsClient) ListComplete(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, caseID string, filter string, orderby string, top *int32, skipToken string) (result CaseRelationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CaseRelationsClient.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, operationalInsightsResourceProvider, workspaceName, caseID, filter, orderby, top, skipToken) + return +} diff --git a/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/cases.go b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/cases.go index 5f4bc4d1c106..7b2b21a07030 100644 --- a/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/cases.go +++ b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/cases.go @@ -73,10 +73,10 @@ func (client CasesClient) CreateOrUpdate(ctx context.Context, resourceGroupName {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: caseParameter, Constraints: []validation.Constraint{{Target: "caseParameter.CaseProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "caseParameter.CaseProperties.StartTimeUtc", Name: validation.Null, Rule: true, Chain: nil}, + Chain: []validation.Constraint{{Target: "caseParameter.CaseProperties.Owner", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "caseParameter.CaseProperties.Owner.ObjectID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "caseParameter.CaseProperties.StartTimeUtc", Name: validation.Null, Rule: true, Chain: nil}, {Target: "caseParameter.CaseProperties.Title", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "caseParameter.CaseProperties.Owner", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "caseParameter.CaseProperties.Owner.ObjectID", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { return result, validation.NewError("securityinsight.CasesClient", "CreateOrUpdate", err.Error()) } diff --git a/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/models.go b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/models.go index a36a38b88823..b474b9a4c669 100644 --- a/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/models.go +++ b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/models.go @@ -48,17 +48,17 @@ func PossibleAggregationsKindValues() []AggregationsKind { type AlertRuleKind string const ( - // Filter ... - Filter AlertRuleKind = "Filter" // Fusion ... Fusion AlertRuleKind = "Fusion" + // MicrosoftSecurityIncidentCreation ... + MicrosoftSecurityIncidentCreation AlertRuleKind = "MicrosoftSecurityIncidentCreation" // Scheduled ... Scheduled AlertRuleKind = "Scheduled" ) // PossibleAlertRuleKindValues returns an array of possible values for the AlertRuleKind const type. func PossibleAlertRuleKindValues() []AlertRuleKind { - return []AlertRuleKind{Filter, Fusion, Scheduled} + return []AlertRuleKind{Fusion, MicrosoftSecurityIncidentCreation, Scheduled} } // AlertSeverity enumerates the values for alert severity. @@ -119,6 +119,8 @@ const ( Execution AttackTactic = "Execution" // Exfiltration ... Exfiltration AttackTactic = "Exfiltration" + // Impact ... + Impact AttackTactic = "Impact" // InitialAccess ... InitialAccess AttackTactic = "InitialAccess" // LateralMovement ... @@ -131,7 +133,7 @@ const ( // PossibleAttackTacticValues returns an array of possible values for the AttackTactic const type. func PossibleAttackTacticValues() []AttackTactic { - return []AttackTactic{Collection, CommandAndControl, CredentialAccess, DefenseEvasion, Discovery, Execution, Exfiltration, InitialAccess, LateralMovement, Persistence, PrivilegeEscalation} + return []AttackTactic{Collection, CommandAndControl, CredentialAccess, DefenseEvasion, Discovery, Execution, Exfiltration, Impact, InitialAccess, LateralMovement, Persistence, PrivilegeEscalation} } // CaseSeverity enumerates the values for case severity. @@ -496,30 +498,34 @@ func PossibleKillChainIntentValues() []KillChainIntent { type Kind string const ( - // KindAlertRule ... - KindAlertRule Kind = "AlertRule" - // KindScheduled ... - KindScheduled Kind = "Scheduled" + // KindAggregations ... + KindAggregations Kind = "Aggregations" + // KindCasesAggregation ... + KindCasesAggregation Kind = "CasesAggregation" ) // PossibleKindValues returns an array of possible values for the Kind const type. func PossibleKindValues() []Kind { - return []Kind{KindAlertRule, KindScheduled} + return []Kind{KindAggregations, KindCasesAggregation} } -// KindBasicAggregations enumerates the values for kind basic aggregations. -type KindBasicAggregations string +// KindBasicAlertRule enumerates the values for kind basic alert rule. +type KindBasicAlertRule string const ( - // KindAggregations ... - KindAggregations KindBasicAggregations = "Aggregations" - // KindCasesAggregation ... - KindCasesAggregation KindBasicAggregations = "CasesAggregation" + // KindAlertRule ... + KindAlertRule KindBasicAlertRule = "AlertRule" + // KindFusion ... + KindFusion KindBasicAlertRule = "Fusion" + // KindMicrosoftSecurityIncidentCreation ... + KindMicrosoftSecurityIncidentCreation KindBasicAlertRule = "MicrosoftSecurityIncidentCreation" + // KindScheduled ... + KindScheduled KindBasicAlertRule = "Scheduled" ) -// PossibleKindBasicAggregationsValues returns an array of possible values for the KindBasicAggregations const type. -func PossibleKindBasicAggregationsValues() []KindBasicAggregations { - return []KindBasicAggregations{KindAggregations, KindCasesAggregation} +// PossibleKindBasicAlertRuleValues returns an array of possible values for the KindBasicAlertRule const type. +func PossibleKindBasicAlertRuleValues() []KindBasicAlertRule { + return []KindBasicAlertRule{KindAlertRule, KindFusion, KindMicrosoftSecurityIncidentCreation, KindScheduled} } // KindBasicAlertRuleTemplate enumerates the values for kind basic alert rule template. @@ -528,17 +534,17 @@ type KindBasicAlertRuleTemplate string const ( // KindBasicAlertRuleTemplateKindAlertRuleTemplate ... KindBasicAlertRuleTemplateKindAlertRuleTemplate KindBasicAlertRuleTemplate = "AlertRuleTemplate" - // KindBasicAlertRuleTemplateKindFilter ... - KindBasicAlertRuleTemplateKindFilter KindBasicAlertRuleTemplate = "Filter" // KindBasicAlertRuleTemplateKindFusion ... KindBasicAlertRuleTemplateKindFusion KindBasicAlertRuleTemplate = "Fusion" + // KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation ... + KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation KindBasicAlertRuleTemplate = "MicrosoftSecurityIncidentCreation" // KindBasicAlertRuleTemplateKindScheduled ... KindBasicAlertRuleTemplateKindScheduled KindBasicAlertRuleTemplate = "Scheduled" ) // PossibleKindBasicAlertRuleTemplateValues returns an array of possible values for the KindBasicAlertRuleTemplate const type. func PossibleKindBasicAlertRuleTemplateValues() []KindBasicAlertRuleTemplate { - return []KindBasicAlertRuleTemplate{KindBasicAlertRuleTemplateKindAlertRuleTemplate, KindBasicAlertRuleTemplateKindFilter, KindBasicAlertRuleTemplateKindFusion, KindBasicAlertRuleTemplateKindScheduled} + return []KindBasicAlertRuleTemplate{KindBasicAlertRuleTemplateKindAlertRuleTemplate, KindBasicAlertRuleTemplateKindFusion, KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation, KindBasicAlertRuleTemplateKindScheduled} } // KindBasicDataConnector enumerates the values for kind basic data connector. @@ -645,6 +651,25 @@ func PossibleLicenseStatusValues() []LicenseStatus { return []LicenseStatus{LicenseStatusDisabled, LicenseStatusEnabled} } +// MicrosoftSecurityProductName enumerates the values for microsoft security product name. +type MicrosoftSecurityProductName string + +const ( + // AzureActiveDirectoryIdentityProtection ... + AzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = "Azure Active Directory Identity Protection" + // AzureAdvancedThreatProtection ... + AzureAdvancedThreatProtection MicrosoftSecurityProductName = "Azure Advanced Threat Protection" + // AzureSecurityCenter ... + AzureSecurityCenter MicrosoftSecurityProductName = "Azure Security Center" + // MicrosoftCloudAppSecurity ... + MicrosoftCloudAppSecurity MicrosoftSecurityProductName = "Microsoft Cloud App Security" +) + +// PossibleMicrosoftSecurityProductNameValues returns an array of possible values for the MicrosoftSecurityProductName const type. +func PossibleMicrosoftSecurityProductNameValues() []MicrosoftSecurityProductName { + return []MicrosoftSecurityProductName{AzureActiveDirectoryIdentityProtection, AzureAdvancedThreatProtection, AzureSecurityCenter, MicrosoftCloudAppSecurity} +} + // OSFamily enumerates the values for os family. type OSFamily string @@ -722,6 +747,34 @@ func PossibleRegistryValueKindValues() []RegistryValueKind { return []RegistryValueKind{RegistryValueKindBinary, RegistryValueKindDWord, RegistryValueKindExpandString, RegistryValueKindMultiString, RegistryValueKindNone, RegistryValueKindQWord, RegistryValueKindString, RegistryValueKindUnknown} } +// RelationNodeKind enumerates the values for relation node kind. +type RelationNodeKind string + +const ( + // RelationNodeKindBookmark Bookmark node part of the relation + RelationNodeKindBookmark RelationNodeKind = "Bookmark" + // RelationNodeKindCase Case node part of the relation + RelationNodeKindCase RelationNodeKind = "Case" +) + +// PossibleRelationNodeKindValues returns an array of possible values for the RelationNodeKind const type. +func PossibleRelationNodeKindValues() []RelationNodeKind { + return []RelationNodeKind{RelationNodeKindBookmark, RelationNodeKindCase} +} + +// RelationTypes enumerates the values for relation types. +type RelationTypes string + +const ( + // CasesToBookmarks Relations between cases and bookmarks + CasesToBookmarks RelationTypes = "CasesToBookmarks" +) + +// PossibleRelationTypesValues returns an array of possible values for the RelationTypes const type. +func PossibleRelationTypesValues() []RelationTypes { + return []RelationTypes{CasesToBookmarks} +} + // SettingKind enumerates the values for setting kind. type SettingKind string @@ -794,13 +847,13 @@ type AADDataConnector struct { *AADDataConnectorProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the data connector. + // 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: 'KindDataConnector', 'KindOffice365', 'KindThreatIntelligence', 'KindAmazonWebServicesCloudTrail', 'KindAzureActiveDirectory', 'KindAzureSecurityCenter', 'KindMicrosoftCloudAppSecurity', 'KindAzureAdvancedThreatProtection', 'KindMicrosoftDefenderAdvancedThreatProtection' + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' Kind KindBasicDataConnector `json:"kind,omitempty"` } @@ -820,13 +873,18 @@ func (adc AADDataConnector) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsOfficeDataConnector is the BasicDataConnector implementation for AADDataConnector. -func (adc AADDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { +// AsAADDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { + return &adc, true +} + +// AsAATPDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { return nil, false } -// AsTIDataConnector is the BasicDataConnector implementation for AADDataConnector. -func (adc AADDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { +// AsASCDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { return nil, false } @@ -835,28 +893,23 @@ func (adc AADDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataCo return nil, false } -// AsAADDataConnector is the BasicDataConnector implementation for AADDataConnector. -func (adc AADDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { - return &adc, true -} - -// AsASCDataConnector is the BasicDataConnector implementation for AADDataConnector. -func (adc AADDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { +// AsMCASDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { return nil, false } -// AsMCASDataConnector is the BasicDataConnector implementation for AADDataConnector. -func (adc AADDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { +// AsMDATPDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { return nil, false } -// AsAATPDataConnector is the BasicDataConnector implementation for AADDataConnector. -func (adc AADDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { +// AsOfficeDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { return nil, false } -// AsMDATPDataConnector is the BasicDataConnector implementation for AADDataConnector. -func (adc AADDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { +// AsTIDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { return nil, false } @@ -897,23 +950,23 @@ func (adc *AADDataConnector) UnmarshalJSON(body []byte) error { } adc.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - adc.Type = &typeVar + adc.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - adc.Name = &name + adc.Type = &typeVar } case "etag": if v != nil { @@ -953,13 +1006,13 @@ type AATPDataConnector struct { *AATPDataConnectorProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the data connector. + // 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: 'KindDataConnector', 'KindOffice365', 'KindThreatIntelligence', 'KindAmazonWebServicesCloudTrail', 'KindAzureActiveDirectory', 'KindAzureSecurityCenter', 'KindMicrosoftCloudAppSecurity', 'KindAzureAdvancedThreatProtection', 'KindMicrosoftDefenderAdvancedThreatProtection' + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' Kind KindBasicDataConnector `json:"kind,omitempty"` } @@ -979,13 +1032,18 @@ func (adc AATPDataConnector) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsOfficeDataConnector is the BasicDataConnector implementation for AATPDataConnector. -func (adc AATPDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { +// AsAADDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { return nil, false } -// AsTIDataConnector is the BasicDataConnector implementation for AATPDataConnector. -func (adc AATPDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { +// AsAATPDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { + return &adc, true +} + +// AsASCDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { return nil, false } @@ -994,28 +1052,23 @@ func (adc AATPDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataC return nil, false } -// AsAADDataConnector is the BasicDataConnector implementation for AATPDataConnector. -func (adc AATPDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { +// AsMCASDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { return nil, false } -// AsASCDataConnector is the BasicDataConnector implementation for AATPDataConnector. -func (adc AATPDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { +// AsMDATPDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { return nil, false } -// AsMCASDataConnector is the BasicDataConnector implementation for AATPDataConnector. -func (adc AATPDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { +// AsOfficeDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { return nil, false } -// AsAATPDataConnector is the BasicDataConnector implementation for AATPDataConnector. -func (adc AATPDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { - return &adc, true -} - -// AsMDATPDataConnector is the BasicDataConnector implementation for AATPDataConnector. -func (adc AATPDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { +// AsTIDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { return nil, false } @@ -1056,23 +1109,23 @@ func (adc *AATPDataConnector) UnmarshalJSON(body []byte) error { } adc.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - adc.Type = &typeVar + adc.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - adc.Name = &name + adc.Type = &typeVar } case "etag": if v != nil { @@ -1112,11 +1165,11 @@ type AccountEntity struct { *AccountEntityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -1138,43 +1191,43 @@ func (ae AccountEntity) AsAccountEntity() (*AccountEntity, bool) { return &ae, true } -// AsHostEntity is the BasicEntity implementation for AccountEntity. -func (ae AccountEntity) AsHostEntity() (*HostEntity, bool) { +// AsAzureResourceEntity is the BasicEntity implementation for AccountEntity. +func (ae AccountEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { return nil, false } -// AsFileEntity is the BasicEntity implementation for AccountEntity. -func (ae AccountEntity) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for AccountEntity. +func (ae AccountEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for AccountEntity. -func (ae AccountEntity) AsSecurityAlert() (*SecurityAlert, bool) { +// AsDNSEntity is the BasicEntity implementation for AccountEntity. +func (ae AccountEntity) AsDNSEntity() (*DNSEntity, bool) { return nil, false } -// AsFileHashEntity is the BasicEntity implementation for AccountEntity. -func (ae AccountEntity) AsFileHashEntity() (*FileHashEntity, bool) { +// AsFileEntity is the BasicEntity implementation for AccountEntity. +func (ae AccountEntity) AsFileEntity() (*FileEntity, bool) { return nil, false } -// AsMalwareEntity is the BasicEntity implementation for AccountEntity. -func (ae AccountEntity) AsMalwareEntity() (*MalwareEntity, bool) { +// AsFileHashEntity is the BasicEntity implementation for AccountEntity. +func (ae AccountEntity) AsFileHashEntity() (*FileHashEntity, bool) { return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for AccountEntity. -func (ae AccountEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { +// AsHostEntity is the BasicEntity implementation for AccountEntity. +func (ae AccountEntity) AsHostEntity() (*HostEntity, bool) { return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for AccountEntity. -func (ae AccountEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { +// AsIPEntity is the BasicEntity implementation for AccountEntity. +func (ae AccountEntity) AsIPEntity() (*IPEntity, bool) { return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for AccountEntity. -func (ae AccountEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for AccountEntity. +func (ae AccountEntity) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } @@ -1183,23 +1236,23 @@ func (ae AccountEntity) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for AccountEntity. -func (ae AccountEntity) AsDNSEntity() (*DNSEntity, bool) { +// AsRegistryKeyEntity is the BasicEntity implementation for AccountEntity. +func (ae AccountEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return nil, false } -// AsIPEntity is the BasicEntity implementation for AccountEntity. -func (ae AccountEntity) AsIPEntity() (*IPEntity, bool) { +// AsRegistryValueEntity is the BasicEntity implementation for AccountEntity. +func (ae AccountEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { return nil, false } -// AsRegistryKeyEntity is the BasicEntity implementation for AccountEntity. -func (ae AccountEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { +// AsSecurityAlert is the BasicEntity implementation for AccountEntity. +func (ae AccountEntity) AsSecurityAlert() (*SecurityAlert, bool) { return nil, false } -// AsRegistryValueEntity is the BasicEntity implementation for AccountEntity. -func (ae AccountEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { +// AsSecurityGroupEntity is the BasicEntity implementation for AccountEntity. +func (ae AccountEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { return nil, false } @@ -1245,23 +1298,23 @@ func (ae *AccountEntity) UnmarshalJSON(body []byte) error { } ae.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - ae.Type = &typeVar + ae.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - ae.Name = &name + ae.Type = &typeVar } case "kind": if v != nil { @@ -1280,32 +1333,32 @@ func (ae *AccountEntity) UnmarshalJSON(body []byte) error { // AccountEntityProperties account entity property bag. type AccountEntityProperties struct { - // AccountName - READ-ONLY; The name of the account. This field should hold only the name without any domain added to it, i.e. administrator. - AccountName *string `json:"accountName,omitempty"` - // NtDomain - READ-ONLY; The NetBIOS domain name as it appears in the alert format – domain\username. Examples: NT AUTHORITY. - NtDomain *string `json:"ntDomain,omitempty"` - // UpnSuffix - READ-ONLY; The user principal name suffix for the account, in some cases it is also the domain name. Examples: contoso.com. - UpnSuffix *string `json:"upnSuffix,omitempty"` - // Sid - READ-ONLY; The account security identifier, e.g. S-1-5-18. - Sid *string `json:"sid,omitempty"` // AadTenantID - READ-ONLY; The Azure Active Directory tenant id. AadTenantID *string `json:"aadTenantId,omitempty"` // AadUserID - READ-ONLY; The Azure Active Directory user id. AadUserID *string `json:"aadUserId,omitempty"` - // Puid - READ-ONLY; The Azure Active Directory Passport User ID. - Puid *string `json:"puid,omitempty"` - // IsDomainJoined - READ-ONLY; Determines whether this is a domain account. - IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + // AccountName - READ-ONLY; The name of the account. This field should hold only the name without any domain added to it, i.e. administrator. + AccountName *string `json:"accountName,omitempty"` // DisplayName - READ-ONLY; The display name of the account. DisplayName *string `json:"displayName,omitempty"` - // ObjectGUID - READ-ONLY; The objectGUID attribute is a single-value attribute that is the unique identifier for the object, assigned by active directory. - ObjectGUID *uuid.UUID `json:"objectGuid,omitempty"` // HostEntityID - READ-ONLY; The Host entity id that contains the account in case it is a local account (not domain joined) HostEntityID *string `json:"hostEntityId,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,omitempty"` + // IsDomainJoined - READ-ONLY; Determines whether this is a domain account. + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + // NtDomain - READ-ONLY; The NetBIOS domain name as it appears in the alert format – domain\username. Examples: NT AUTHORITY. + NtDomain *string `json:"ntDomain,omitempty"` + // ObjectGUID - READ-ONLY; The objectGUID attribute is a single-value attribute that is the unique identifier for the object, assigned by active directory. + ObjectGUID *uuid.UUID `json:"objectGuid,omitempty"` + // Puid - READ-ONLY; The Azure Active Directory Passport User ID. + Puid *string `json:"puid,omitempty"` + // Sid - READ-ONLY; The account security identifier, e.g. S-1-5-18. + Sid *string `json:"sid,omitempty"` + // UpnSuffix - READ-ONLY; The user principal name suffix for the account, in some cases it is also the domain name. Examples: contoso.com. + UpnSuffix *string `json:"upnSuffix,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for AccountEntityProperties. @@ -1314,35 +1367,34 @@ func (aep AccountEntityProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Action action for alert rule. -type Action struct { - autorest.Response `json:"-"` - // Etag - Etag of the action. - Etag *string `json:"etag,omitempty"` - // ActionProperties - Action properties - *ActionProperties `json:"properties,omitempty"` +// ActionRequest action for alert rule. +type ActionRequest struct { + // ActionRequestProperties - Action properties for put request + *ActionRequestProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,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"` } -// MarshalJSON is the custom marshaler for Action. -func (a Action) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ActionRequest. +func (ar ActionRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if a.Etag != nil { - objectMap["etag"] = a.Etag + if ar.ActionRequestProperties != nil { + objectMap["properties"] = ar.ActionRequestProperties } - if a.ActionProperties != nil { - objectMap["properties"] = a.ActionProperties + if ar.Etag != nil { + objectMap["etag"] = ar.Etag } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for Action struct. -func (a *Action) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ActionRequest struct. +func (ar *ActionRequest) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1350,23 +1402,14 @@ func (a *Action) UnmarshalJSON(body []byte) error { } 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 - } - a.Etag = &etag - } case "properties": if v != nil { - var actionProperties ActionProperties - err = json.Unmarshal(*v, &actionProperties) + var actionRequestProperties ActionRequestProperties + err = json.Unmarshal(*v, &actionRequestProperties) if err != nil { return err } - a.ActionProperties = &actionProperties + ar.ActionRequestProperties = &actionRequestProperties } case "id": if v != nil { @@ -1375,16 +1418,109 @@ func (a *Action) UnmarshalJSON(body []byte) error { if err != nil { return err } - a.ID = &ID + ar.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ar.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + ar.Etag = &etag + } + } + } + + return nil +} + +// ActionRequestProperties action property bag. +type ActionRequestProperties struct { + // TriggerURI - Logic App Callback URL for this specific workflow. + TriggerURI *string `json:"triggerUri,omitempty"` +} + +// ActionResponse action for alert rule. +type ActionResponse struct { + autorest.Response `json:"-"` + // Etag - Etag of the action. + Etag *string `json:"etag,omitempty"` + // ActionResponseProperties - Action properties for get request + *ActionResponseProperties `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"` +} + +// MarshalJSON is the custom marshaler for ActionResponse. +func (ar ActionResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ar.Etag != nil { + objectMap["etag"] = ar.Etag + } + if ar.ActionResponseProperties != nil { + objectMap["properties"] = ar.ActionResponseProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ActionResponse struct. +func (ar *ActionResponse) UnmarshalJSON(body []byte) error { + 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 + } + ar.Etag = &etag + } + case "properties": + if v != nil { + var actionResponseProperties ActionResponseProperties + err = json.Unmarshal(*v, &actionResponseProperties) + if err != nil { + return err + } + ar.ActionResponseProperties = &actionResponseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - a.Type = &typeVar + ar.ID = &ID } case "name": if v != nil { @@ -1393,7 +1529,16 @@ func (a *Action) UnmarshalJSON(body []byte) error { if err != nil { return err } - a.Name = &name + ar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ar.Type = &typeVar } } } @@ -1401,10 +1546,10 @@ func (a *Action) UnmarshalJSON(body []byte) error { return nil } -// ActionProperties action property bag. -type ActionProperties struct { - // TriggerURI - The uri for the action to trigger. - TriggerURI *string `json:"triggerUri,omitempty"` +// ActionResponseProperties action property bag. +type ActionResponseProperties struct { + // WorkflowID - The name of the logic app's workflow. + WorkflowID *string `json:"workflowId,omitempty"` } // ActionsList list all the actions. @@ -1413,10 +1558,10 @@ type ActionsList struct { // NextLink - READ-ONLY; URL to fetch the next set of actions. NextLink *string `json:"nextLink,omitempty"` // Value - Array of actions. - Value *[]Action `json:"value,omitempty"` + Value *[]ActionResponse `json:"value,omitempty"` } -// ActionsListIterator provides access to a complete listing of Action values. +// ActionsListIterator provides access to a complete listing of ActionResponse values. type ActionsListIterator struct { i int page ActionsListPage @@ -1467,9 +1612,9 @@ func (iter ActionsListIterator) Response() ActionsList { // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter ActionsListIterator) Value() Action { +func (iter ActionsListIterator) Value() ActionResponse { if !iter.page.NotDone() { - return Action{} + return ActionResponse{} } return iter.page.Values()[iter.i] } @@ -1496,7 +1641,7 @@ func (al ActionsList) actionsListPreparer(ctx context.Context) (*http.Request, e autorest.WithBaseURL(to.String(al.NextLink))) } -// ActionsListPage contains a page of Action values. +// ActionsListPage contains a page of ActionResponse values. type ActionsListPage struct { fn func(context.Context, ActionsList) (ActionsList, error) al ActionsList @@ -1541,7 +1686,7 @@ func (page ActionsListPage) Response() ActionsList { } // Values returns the slice of values for the current page or nil if there are no values. -func (page ActionsListPage) Values() []Action { +func (page ActionsListPage) Values() []ActionResponse { if page.al.IsEmpty() { return nil } @@ -1564,12 +1709,12 @@ type Aggregations struct { autorest.Response `json:"-"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` // Kind - Possible values include: 'KindAggregations', 'KindCasesAggregation' - Kind KindBasicAggregations `json:"kind,omitempty"` + Kind Kind `json:"kind,omitempty"` } func unmarshalBasicAggregations(body []byte) (BasicAggregations, error) { @@ -1659,6 +1804,8 @@ func (am *AggregationsModel) UnmarshalJSON(body []byte) error { // BasicAlertRule alert rule. type BasicAlertRule interface { + AsFusionAlertRule() (*FusionAlertRule, bool) + AsMicrosoftSecurityIncidentCreationAlertRule() (*MicrosoftSecurityIncidentCreationAlertRule, bool) AsScheduledAlertRule() (*ScheduledAlertRule, bool) AsAlertRule() (*AlertRule, bool) } @@ -1668,14 +1815,14 @@ type AlertRule struct { autorest.Response `json:"-"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the alert rule. + // 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: 'KindAlertRule', 'KindScheduled' - Kind Kind `json:"kind,omitempty"` + // Kind - Possible values include: 'KindAlertRule', 'KindFusion', 'KindMicrosoftSecurityIncidentCreation', 'KindScheduled' + Kind KindBasicAlertRule `json:"kind,omitempty"` } func unmarshalBasicAlertRule(body []byte) (BasicAlertRule, error) { @@ -1686,6 +1833,14 @@ func unmarshalBasicAlertRule(body []byte) (BasicAlertRule, error) { } switch m["kind"] { + case string(KindFusion): + var far FusionAlertRule + err := json.Unmarshal(body, &far) + return far, err + case string(KindMicrosoftSecurityIncidentCreation): + var msicar MicrosoftSecurityIncidentCreationAlertRule + err := json.Unmarshal(body, &msicar) + return msicar, err case string(KindScheduled): var sar ScheduledAlertRule err := json.Unmarshal(body, &sar) @@ -1728,6 +1883,16 @@ func (ar AlertRule) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsFusionAlertRule is the BasicAlertRule implementation for AlertRule. +func (ar AlertRule) AsFusionAlertRule() (*FusionAlertRule, bool) { + return nil, false +} + +// AsMicrosoftSecurityIncidentCreationAlertRule is the BasicAlertRule implementation for AlertRule. +func (ar AlertRule) AsMicrosoftSecurityIncidentCreationAlertRule() (*MicrosoftSecurityIncidentCreationAlertRule, bool) { + return nil, false +} + // AsScheduledAlertRule is the BasicAlertRule implementation for AlertRule. func (ar AlertRule) AsScheduledAlertRule() (*ScheduledAlertRule, bool) { return nil, false @@ -1745,7 +1910,7 @@ func (ar AlertRule) AsBasicAlertRule() (BasicAlertRule, bool) { // AlertRuleKind1 describes an Azure resource with kind. type AlertRuleKind1 struct { - // Kind - The kind of the alert rule. Possible values include: 'Scheduled', 'Filter', 'Fusion' + // Kind - The kind of the alert rule. Possible values include: 'Scheduled', 'MicrosoftSecurityIncidentCreation', 'Fusion' Kind AlertRuleKind `json:"kind,omitempty"` } @@ -1946,9 +2111,9 @@ func NewAlertRulesListPage(getNextPage func(context.Context, AlertRulesList) (Al // BasicAlertRuleTemplate alert rule template. type BasicAlertRuleTemplate interface { - AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) - AsFilterAlertRuleTemplate() (*FilterAlertRuleTemplate, bool) AsFusionAlertRuleTemplate() (*FusionAlertRuleTemplate, bool) + AsMicrosoftSecurityIncidentCreationAlertRuleTemplate() (*MicrosoftSecurityIncidentCreationAlertRuleTemplate, bool) + AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) AsAlertRuleTemplate() (*AlertRuleTemplate, bool) } @@ -1957,13 +2122,11 @@ type AlertRuleTemplate struct { autorest.Response `json:"-"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the alert rule. - Etag *string `json:"etag,omitempty"` - // Kind - Possible values include: 'KindBasicAlertRuleTemplateKindAlertRuleTemplate', 'KindBasicAlertRuleTemplateKindScheduled', 'KindBasicAlertRuleTemplateKindFilter', 'KindBasicAlertRuleTemplateKindFusion' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindBasicAlertRuleTemplateKindAlertRuleTemplate', 'KindBasicAlertRuleTemplateKindFusion', 'KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation', 'KindBasicAlertRuleTemplateKindScheduled' Kind KindBasicAlertRuleTemplate `json:"kind,omitempty"` } @@ -1975,18 +2138,18 @@ func unmarshalBasicAlertRuleTemplate(body []byte) (BasicAlertRuleTemplate, error } switch m["kind"] { - case string(KindBasicAlertRuleTemplateKindScheduled): - var sart ScheduledAlertRuleTemplate - err := json.Unmarshal(body, &sart) - return sart, err - case string(KindBasicAlertRuleTemplateKindFilter): - var fart FilterAlertRuleTemplate - err := json.Unmarshal(body, &fart) - return fart, err case string(KindBasicAlertRuleTemplateKindFusion): var fart FusionAlertRuleTemplate err := json.Unmarshal(body, &fart) return fart, err + case string(KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation): + var msicart MicrosoftSecurityIncidentCreationAlertRuleTemplate + err := json.Unmarshal(body, &msicart) + return msicart, err + case string(KindBasicAlertRuleTemplateKindScheduled): + var sart ScheduledAlertRuleTemplate + err := json.Unmarshal(body, &sart) + return sart, err default: var art AlertRuleTemplate err := json.Unmarshal(body, &art) @@ -2016,27 +2179,24 @@ func unmarshalBasicAlertRuleTemplateArray(body []byte) ([]BasicAlertRuleTemplate func (art AlertRuleTemplate) MarshalJSON() ([]byte, error) { art.Kind = KindBasicAlertRuleTemplateKindAlertRuleTemplate objectMap := make(map[string]interface{}) - if art.Etag != nil { - objectMap["etag"] = art.Etag - } if art.Kind != "" { objectMap["kind"] = art.Kind } return json.Marshal(objectMap) } -// AsScheduledAlertRuleTemplate is the BasicAlertRuleTemplate implementation for AlertRuleTemplate. -func (art AlertRuleTemplate) AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) { +// AsFusionAlertRuleTemplate is the BasicAlertRuleTemplate implementation for AlertRuleTemplate. +func (art AlertRuleTemplate) AsFusionAlertRuleTemplate() (*FusionAlertRuleTemplate, bool) { return nil, false } -// AsFilterAlertRuleTemplate is the BasicAlertRuleTemplate implementation for AlertRuleTemplate. -func (art AlertRuleTemplate) AsFilterAlertRuleTemplate() (*FilterAlertRuleTemplate, bool) { +// AsMicrosoftSecurityIncidentCreationAlertRuleTemplate is the BasicAlertRuleTemplate implementation for AlertRuleTemplate. +func (art AlertRuleTemplate) AsMicrosoftSecurityIncidentCreationAlertRuleTemplate() (*MicrosoftSecurityIncidentCreationAlertRuleTemplate, bool) { return nil, false } -// AsFusionAlertRuleTemplate is the BasicAlertRuleTemplate implementation for AlertRuleTemplate. -func (art AlertRuleTemplate) AsFusionAlertRuleTemplate() (*FusionAlertRuleTemplate, bool) { +// AsScheduledAlertRuleTemplate is the BasicAlertRuleTemplate implementation for AlertRuleTemplate. +func (art AlertRuleTemplate) AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) { return nil, false } @@ -2067,6 +2227,24 @@ func (artm *AlertRuleTemplateModel) UnmarshalJSON(body []byte) error { return nil } +// AlertRuleTemplatePropertiesBase base alert rule template property bag. +type AlertRuleTemplatePropertiesBase struct { + // AlertRulesCreatedByTemplateCount - the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + // CreatedDateUTC - READ-ONLY; The time that this alert rule template has been added. + CreatedDateUTC *date.Time `json:"createdDateUTC,omitempty"` + // Description - The description of the alert rule template. + Description *string `json:"description,omitempty"` + // DisplayName - The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` + // RequiredDataConnectors - The required data connectors for this template + RequiredDataConnectors *[]DataConnectorStatus `json:"requiredDataConnectors,omitempty"` + // Status - The alert rule template status. Possible values include: 'Installed', 'Available', 'NotAvailable' + Status TemplateStatus `json:"status,omitempty"` + // Tactics - The tactics of the alert rule template + Tactics *[]AttackTactic `json:"tactics,omitempty"` +} + // AlertRuleTemplatesList list all the alert rule templates. type AlertRuleTemplatesList struct { autorest.Response `json:"-"` @@ -2263,13 +2441,13 @@ type ASCDataConnector struct { *ASCDataConnectorProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the data connector. + // 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: 'KindDataConnector', 'KindOffice365', 'KindThreatIntelligence', 'KindAmazonWebServicesCloudTrail', 'KindAzureActiveDirectory', 'KindAzureSecurityCenter', 'KindMicrosoftCloudAppSecurity', 'KindAzureAdvancedThreatProtection', 'KindMicrosoftDefenderAdvancedThreatProtection' + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' Kind KindBasicDataConnector `json:"kind,omitempty"` } @@ -2289,43 +2467,43 @@ func (adc ASCDataConnector) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsOfficeDataConnector is the BasicDataConnector implementation for ASCDataConnector. -func (adc ASCDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { +// AsAADDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { return nil, false } -// AsTIDataConnector is the BasicDataConnector implementation for ASCDataConnector. -func (adc ASCDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { +// AsAATPDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { return nil, false } +// AsASCDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { + return &adc, true +} + // AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for ASCDataConnector. func (adc ASCDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { return nil, false } -// AsAADDataConnector is the BasicDataConnector implementation for ASCDataConnector. -func (adc ASCDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { +// AsMCASDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { return nil, false } -// AsASCDataConnector is the BasicDataConnector implementation for ASCDataConnector. -func (adc ASCDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { - return &adc, true -} - -// AsMCASDataConnector is the BasicDataConnector implementation for ASCDataConnector. -func (adc ASCDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { +// AsMDATPDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { return nil, false } -// AsAATPDataConnector is the BasicDataConnector implementation for ASCDataConnector. -func (adc ASCDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { +// AsOfficeDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { return nil, false } -// AsMDATPDataConnector is the BasicDataConnector implementation for ASCDataConnector. -func (adc ASCDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { +// AsTIDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { return nil, false } @@ -2366,23 +2544,23 @@ func (adc *ASCDataConnector) UnmarshalJSON(body []byte) error { } adc.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - adc.Type = &typeVar + adc.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - adc.Name = &name + adc.Type = &typeVar } case "etag": if v != nil { @@ -2408,7 +2586,7 @@ func (adc *ASCDataConnector) UnmarshalJSON(body []byte) error { return nil } -// ASCDataConnectorProperties MCAS (Microsoft Cloud App Security) data connector properties. +// ASCDataConnectorProperties ASC (Azure Security Center) data connector properties. type ASCDataConnectorProperties struct { // SubscriptionID - The subscription id to connect to, and get the data from. SubscriptionID *string `json:"subscriptionId,omitempty"` @@ -2422,13 +2600,13 @@ type AwsCloudTrailDataConnector struct { *AwsCloudTrailDataConnectorProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the data connector. + // 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: 'KindDataConnector', 'KindOffice365', 'KindThreatIntelligence', 'KindAmazonWebServicesCloudTrail', 'KindAzureActiveDirectory', 'KindAzureSecurityCenter', 'KindMicrosoftCloudAppSecurity', 'KindAzureAdvancedThreatProtection', 'KindMicrosoftDefenderAdvancedThreatProtection' + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' Kind KindBasicDataConnector `json:"kind,omitempty"` } @@ -2448,13 +2626,18 @@ func (actdc AwsCloudTrailDataConnector) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsOfficeDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. -func (actdc AwsCloudTrailDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { +// AsAADDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { return nil, false } -// AsTIDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. -func (actdc AwsCloudTrailDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { +// AsAATPDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { + return nil, false +} + +// AsASCDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { return nil, false } @@ -2463,28 +2646,23 @@ func (actdc AwsCloudTrailDataConnector) AsAwsCloudTrailDataConnector() (*AwsClou return &actdc, true } -// AsAADDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. -func (actdc AwsCloudTrailDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { - return nil, false -} - -// AsASCDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. -func (actdc AwsCloudTrailDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { +// AsMCASDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { return nil, false } -// AsMCASDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. -func (actdc AwsCloudTrailDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { +// AsMDATPDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { return nil, false } -// AsAATPDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. -func (actdc AwsCloudTrailDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { +// AsOfficeDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { return nil, false } -// AsMDATPDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. -func (actdc AwsCloudTrailDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { +// AsTIDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { return nil, false } @@ -2525,23 +2703,23 @@ func (actdc *AwsCloudTrailDataConnector) UnmarshalJSON(body []byte) error { } actdc.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - actdc.Type = &typeVar + actdc.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - actdc.Name = &name + actdc.Type = &typeVar } case "etag": if v != nil { @@ -2594,11 +2772,11 @@ type AzureResourceEntity struct { *AzureResourceEntityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -2620,43 +2798,43 @@ func (are AzureResourceEntity) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for AzureResourceEntity. -func (are AzureResourceEntity) AsHostEntity() (*HostEntity, bool) { - return nil, false +// AsAzureResourceEntity is the BasicEntity implementation for AzureResourceEntity. +func (are AzureResourceEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { + return &are, true } -// AsFileEntity is the BasicEntity implementation for AzureResourceEntity. -func (are AzureResourceEntity) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for AzureResourceEntity. +func (are AzureResourceEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for AzureResourceEntity. -func (are AzureResourceEntity) AsSecurityAlert() (*SecurityAlert, bool) { +// AsDNSEntity is the BasicEntity implementation for AzureResourceEntity. +func (are AzureResourceEntity) AsDNSEntity() (*DNSEntity, bool) { return nil, false } -// AsFileHashEntity is the BasicEntity implementation for AzureResourceEntity. -func (are AzureResourceEntity) AsFileHashEntity() (*FileHashEntity, bool) { +// AsFileEntity is the BasicEntity implementation for AzureResourceEntity. +func (are AzureResourceEntity) AsFileEntity() (*FileEntity, bool) { return nil, false } -// AsMalwareEntity is the BasicEntity implementation for AzureResourceEntity. -func (are AzureResourceEntity) AsMalwareEntity() (*MalwareEntity, bool) { +// AsFileHashEntity is the BasicEntity implementation for AzureResourceEntity. +func (are AzureResourceEntity) AsFileHashEntity() (*FileHashEntity, bool) { return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for AzureResourceEntity. -func (are AzureResourceEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { +// AsHostEntity is the BasicEntity implementation for AzureResourceEntity. +func (are AzureResourceEntity) AsHostEntity() (*HostEntity, bool) { return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for AzureResourceEntity. -func (are AzureResourceEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { - return &are, true +// AsIPEntity is the BasicEntity implementation for AzureResourceEntity. +func (are AzureResourceEntity) AsIPEntity() (*IPEntity, bool) { + return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for AzureResourceEntity. -func (are AzureResourceEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for AzureResourceEntity. +func (are AzureResourceEntity) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } @@ -2665,23 +2843,23 @@ func (are AzureResourceEntity) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for AzureResourceEntity. -func (are AzureResourceEntity) AsDNSEntity() (*DNSEntity, bool) { +// AsRegistryKeyEntity is the BasicEntity implementation for AzureResourceEntity. +func (are AzureResourceEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return nil, false } -// AsIPEntity is the BasicEntity implementation for AzureResourceEntity. -func (are AzureResourceEntity) AsIPEntity() (*IPEntity, bool) { +// AsRegistryValueEntity is the BasicEntity implementation for AzureResourceEntity. +func (are AzureResourceEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { return nil, false } -// AsRegistryKeyEntity is the BasicEntity implementation for AzureResourceEntity. -func (are AzureResourceEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { +// AsSecurityAlert is the BasicEntity implementation for AzureResourceEntity. +func (are AzureResourceEntity) AsSecurityAlert() (*SecurityAlert, bool) { return nil, false } -// AsRegistryValueEntity is the BasicEntity implementation for AzureResourceEntity. -func (are AzureResourceEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { +// AsSecurityGroupEntity is the BasicEntity implementation for AzureResourceEntity. +func (are AzureResourceEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { return nil, false } @@ -2727,23 +2905,23 @@ func (are *AzureResourceEntity) UnmarshalJSON(body []byte) error { } are.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - are.Type = &typeVar + are.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - are.Name = &name + are.Type = &typeVar } case "kind": if v != nil { @@ -2764,10 +2942,10 @@ func (are *AzureResourceEntity) UnmarshalJSON(body []byte) error { type AzureResourceEntityProperties struct { // ResourceID - READ-ONLY; The azure resource id of the resource ResourceID *string `json:"resourceId,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for AzureResourceEntityProperties. @@ -2776,48 +2954,30 @@ func (arep AzureResourceEntityProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// BaseAlertRuleTemplateProperties base alert rule template property bag. -type BaseAlertRuleTemplateProperties struct { - // DisplayName - The display name for alert rule template. - DisplayName *string `json:"displayName,omitempty"` - // Description - The description of the alert rule template. - Description *string `json:"description,omitempty"` - // Tactics - The tactics of the alert rule template - Tactics *[]AttackTactic `json:"tactics,omitempty"` - // CreatedDateUTC - READ-ONLY; The time that this alert rule template has been added. - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - // Status - The alert rule template status. Possible values include: 'Installed', 'Available', 'NotAvailable' - Status TemplateStatus `json:"status,omitempty"` - // RequiredDataConnectors - The required data connectors for this template - RequiredDataConnectors *[]DataConnectorStatus `json:"requiredDataConnectors,omitempty"` - // AlertRulesCreatedByTemplateCount - the number of alert rules that were created by this template - AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` -} - // Bookmark represents a bookmark in Azure Security Insights. type Bookmark struct { autorest.Response `json:"-"` - // Etag - Etag of the bookmark. - Etag *string `json:"etag,omitempty"` // BookmarkProperties - Bookmark properties *BookmarkProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,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"` } // MarshalJSON is the custom marshaler for Bookmark. func (b Bookmark) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if b.Etag != nil { - objectMap["etag"] = b.Etag - } if b.BookmarkProperties != nil { objectMap["properties"] = b.BookmarkProperties } + if b.Etag != nil { + objectMap["etag"] = b.Etag + } return json.Marshal(objectMap) } @@ -2830,15 +2990,6 @@ func (b *Bookmark) UnmarshalJSON(body []byte) error { } 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 - } - b.Etag = &etag - } case "properties": if v != nil { var bookmarkProperties BookmarkProperties @@ -2857,6 +3008,15 @@ func (b *Bookmark) UnmarshalJSON(body []byte) error { } b.ID = &ID } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + b.Name = &name + } case "type": if v != nil { var typeVar string @@ -2866,14 +3026,14 @@ func (b *Bookmark) UnmarshalJSON(body []byte) error { } b.Type = &typeVar } - case "name": + case "etag": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var etag string + err = json.Unmarshal(*v, &etag) if err != nil { return err } - b.Name = &name + b.Etag = &etag } } } @@ -3029,55 +3189,57 @@ func NewBookmarkListPage(getNextPage func(context.Context, BookmarkList) (Bookma // BookmarkProperties describes bookmark properties type BookmarkProperties struct { - // DisplayName - The display name of the bookmark - DisplayName *string `json:"displayName,omitempty"` - // Updated - The last time the bookmark was updated - Updated *date.Time `json:"updated,omitempty"` // Created - The time the bookmark was created Created *date.Time `json:"created,omitempty"` // CreatedBy - Describes a user that created the bookmark CreatedBy *UserInfo `json:"createdBy,omitempty"` - // UpdatedBy - Describes a user that updated the bookmark - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` - // Notes - The notes of the bookmark - Notes *string `json:"notes,omitempty"` + // DisplayName - The display name of the bookmark + DisplayName *string `json:"displayName,omitempty"` // Labels - List of labels relevant to this bookmark Labels *[]string `json:"labels,omitempty"` + // Notes - The notes of the bookmark + Notes *string `json:"notes,omitempty"` // Query - The query of the bookmark. Query *string `json:"query,omitempty"` // QueryResult - The query result of the bookmark. QueryResult *string `json:"queryResult,omitempty"` + // Updated - The last time the bookmark was updated + Updated *date.Time `json:"updated,omitempty"` + // UpdatedBy - Describes a user that updated the bookmark + UpdatedBy *UserInfo `json:"updatedBy,omitempty"` } -// Case represents a case in Azure Security Insights. -type Case struct { +// BookmarkRelation represents a bookmark relation +type BookmarkRelation struct { autorest.Response `json:"-"` - // Etag - Etag of the alert rule. + // 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"` - // CaseProperties - Case properties - *CaseProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,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 Case. -func (c Case) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for BookmarkRelation. +func (br BookmarkRelation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if c.Etag != nil { - objectMap["etag"] = c.Etag + if br.BookmarkRelationProperties != nil { + objectMap["properties"] = br.BookmarkRelationProperties } - if c.CaseProperties != nil { - objectMap["properties"] = c.CaseProperties + if br.Etag != nil { + objectMap["etag"] = br.Etag } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for Case struct. -func (c *Case) UnmarshalJSON(body []byte) error { +// 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 { @@ -3085,41 +3247,41 @@ func (c *Case) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "etag": + case "properties": if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) + var bookmarkRelationProperties BookmarkRelationProperties + err = json.Unmarshal(*v, &bookmarkRelationProperties) if err != nil { return err } - c.Etag = &etag + br.BookmarkRelationProperties = &bookmarkRelationProperties } - case "properties": + case "kind": if v != nil { - var caseProperties CaseProperties - err = json.Unmarshal(*v, &caseProperties) + var kind RelationTypes + err = json.Unmarshal(*v, &kind) if err != nil { return err } - c.CaseProperties = &caseProperties + br.Kind = kind } - case "id": + case "etag": if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var etag string + err = json.Unmarshal(*v, &etag) if err != nil { return err } - c.ID = &ID + br.Etag = &etag } - case "type": + case "id": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - c.Type = &typeVar + br.ID = &ID } case "name": if v != nil { @@ -3128,62 +3290,7 @@ func (c *Case) UnmarshalJSON(body []byte) error { if err != nil { return err } - c.Name = &name - } - } - } - - return nil -} - -// CaseComment represents a case comment -type CaseComment struct { - autorest.Response `json:"-"` - // CaseCommentProperties - Case comment properties - *CaseCommentProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Azure resource Id - ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` - // Name - READ-ONLY; Azure resource name - Name *string `json:"name,omitempty"` -} - -// MarshalJSON is the custom marshaler for CaseComment. -func (cc CaseComment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cc.CaseCommentProperties != nil { - objectMap["properties"] = cc.CaseCommentProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CaseComment struct. -func (cc *CaseComment) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var caseCommentProperties CaseCommentProperties - err = json.Unmarshal(*v, &caseCommentProperties) - if err != nil { - return err - } - cc.CaseCommentProperties = &caseCommentProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cc.ID = &ID + br.Name = &name } case "type": if v != nil { @@ -3192,16 +3299,7 @@ func (cc *CaseComment) UnmarshalJSON(body []byte) error { if err != nil { return err } - cc.Type = &typeVar - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cc.Name = &name + br.Type = &typeVar } } } @@ -3209,26 +3307,26 @@ func (cc *CaseComment) UnmarshalJSON(body []byte) error { return nil } -// CaseCommentList list of case comments. -type CaseCommentList struct { +// BookmarkRelationList list of bookmark relations. +type BookmarkRelationList struct { autorest.Response `json:"-"` - // NextLink - READ-ONLY; URL to fetch the next set of comments. + // NextLink - READ-ONLY; URL to fetch the next set of relations. NextLink *string `json:"nextLink,omitempty"` - // Value - Array of comments. - Value *[]CaseComment `json:"value,omitempty"` + // Value - Array of relations. + Value *[]BookmarkRelation `json:"value,omitempty"` } -// CaseCommentListIterator provides access to a complete listing of CaseComment values. -type CaseCommentListIterator struct { +// BookmarkRelationListIterator provides access to a complete listing of BookmarkRelation values. +type BookmarkRelationListIterator struct { i int - page CaseCommentListPage + 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 *CaseCommentListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *BookmarkRelationListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CaseCommentListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -3253,7 +3351,327 @@ func (iter *CaseCommentListIterator) NextWithContext(ctx context.Context) (err e // 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 *CaseCommentListIterator) Next() error { +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:"-"` + // CaseProperties - Case properties + *CaseProperties `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"` +} + +// MarshalJSON is the custom marshaler for Case. +func (c Case) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.CaseProperties != nil { + objectMap["properties"] = c.CaseProperties + } + if c.Etag != nil { + objectMap["etag"] = c.Etag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Case struct. +func (c *Case) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var caseProperties CaseProperties + err = json.Unmarshal(*v, &caseProperties) + if err != nil { + return err + } + c.CaseProperties = &caseProperties + } + 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 + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + c.Etag = &etag + } + } + } + + return nil +} + +// CaseComment represents a case comment +type CaseComment struct { + autorest.Response `json:"-"` + // CaseCommentProperties - Case comment properties + *CaseCommentProperties `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"` +} + +// MarshalJSON is the custom marshaler for CaseComment. +func (cc CaseComment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cc.CaseCommentProperties != nil { + objectMap["properties"] = cc.CaseCommentProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CaseComment struct. +func (cc *CaseComment) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var caseCommentProperties CaseCommentProperties + err = json.Unmarshal(*v, &caseCommentProperties) + if err != nil { + return err + } + cc.CaseCommentProperties = &caseCommentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cc.Type = &typeVar + } + } + } + + return nil +} + +// CaseCommentList list of case comments. +type CaseCommentList struct { + autorest.Response `json:"-"` + // NextLink - READ-ONLY; URL to fetch the next set of comments. + NextLink *string `json:"nextLink,omitempty"` + // Value - Array of comments. + Value *[]CaseComment `json:"value,omitempty"` +} + +// CaseCommentListIterator provides access to a complete listing of CaseComment values. +type CaseCommentListIterator struct { + i int + page CaseCommentListPage +} + +// 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 *CaseCommentListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CaseCommentListIterator.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 *CaseCommentListIterator) Next() error { return iter.NextWithContext(context.Background()) } @@ -3357,10 +3775,10 @@ func NewCaseCommentListPage(getNextPage func(context.Context, CaseCommentList) ( // CaseCommentProperties case comment property bag. type CaseCommentProperties struct { - // Message - The comment message - Message *string `json:"message,omitempty"` // CreatedTimeUtc - READ-ONLY; The time the comment was created CreatedTimeUtc *date.Time `json:"createdTimeUtc,omitempty"` + // Message - The comment message + Message *string `json:"message,omitempty"` // UserInfo - READ-ONLY; Describes the user that created the comment UserInfo *UserInfo `json:"userInfo,omitempty"` } @@ -3513,52 +3931,308 @@ func NewCaseListPage(getNextPage func(context.Context, CaseList) (CaseList, erro // CaseProperties describes case properties type CaseProperties struct { - // LastUpdatedTimeUtc - READ-ONLY; The last time the case was updated - LastUpdatedTimeUtc *date.Time `json:"lastUpdatedTimeUtc,omitempty"` + // CaseNumber - READ-ONLY; a sequential number + CaseNumber *int32 `json:"caseNumber,omitempty"` + // CloseReason - The reason the case was closed. Possible values include: 'Resolved', 'Dismissed', 'TruePositive', 'FalsePositive', 'Other' + CloseReason CloseReason `json:"closeReason,omitempty"` + // ClosedReasonText - the case close reason details + ClosedReasonText *string `json:"closedReasonText,omitempty"` // CreatedTimeUtc - READ-ONLY; The time the case was created CreatedTimeUtc *date.Time `json:"createdTimeUtc,omitempty"` + // Description - The description of the case + Description *string `json:"description,omitempty"` // EndTimeUtc - The end time of the case EndTimeUtc *date.Time `json:"endTimeUtc,omitempty"` - // StartTimeUtc - The start time of the case - StartTimeUtc *date.Time `json:"startTimeUtc,omitempty"` // Labels - List of labels relevant to this case Labels *[]string `json:"labels,omitempty"` - // Description - The description of the case - Description *string `json:"description,omitempty"` - // Title - The title of the case - Title *string `json:"title,omitempty"` + // LastComment - READ-ONLY; the last comment in the case + LastComment *string `json:"lastComment,omitempty"` + // LastUpdatedTimeUtc - READ-ONLY; The last time the case was updated + LastUpdatedTimeUtc *date.Time `json:"lastUpdatedTimeUtc,omitempty"` // Owner - Describes a user that the case is assigned to Owner *UserInfo `json:"owner,omitempty"` + // RelatedAlertIds - READ-ONLY; List of related alert identifiers + RelatedAlertIds *[]string `json:"relatedAlertIds,omitempty"` // Severity - The severity of the case. Possible values include: 'CaseSeverityCritical', 'CaseSeverityHigh', 'CaseSeverityMedium', 'CaseSeverityLow', 'CaseSeverityInformational' Severity CaseSeverity `json:"severity,omitempty"` + // StartTimeUtc - The start time of the case + StartTimeUtc *date.Time `json:"startTimeUtc,omitempty"` // Status - The status of the case. Possible values include: 'CaseStatusDraft', 'CaseStatusNew', 'CaseStatusInProgress', 'CaseStatusClosed' Status CaseStatus `json:"status,omitempty"` - // CloseReason - The reason the case was closed. Possible values include: 'Resolved', 'Dismissed', 'TruePositive', 'FalsePositive', 'Other' - CloseReason CloseReason `json:"closeReason,omitempty"` - // ClosedReasonText - the case close reason details - ClosedReasonText *string `json:"closedReasonText,omitempty"` - // RelatedAlertIds - READ-ONLY; List of related alert identifiers - RelatedAlertIds *[]string `json:"relatedAlertIds,omitempty"` - // CaseNumber - READ-ONLY; a sequential number - CaseNumber *int32 `json:"caseNumber,omitempty"` - // LastComment - READ-ONLY; the last comment in the case - LastComment *string `json:"lastComment,omitempty"` + // Title - The title of the case + Title *string `json:"title,omitempty"` // TotalComments - READ-ONLY; the number of total comments in the case TotalComments *int32 `json:"totalComments,omitempty"` } +// CaseRelation represents a case relation +type CaseRelation struct { + autorest.Response `json:"-"` + // CaseRelationProperties - Case relation properties + *CaseRelationProperties `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 CaseRelation. +func (cr CaseRelation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cr.CaseRelationProperties != nil { + objectMap["properties"] = cr.CaseRelationProperties + } + if cr.Etag != nil { + objectMap["etag"] = cr.Etag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CaseRelation struct. +func (cr *CaseRelation) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var caseRelationProperties CaseRelationProperties + err = json.Unmarshal(*v, &caseRelationProperties) + if err != nil { + return err + } + cr.CaseRelationProperties = &caseRelationProperties + } + case "kind": + if v != nil { + var kind RelationTypes + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + cr.Kind = kind + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + cr.Etag = &etag + } + 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 "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cr.Type = &typeVar + } + } + } + + return nil +} + +// CaseRelationList list of case relations. +type CaseRelationList 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 *[]CaseRelation `json:"value,omitempty"` +} + +// CaseRelationListIterator provides access to a complete listing of CaseRelation values. +type CaseRelationListIterator struct { + i int + page CaseRelationListPage +} + +// 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 *CaseRelationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CaseRelationListIterator.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 *CaseRelationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CaseRelationListIterator) 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 CaseRelationListIterator) Response() CaseRelationList { + 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 CaseRelationListIterator) Value() CaseRelation { + if !iter.page.NotDone() { + return CaseRelation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CaseRelationListIterator type. +func NewCaseRelationListIterator(page CaseRelationListPage) CaseRelationListIterator { + return CaseRelationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (crl CaseRelationList) IsEmpty() bool { + return crl.Value == nil || len(*crl.Value) == 0 +} + +// caseRelationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (crl CaseRelationList) caseRelationListPreparer(ctx context.Context) (*http.Request, error) { + if crl.NextLink == nil || len(to.String(crl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(crl.NextLink))) +} + +// CaseRelationListPage contains a page of CaseRelation values. +type CaseRelationListPage struct { + fn func(context.Context, CaseRelationList) (CaseRelationList, error) + crl CaseRelationList +} + +// 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 *CaseRelationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CaseRelationListPage.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.crl) + if err != nil { + return err + } + page.crl = 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 *CaseRelationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CaseRelationListPage) NotDone() bool { + return !page.crl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CaseRelationListPage) Response() CaseRelationList { + return page.crl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CaseRelationListPage) Values() []CaseRelation { + if page.crl.IsEmpty() { + return nil + } + return *page.crl.Value +} + +// Creates a new instance of the CaseRelationListPage type. +func NewCaseRelationListPage(getNextPage func(context.Context, CaseRelationList) (CaseRelationList, error)) CaseRelationListPage { + return CaseRelationListPage{fn: getNextPage} +} + +// CaseRelationProperties case relation properties +type CaseRelationProperties 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"` + // BookmarkName - The case related bookmark name + BookmarkName *string `json:"bookmarkName,omitempty"` +} + // CasesAggregation represents aggregations results for cases. type CasesAggregation struct { // CasesAggregationProperties - Properties of aggregations results of cases. *CasesAggregationProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` // Kind - Possible values include: 'KindAggregations', 'KindCasesAggregation' - Kind KindBasicAggregations `json:"kind,omitempty"` + Kind Kind `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for CasesAggregation. @@ -3616,27 +4290,27 @@ func (ca *CasesAggregation) UnmarshalJSON(body []byte) error { } ca.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - ca.Type = &typeVar + ca.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - ca.Name = &name + ca.Type = &typeVar } case "kind": if v != nil { - var kind KindBasicAggregations + var kind Kind err = json.Unmarshal(*v, &kind) if err != nil { return err @@ -3655,24 +4329,24 @@ type CasesAggregationBySeverityProperties struct { TotalCriticalSeverity *int32 `json:"totalCriticalSeverity,omitempty"` // TotalHighSeverity - READ-ONLY; Total amount of open cases with severity High TotalHighSeverity *int32 `json:"totalHighSeverity,omitempty"` - // TotalMediumSeverity - READ-ONLY; Total amount of open cases with severity medium - TotalMediumSeverity *int32 `json:"totalMediumSeverity,omitempty"` - // TotalLowSeverity - READ-ONLY; Total amount of open cases with severity Low - TotalLowSeverity *int32 `json:"totalLowSeverity,omitempty"` // TotalInformationalSeverity - READ-ONLY; Total amount of open cases with severity Informational TotalInformationalSeverity *int32 `json:"totalInformationalSeverity,omitempty"` + // TotalLowSeverity - READ-ONLY; Total amount of open cases with severity Low + TotalLowSeverity *int32 `json:"totalLowSeverity,omitempty"` + // TotalMediumSeverity - READ-ONLY; Total amount of open cases with severity medium + TotalMediumSeverity *int32 `json:"totalMediumSeverity,omitempty"` } // CasesAggregationByStatusProperties aggregative results of cases by status property bag. type CasesAggregationByStatusProperties struct { - // TotalNewStatus - READ-ONLY; Total amount of open cases with status New - TotalNewStatus *int32 `json:"totalNewStatus,omitempty"` + // TotalDismissedStatus - READ-ONLY; Total amount of open cases with status Dismissed + TotalDismissedStatus *int32 `json:"totalDismissedStatus,omitempty"` // TotalInProgressStatus - READ-ONLY; Total amount of open cases with status InProgress TotalInProgressStatus *int32 `json:"totalInProgressStatus,omitempty"` + // TotalNewStatus - READ-ONLY; Total amount of open cases with status New + TotalNewStatus *int32 `json:"totalNewStatus,omitempty"` // TotalResolvedStatus - READ-ONLY; Total amount of open cases with status Resolved TotalResolvedStatus *int32 `json:"totalResolvedStatus,omitempty"` - // TotalDismissedStatus - READ-ONLY; Total amount of open cases with status Dismissed - TotalDismissedStatus *int32 `json:"totalDismissedStatus,omitempty"` } // CasesAggregationProperties aggregative results of cases property bag. @@ -3689,11 +4363,11 @@ type CloudApplicationEntity struct { *CloudApplicationEntityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -3715,18 +4389,23 @@ func (cae CloudApplicationEntity) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for CloudApplicationEntity. -func (cae CloudApplicationEntity) AsHostEntity() (*HostEntity, bool) { +// AsAzureResourceEntity is the BasicEntity implementation for CloudApplicationEntity. +func (cae CloudApplicationEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { return nil, false } -// AsFileEntity is the BasicEntity implementation for CloudApplicationEntity. -func (cae CloudApplicationEntity) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for CloudApplicationEntity. +func (cae CloudApplicationEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { + return &cae, true +} + +// AsDNSEntity is the BasicEntity implementation for CloudApplicationEntity. +func (cae CloudApplicationEntity) AsDNSEntity() (*DNSEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for CloudApplicationEntity. -func (cae CloudApplicationEntity) AsSecurityAlert() (*SecurityAlert, bool) { +// AsFileEntity is the BasicEntity implementation for CloudApplicationEntity. +func (cae CloudApplicationEntity) AsFileEntity() (*FileEntity, bool) { return nil, false } @@ -3735,48 +4414,43 @@ func (cae CloudApplicationEntity) AsFileHashEntity() (*FileHashEntity, bool) { return nil, false } -// AsMalwareEntity is the BasicEntity implementation for CloudApplicationEntity. -func (cae CloudApplicationEntity) AsMalwareEntity() (*MalwareEntity, bool) { +// AsHostEntity is the BasicEntity implementation for CloudApplicationEntity. +func (cae CloudApplicationEntity) AsHostEntity() (*HostEntity, bool) { return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for CloudApplicationEntity. -func (cae CloudApplicationEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { +// AsIPEntity is the BasicEntity implementation for CloudApplicationEntity. +func (cae CloudApplicationEntity) AsIPEntity() (*IPEntity, bool) { return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for CloudApplicationEntity. -func (cae CloudApplicationEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for CloudApplicationEntity. +func (cae CloudApplicationEntity) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for CloudApplicationEntity. -func (cae CloudApplicationEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { - return &cae, true -} - // AsProcessEntity is the BasicEntity implementation for CloudApplicationEntity. func (cae CloudApplicationEntity) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for CloudApplicationEntity. -func (cae CloudApplicationEntity) AsDNSEntity() (*DNSEntity, bool) { +// AsRegistryKeyEntity is the BasicEntity implementation for CloudApplicationEntity. +func (cae CloudApplicationEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return nil, false } -// AsIPEntity is the BasicEntity implementation for CloudApplicationEntity. -func (cae CloudApplicationEntity) AsIPEntity() (*IPEntity, bool) { +// AsRegistryValueEntity is the BasicEntity implementation for CloudApplicationEntity. +func (cae CloudApplicationEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { return nil, false } -// AsRegistryKeyEntity is the BasicEntity implementation for CloudApplicationEntity. -func (cae CloudApplicationEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { +// AsSecurityAlert is the BasicEntity implementation for CloudApplicationEntity. +func (cae CloudApplicationEntity) AsSecurityAlert() (*SecurityAlert, bool) { return nil, false } -// AsRegistryValueEntity is the BasicEntity implementation for CloudApplicationEntity. -func (cae CloudApplicationEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { +// AsSecurityGroupEntity is the BasicEntity implementation for CloudApplicationEntity. +func (cae CloudApplicationEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { return nil, false } @@ -3822,23 +4496,23 @@ func (cae *CloudApplicationEntity) UnmarshalJSON(body []byte) error { } cae.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - cae.Type = &typeVar + cae.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - cae.Name = &name + cae.Type = &typeVar } case "kind": if v != nil { @@ -3863,10 +4537,10 @@ type CloudApplicationEntityProperties struct { AppName *string `json:"appName,omitempty"` // InstanceName - READ-ONLY; The user defined instance name of the cloud application. It is often used to distinguish between several applications of the same type that a customer has. InstanceName *string `json:"instanceName,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for CloudApplicationEntityProperties. @@ -3924,14 +4598,14 @@ type CloudErrorBody struct { // BasicDataConnector data connector. type BasicDataConnector interface { - AsOfficeDataConnector() (*OfficeDataConnector, bool) - AsTIDataConnector() (*TIDataConnector, bool) - AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) AsAADDataConnector() (*AADDataConnector, bool) + AsAATPDataConnector() (*AATPDataConnector, bool) AsASCDataConnector() (*ASCDataConnector, bool) + AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) AsMCASDataConnector() (*MCASDataConnector, bool) - AsAATPDataConnector() (*AATPDataConnector, bool) AsMDATPDataConnector() (*MDATPDataConnector, bool) + AsOfficeDataConnector() (*OfficeDataConnector, bool) + AsTIDataConnector() (*TIDataConnector, bool) AsDataConnector() (*DataConnector, bool) } @@ -3940,13 +4614,13 @@ type DataConnector struct { autorest.Response `json:"-"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the data connector. + // 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: 'KindDataConnector', 'KindOffice365', 'KindThreatIntelligence', 'KindAmazonWebServicesCloudTrail', 'KindAzureActiveDirectory', 'KindAzureSecurityCenter', 'KindMicrosoftCloudAppSecurity', 'KindAzureAdvancedThreatProtection', 'KindMicrosoftDefenderAdvancedThreatProtection' + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' Kind KindBasicDataConnector `json:"kind,omitempty"` } @@ -3958,38 +4632,38 @@ func unmarshalBasicDataConnector(body []byte) (BasicDataConnector, error) { } switch m["kind"] { - case string(KindOffice365): - var odc OfficeDataConnector - err := json.Unmarshal(body, &odc) - return odc, err - case string(KindThreatIntelligence): - var tdc TIDataConnector - err := json.Unmarshal(body, &tdc) - return tdc, err - case string(KindAmazonWebServicesCloudTrail): - var actdc AwsCloudTrailDataConnector - err := json.Unmarshal(body, &actdc) - return actdc, err case string(KindAzureActiveDirectory): var adc AADDataConnector err := json.Unmarshal(body, &adc) return adc, err + case string(KindAzureAdvancedThreatProtection): + var adc AATPDataConnector + err := json.Unmarshal(body, &adc) + return adc, err case string(KindAzureSecurityCenter): var adc ASCDataConnector err := json.Unmarshal(body, &adc) return adc, err + case string(KindAmazonWebServicesCloudTrail): + var actdc AwsCloudTrailDataConnector + err := json.Unmarshal(body, &actdc) + return actdc, err case string(KindMicrosoftCloudAppSecurity): var mdc MCASDataConnector err := json.Unmarshal(body, &mdc) return mdc, err - case string(KindAzureAdvancedThreatProtection): - var adc AATPDataConnector - err := json.Unmarshal(body, &adc) - return adc, err case string(KindMicrosoftDefenderAdvancedThreatProtection): var mdc MDATPDataConnector err := json.Unmarshal(body, &mdc) return mdc, err + case string(KindOffice365): + var odc OfficeDataConnector + err := json.Unmarshal(body, &odc) + return odc, err + case string(KindThreatIntelligence): + var tdc TIDataConnector + err := json.Unmarshal(body, &tdc) + return tdc, err default: var dc DataConnector err := json.Unmarshal(body, &dc) @@ -4028,43 +4702,43 @@ func (dc DataConnector) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsOfficeDataConnector is the BasicDataConnector implementation for DataConnector. -func (dc DataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { +// AsAADDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsAADDataConnector() (*AADDataConnector, bool) { return nil, false } -// AsTIDataConnector is the BasicDataConnector implementation for DataConnector. -func (dc DataConnector) AsTIDataConnector() (*TIDataConnector, bool) { +// AsAATPDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { return nil, false } -// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for DataConnector. -func (dc DataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { +// AsASCDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { return nil, false } -// AsAADDataConnector is the BasicDataConnector implementation for DataConnector. -func (dc DataConnector) AsAADDataConnector() (*AADDataConnector, bool) { +// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { return nil, false } -// AsASCDataConnector is the BasicDataConnector implementation for DataConnector. -func (dc DataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { +// AsMCASDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { return nil, false } -// AsMCASDataConnector is the BasicDataConnector implementation for DataConnector. -func (dc DataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { +// AsMDATPDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { return nil, false } -// AsAATPDataConnector is the BasicDataConnector implementation for DataConnector. -func (dc DataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { +// AsOfficeDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { return nil, false } -// AsMDATPDataConnector is the BasicDataConnector implementation for DataConnector. -func (dc DataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { +// AsTIDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsTIDataConnector() (*TIDataConnector, bool) { return nil, false } @@ -4323,11 +4997,11 @@ type DNSEntity struct { *DNSEntityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -4349,43 +5023,43 @@ func (de DNSEntity) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for DNSEntity. -func (de DNSEntity) AsHostEntity() (*HostEntity, bool) { +// AsAzureResourceEntity is the BasicEntity implementation for DNSEntity. +func (de DNSEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { return nil, false } -// AsFileEntity is the BasicEntity implementation for DNSEntity. -func (de DNSEntity) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for DNSEntity. +func (de DNSEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for DNSEntity. -func (de DNSEntity) AsSecurityAlert() (*SecurityAlert, bool) { - return nil, false +// AsDNSEntity is the BasicEntity implementation for DNSEntity. +func (de DNSEntity) AsDNSEntity() (*DNSEntity, bool) { + return &de, true } -// AsFileHashEntity is the BasicEntity implementation for DNSEntity. -func (de DNSEntity) AsFileHashEntity() (*FileHashEntity, bool) { +// AsFileEntity is the BasicEntity implementation for DNSEntity. +func (de DNSEntity) AsFileEntity() (*FileEntity, bool) { return nil, false } -// AsMalwareEntity is the BasicEntity implementation for DNSEntity. -func (de DNSEntity) AsMalwareEntity() (*MalwareEntity, bool) { +// AsFileHashEntity is the BasicEntity implementation for DNSEntity. +func (de DNSEntity) AsFileHashEntity() (*FileHashEntity, bool) { return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for DNSEntity. -func (de DNSEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { +// AsHostEntity is the BasicEntity implementation for DNSEntity. +func (de DNSEntity) AsHostEntity() (*HostEntity, bool) { return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for DNSEntity. -func (de DNSEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { +// AsIPEntity is the BasicEntity implementation for DNSEntity. +func (de DNSEntity) AsIPEntity() (*IPEntity, bool) { return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for DNSEntity. -func (de DNSEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for DNSEntity. +func (de DNSEntity) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } @@ -4394,23 +5068,23 @@ func (de DNSEntity) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for DNSEntity. -func (de DNSEntity) AsDNSEntity() (*DNSEntity, bool) { - return &de, true +// AsRegistryKeyEntity is the BasicEntity implementation for DNSEntity. +func (de DNSEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { + return nil, false } -// AsIPEntity is the BasicEntity implementation for DNSEntity. -func (de DNSEntity) AsIPEntity() (*IPEntity, bool) { +// AsRegistryValueEntity is the BasicEntity implementation for DNSEntity. +func (de DNSEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { return nil, false } -// AsRegistryKeyEntity is the BasicEntity implementation for DNSEntity. -func (de DNSEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { +// AsSecurityAlert is the BasicEntity implementation for DNSEntity. +func (de DNSEntity) AsSecurityAlert() (*SecurityAlert, bool) { return nil, false } -// AsRegistryValueEntity is the BasicEntity implementation for DNSEntity. -func (de DNSEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { +// AsSecurityGroupEntity is the BasicEntity implementation for DNSEntity. +func (de DNSEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { return nil, false } @@ -4456,23 +5130,23 @@ func (de *DNSEntity) UnmarshalJSON(body []byte) error { } de.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - de.Type = &typeVar + de.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - de.Name = &name + de.Type = &typeVar } case "kind": if v != nil { @@ -4491,18 +5165,18 @@ func (de *DNSEntity) UnmarshalJSON(body []byte) error { // DNSEntityProperties dns entity property bag. type DNSEntityProperties struct { - // DomainName - READ-ONLY; The name of the dns record associated with the alert - DomainName *string `json:"domainName,omitempty"` - // IPAddressEntityIds - READ-ONLY; Ip entity identifiers for the resolved ip address. - IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` // DNSServerIPEntityID - READ-ONLY; An ip entity id for the dns server resolving the request DNSServerIPEntityID *string `json:"dnsServerIpEntityId,omitempty"` + // DomainName - READ-ONLY; The name of the dns record associated with the alert + DomainName *string `json:"domainName,omitempty"` // HostIPAddressEntityID - READ-ONLY; An ip entity id for the dns request client HostIPAddressEntityID *string `json:"hostIpAddressEntityId,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,omitempty"` + // IPAddressEntityIds - READ-ONLY; Ip entity identifiers for the resolved ip address. + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for DNSEntityProperties. @@ -4514,19 +5188,19 @@ func (dep DNSEntityProperties) MarshalJSON() ([]byte, error) { // BasicEntity specific entity. type BasicEntity interface { AsAccountEntity() (*AccountEntity, bool) - AsHostEntity() (*HostEntity, bool) - AsFileEntity() (*FileEntity, bool) - AsSecurityAlert() (*SecurityAlert, bool) - AsFileHashEntity() (*FileHashEntity, bool) - AsMalwareEntity() (*MalwareEntity, bool) - AsSecurityGroupEntity() (*SecurityGroupEntity, bool) AsAzureResourceEntity() (*AzureResourceEntity, bool) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) - AsProcessEntity() (*ProcessEntity, bool) AsDNSEntity() (*DNSEntity, bool) + AsFileEntity() (*FileEntity, bool) + AsFileHashEntity() (*FileHashEntity, bool) + AsHostEntity() (*HostEntity, bool) AsIPEntity() (*IPEntity, bool) + AsMalwareEntity() (*MalwareEntity, bool) + AsProcessEntity() (*ProcessEntity, bool) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) AsRegistryValueEntity() (*RegistryValueEntity, bool) + AsSecurityAlert() (*SecurityAlert, bool) + AsSecurityGroupEntity() (*SecurityGroupEntity, bool) AsURLEntity() (*URLEntity, bool) AsEntity() (*Entity, bool) } @@ -4536,11 +5210,11 @@ type Entity struct { autorest.Response `json:"-"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -4556,30 +5230,6 @@ func unmarshalBasicEntity(body []byte) (BasicEntity, error) { var ae AccountEntity err := json.Unmarshal(body, &ae) return ae, err - case string(KindHost): - var he HostEntity - err := json.Unmarshal(body, &he) - return he, err - case string(KindFile): - var fe FileEntity - err := json.Unmarshal(body, &fe) - return fe, err - case string(KindSecurityAlert): - var sa SecurityAlert - err := json.Unmarshal(body, &sa) - return sa, err - case string(KindFileHash): - var fhe FileHashEntity - err := json.Unmarshal(body, &fhe) - return fhe, err - case string(KindMalware): - var me MalwareEntity - err := json.Unmarshal(body, &me) - return me, err - case string(KindSecurityGroup): - var sge SecurityGroupEntity - err := json.Unmarshal(body, &sge) - return sge, err case string(KindAzureResource): var are AzureResourceEntity err := json.Unmarshal(body, &are) @@ -4588,18 +5238,34 @@ func unmarshalBasicEntity(body []byte) (BasicEntity, error) { var cae CloudApplicationEntity err := json.Unmarshal(body, &cae) return cae, err - case string(KindProcess): - var peVar ProcessEntity - err := json.Unmarshal(body, &peVar) - return peVar, err case string(KindDNSResolution): var de DNSEntity err := json.Unmarshal(body, &de) return de, err + case string(KindFile): + var fe FileEntity + err := json.Unmarshal(body, &fe) + return fe, err + case string(KindFileHash): + var fhe FileHashEntity + err := json.Unmarshal(body, &fhe) + return fhe, err + case string(KindHost): + var he HostEntity + err := json.Unmarshal(body, &he) + return he, err case string(KindIP): var ie IPEntity err := json.Unmarshal(body, &ie) return ie, err + case string(KindMalware): + var me MalwareEntity + err := json.Unmarshal(body, &me) + return me, err + case string(KindProcess): + var peVar ProcessEntity + err := json.Unmarshal(body, &peVar) + return peVar, err case string(KindRegistryKey): var rke RegistryKeyEntity err := json.Unmarshal(body, &rke) @@ -4608,6 +5274,14 @@ func unmarshalBasicEntity(body []byte) (BasicEntity, error) { var rve RegistryValueEntity err := json.Unmarshal(body, &rve) return rve, err + case string(KindSecurityAlert): + var sa SecurityAlert + err := json.Unmarshal(body, &sa) + return sa, err + case string(KindSecurityGroup): + var sge SecurityGroupEntity + err := json.Unmarshal(body, &sge) + return sge, err case string(KindURL): var ue URLEntity err := json.Unmarshal(body, &ue) @@ -4652,43 +5326,43 @@ func (e Entity) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for Entity. -func (e Entity) AsHostEntity() (*HostEntity, bool) { +// AsAzureResourceEntity is the BasicEntity implementation for Entity. +func (e Entity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { return nil, false } -// AsFileEntity is the BasicEntity implementation for Entity. -func (e Entity) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for Entity. +func (e Entity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for Entity. -func (e Entity) AsSecurityAlert() (*SecurityAlert, bool) { +// AsDNSEntity is the BasicEntity implementation for Entity. +func (e Entity) AsDNSEntity() (*DNSEntity, bool) { return nil, false } -// AsFileHashEntity is the BasicEntity implementation for Entity. -func (e Entity) AsFileHashEntity() (*FileHashEntity, bool) { +// AsFileEntity is the BasicEntity implementation for Entity. +func (e Entity) AsFileEntity() (*FileEntity, bool) { return nil, false } -// AsMalwareEntity is the BasicEntity implementation for Entity. -func (e Entity) AsMalwareEntity() (*MalwareEntity, bool) { +// AsFileHashEntity is the BasicEntity implementation for Entity. +func (e Entity) AsFileHashEntity() (*FileHashEntity, bool) { return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for Entity. -func (e Entity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { +// AsHostEntity is the BasicEntity implementation for Entity. +func (e Entity) AsHostEntity() (*HostEntity, bool) { return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for Entity. -func (e Entity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { +// AsIPEntity is the BasicEntity implementation for Entity. +func (e Entity) AsIPEntity() (*IPEntity, bool) { return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for Entity. -func (e Entity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for Entity. +func (e Entity) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } @@ -4697,23 +5371,23 @@ func (e Entity) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for Entity. -func (e Entity) AsDNSEntity() (*DNSEntity, bool) { +// AsRegistryKeyEntity is the BasicEntity implementation for Entity. +func (e Entity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return nil, false } -// AsIPEntity is the BasicEntity implementation for Entity. -func (e Entity) AsIPEntity() (*IPEntity, bool) { +// AsRegistryValueEntity is the BasicEntity implementation for Entity. +func (e Entity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { return nil, false } -// AsRegistryKeyEntity is the BasicEntity implementation for Entity. -func (e Entity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { +// AsSecurityAlert is the BasicEntity implementation for Entity. +func (e Entity) AsSecurityAlert() (*SecurityAlert, bool) { return nil, false } -// AsRegistryValueEntity is the BasicEntity implementation for Entity. -func (e Entity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { +// AsSecurityGroupEntity is the BasicEntity implementation for Entity. +func (e Entity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { return nil, false } @@ -4734,10 +5408,10 @@ func (e Entity) AsBasicEntity() (BasicEntity, bool) { // EntityCommonProperties entity common property bag. type EntityCommonProperties struct { - // 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. - FriendlyName *string `json:"friendlyName,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for EntityCommonProperties. @@ -4748,21 +5422,21 @@ func (ecp EntityCommonProperties) MarshalJSON() ([]byte, error) { // EntityExpandParameters the parameters required to execute an expand operation on the given entity. type EntityExpandParameters struct { + // EndTime - The end date filter, so the only expansion results returned are before this date. + EndTime *date.Time `json:"endTime,omitempty"` // ExpansionID - The Id of the expansion to perform. ExpansionID *uuid.UUID `json:"expansionId,omitempty"` // StartTime - The start date filter, so the only expansion results returned are after this date. StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end date filter, so the only expansion results returned are before this date. - EndTime *date.Time `json:"endTime,omitempty"` } // EntityExpandResponse the entity expansion result operation response. type EntityExpandResponse struct { autorest.Response `json:"-"` - // Value - The expansion result values. - Value *EntityExpandResponseValue `json:"value,omitempty"` // MetaData - The metadata from the expansion operation results. MetaData *ExpansionResultsMetadata `json:"metaData,omitempty"` + // Value - The expansion result values. + Value *EntityExpandResponseValue `json:"value,omitempty"` } // EntityExpandResponseValue the expansion result values. @@ -5002,10 +5676,10 @@ type EntityQuery struct { *EntityQueryProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,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 EntityQuery. @@ -5044,23 +5718,23 @@ func (eq *EntityQuery) UnmarshalJSON(body []byte) error { } eq.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - eq.Type = &typeVar + eq.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - eq.Name = &name + eq.Type = &typeVar } } } @@ -5216,30 +5890,30 @@ func NewEntityQueryListPage(getNextPage func(context.Context, EntityQueryList) ( // EntityQueryProperties describes entity query properties type EntityQueryProperties struct { - // QueryTemplate - The template query string to be parsed and formatted - QueryTemplate *string `json:"queryTemplate,omitempty"` + // DataSources - List of the data sources that are required to run the query + DataSources *[]string `json:"dataSources,omitempty"` + // DisplayName - The query display name + DisplayName *string `json:"displayName,omitempty"` // InputEntityType - The type of the query's source entity. Possible values include: 'EntityTypeAccount', 'EntityTypeHost', 'EntityTypeFile', 'EntityTypeAzureResource', 'EntityTypeCloudApplication', 'EntityTypeDNS', 'EntityTypeFileHash', 'EntityTypeIP', 'EntityTypeMalware', 'EntityTypeProcess', 'EntityTypeRegistryKey', 'EntityTypeRegistryValue', 'EntityTypeSecurityGroup', 'EntityTypeURL', 'EntityTypeSecurityAlert', 'EntityTypeHuntingBookmark' InputEntityType EntityType `json:"inputEntityType,omitempty"` // InputFields - List of the fields of the source entity that are required to run the query InputFields *[]string `json:"inputFields,omitempty"` // OutputEntityTypes - List of the desired output types to be constructed from the result OutputEntityTypes *[]EntityType `json:"outputEntityTypes,omitempty"` - // DataSources - List of the data sources that are required to run the query - DataSources *[]string `json:"dataSources,omitempty"` - // DisplayName - The query display name - DisplayName *string `json:"displayName,omitempty"` + // QueryTemplate - The template query string to be parsed and formatted + QueryTemplate *string `json:"queryTemplate,omitempty"` } // ExpansionResultAggregation information of a specific aggregation in the expansion result. type ExpansionResultAggregation struct { - // EntityKind - The kind of the aggregated entity. Possible values include: 'EntityKindAccount', 'EntityKindHost', 'EntityKindFile', 'EntityKindAzureResource', 'EntityKindCloudApplication', 'EntityKindDNSResolution', 'EntityKindFileHash', 'EntityKindIP', 'EntityKindMalware', 'EntityKindProcess', 'EntityKindRegistryKey', 'EntityKindRegistryValue', 'EntityKindSecurityGroup', 'EntityKindURL', 'EntityKindSecurityAlert', 'EntityKindBookmark' - EntityKind EntityKind `json:"entityKind,omitempty"` - // Count - Total number of aggregations of the given kind (and aggregationType if given) in the expansion result. - Count *int32 `json:"count,omitempty"` // AggregationType - The common type of the aggregation. (for e.g. entity field name) AggregationType *string `json:"aggregationType,omitempty"` + // Count - Total number of aggregations of the given kind (and aggregationType if given) in the expansion result. + Count *int32 `json:"count,omitempty"` // DisplayName - The display name of the aggregation by type. DisplayName *string `json:"displayName,omitempty"` + // EntityKind - The kind of the aggregated entity. Possible values include: 'EntityKindAccount', 'EntityKindHost', 'EntityKindFile', 'EntityKindAzureResource', 'EntityKindCloudApplication', 'EntityKindDNSResolution', 'EntityKindFileHash', 'EntityKindIP', 'EntityKindMalware', 'EntityKindProcess', 'EntityKindRegistryKey', 'EntityKindRegistryValue', 'EntityKindSecurityGroup', 'EntityKindURL', 'EntityKindSecurityAlert', 'EntityKindBookmark' + EntityKind EntityKind `json:"entityKind,omitempty"` } // ExpansionResultsMetadata expansion result metadata. @@ -5254,11 +5928,11 @@ type FileEntity struct { *FileEntityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -5280,43 +5954,43 @@ func (fe FileEntity) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for FileEntity. -func (fe FileEntity) AsHostEntity() (*HostEntity, bool) { +// AsAzureResourceEntity is the BasicEntity implementation for FileEntity. +func (fe FileEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { return nil, false } -// AsFileEntity is the BasicEntity implementation for FileEntity. -func (fe FileEntity) AsFileEntity() (*FileEntity, bool) { - return &fe, true +// AsCloudApplicationEntity is the BasicEntity implementation for FileEntity. +func (fe FileEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { + return nil, false } -// AsSecurityAlert is the BasicEntity implementation for FileEntity. -func (fe FileEntity) AsSecurityAlert() (*SecurityAlert, bool) { +// AsDNSEntity is the BasicEntity implementation for FileEntity. +func (fe FileEntity) AsDNSEntity() (*DNSEntity, bool) { return nil, false } -// AsFileHashEntity is the BasicEntity implementation for FileEntity. -func (fe FileEntity) AsFileHashEntity() (*FileHashEntity, bool) { - return nil, false +// AsFileEntity is the BasicEntity implementation for FileEntity. +func (fe FileEntity) AsFileEntity() (*FileEntity, bool) { + return &fe, true } -// AsMalwareEntity is the BasicEntity implementation for FileEntity. -func (fe FileEntity) AsMalwareEntity() (*MalwareEntity, bool) { +// AsFileHashEntity is the BasicEntity implementation for FileEntity. +func (fe FileEntity) AsFileHashEntity() (*FileHashEntity, bool) { return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for FileEntity. -func (fe FileEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { +// AsHostEntity is the BasicEntity implementation for FileEntity. +func (fe FileEntity) AsHostEntity() (*HostEntity, bool) { return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for FileEntity. -func (fe FileEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { +// AsIPEntity is the BasicEntity implementation for FileEntity. +func (fe FileEntity) AsIPEntity() (*IPEntity, bool) { return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for FileEntity. -func (fe FileEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for FileEntity. +func (fe FileEntity) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } @@ -5325,23 +5999,23 @@ func (fe FileEntity) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for FileEntity. -func (fe FileEntity) AsDNSEntity() (*DNSEntity, bool) { +// AsRegistryKeyEntity is the BasicEntity implementation for FileEntity. +func (fe FileEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return nil, false } -// AsIPEntity is the BasicEntity implementation for FileEntity. -func (fe FileEntity) AsIPEntity() (*IPEntity, bool) { +// AsRegistryValueEntity is the BasicEntity implementation for FileEntity. +func (fe FileEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { return nil, false } -// AsRegistryKeyEntity is the BasicEntity implementation for FileEntity. -func (fe FileEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { +// AsSecurityAlert is the BasicEntity implementation for FileEntity. +func (fe FileEntity) AsSecurityAlert() (*SecurityAlert, bool) { return nil, false } -// AsRegistryValueEntity is the BasicEntity implementation for FileEntity. -func (fe FileEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { +// AsSecurityGroupEntity is the BasicEntity implementation for FileEntity. +func (fe FileEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { return nil, false } @@ -5385,16 +6059,7 @@ func (fe *FileEntity) UnmarshalJSON(body []byte) error { if err != nil { return err } - fe.ID = &ID - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fe.Type = &typeVar + fe.ID = &ID } case "name": if v != nil { @@ -5405,6 +6070,15 @@ func (fe *FileEntity) UnmarshalJSON(body []byte) error { } 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 "kind": if v != nil { var kind KindBasicEntity @@ -5424,16 +6098,16 @@ func (fe *FileEntity) UnmarshalJSON(body []byte) error { type FileEntityProperties struct { // Directory - READ-ONLY; The full path to the file. Directory *string `json:"directory,omitempty"` + // FileHashEntityIds - READ-ONLY; The file hash entity identifiers associated with this file + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` // FileName - READ-ONLY; The file name without path (some alerts might not include path). FileName *string `json:"fileName,omitempty"` // HostEntityID - READ-ONLY; The Host entity id which the file belongs to HostEntityID *string `json:"hostEntityId,omitempty"` - // FileHashEntityIds - READ-ONLY; The file hash entity identifiers associated with this file - FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for FileEntityProperties. @@ -5448,11 +6122,11 @@ type FileHashEntity struct { *FileHashEntityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -5474,18 +6148,23 @@ func (fhe FileHashEntity) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for FileHashEntity. -func (fhe FileHashEntity) AsHostEntity() (*HostEntity, bool) { +// AsAzureResourceEntity is the BasicEntity implementation for FileHashEntity. +func (fhe FileHashEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { return nil, false } -// AsFileEntity is the BasicEntity implementation for FileHashEntity. -func (fhe FileHashEntity) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for FileHashEntity. +func (fhe FileHashEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for FileHashEntity. -func (fhe FileHashEntity) AsSecurityAlert() (*SecurityAlert, bool) { +// AsDNSEntity is the BasicEntity implementation for FileHashEntity. +func (fhe FileHashEntity) AsDNSEntity() (*DNSEntity, bool) { + return nil, false +} + +// AsFileEntity is the BasicEntity implementation for FileHashEntity. +func (fhe FileHashEntity) AsFileEntity() (*FileEntity, bool) { return nil, false } @@ -5494,23 +6173,18 @@ func (fhe FileHashEntity) AsFileHashEntity() (*FileHashEntity, bool) { return &fhe, true } -// AsMalwareEntity is the BasicEntity implementation for FileHashEntity. -func (fhe FileHashEntity) AsMalwareEntity() (*MalwareEntity, bool) { - return nil, false -} - -// AsSecurityGroupEntity is the BasicEntity implementation for FileHashEntity. -func (fhe FileHashEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { +// AsHostEntity is the BasicEntity implementation for FileHashEntity. +func (fhe FileHashEntity) AsHostEntity() (*HostEntity, bool) { return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for FileHashEntity. -func (fhe FileHashEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { +// AsIPEntity is the BasicEntity implementation for FileHashEntity. +func (fhe FileHashEntity) AsIPEntity() (*IPEntity, bool) { return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for FileHashEntity. -func (fhe FileHashEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for FileHashEntity. +func (fhe FileHashEntity) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } @@ -5519,23 +6193,23 @@ func (fhe FileHashEntity) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for FileHashEntity. -func (fhe FileHashEntity) AsDNSEntity() (*DNSEntity, bool) { +// AsRegistryKeyEntity is the BasicEntity implementation for FileHashEntity. +func (fhe FileHashEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return nil, false } -// AsIPEntity is the BasicEntity implementation for FileHashEntity. -func (fhe FileHashEntity) AsIPEntity() (*IPEntity, bool) { +// AsRegistryValueEntity is the BasicEntity implementation for FileHashEntity. +func (fhe FileHashEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { return nil, false } -// AsRegistryKeyEntity is the BasicEntity implementation for FileHashEntity. -func (fhe FileHashEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { +// AsSecurityAlert is the BasicEntity implementation for FileHashEntity. +func (fhe FileHashEntity) AsSecurityAlert() (*SecurityAlert, bool) { return nil, false } -// AsRegistryValueEntity is the BasicEntity implementation for FileHashEntity. -func (fhe FileHashEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { +// AsSecurityGroupEntity is the BasicEntity implementation for FileHashEntity. +func (fhe FileHashEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { return nil, false } @@ -5581,23 +6255,23 @@ func (fhe *FileHashEntity) UnmarshalJSON(body []byte) error { } fhe.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - fhe.Type = &typeVar + fhe.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - fhe.Name = &name + fhe.Type = &typeVar } case "kind": if v != nil { @@ -5616,14 +6290,14 @@ func (fhe *FileHashEntity) UnmarshalJSON(body []byte) error { // FileHashEntityProperties fileHash entity property bag. type FileHashEntityProperties struct { - // HashValue - READ-ONLY; The file hash value. - HashValue *string `json:"hashValue,omitempty"` // Algorithm - READ-ONLY; The hash algorithm type. Possible values include: 'Unknown', 'MD5', 'SHA1', 'SHA256', 'SHA256AC' Algorithm FileHashAlgorithm `json:"algorithm,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,omitempty"` + // HashValue - READ-ONLY; The file hash value. + HashValue *string `json:"hashValue,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for FileHashEntityProperties. @@ -5632,65 +6306,65 @@ func (fhep FileHashEntityProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// FilterAlertRuleTemplate represents filter alert rule template. -type FilterAlertRuleTemplate struct { - // FilterAlertRuleTemplateProperties - Filter alert rule template properties - *FilterAlertRuleTemplateProperties `json:"properties,omitempty"` +// FusionAlertRule represents Fusion alert rule. +type FusionAlertRule struct { + // FusionAlertRuleProperties - Fusion alert rule properties + *FusionAlertRuleProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the alert rule. + // 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: 'KindBasicAlertRuleTemplateKindAlertRuleTemplate', 'KindBasicAlertRuleTemplateKindScheduled', 'KindBasicAlertRuleTemplateKindFilter', 'KindBasicAlertRuleTemplateKindFusion' - Kind KindBasicAlertRuleTemplate `json:"kind,omitempty"` + // Kind - Possible values include: 'KindAlertRule', 'KindFusion', 'KindMicrosoftSecurityIncidentCreation', 'KindScheduled' + Kind KindBasicAlertRule `json:"kind,omitempty"` } -// MarshalJSON is the custom marshaler for FilterAlertRuleTemplate. -func (fart FilterAlertRuleTemplate) MarshalJSON() ([]byte, error) { - fart.Kind = KindBasicAlertRuleTemplateKindFilter +// MarshalJSON is the custom marshaler for FusionAlertRule. +func (far FusionAlertRule) MarshalJSON() ([]byte, error) { + far.Kind = KindFusion objectMap := make(map[string]interface{}) - if fart.FilterAlertRuleTemplateProperties != nil { - objectMap["properties"] = fart.FilterAlertRuleTemplateProperties + if far.FusionAlertRuleProperties != nil { + objectMap["properties"] = far.FusionAlertRuleProperties } - if fart.Etag != nil { - objectMap["etag"] = fart.Etag + if far.Etag != nil { + objectMap["etag"] = far.Etag } - if fart.Kind != "" { - objectMap["kind"] = fart.Kind + if far.Kind != "" { + objectMap["kind"] = far.Kind } return json.Marshal(objectMap) } -// AsScheduledAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FilterAlertRuleTemplate. -func (fart FilterAlertRuleTemplate) AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) { - return nil, false +// AsFusionAlertRule is the BasicAlertRule implementation for FusionAlertRule. +func (far FusionAlertRule) AsFusionAlertRule() (*FusionAlertRule, bool) { + return &far, true } -// AsFilterAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FilterAlertRuleTemplate. -func (fart FilterAlertRuleTemplate) AsFilterAlertRuleTemplate() (*FilterAlertRuleTemplate, bool) { - return &fart, true +// AsMicrosoftSecurityIncidentCreationAlertRule is the BasicAlertRule implementation for FusionAlertRule. +func (far FusionAlertRule) AsMicrosoftSecurityIncidentCreationAlertRule() (*MicrosoftSecurityIncidentCreationAlertRule, bool) { + return nil, false } -// AsFusionAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FilterAlertRuleTemplate. -func (fart FilterAlertRuleTemplate) AsFusionAlertRuleTemplate() (*FusionAlertRuleTemplate, bool) { +// AsScheduledAlertRule is the BasicAlertRule implementation for FusionAlertRule. +func (far FusionAlertRule) AsScheduledAlertRule() (*ScheduledAlertRule, bool) { return nil, false } -// AsAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FilterAlertRuleTemplate. -func (fart FilterAlertRuleTemplate) AsAlertRuleTemplate() (*AlertRuleTemplate, bool) { +// AsAlertRule is the BasicAlertRule implementation for FusionAlertRule. +func (far FusionAlertRule) AsAlertRule() (*AlertRule, bool) { return nil, false } -// AsBasicAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FilterAlertRuleTemplate. -func (fart FilterAlertRuleTemplate) AsBasicAlertRuleTemplate() (BasicAlertRuleTemplate, bool) { - return &fart, true +// AsBasicAlertRule is the BasicAlertRule implementation for FusionAlertRule. +func (far FusionAlertRule) AsBasicAlertRule() (BasicAlertRule, bool) { + return &far, true } -// UnmarshalJSON is the custom unmarshaler for FilterAlertRuleTemplate struct. -func (fart *FilterAlertRuleTemplate) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for FusionAlertRule struct. +func (far *FusionAlertRule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5700,12 +6374,12 @@ func (fart *FilterAlertRuleTemplate) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var filterAlertRuleTemplateProperties FilterAlertRuleTemplateProperties - err = json.Unmarshal(*v, &filterAlertRuleTemplateProperties) + var fusionAlertRuleProperties FusionAlertRuleProperties + err = json.Unmarshal(*v, &fusionAlertRuleProperties) if err != nil { return err } - fart.FilterAlertRuleTemplateProperties = &filterAlertRuleTemplateProperties + far.FusionAlertRuleProperties = &fusionAlertRuleProperties } case "id": if v != nil { @@ -5714,25 +6388,25 @@ func (fart *FilterAlertRuleTemplate) UnmarshalJSON(body []byte) error { if err != nil { return err } - fart.ID = &ID + far.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - fart.Type = &typeVar + far.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - fart.Name = &name + far.Type = &typeVar } case "etag": if v != nil { @@ -5741,16 +6415,16 @@ func (fart *FilterAlertRuleTemplate) UnmarshalJSON(body []byte) error { if err != nil { return err } - fart.Etag = &etag + far.Etag = &etag } case "kind": if v != nil { - var kind KindBasicAlertRuleTemplate + var kind KindBasicAlertRule err = json.Unmarshal(*v, &kind) if err != nil { return err } - fart.Kind = kind + far.Kind = kind } } } @@ -5758,53 +6432,35 @@ func (fart *FilterAlertRuleTemplate) UnmarshalJSON(body []byte) error { return nil } -// FilterAlertRuleTemplateProperties filter alert rule template properties -type FilterAlertRuleTemplateProperties struct { - // DisplayName - The display name for alert rule template. - DisplayName *string `json:"displayName,omitempty"` - // Description - The description of the alert rule template. +// FusionAlertRuleProperties fusion alert rule base property bag. +type FusionAlertRuleProperties struct { + // AlertRuleTemplateName - The Name of the alert rule template used to create this rule. + AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` + // Description - READ-ONLY; The description of the alert rule. Description *string `json:"description,omitempty"` - // Tactics - The tactics of the alert rule template + // DisplayName - READ-ONLY; The display name for alerts created by this alert rule. + DisplayName *string `json:"displayName,omitempty"` + // Enabled - Determines whether this alert rule is enabled or disabled. + Enabled *bool `json:"enabled,omitempty"` + // LastModifiedUtc - READ-ONLY; The last time that this alert has been modified. + LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` + // Severity - READ-ONLY; The severity for alerts created by this alert rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' + Severity AlertSeverity `json:"severity,omitempty"` + // Tactics - READ-ONLY; The tactics of the alert rule Tactics *[]AttackTactic `json:"tactics,omitempty"` - // CreatedDateUTC - READ-ONLY; The time that this alert rule template has been added. - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - // Status - The alert rule template status. Possible values include: 'Installed', 'Available', 'NotAvailable' - Status TemplateStatus `json:"status,omitempty"` - // RequiredDataConnectors - The required data connectors for this template - RequiredDataConnectors *[]DataConnectorStatus `json:"requiredDataConnectors,omitempty"` - // AlertRulesCreatedByTemplateCount - the number of alert rules that were created by this template - AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` - // FilterProduct - The filter product name for this template rule. - FilterProduct *string `json:"filterProduct,omitempty"` - // FilterSeverities - the alert’s severities on which the cases will be generated - FilterSeverities *[]AlertSeverity `json:"filterSeverities,omitempty"` - // FilterTitles - the alert’s titles on which the cases will be generated - FilterTitles *[]string `json:"filterTitles,omitempty"` } -// FilterAlertRuleTemplatePropertiesModel filter alert rule template property bag. -type FilterAlertRuleTemplatePropertiesModel struct { - // FilterProduct - The filter product name for this template rule. - FilterProduct *string `json:"filterProduct,omitempty"` - // FilterSeverities - the alert’s severities on which the cases will be generated - FilterSeverities *[]AlertSeverity `json:"filterSeverities,omitempty"` - // FilterTitles - the alert’s titles on which the cases will be generated - FilterTitles *[]string `json:"filterTitles,omitempty"` -} - -// FusionAlertRuleTemplate represents fusion alert rule template. +// FusionAlertRuleTemplate represents Fusion alert rule template. type FusionAlertRuleTemplate struct { // FusionAlertRuleTemplateProperties - Fusion alert rule template properties *FusionAlertRuleTemplateProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the alert rule. - Etag *string `json:"etag,omitempty"` - // Kind - Possible values include: 'KindBasicAlertRuleTemplateKindAlertRuleTemplate', 'KindBasicAlertRuleTemplateKindScheduled', 'KindBasicAlertRuleTemplateKindFilter', 'KindBasicAlertRuleTemplateKindFusion' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindBasicAlertRuleTemplateKindAlertRuleTemplate', 'KindBasicAlertRuleTemplateKindFusion', 'KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation', 'KindBasicAlertRuleTemplateKindScheduled' Kind KindBasicAlertRuleTemplate `json:"kind,omitempty"` } @@ -5815,28 +6471,25 @@ func (fart FusionAlertRuleTemplate) MarshalJSON() ([]byte, error) { if fart.FusionAlertRuleTemplateProperties != nil { objectMap["properties"] = fart.FusionAlertRuleTemplateProperties } - if fart.Etag != nil { - objectMap["etag"] = fart.Etag - } if fart.Kind != "" { objectMap["kind"] = fart.Kind } return json.Marshal(objectMap) } -// AsScheduledAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FusionAlertRuleTemplate. -func (fart FusionAlertRuleTemplate) AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) { - return nil, false +// AsFusionAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FusionAlertRuleTemplate. +func (fart FusionAlertRuleTemplate) AsFusionAlertRuleTemplate() (*FusionAlertRuleTemplate, bool) { + return &fart, true } -// AsFilterAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FusionAlertRuleTemplate. -func (fart FusionAlertRuleTemplate) AsFilterAlertRuleTemplate() (*FilterAlertRuleTemplate, bool) { +// AsMicrosoftSecurityIncidentCreationAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FusionAlertRuleTemplate. +func (fart FusionAlertRuleTemplate) AsMicrosoftSecurityIncidentCreationAlertRuleTemplate() (*MicrosoftSecurityIncidentCreationAlertRuleTemplate, bool) { return nil, false } -// AsFusionAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FusionAlertRuleTemplate. -func (fart FusionAlertRuleTemplate) AsFusionAlertRuleTemplate() (*FusionAlertRuleTemplate, bool) { - return &fart, true +// AsScheduledAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FusionAlertRuleTemplate. +func (fart FusionAlertRuleTemplate) AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) { + return nil, false } // AsAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FusionAlertRuleTemplate. @@ -5876,15 +6529,6 @@ func (fart *FusionAlertRuleTemplate) UnmarshalJSON(body []byte) error { } fart.ID = &ID } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fart.Type = &typeVar - } case "name": if v != nil { var name string @@ -5894,14 +6538,14 @@ func (fart *FusionAlertRuleTemplate) UnmarshalJSON(body []byte) error { } fart.Name = &name } - case "etag": + case "type": if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - fart.Etag = &etag + fart.Type = &typeVar } case "kind": if v != nil { @@ -5920,46 +6564,40 @@ func (fart *FusionAlertRuleTemplate) UnmarshalJSON(body []byte) error { // FusionAlertRuleTemplateProperties fusion alert rule template properties type FusionAlertRuleTemplateProperties struct { - // DisplayName - The display name for alert rule template. - DisplayName *string `json:"displayName,omitempty"` + // Severity - The severity for alerts created by this alert rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' + Severity AlertSeverity `json:"severity,omitempty"` + // AlertRulesCreatedByTemplateCount - the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + // CreatedDateUTC - READ-ONLY; The time that this alert rule template has been added. + CreatedDateUTC *date.Time `json:"createdDateUTC,omitempty"` // Description - The description of the alert rule template. Description *string `json:"description,omitempty"` - // Tactics - The tactics of the alert rule template - Tactics *[]AttackTactic `json:"tactics,omitempty"` - // CreatedDateUTC - READ-ONLY; The time that this alert rule template has been added. - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - // Status - The alert rule template status. Possible values include: 'Installed', 'Available', 'NotAvailable' - Status TemplateStatus `json:"status,omitempty"` + // DisplayName - The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` // RequiredDataConnectors - The required data connectors for this template RequiredDataConnectors *[]DataConnectorStatus `json:"requiredDataConnectors,omitempty"` - // AlertRulesCreatedByTemplateCount - the number of alert rules that were created by this template - AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` - // Severity - The severity for alerts created by this alert rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' - Severity AlertSeverity `json:"severity,omitempty"` -} - -// FusionAlertRuleTemplatePropertiesModel filter alert rule template property bag. -type FusionAlertRuleTemplatePropertiesModel struct { - // Severity - The severity for alerts created by this alert rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' - Severity AlertSeverity `json:"severity,omitempty"` + // Status - The alert rule template status. Possible values include: 'Installed', 'Available', 'NotAvailable' + Status TemplateStatus `json:"status,omitempty"` + // Tactics - The tactics of the alert rule template + Tactics *[]AttackTactic `json:"tactics,omitempty"` } // GeoLocation the geo-location context attached to the ip entity type GeoLocation struct { + // Asn - READ-ONLY; Autonomous System Number + Asn *int32 `json:"asn,omitempty"` + // City - READ-ONLY; City name + City *string `json:"city,omitempty"` // CountryCode - READ-ONLY; The country code according to ISO 3166 format CountryCode *string `json:"countryCode,omitempty"` // CountryName - READ-ONLY; Country name according to ISO 3166 Alpha 2: the lowercase of the English Short Name CountryName *string `json:"countryName,omitempty"` - // State - READ-ONLY; State name - State *string `json:"state,omitempty"` - // City - READ-ONLY; City name - City *string `json:"city,omitempty"` - // Longitude - READ-ONLY; The latitude of the identified location, expressed as a floating point number with range of - 90 to 90, with positive numbers representing North and negative numbers representing South. Latitude and longitude are derived from the city or postal code. - Longitude *float64 `json:"longitude,omitempty"` // Latitude - READ-ONLY; The longitude of the identified location, expressed as a floating point number with range of -180 to 180, with positive numbers representing East and negative numbers representing West. Latitude and longitude are derived from the city or postal code. Latitude *float64 `json:"latitude,omitempty"` - // Asn - READ-ONLY; Autonomous System Number - Asn *int32 `json:"asn,omitempty"` + // Longitude - READ-ONLY; The latitude of the identified location, expressed as a floating point number with range of - 90 to 90, with positive numbers representing North and negative numbers representing South. Latitude and longitude are derived from the city or postal code. + Longitude *float64 `json:"longitude,omitempty"` + // State - READ-ONLY; State name + State *string `json:"state,omitempty"` } // HostEntity represents a host entity. @@ -5968,11 +6606,11 @@ type HostEntity struct { *HostEntityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -5994,43 +6632,43 @@ func (he HostEntity) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for HostEntity. -func (he HostEntity) AsHostEntity() (*HostEntity, bool) { - return &he, true +// AsAzureResourceEntity is the BasicEntity implementation for HostEntity. +func (he HostEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { + return nil, false } -// AsFileEntity is the BasicEntity implementation for HostEntity. -func (he HostEntity) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for HostEntity. +func (he HostEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for HostEntity. -func (he HostEntity) AsSecurityAlert() (*SecurityAlert, bool) { +// AsDNSEntity is the BasicEntity implementation for HostEntity. +func (he HostEntity) AsDNSEntity() (*DNSEntity, bool) { return nil, false } -// AsFileHashEntity is the BasicEntity implementation for HostEntity. -func (he HostEntity) AsFileHashEntity() (*FileHashEntity, bool) { +// AsFileEntity is the BasicEntity implementation for HostEntity. +func (he HostEntity) AsFileEntity() (*FileEntity, bool) { return nil, false } -// AsMalwareEntity is the BasicEntity implementation for HostEntity. -func (he HostEntity) AsMalwareEntity() (*MalwareEntity, bool) { +// AsFileHashEntity is the BasicEntity implementation for HostEntity. +func (he HostEntity) AsFileHashEntity() (*FileHashEntity, bool) { return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for HostEntity. -func (he HostEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { - return nil, false +// AsHostEntity is the BasicEntity implementation for HostEntity. +func (he HostEntity) AsHostEntity() (*HostEntity, bool) { + return &he, true } -// AsAzureResourceEntity is the BasicEntity implementation for HostEntity. -func (he HostEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { +// AsIPEntity is the BasicEntity implementation for HostEntity. +func (he HostEntity) AsIPEntity() (*IPEntity, bool) { return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for HostEntity. -func (he HostEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for HostEntity. +func (he HostEntity) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } @@ -6039,23 +6677,23 @@ func (he HostEntity) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for HostEntity. -func (he HostEntity) AsDNSEntity() (*DNSEntity, bool) { +// AsRegistryKeyEntity is the BasicEntity implementation for HostEntity. +func (he HostEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return nil, false } -// AsIPEntity is the BasicEntity implementation for HostEntity. -func (he HostEntity) AsIPEntity() (*IPEntity, bool) { +// AsRegistryValueEntity is the BasicEntity implementation for HostEntity. +func (he HostEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { return nil, false } -// AsRegistryKeyEntity is the BasicEntity implementation for HostEntity. -func (he HostEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { +// AsSecurityAlert is the BasicEntity implementation for HostEntity. +func (he HostEntity) AsSecurityAlert() (*SecurityAlert, bool) { return nil, false } -// AsRegistryValueEntity is the BasicEntity implementation for HostEntity. -func (he HostEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { +// AsSecurityGroupEntity is the BasicEntity implementation for HostEntity. +func (he HostEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { return nil, false } @@ -6101,23 +6739,23 @@ func (he *HostEntity) UnmarshalJSON(body []byte) error { } he.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - he.Type = &typeVar + he.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - he.Name = &name + he.Type = &typeVar } case "kind": if v != nil { @@ -6136,28 +6774,28 @@ func (he *HostEntity) UnmarshalJSON(body []byte) error { // HostEntityProperties host entity property bag. type HostEntityProperties struct { + // AzureID - READ-ONLY; The azure resource id of the VM. + AzureID *string `json:"azureID,omitempty"` // DNSDomain - READ-ONLY; The DNS domain that this host belongs to. Should contain the compete DNS suffix for the domain DNSDomain *string `json:"dnsDomain,omitempty"` - // NtDomain - READ-ONLY; The NT domain that this host belongs to. - NtDomain *string `json:"ntDomain,omitempty"` // HostName - READ-ONLY; The hostname without the domain suffix. HostName *string `json:"hostName,omitempty"` + // IsDomainJoined - READ-ONLY; Determines whether this host belongs to a domain. + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` // NetBiosName - READ-ONLY; The host name (pre-windows2000). NetBiosName *string `json:"netBiosName,omitempty"` - // AzureID - READ-ONLY; The azure resource id of the VM. - AzureID *string `json:"azureID,omitempty"` + // NtDomain - READ-ONLY; The NT domain that this host belongs to. + NtDomain *string `json:"ntDomain,omitempty"` // OmsAgentID - READ-ONLY; The OMS agent id, if the host has OMS agent installed. OmsAgentID *string `json:"omsAgentID,omitempty"` // OsFamily - The operating system type. Possible values include: 'Linux', 'Windows', 'Android', 'IOS' OsFamily OSFamily `json:"osFamily,omitempty"` // OsVersion - READ-ONLY; A free text representation of the operating system. This field is meant to hold specific versions the are more fine grained than OSFamily or future values not supported by OSFamily enumeration OsVersion *string `json:"osVersion,omitempty"` - // IsDomainJoined - READ-ONLY; Determines whether this host belongs to a domain. - IsDomainJoined *bool `json:"isDomainJoined,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for HostEntityProperties. @@ -6175,11 +6813,11 @@ type IPEntity struct { *IPEntityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -6201,43 +6839,43 @@ func (ie IPEntity) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for IPEntity. -func (ie IPEntity) AsHostEntity() (*HostEntity, bool) { +// AsAzureResourceEntity is the BasicEntity implementation for IPEntity. +func (ie IPEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { return nil, false } -// AsFileEntity is the BasicEntity implementation for IPEntity. -func (ie IPEntity) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for IPEntity. +func (ie IPEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for IPEntity. -func (ie IPEntity) AsSecurityAlert() (*SecurityAlert, bool) { +// AsDNSEntity is the BasicEntity implementation for IPEntity. +func (ie IPEntity) AsDNSEntity() (*DNSEntity, bool) { return nil, false } -// AsFileHashEntity is the BasicEntity implementation for IPEntity. -func (ie IPEntity) AsFileHashEntity() (*FileHashEntity, bool) { +// AsFileEntity is the BasicEntity implementation for IPEntity. +func (ie IPEntity) AsFileEntity() (*FileEntity, bool) { return nil, false } -// AsMalwareEntity is the BasicEntity implementation for IPEntity. -func (ie IPEntity) AsMalwareEntity() (*MalwareEntity, bool) { +// AsFileHashEntity is the BasicEntity implementation for IPEntity. +func (ie IPEntity) AsFileHashEntity() (*FileHashEntity, bool) { return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for IPEntity. -func (ie IPEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { +// AsHostEntity is the BasicEntity implementation for IPEntity. +func (ie IPEntity) AsHostEntity() (*HostEntity, bool) { return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for IPEntity. -func (ie IPEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { - return nil, false +// AsIPEntity is the BasicEntity implementation for IPEntity. +func (ie IPEntity) AsIPEntity() (*IPEntity, bool) { + return &ie, true } -// AsCloudApplicationEntity is the BasicEntity implementation for IPEntity. -func (ie IPEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for IPEntity. +func (ie IPEntity) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } @@ -6246,23 +6884,23 @@ func (ie IPEntity) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for IPEntity. -func (ie IPEntity) AsDNSEntity() (*DNSEntity, bool) { +// AsRegistryKeyEntity is the BasicEntity implementation for IPEntity. +func (ie IPEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return nil, false } -// AsIPEntity is the BasicEntity implementation for IPEntity. -func (ie IPEntity) AsIPEntity() (*IPEntity, bool) { - return &ie, true +// AsRegistryValueEntity is the BasicEntity implementation for IPEntity. +func (ie IPEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { + return nil, false } -// AsRegistryKeyEntity is the BasicEntity implementation for IPEntity. -func (ie IPEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { +// AsSecurityAlert is the BasicEntity implementation for IPEntity. +func (ie IPEntity) AsSecurityAlert() (*SecurityAlert, bool) { return nil, false } -// AsRegistryValueEntity is the BasicEntity implementation for IPEntity. -func (ie IPEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { +// AsSecurityGroupEntity is the BasicEntity implementation for IPEntity. +func (ie IPEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { return nil, false } @@ -6308,23 +6946,23 @@ func (ie *IPEntity) UnmarshalJSON(body []byte) error { } ie.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - ie.Type = &typeVar + ie.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - ie.Name = &name + ie.Type = &typeVar } case "kind": if v != nil { @@ -6349,10 +6987,10 @@ type IPEntityProperties struct { Location *GeoLocation `json:"location,omitempty"` // ThreatIntelligence - READ-ONLY; A list of TI contexts attached to the ip entity. ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for IPEntityProperties. @@ -6370,11 +7008,11 @@ type MalwareEntity struct { *MalwareEntityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -6396,44 +7034,44 @@ func (me MalwareEntity) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for MalwareEntity. -func (me MalwareEntity) AsHostEntity() (*HostEntity, bool) { +// AsAzureResourceEntity is the BasicEntity implementation for MalwareEntity. +func (me MalwareEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { return nil, false } -// AsFileEntity is the BasicEntity implementation for MalwareEntity. -func (me MalwareEntity) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for MalwareEntity. +func (me MalwareEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for MalwareEntity. -func (me MalwareEntity) AsSecurityAlert() (*SecurityAlert, bool) { +// AsDNSEntity is the BasicEntity implementation for MalwareEntity. +func (me MalwareEntity) AsDNSEntity() (*DNSEntity, bool) { return nil, false } -// AsFileHashEntity is the BasicEntity implementation for MalwareEntity. -func (me MalwareEntity) AsFileHashEntity() (*FileHashEntity, bool) { +// AsFileEntity is the BasicEntity implementation for MalwareEntity. +func (me MalwareEntity) AsFileEntity() (*FileEntity, bool) { return nil, false } -// AsMalwareEntity is the BasicEntity implementation for MalwareEntity. -func (me MalwareEntity) AsMalwareEntity() (*MalwareEntity, bool) { - return &me, true +// AsFileHashEntity is the BasicEntity implementation for MalwareEntity. +func (me MalwareEntity) AsFileHashEntity() (*FileHashEntity, bool) { + return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for MalwareEntity. -func (me MalwareEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { +// AsHostEntity is the BasicEntity implementation for MalwareEntity. +func (me MalwareEntity) AsHostEntity() (*HostEntity, bool) { return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for MalwareEntity. -func (me MalwareEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { +// AsIPEntity is the BasicEntity implementation for MalwareEntity. +func (me MalwareEntity) AsIPEntity() (*IPEntity, bool) { return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for MalwareEntity. -func (me MalwareEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { - return nil, false +// AsMalwareEntity is the BasicEntity implementation for MalwareEntity. +func (me MalwareEntity) AsMalwareEntity() (*MalwareEntity, bool) { + return &me, true } // AsProcessEntity is the BasicEntity implementation for MalwareEntity. @@ -6441,23 +7079,23 @@ func (me MalwareEntity) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for MalwareEntity. -func (me MalwareEntity) AsDNSEntity() (*DNSEntity, bool) { +// AsRegistryKeyEntity is the BasicEntity implementation for MalwareEntity. +func (me MalwareEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return nil, false } -// AsIPEntity is the BasicEntity implementation for MalwareEntity. -func (me MalwareEntity) AsIPEntity() (*IPEntity, bool) { +// AsRegistryValueEntity is the BasicEntity implementation for MalwareEntity. +func (me MalwareEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { return nil, false } -// AsRegistryKeyEntity is the BasicEntity implementation for MalwareEntity. -func (me MalwareEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { +// AsSecurityAlert is the BasicEntity implementation for MalwareEntity. +func (me MalwareEntity) AsSecurityAlert() (*SecurityAlert, bool) { return nil, false } -// AsRegistryValueEntity is the BasicEntity implementation for MalwareEntity. -func (me MalwareEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { +// AsSecurityGroupEntity is the BasicEntity implementation for MalwareEntity. +func (me MalwareEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { return nil, false } @@ -6503,23 +7141,23 @@ func (me *MalwareEntity) UnmarshalJSON(body []byte) error { } me.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - me.Type = &typeVar + me.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - me.Name = &name + me.Type = &typeVar } case "kind": if v != nil { @@ -6538,18 +7176,18 @@ func (me *MalwareEntity) UnmarshalJSON(body []byte) error { // MalwareEntityProperties malware entity property bag. type MalwareEntityProperties struct { - // MalwareName - READ-ONLY; The malware name by the vendor, e.g. Win32/Toga!rfn - MalwareName *string `json:"malwareName,omitempty"` // Category - READ-ONLY; The malware category by the vendor, e.g. Trojan Category *string `json:"category,omitempty"` // FileEntityIds - READ-ONLY; List of linked file entity identifiers on which the malware was found FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + // MalwareName - READ-ONLY; The malware name by the vendor, e.g. Win32/Toga!rfn + MalwareName *string `json:"malwareName,omitempty"` // ProcessEntityIds - READ-ONLY; List of linked process entity identifiers on which the malware was found. ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for MalwareEntityProperties. @@ -6564,13 +7202,13 @@ type MCASDataConnector struct { *MCASDataConnectorProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the data connector. + // 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: 'KindDataConnector', 'KindOffice365', 'KindThreatIntelligence', 'KindAmazonWebServicesCloudTrail', 'KindAzureActiveDirectory', 'KindAzureSecurityCenter', 'KindMicrosoftCloudAppSecurity', 'KindAzureAdvancedThreatProtection', 'KindMicrosoftDefenderAdvancedThreatProtection' + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' Kind KindBasicDataConnector `json:"kind,omitempty"` } @@ -6590,28 +7228,23 @@ func (mdc MCASDataConnector) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsOfficeDataConnector is the BasicDataConnector implementation for MCASDataConnector. -func (mdc MCASDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { - return nil, false -} - -// AsTIDataConnector is the BasicDataConnector implementation for MCASDataConnector. -func (mdc MCASDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { +// AsAADDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { return nil, false } -// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for MCASDataConnector. -func (mdc MCASDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { +// AsAATPDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { return nil, false } -// AsAADDataConnector is the BasicDataConnector implementation for MCASDataConnector. -func (mdc MCASDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { +// AsASCDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { return nil, false } -// AsASCDataConnector is the BasicDataConnector implementation for MCASDataConnector. -func (mdc MCASDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { +// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { return nil, false } @@ -6620,13 +7253,18 @@ func (mdc MCASDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { return &mdc, true } -// AsAATPDataConnector is the BasicDataConnector implementation for MCASDataConnector. -func (mdc MCASDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { +// AsMDATPDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { return nil, false } -// AsMDATPDataConnector is the BasicDataConnector implementation for MCASDataConnector. -func (mdc MCASDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { +// AsOfficeDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { + return nil, false +} + +// AsTIDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { return nil, false } @@ -6659,22 +7297,13 @@ func (mdc *MCASDataConnector) UnmarshalJSON(body []byte) error { mdc.MCASDataConnectorProperties = &mCASDataConnectorProperties } case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mdc.ID = &ID - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - mdc.Type = &typeVar + mdc.ID = &ID } case "name": if v != nil { @@ -6685,6 +7314,15 @@ func (mdc *MCASDataConnector) UnmarshalJSON(body []byte) error { } mdc.Name = &name } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mdc.Type = &typeVar + } case "etag": if v != nil { var etag string @@ -6738,13 +7376,13 @@ type MDATPDataConnector struct { *MDATPDataConnectorProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the data connector. + // 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: 'KindDataConnector', 'KindOffice365', 'KindThreatIntelligence', 'KindAmazonWebServicesCloudTrail', 'KindAzureActiveDirectory', 'KindAzureSecurityCenter', 'KindMicrosoftCloudAppSecurity', 'KindAzureAdvancedThreatProtection', 'KindMicrosoftDefenderAdvancedThreatProtection' + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' Kind KindBasicDataConnector `json:"kind,omitempty"` } @@ -6764,23 +7402,13 @@ func (mdc MDATPDataConnector) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsOfficeDataConnector is the BasicDataConnector implementation for MDATPDataConnector. -func (mdc MDATPDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { - return nil, false -} - -// AsTIDataConnector is the BasicDataConnector implementation for MDATPDataConnector. -func (mdc MDATPDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { - return nil, false -} - -// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for MDATPDataConnector. -func (mdc MDATPDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { +// AsAADDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { return nil, false } -// AsAADDataConnector is the BasicDataConnector implementation for MDATPDataConnector. -func (mdc MDATPDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { +// AsAATPDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { return nil, false } @@ -6789,13 +7417,13 @@ func (mdc MDATPDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { return nil, false } -// AsMCASDataConnector is the BasicDataConnector implementation for MDATPDataConnector. -func (mdc MDATPDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { +// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { return nil, false } -// AsAATPDataConnector is the BasicDataConnector implementation for MDATPDataConnector. -func (mdc MDATPDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { +// AsMCASDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { return nil, false } @@ -6804,6 +7432,16 @@ func (mdc MDATPDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) return &mdc, true } +// AsOfficeDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { + return nil, false +} + +// AsTIDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { + return nil, false +} + // AsDataConnector is the BasicDataConnector implementation for MDATPDataConnector. func (mdc MDATPDataConnector) AsDataConnector() (*DataConnector, bool) { return nil, false @@ -6841,23 +7479,23 @@ func (mdc *MDATPDataConnector) UnmarshalJSON(body []byte) error { } mdc.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - mdc.Type = &typeVar + mdc.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - mdc.Name = &name + mdc.Type = &typeVar } case "etag": if v != nil { @@ -6892,6 +7530,304 @@ type MDATPDataConnectorProperties struct { DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` } +// MicrosoftSecurityIncidentCreationAlertRule represents MicrosoftSecurityIncidentCreation rule. +type MicrosoftSecurityIncidentCreationAlertRule struct { + // MicrosoftSecurityIncidentCreationAlertRuleProperties - MicrosoftSecurityIncidentCreation rule properties + *MicrosoftSecurityIncidentCreationAlertRuleProperties `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: 'KindAlertRule', 'KindFusion', 'KindMicrosoftSecurityIncidentCreation', 'KindScheduled' + Kind KindBasicAlertRule `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for MicrosoftSecurityIncidentCreationAlertRule. +func (msicar MicrosoftSecurityIncidentCreationAlertRule) MarshalJSON() ([]byte, error) { + msicar.Kind = KindMicrosoftSecurityIncidentCreation + objectMap := make(map[string]interface{}) + if msicar.MicrosoftSecurityIncidentCreationAlertRuleProperties != nil { + objectMap["properties"] = msicar.MicrosoftSecurityIncidentCreationAlertRuleProperties + } + if msicar.Etag != nil { + objectMap["etag"] = msicar.Etag + } + if msicar.Kind != "" { + objectMap["kind"] = msicar.Kind + } + return json.Marshal(objectMap) +} + +// AsFusionAlertRule is the BasicAlertRule implementation for MicrosoftSecurityIncidentCreationAlertRule. +func (msicar MicrosoftSecurityIncidentCreationAlertRule) AsFusionAlertRule() (*FusionAlertRule, bool) { + return nil, false +} + +// AsMicrosoftSecurityIncidentCreationAlertRule is the BasicAlertRule implementation for MicrosoftSecurityIncidentCreationAlertRule. +func (msicar MicrosoftSecurityIncidentCreationAlertRule) AsMicrosoftSecurityIncidentCreationAlertRule() (*MicrosoftSecurityIncidentCreationAlertRule, bool) { + return &msicar, true +} + +// AsScheduledAlertRule is the BasicAlertRule implementation for MicrosoftSecurityIncidentCreationAlertRule. +func (msicar MicrosoftSecurityIncidentCreationAlertRule) AsScheduledAlertRule() (*ScheduledAlertRule, bool) { + return nil, false +} + +// AsAlertRule is the BasicAlertRule implementation for MicrosoftSecurityIncidentCreationAlertRule. +func (msicar MicrosoftSecurityIncidentCreationAlertRule) AsAlertRule() (*AlertRule, bool) { + return nil, false +} + +// AsBasicAlertRule is the BasicAlertRule implementation for MicrosoftSecurityIncidentCreationAlertRule. +func (msicar MicrosoftSecurityIncidentCreationAlertRule) AsBasicAlertRule() (BasicAlertRule, bool) { + return &msicar, true +} + +// UnmarshalJSON is the custom unmarshaler for MicrosoftSecurityIncidentCreationAlertRule struct. +func (msicar *MicrosoftSecurityIncidentCreationAlertRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var microsoftSecurityIncidentCreationAlertRuleProperties MicrosoftSecurityIncidentCreationAlertRuleProperties + err = json.Unmarshal(*v, µsoftSecurityIncidentCreationAlertRuleProperties) + if err != nil { + return err + } + msicar.MicrosoftSecurityIncidentCreationAlertRuleProperties = µsoftSecurityIncidentCreationAlertRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + msicar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + msicar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + msicar.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + msicar.Etag = &etag + } + case "kind": + if v != nil { + var kind KindBasicAlertRule + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + msicar.Kind = kind + } + } + } + + return nil +} + +// MicrosoftSecurityIncidentCreationAlertRuleCommonProperties microsoftSecurityIncidentCreation rule common +// property bag. +type MicrosoftSecurityIncidentCreationAlertRuleCommonProperties struct { + // DisplayNamesFilter - the alerts' displayNames on which the cases will be generated + DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` + // ProductFilter - The alerts' productName on which the cases will be generated. Possible values include: 'MicrosoftCloudAppSecurity', 'AzureSecurityCenter', 'AzureAdvancedThreatProtection', 'AzureActiveDirectoryIdentityProtection' + ProductFilter MicrosoftSecurityProductName `json:"productFilter,omitempty"` + // SeveritiesFilter - the alerts' severities on which the cases will be generated + SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` +} + +// MicrosoftSecurityIncidentCreationAlertRuleProperties microsoftSecurityIncidentCreation rule property +// bag. +type MicrosoftSecurityIncidentCreationAlertRuleProperties struct { + // AlertRuleTemplateName - The Name of the alert rule template used to create this rule. + AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` + // Description - The description of the alert rule. + Description *string `json:"description,omitempty"` + // DisplayName - The display name for alerts created by this alert rule. + DisplayName *string `json:"displayName,omitempty"` + // Enabled - Determines whether this alert rule is enabled or disabled. + Enabled *bool `json:"enabled,omitempty"` + // LastModifiedUtc - READ-ONLY; The last time that this alert has been modified. + LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` + // Tactics - The tactics of the alert rule + Tactics *[]AttackTactic `json:"tactics,omitempty"` + // DisplayNamesFilter - the alerts' displayNames on which the cases will be generated + DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` + // ProductFilter - The alerts' productName on which the cases will be generated. Possible values include: 'MicrosoftCloudAppSecurity', 'AzureSecurityCenter', 'AzureAdvancedThreatProtection', 'AzureActiveDirectoryIdentityProtection' + ProductFilter MicrosoftSecurityProductName `json:"productFilter,omitempty"` + // SeveritiesFilter - the alerts' severities on which the cases will be generated + SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` +} + +// MicrosoftSecurityIncidentCreationAlertRuleTemplate represents MicrosoftSecurityIncidentCreation rule +// template. +type MicrosoftSecurityIncidentCreationAlertRuleTemplate struct { + // MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties - MicrosoftSecurityIncidentCreation rule template properties + *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties `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"` + // Kind - Possible values include: 'KindBasicAlertRuleTemplateKindAlertRuleTemplate', 'KindBasicAlertRuleTemplateKindFusion', 'KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation', 'KindBasicAlertRuleTemplateKindScheduled' + Kind KindBasicAlertRuleTemplate `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (msicart MicrosoftSecurityIncidentCreationAlertRuleTemplate) MarshalJSON() ([]byte, error) { + msicart.Kind = KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation + objectMap := make(map[string]interface{}) + if msicart.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties != nil { + objectMap["properties"] = msicart.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties + } + if msicart.Kind != "" { + objectMap["kind"] = msicart.Kind + } + return json.Marshal(objectMap) +} + +// AsFusionAlertRuleTemplate is the BasicAlertRuleTemplate implementation for MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (msicart MicrosoftSecurityIncidentCreationAlertRuleTemplate) AsFusionAlertRuleTemplate() (*FusionAlertRuleTemplate, bool) { + return nil, false +} + +// AsMicrosoftSecurityIncidentCreationAlertRuleTemplate is the BasicAlertRuleTemplate implementation for MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (msicart MicrosoftSecurityIncidentCreationAlertRuleTemplate) AsMicrosoftSecurityIncidentCreationAlertRuleTemplate() (*MicrosoftSecurityIncidentCreationAlertRuleTemplate, bool) { + return &msicart, true +} + +// AsScheduledAlertRuleTemplate is the BasicAlertRuleTemplate implementation for MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (msicart MicrosoftSecurityIncidentCreationAlertRuleTemplate) AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) { + return nil, false +} + +// AsAlertRuleTemplate is the BasicAlertRuleTemplate implementation for MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (msicart MicrosoftSecurityIncidentCreationAlertRuleTemplate) AsAlertRuleTemplate() (*AlertRuleTemplate, bool) { + return nil, false +} + +// AsBasicAlertRuleTemplate is the BasicAlertRuleTemplate implementation for MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (msicart MicrosoftSecurityIncidentCreationAlertRuleTemplate) AsBasicAlertRuleTemplate() (BasicAlertRuleTemplate, bool) { + return &msicart, true +} + +// UnmarshalJSON is the custom unmarshaler for MicrosoftSecurityIncidentCreationAlertRuleTemplate struct. +func (msicart *MicrosoftSecurityIncidentCreationAlertRuleTemplate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var microsoftSecurityIncidentCreationAlertRuleTemplateProperties MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties + err = json.Unmarshal(*v, µsoftSecurityIncidentCreationAlertRuleTemplateProperties) + if err != nil { + return err + } + msicart.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties = µsoftSecurityIncidentCreationAlertRuleTemplateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + msicart.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + msicart.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + msicart.Type = &typeVar + } + case "kind": + if v != nil { + var kind KindBasicAlertRuleTemplate + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + msicart.Kind = kind + } + } + } + + return nil +} + +// MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties microsoftSecurityIncidentCreation rule +// template properties +type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties struct { + // AlertRulesCreatedByTemplateCount - the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + // CreatedDateUTC - READ-ONLY; The time that this alert rule template has been added. + CreatedDateUTC *date.Time `json:"createdDateUTC,omitempty"` + // Description - The description of the alert rule template. + Description *string `json:"description,omitempty"` + // DisplayName - The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` + // RequiredDataConnectors - The required data connectors for this template + RequiredDataConnectors *[]DataConnectorStatus `json:"requiredDataConnectors,omitempty"` + // Status - The alert rule template status. Possible values include: 'Installed', 'Available', 'NotAvailable' + Status TemplateStatus `json:"status,omitempty"` + // Tactics - The tactics of the alert rule template + Tactics *[]AttackTactic `json:"tactics,omitempty"` + // DisplayNamesFilter - the alerts' displayNames on which the cases will be generated + DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` + // ProductFilter - The alerts' productName on which the cases will be generated. Possible values include: 'MicrosoftCloudAppSecurity', 'AzureSecurityCenter', 'AzureAdvancedThreatProtection', 'AzureActiveDirectoryIdentityProtection' + ProductFilter MicrosoftSecurityProductName `json:"productFilter,omitempty"` + // SeveritiesFilter - the alerts' severities on which the cases will be generated + SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` +} + // OfficeConsent consent for Office365 tenant that already made. type OfficeConsent struct { autorest.Response `json:"-"` @@ -6899,10 +7835,10 @@ type OfficeConsent struct { *OfficeConsentProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,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 OfficeConsent. @@ -6941,23 +7877,23 @@ func (oc *OfficeConsent) UnmarshalJSON(body []byte) error { } oc.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - oc.Type = &typeVar + oc.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - oc.Name = &name + oc.Type = &typeVar } } } @@ -7125,13 +8061,13 @@ type OfficeDataConnector struct { *OfficeDataConnectorProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the data connector. + // 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: 'KindDataConnector', 'KindOffice365', 'KindThreatIntelligence', 'KindAmazonWebServicesCloudTrail', 'KindAzureActiveDirectory', 'KindAzureSecurityCenter', 'KindMicrosoftCloudAppSecurity', 'KindAzureAdvancedThreatProtection', 'KindMicrosoftDefenderAdvancedThreatProtection' + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' Kind KindBasicDataConnector `json:"kind,omitempty"` } @@ -7151,28 +8087,23 @@ func (odc OfficeDataConnector) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsOfficeDataConnector is the BasicDataConnector implementation for OfficeDataConnector. -func (odc OfficeDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { - return &odc, true -} - -// AsTIDataConnector is the BasicDataConnector implementation for OfficeDataConnector. -func (odc OfficeDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { +// AsAADDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { return nil, false } -// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for OfficeDataConnector. -func (odc OfficeDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { +// AsAATPDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { return nil, false } -// AsAADDataConnector is the BasicDataConnector implementation for OfficeDataConnector. -func (odc OfficeDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { +// AsASCDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { return nil, false } -// AsASCDataConnector is the BasicDataConnector implementation for OfficeDataConnector. -func (odc OfficeDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { +// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { return nil, false } @@ -7181,13 +8112,18 @@ func (odc OfficeDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) return nil, false } -// AsAATPDataConnector is the BasicDataConnector implementation for OfficeDataConnector. -func (odc OfficeDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { +// AsMDATPDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { return nil, false } -// AsMDATPDataConnector is the BasicDataConnector implementation for OfficeDataConnector. -func (odc OfficeDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { +// AsOfficeDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { + return &odc, true +} + +// AsTIDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { return nil, false } @@ -7228,23 +8164,23 @@ func (odc *OfficeDataConnector) UnmarshalJSON(body []byte) error { } odc.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - odc.Type = &typeVar + odc.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - odc.Name = &name + odc.Type = &typeVar } case "etag": if v != nil { @@ -7272,10 +8208,10 @@ func (odc *OfficeDataConnector) UnmarshalJSON(body []byte) error { // OfficeDataConnectorDataTypes the available data types for office data connector. type OfficeDataConnectorDataTypes struct { - // SharePoint - SharePoint data type connection. - SharePoint *OfficeDataConnectorDataTypesSharePoint `json:"sharePoint,omitempty"` // Exchange - Exchange data type connection. Exchange *OfficeDataConnectorDataTypesExchange `json:"exchange,omitempty"` + // SharePoint - SharePoint data type connection. + SharePoint *OfficeDataConnectorDataTypesSharePoint `json:"sharePoint,omitempty"` } // OfficeDataConnectorDataTypesExchange exchange data type connection. @@ -7300,22 +8236,22 @@ type OfficeDataConnectorProperties struct { // Operation operation provided by provider type Operation struct { - // Name - Name of the operation - Name *string `json:"name,omitempty"` // Display - Properties of the operation Display *OperationDisplay `json:"display,omitempty"` + // Name - Name of the operation + Name *string `json:"name,omitempty"` } // OperationDisplay properties of the operation type OperationDisplay struct { + // Description - Description of the operation + Description *string `json:"description,omitempty"` + // Operation - Operation name + Operation *string `json:"operation,omitempty"` // Provider - Provider name Provider *string `json:"provider,omitempty"` // Resource - Resource name Resource *string `json:"resource,omitempty"` - // Operation - Operation name - Operation *string `json:"operation,omitempty"` - // Description - Description of the operation - Description *string `json:"description,omitempty"` } // OperationsList lists the operations available in the SecurityInsights RP. @@ -7470,11 +8406,11 @@ type ProcessEntity struct { *ProcessEntityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -7496,43 +8432,43 @@ func (peVar ProcessEntity) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for ProcessEntity. -func (peVar ProcessEntity) AsHostEntity() (*HostEntity, bool) { +// AsAzureResourceEntity is the BasicEntity implementation for ProcessEntity. +func (peVar ProcessEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { return nil, false } -// AsFileEntity is the BasicEntity implementation for ProcessEntity. -func (peVar ProcessEntity) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for ProcessEntity. +func (peVar ProcessEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for ProcessEntity. -func (peVar ProcessEntity) AsSecurityAlert() (*SecurityAlert, bool) { +// AsDNSEntity is the BasicEntity implementation for ProcessEntity. +func (peVar ProcessEntity) AsDNSEntity() (*DNSEntity, bool) { return nil, false } -// AsFileHashEntity is the BasicEntity implementation for ProcessEntity. -func (peVar ProcessEntity) AsFileHashEntity() (*FileHashEntity, bool) { +// AsFileEntity is the BasicEntity implementation for ProcessEntity. +func (peVar ProcessEntity) AsFileEntity() (*FileEntity, bool) { return nil, false } -// AsMalwareEntity is the BasicEntity implementation for ProcessEntity. -func (peVar ProcessEntity) AsMalwareEntity() (*MalwareEntity, bool) { +// AsFileHashEntity is the BasicEntity implementation for ProcessEntity. +func (peVar ProcessEntity) AsFileHashEntity() (*FileHashEntity, bool) { return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for ProcessEntity. -func (peVar ProcessEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { +// AsHostEntity is the BasicEntity implementation for ProcessEntity. +func (peVar ProcessEntity) AsHostEntity() (*HostEntity, bool) { return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for ProcessEntity. -func (peVar ProcessEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { +// AsIPEntity is the BasicEntity implementation for ProcessEntity. +func (peVar ProcessEntity) AsIPEntity() (*IPEntity, bool) { return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for ProcessEntity. -func (peVar ProcessEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for ProcessEntity. +func (peVar ProcessEntity) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } @@ -7541,23 +8477,23 @@ func (peVar ProcessEntity) AsProcessEntity() (*ProcessEntity, bool) { return &peVar, true } -// AsDNSEntity is the BasicEntity implementation for ProcessEntity. -func (peVar ProcessEntity) AsDNSEntity() (*DNSEntity, bool) { +// AsRegistryKeyEntity is the BasicEntity implementation for ProcessEntity. +func (peVar ProcessEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return nil, false } -// AsIPEntity is the BasicEntity implementation for ProcessEntity. -func (peVar ProcessEntity) AsIPEntity() (*IPEntity, bool) { +// AsRegistryValueEntity is the BasicEntity implementation for ProcessEntity. +func (peVar ProcessEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { return nil, false } -// AsRegistryKeyEntity is the BasicEntity implementation for ProcessEntity. -func (peVar ProcessEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { +// AsSecurityAlert is the BasicEntity implementation for ProcessEntity. +func (peVar ProcessEntity) AsSecurityAlert() (*SecurityAlert, bool) { return nil, false } -// AsRegistryValueEntity is the BasicEntity implementation for ProcessEntity. -func (peVar ProcessEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { +// AsSecurityGroupEntity is the BasicEntity implementation for ProcessEntity. +func (peVar ProcessEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { return nil, false } @@ -7603,23 +8539,23 @@ func (peVar *ProcessEntity) UnmarshalJSON(body []byte) error { } peVar.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - peVar.Type = &typeVar + peVar.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - peVar.Name = &name + peVar.Type = &typeVar } case "kind": if v != nil { @@ -7638,28 +8574,28 @@ func (peVar *ProcessEntity) UnmarshalJSON(body []byte) error { // ProcessEntityProperties process entity property bag. type ProcessEntityProperties struct { - // ProcessID - READ-ONLY; The process ID - ProcessID *string `json:"processId,omitempty"` + // AccountEntityID - READ-ONLY; The account entity id running the processes. + AccountEntityID *string `json:"accountEntityId,omitempty"` // CommandLine - READ-ONLY; The command line used to create the process CommandLine *string `json:"commandLine,omitempty"` - // ElevationToken - The elevation token associated with the process. Possible values include: 'Default', 'Full', 'Limited' - ElevationToken ElevationToken `json:"elevationToken,omitempty"` // CreationTimeUtc - READ-ONLY; The time when the process started to run CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` - // ImageFileEntityID - READ-ONLY; Image file entity id - ImageFileEntityID *string `json:"imageFileEntityId,omitempty"` - // AccountEntityID - READ-ONLY; The account entity id running the processes. - AccountEntityID *string `json:"accountEntityId,omitempty"` - // ParentProcessEntityID - READ-ONLY; The parent process entity id. - ParentProcessEntityID *string `json:"parentProcessEntityId,omitempty"` + // ElevationToken - The elevation token associated with the process. Possible values include: 'Default', 'Full', 'Limited' + ElevationToken ElevationToken `json:"elevationToken,omitempty"` // HostEntityID - READ-ONLY; The host entity id on which the process was running HostEntityID *string `json:"hostEntityId,omitempty"` // HostLogonSessionEntityID - READ-ONLY; The session entity id in which the process was running HostLogonSessionEntityID *string `json:"hostLogonSessionEntityId,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,omitempty"` + // ImageFileEntityID - READ-ONLY; Image file entity id + ImageFileEntityID *string `json:"imageFileEntityId,omitempty"` + // ParentProcessEntityID - READ-ONLY; The parent process entity id. + ParentProcessEntityID *string `json:"parentProcessEntityId,omitempty"` + // ProcessID - READ-ONLY; The process ID + ProcessID *string `json:"processId,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for ProcessEntityProperties. @@ -7677,11 +8613,11 @@ type RegistryKeyEntity struct { *RegistryKeyEntityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -7703,43 +8639,43 @@ func (rke RegistryKeyEntity) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for RegistryKeyEntity. -func (rke RegistryKeyEntity) AsHostEntity() (*HostEntity, bool) { +// AsAzureResourceEntity is the BasicEntity implementation for RegistryKeyEntity. +func (rke RegistryKeyEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { return nil, false } -// AsFileEntity is the BasicEntity implementation for RegistryKeyEntity. -func (rke RegistryKeyEntity) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for RegistryKeyEntity. +func (rke RegistryKeyEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for RegistryKeyEntity. -func (rke RegistryKeyEntity) AsSecurityAlert() (*SecurityAlert, bool) { +// AsDNSEntity is the BasicEntity implementation for RegistryKeyEntity. +func (rke RegistryKeyEntity) AsDNSEntity() (*DNSEntity, bool) { return nil, false } -// AsFileHashEntity is the BasicEntity implementation for RegistryKeyEntity. -func (rke RegistryKeyEntity) AsFileHashEntity() (*FileHashEntity, bool) { +// AsFileEntity is the BasicEntity implementation for RegistryKeyEntity. +func (rke RegistryKeyEntity) AsFileEntity() (*FileEntity, bool) { return nil, false } -// AsMalwareEntity is the BasicEntity implementation for RegistryKeyEntity. -func (rke RegistryKeyEntity) AsMalwareEntity() (*MalwareEntity, bool) { +// AsFileHashEntity is the BasicEntity implementation for RegistryKeyEntity. +func (rke RegistryKeyEntity) AsFileHashEntity() (*FileHashEntity, bool) { return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for RegistryKeyEntity. -func (rke RegistryKeyEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { +// AsHostEntity is the BasicEntity implementation for RegistryKeyEntity. +func (rke RegistryKeyEntity) AsHostEntity() (*HostEntity, bool) { return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for RegistryKeyEntity. -func (rke RegistryKeyEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { +// AsIPEntity is the BasicEntity implementation for RegistryKeyEntity. +func (rke RegistryKeyEntity) AsIPEntity() (*IPEntity, bool) { return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for RegistryKeyEntity. -func (rke RegistryKeyEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for RegistryKeyEntity. +func (rke RegistryKeyEntity) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } @@ -7748,16 +8684,6 @@ func (rke RegistryKeyEntity) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for RegistryKeyEntity. -func (rke RegistryKeyEntity) AsDNSEntity() (*DNSEntity, bool) { - return nil, false -} - -// AsIPEntity is the BasicEntity implementation for RegistryKeyEntity. -func (rke RegistryKeyEntity) AsIPEntity() (*IPEntity, bool) { - return nil, false -} - // AsRegistryKeyEntity is the BasicEntity implementation for RegistryKeyEntity. func (rke RegistryKeyEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return &rke, true @@ -7768,6 +8694,16 @@ func (rke RegistryKeyEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool return nil, false } +// AsSecurityAlert is the BasicEntity implementation for RegistryKeyEntity. +func (rke RegistryKeyEntity) AsSecurityAlert() (*SecurityAlert, bool) { + return nil, false +} + +// AsSecurityGroupEntity is the BasicEntity implementation for RegistryKeyEntity. +func (rke RegistryKeyEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { + return nil, false +} + // AsURLEntity is the BasicEntity implementation for RegistryKeyEntity. func (rke RegistryKeyEntity) AsURLEntity() (*URLEntity, bool) { return nil, false @@ -7810,23 +8746,23 @@ func (rke *RegistryKeyEntity) UnmarshalJSON(body []byte) error { } rke.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - rke.Type = &typeVar + rke.Name = &name } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - rke.Name = &name + rke.Type = &typeVar } case "kind": if v != nil { @@ -7849,10 +8785,10 @@ type RegistryKeyEntityProperties struct { Hive RegistryHive `json:"hive,omitempty"` // Key - READ-ONLY; The registry key path. Key *string `json:"key,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for RegistryKeyEntityProperties. @@ -7867,11 +8803,11 @@ type RegistryValueEntity struct { *RegistryValueEntityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -7893,43 +8829,43 @@ func (rve RegistryValueEntity) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for RegistryValueEntity. -func (rve RegistryValueEntity) AsHostEntity() (*HostEntity, bool) { +// AsAzureResourceEntity is the BasicEntity implementation for RegistryValueEntity. +func (rve RegistryValueEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { return nil, false } -// AsFileEntity is the BasicEntity implementation for RegistryValueEntity. -func (rve RegistryValueEntity) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for RegistryValueEntity. +func (rve RegistryValueEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for RegistryValueEntity. -func (rve RegistryValueEntity) AsSecurityAlert() (*SecurityAlert, bool) { +// AsDNSEntity is the BasicEntity implementation for RegistryValueEntity. +func (rve RegistryValueEntity) AsDNSEntity() (*DNSEntity, bool) { return nil, false } -// AsFileHashEntity is the BasicEntity implementation for RegistryValueEntity. -func (rve RegistryValueEntity) AsFileHashEntity() (*FileHashEntity, bool) { +// AsFileEntity is the BasicEntity implementation for RegistryValueEntity. +func (rve RegistryValueEntity) AsFileEntity() (*FileEntity, bool) { return nil, false } -// AsMalwareEntity is the BasicEntity implementation for RegistryValueEntity. -func (rve RegistryValueEntity) AsMalwareEntity() (*MalwareEntity, bool) { +// AsFileHashEntity is the BasicEntity implementation for RegistryValueEntity. +func (rve RegistryValueEntity) AsFileHashEntity() (*FileHashEntity, bool) { return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for RegistryValueEntity. -func (rve RegistryValueEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { +// AsHostEntity is the BasicEntity implementation for RegistryValueEntity. +func (rve RegistryValueEntity) AsHostEntity() (*HostEntity, bool) { return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for RegistryValueEntity. -func (rve RegistryValueEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { +// AsIPEntity is the BasicEntity implementation for RegistryValueEntity. +func (rve RegistryValueEntity) AsIPEntity() (*IPEntity, bool) { return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for RegistryValueEntity. -func (rve RegistryValueEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for RegistryValueEntity. +func (rve RegistryValueEntity) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } @@ -7938,16 +8874,6 @@ func (rve RegistryValueEntity) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for RegistryValueEntity. -func (rve RegistryValueEntity) AsDNSEntity() (*DNSEntity, bool) { - return nil, false -} - -// AsIPEntity is the BasicEntity implementation for RegistryValueEntity. -func (rve RegistryValueEntity) AsIPEntity() (*IPEntity, bool) { - return nil, false -} - // AsRegistryKeyEntity is the BasicEntity implementation for RegistryValueEntity. func (rve RegistryValueEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return nil, false @@ -7958,6 +8884,16 @@ func (rve RegistryValueEntity) AsRegistryValueEntity() (*RegistryValueEntity, bo return &rve, true } +// AsSecurityAlert is the BasicEntity implementation for RegistryValueEntity. +func (rve RegistryValueEntity) AsSecurityAlert() (*SecurityAlert, bool) { + return nil, false +} + +// AsSecurityGroupEntity is the BasicEntity implementation for RegistryValueEntity. +func (rve RegistryValueEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { + return nil, false +} + // AsURLEntity is the BasicEntity implementation for RegistryValueEntity. func (rve RegistryValueEntity) AsURLEntity() (*URLEntity, bool) { return nil, false @@ -8000,23 +8936,23 @@ func (rve *RegistryValueEntity) UnmarshalJSON(body []byte) error { } rve.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - rve.Type = &typeVar + rve.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - rve.Name = &name + rve.Type = &typeVar } case "kind": if v != nil { @@ -8035,18 +8971,18 @@ func (rve *RegistryValueEntity) UnmarshalJSON(body []byte) error { // RegistryValueEntityProperties registryValue entity property bag. type RegistryValueEntityProperties struct { - // ValueName - READ-ONLY; The registry value name. - ValueName *string `json:"valueName,omitempty"` + // KeyEntityID - READ-ONLY; The registry key entity id. + KeyEntityID *string `json:"keyEntityId,omitempty"` // ValueData - READ-ONLY; String formatted representation of the value data. ValueData *string `json:"valueData,omitempty"` + // ValueName - READ-ONLY; The registry value name. + ValueName *string `json:"valueName,omitempty"` // ValueType - READ-ONLY; Specifies the data types to use when storing values in the registry, or identifies the data type of a value in the registry. Possible values include: 'RegistryValueKindNone', 'RegistryValueKindUnknown', 'RegistryValueKindString', 'RegistryValueKindExpandString', 'RegistryValueKindBinary', 'RegistryValueKindDWord', 'RegistryValueKindMultiString', 'RegistryValueKindQWord' ValueType RegistryValueKind `json:"valueType,omitempty"` - // KeyEntityID - READ-ONLY; The registry key entity id. - KeyEntityID *string `json:"keyEntityId,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for RegistryValueEntityProperties. @@ -8055,14 +8991,174 @@ func (rvep RegistryValueEntityProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// RelationBase represents a relation +type RelationBase struct { + // 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"` +} + +// RelationNode relation node +type RelationNode struct { + // RelationNodeID - Relation Node Id + RelationNodeID *string `json:"relationNodeId,omitempty"` + // RelationNodeKind - READ-ONLY; The type of relation node. Possible values include: 'RelationNodeKindCase', 'RelationNodeKindBookmark' + RelationNodeKind RelationNodeKind `json:"relationNodeKind,omitempty"` + // Etag - Etag for relation node + Etag *string `json:"etag,omitempty"` + // RelationAdditionalProperties - Additional set of properties + RelationAdditionalProperties map[string]*string `json:"relationAdditionalProperties"` +} + +// MarshalJSON is the custom marshaler for RelationNode. +func (rn RelationNode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rn.RelationNodeID != nil { + objectMap["relationNodeId"] = rn.RelationNodeID + } + if rn.Etag != nil { + objectMap["etag"] = rn.Etag + } + if rn.RelationAdditionalProperties != nil { + objectMap["relationAdditionalProperties"] = rn.RelationAdditionalProperties + } + return json.Marshal(objectMap) +} + +// RelationsModelInput relation input model +type RelationsModelInput struct { + // RelationsModelInputProperties - Relation input properties + *RelationsModelInputProperties `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 RelationsModelInput. +func (rmi RelationsModelInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rmi.RelationsModelInputProperties != nil { + objectMap["properties"] = rmi.RelationsModelInputProperties + } + if rmi.Etag != nil { + objectMap["etag"] = rmi.Etag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RelationsModelInput struct. +func (rmi *RelationsModelInput) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var relationsModelInputProperties RelationsModelInputProperties + err = json.Unmarshal(*v, &relationsModelInputProperties) + if err != nil { + return err + } + rmi.RelationsModelInputProperties = &relationsModelInputProperties + } + case "kind": + if v != nil { + var kind RelationTypes + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rmi.Kind = kind + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + rmi.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rmi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rmi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rmi.Type = &typeVar + } + } + } + + return nil +} + +// RelationsModelInputProperties relation input properties +type RelationsModelInputProperties struct { + // RelationName - Name of relation + RelationName *string `json:"relationName,omitempty"` + // SourceRelationNode - Relation source node + SourceRelationNode *RelationNode `json:"sourceRelationNode,omitempty"` + // TargetRelationNode - Relation target node + TargetRelationNode *RelationNode `json:"targetRelationNode,omitempty"` +} + // Resource an azure resource object type Resource struct { // 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"` +} + +// ResourceWithEtag an azure resource object with an Etag property +type ResourceWithEtag struct { + // 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"` } // ScheduledAlertRule represents scheduled alert rule. @@ -8071,14 +9167,14 @@ type ScheduledAlertRule struct { *ScheduledAlertRuleProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the alert rule. + // 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: 'KindAlertRule', 'KindScheduled' - Kind Kind `json:"kind,omitempty"` + // Kind - Possible values include: 'KindAlertRule', 'KindFusion', 'KindMicrosoftSecurityIncidentCreation', 'KindScheduled' + Kind KindBasicAlertRule `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for ScheduledAlertRule. @@ -8097,6 +9193,16 @@ func (sar ScheduledAlertRule) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsFusionAlertRule is the BasicAlertRule implementation for ScheduledAlertRule. +func (sar ScheduledAlertRule) AsFusionAlertRule() (*FusionAlertRule, bool) { + return nil, false +} + +// AsMicrosoftSecurityIncidentCreationAlertRule is the BasicAlertRule implementation for ScheduledAlertRule. +func (sar ScheduledAlertRule) AsMicrosoftSecurityIncidentCreationAlertRule() (*MicrosoftSecurityIncidentCreationAlertRule, bool) { + return nil, false +} + // AsScheduledAlertRule is the BasicAlertRule implementation for ScheduledAlertRule. func (sar ScheduledAlertRule) AsScheduledAlertRule() (*ScheduledAlertRule, bool) { return &sar, true @@ -8139,23 +9245,23 @@ func (sar *ScheduledAlertRule) UnmarshalJSON(body []byte) error { } sar.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - sar.Type = &typeVar + sar.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - sar.Name = &name + sar.Type = &typeVar } case "etag": if v != nil { @@ -8168,7 +9274,7 @@ func (sar *ScheduledAlertRule) UnmarshalJSON(body []byte) error { } case "kind": if v != nil { - var kind Kind + var kind KindBasicAlertRule err = json.Unmarshal(*v, &kind) if err != nil { return err @@ -8181,32 +9287,52 @@ func (sar *ScheduledAlertRule) UnmarshalJSON(body []byte) error { return nil } -// ScheduledAlertRuleProperties alert rule property bag. +// ScheduledAlertRuleCommonProperties schedule alert rule template property bag. +type ScheduledAlertRuleCommonProperties struct { + // Query - The query that creates alerts for this rule. + Query *string `json:"query,omitempty"` + // QueryFrequency - The frequency (in ISO 8601 duration format) for this alert rule to run. + QueryFrequency *string `json:"queryFrequency,omitempty"` + // QueryPeriod - The period (in ISO 8601 duration format) that this alert rule looks at. + QueryPeriod *string `json:"queryPeriod,omitempty"` + // Severity - The severity for alerts created by this alert rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' + Severity AlertSeverity `json:"severity,omitempty"` + // TriggerOperator - The operation against the threshold that triggers alert rule. Possible values include: 'GreaterThan', 'LessThan', 'Equal', 'NotEqual' + TriggerOperator TriggerOperator `json:"triggerOperator,omitempty"` + // TriggerThreshold - The threshold triggers this alert rule. + TriggerThreshold *int32 `json:"triggerThreshold,omitempty"` +} + +// ScheduledAlertRuleProperties scheduled alert rule base property bag. type ScheduledAlertRuleProperties struct { - // DisplayName - The display name for alerts created by this alert rule. - DisplayName *string `json:"displayName,omitempty"` + // AlertRuleTemplateName - The Name of the alert rule template used to create this rule. + AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` // Description - The description of the alert rule. Description *string `json:"description,omitempty"` - // Severity - The severity for alerts created by this alert rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' - Severity AlertSeverity `json:"severity,omitempty"` + // DisplayName - The display name for alerts created by this alert rule. + DisplayName *string `json:"displayName,omitempty"` // Enabled - Determines whether this alert rule is enabled or disabled. Enabled *bool `json:"enabled,omitempty"` + // LastModifiedUtc - READ-ONLY; The last time that this alert rule has been modified. + LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` + // SuppressionDuration - The suppression (in ISO 8601 duration format) to wait since last time this alert rule been triggered. + SuppressionDuration *string `json:"suppressionDuration,omitempty"` + // SuppressionEnabled - Determines whether the suppression for this alert rule is enabled or disabled. + SuppressionEnabled *bool `json:"suppressionEnabled,omitempty"` + // Tactics - The tactics of the alert rule + Tactics *[]AttackTactic `json:"tactics,omitempty"` // Query - The query that creates alerts for this rule. Query *string `json:"query,omitempty"` // QueryFrequency - The frequency (in ISO 8601 duration format) for this alert rule to run. QueryFrequency *string `json:"queryFrequency,omitempty"` // QueryPeriod - The period (in ISO 8601 duration format) that this alert rule looks at. QueryPeriod *string `json:"queryPeriod,omitempty"` + // Severity - The severity for alerts created by this alert rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' + Severity AlertSeverity `json:"severity,omitempty"` // TriggerOperator - The operation against the threshold that triggers alert rule. Possible values include: 'GreaterThan', 'LessThan', 'Equal', 'NotEqual' TriggerOperator TriggerOperator `json:"triggerOperator,omitempty"` // TriggerThreshold - The threshold triggers this alert rule. TriggerThreshold *int32 `json:"triggerThreshold,omitempty"` - // SuppressionEnabled - Determines whether the suppression for this alert rule is enabled or disabled. - SuppressionEnabled *bool `json:"suppressionEnabled,omitempty"` - // SuppressionDuration - The suppression (in ISO 8601 duration format) to wait since last time this alert rule been triggered. - SuppressionDuration *string `json:"suppressionDuration,omitempty"` - // LastModifiedUtc - READ-ONLY; The last time that this alert has been modified. - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` } // ScheduledAlertRuleTemplate represents scheduled alert rule template. @@ -8215,13 +9341,11 @@ type ScheduledAlertRuleTemplate struct { *ScheduledAlertRuleTemplateProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the alert rule. - Etag *string `json:"etag,omitempty"` - // Kind - Possible values include: 'KindBasicAlertRuleTemplateKindAlertRuleTemplate', 'KindBasicAlertRuleTemplateKindScheduled', 'KindBasicAlertRuleTemplateKindFilter', 'KindBasicAlertRuleTemplateKindFusion' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindBasicAlertRuleTemplateKindAlertRuleTemplate', 'KindBasicAlertRuleTemplateKindFusion', 'KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation', 'KindBasicAlertRuleTemplateKindScheduled' Kind KindBasicAlertRuleTemplate `json:"kind,omitempty"` } @@ -8232,28 +9356,25 @@ func (sart ScheduledAlertRuleTemplate) MarshalJSON() ([]byte, error) { if sart.ScheduledAlertRuleTemplateProperties != nil { objectMap["properties"] = sart.ScheduledAlertRuleTemplateProperties } - if sart.Etag != nil { - objectMap["etag"] = sart.Etag - } if sart.Kind != "" { objectMap["kind"] = sart.Kind } return json.Marshal(objectMap) } -// AsScheduledAlertRuleTemplate is the BasicAlertRuleTemplate implementation for ScheduledAlertRuleTemplate. -func (sart ScheduledAlertRuleTemplate) AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) { - return &sart, true +// AsFusionAlertRuleTemplate is the BasicAlertRuleTemplate implementation for ScheduledAlertRuleTemplate. +func (sart ScheduledAlertRuleTemplate) AsFusionAlertRuleTemplate() (*FusionAlertRuleTemplate, bool) { + return nil, false } -// AsFilterAlertRuleTemplate is the BasicAlertRuleTemplate implementation for ScheduledAlertRuleTemplate. -func (sart ScheduledAlertRuleTemplate) AsFilterAlertRuleTemplate() (*FilterAlertRuleTemplate, bool) { +// AsMicrosoftSecurityIncidentCreationAlertRuleTemplate is the BasicAlertRuleTemplate implementation for ScheduledAlertRuleTemplate. +func (sart ScheduledAlertRuleTemplate) AsMicrosoftSecurityIncidentCreationAlertRuleTemplate() (*MicrosoftSecurityIncidentCreationAlertRuleTemplate, bool) { return nil, false } -// AsFusionAlertRuleTemplate is the BasicAlertRuleTemplate implementation for ScheduledAlertRuleTemplate. -func (sart ScheduledAlertRuleTemplate) AsFusionAlertRuleTemplate() (*FusionAlertRuleTemplate, bool) { - return nil, false +// AsScheduledAlertRuleTemplate is the BasicAlertRuleTemplate implementation for ScheduledAlertRuleTemplate. +func (sart ScheduledAlertRuleTemplate) AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) { + return &sart, true } // AsAlertRuleTemplate is the BasicAlertRuleTemplate implementation for ScheduledAlertRuleTemplate. @@ -8293,15 +9414,6 @@ func (sart *ScheduledAlertRuleTemplate) UnmarshalJSON(body []byte) error { } sart.ID = &ID } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sart.Type = &typeVar - } case "name": if v != nil { var name string @@ -8311,14 +9423,14 @@ func (sart *ScheduledAlertRuleTemplate) UnmarshalJSON(body []byte) error { } sart.Name = &name } - case "etag": + case "type": if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - sart.Etag = &etag + sart.Type = &typeVar } case "kind": if v != nil { @@ -8337,44 +9449,28 @@ func (sart *ScheduledAlertRuleTemplate) UnmarshalJSON(body []byte) error { // ScheduledAlertRuleTemplateProperties scheduled alert rule template properties type ScheduledAlertRuleTemplateProperties struct { - // DisplayName - The display name for alert rule template. - DisplayName *string `json:"displayName,omitempty"` + // AlertRulesCreatedByTemplateCount - the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + // CreatedDateUTC - READ-ONLY; The time that this alert rule template has been added. + CreatedDateUTC *date.Time `json:"createdDateUTC,omitempty"` // Description - The description of the alert rule template. Description *string `json:"description,omitempty"` - // Tactics - The tactics of the alert rule template - Tactics *[]AttackTactic `json:"tactics,omitempty"` - // CreatedDateUTC - READ-ONLY; The time that this alert rule template has been added. - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - // Status - The alert rule template status. Possible values include: 'Installed', 'Available', 'NotAvailable' - Status TemplateStatus `json:"status,omitempty"` + // DisplayName - The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` // RequiredDataConnectors - The required data connectors for this template RequiredDataConnectors *[]DataConnectorStatus `json:"requiredDataConnectors,omitempty"` - // AlertRulesCreatedByTemplateCount - the number of alert rules that were created by this template - AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` - // Severity - The severity for alerts created by this alert rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' - Severity AlertSeverity `json:"severity,omitempty"` + // Status - The alert rule template status. Possible values include: 'Installed', 'Available', 'NotAvailable' + Status TemplateStatus `json:"status,omitempty"` + // Tactics - The tactics of the alert rule template + Tactics *[]AttackTactic `json:"tactics,omitempty"` // Query - The query that creates alerts for this rule. Query *string `json:"query,omitempty"` // QueryFrequency - The frequency (in ISO 8601 duration format) for this alert rule to run. QueryFrequency *string `json:"queryFrequency,omitempty"` // QueryPeriod - The period (in ISO 8601 duration format) that this alert rule looks at. QueryPeriod *string `json:"queryPeriod,omitempty"` - // TriggerOperator - The operation against the threshold that triggers alert rule. Possible values include: 'GreaterThan', 'LessThan', 'Equal', 'NotEqual' - TriggerOperator TriggerOperator `json:"triggerOperator,omitempty"` - // TriggerThreshold - The threshold triggers this alert rule. - TriggerThreshold *int32 `json:"triggerThreshold,omitempty"` -} - -// ScheduledAlertRuleTemplatePropertiesModel schedule alert rule template property bag. -type ScheduledAlertRuleTemplatePropertiesModel struct { // Severity - The severity for alerts created by this alert rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' Severity AlertSeverity `json:"severity,omitempty"` - // Query - The query that creates alerts for this rule. - Query *string `json:"query,omitempty"` - // QueryFrequency - The frequency (in ISO 8601 duration format) for this alert rule to run. - QueryFrequency *string `json:"queryFrequency,omitempty"` - // QueryPeriod - The period (in ISO 8601 duration format) that this alert rule looks at. - QueryPeriod *string `json:"queryPeriod,omitempty"` // TriggerOperator - The operation against the threshold that triggers alert rule. Possible values include: 'GreaterThan', 'LessThan', 'Equal', 'NotEqual' TriggerOperator TriggerOperator `json:"triggerOperator,omitempty"` // TriggerThreshold - The threshold triggers this alert rule. @@ -8387,11 +9483,11 @@ type SecurityAlert struct { *SecurityAlertProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -8413,43 +9509,43 @@ func (sa SecurityAlert) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for SecurityAlert. -func (sa SecurityAlert) AsHostEntity() (*HostEntity, bool) { +// AsAzureResourceEntity is the BasicEntity implementation for SecurityAlert. +func (sa SecurityAlert) AsAzureResourceEntity() (*AzureResourceEntity, bool) { return nil, false } -// AsFileEntity is the BasicEntity implementation for SecurityAlert. -func (sa SecurityAlert) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for SecurityAlert. +func (sa SecurityAlert) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for SecurityAlert. -func (sa SecurityAlert) AsSecurityAlert() (*SecurityAlert, bool) { - return &sa, true +// AsDNSEntity is the BasicEntity implementation for SecurityAlert. +func (sa SecurityAlert) AsDNSEntity() (*DNSEntity, bool) { + return nil, false } -// AsFileHashEntity is the BasicEntity implementation for SecurityAlert. -func (sa SecurityAlert) AsFileHashEntity() (*FileHashEntity, bool) { +// AsFileEntity is the BasicEntity implementation for SecurityAlert. +func (sa SecurityAlert) AsFileEntity() (*FileEntity, bool) { return nil, false } -// AsMalwareEntity is the BasicEntity implementation for SecurityAlert. -func (sa SecurityAlert) AsMalwareEntity() (*MalwareEntity, bool) { +// AsFileHashEntity is the BasicEntity implementation for SecurityAlert. +func (sa SecurityAlert) AsFileHashEntity() (*FileHashEntity, bool) { return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for SecurityAlert. -func (sa SecurityAlert) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { +// AsHostEntity is the BasicEntity implementation for SecurityAlert. +func (sa SecurityAlert) AsHostEntity() (*HostEntity, bool) { return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for SecurityAlert. -func (sa SecurityAlert) AsAzureResourceEntity() (*AzureResourceEntity, bool) { +// AsIPEntity is the BasicEntity implementation for SecurityAlert. +func (sa SecurityAlert) AsIPEntity() (*IPEntity, bool) { return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for SecurityAlert. -func (sa SecurityAlert) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for SecurityAlert. +func (sa SecurityAlert) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } @@ -8458,23 +9554,23 @@ func (sa SecurityAlert) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for SecurityAlert. -func (sa SecurityAlert) AsDNSEntity() (*DNSEntity, bool) { +// AsRegistryKeyEntity is the BasicEntity implementation for SecurityAlert. +func (sa SecurityAlert) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return nil, false } -// AsIPEntity is the BasicEntity implementation for SecurityAlert. -func (sa SecurityAlert) AsIPEntity() (*IPEntity, bool) { +// AsRegistryValueEntity is the BasicEntity implementation for SecurityAlert. +func (sa SecurityAlert) AsRegistryValueEntity() (*RegistryValueEntity, bool) { return nil, false } -// AsRegistryKeyEntity is the BasicEntity implementation for SecurityAlert. -func (sa SecurityAlert) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { - return nil, false +// AsSecurityAlert is the BasicEntity implementation for SecurityAlert. +func (sa SecurityAlert) AsSecurityAlert() (*SecurityAlert, bool) { + return &sa, true } -// AsRegistryValueEntity is the BasicEntity implementation for SecurityAlert. -func (sa SecurityAlert) AsRegistryValueEntity() (*RegistryValueEntity, bool) { +// AsSecurityGroupEntity is the BasicEntity implementation for SecurityAlert. +func (sa SecurityAlert) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { return nil, false } @@ -8520,23 +9616,23 @@ func (sa *SecurityAlert) UnmarshalJSON(body []byte) error { } sa.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - sa.Type = &typeVar + sa.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - sa.Name = &name + sa.Type = &typeVar } case "kind": if v != nil { @@ -8555,52 +9651,52 @@ func (sa *SecurityAlert) UnmarshalJSON(body []byte) error { // SecurityAlertProperties securityAlert entity property bag. type SecurityAlertProperties struct { - // SystemAlertID - READ-ONLY; Holds the product identifier of the alert for the product. - SystemAlertID *string `json:"systemAlertId,omitempty"` + // AlertDisplayName - READ-ONLY; The display name of the alert. + AlertDisplayName *string `json:"alertDisplayName,omitempty"` + // AlertType - READ-ONLY; The type name of the alert. + AlertType *string `json:"alertType,omitempty"` + // CompromisedEntity - READ-ONLY; Display name of the main entity being reported on. + CompromisedEntity *string `json:"compromisedEntity,omitempty"` + // ConfidenceLevel - READ-ONLY; The confidence level of this alert. Possible values include: 'ConfidenceLevelUnknown', 'ConfidenceLevelLow', 'ConfidenceLevelHigh' + ConfidenceLevel ConfidenceLevel `json:"confidenceLevel,omitempty"` // ConfidenceReasons - READ-ONLY; The confidence reasons ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsItem `json:"confidenceReasons,omitempty"` - // ConfidenceScoreStatus - READ-ONLY; The confidence score calculation status, i.e. indicating if score calculation is pending for this alert, not applicable or final. Possible values include: 'NotApplicable', 'InProcess', 'NotFinal', 'Final' - ConfidenceScoreStatus ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` - // Intent - READ-ONLY; Holds the alert intent stage(s) mapping for this alert. Possible values include: 'KillChainIntentUnknown', 'KillChainIntentProbing', 'KillChainIntentExploitation', 'KillChainIntentPersistence', 'KillChainIntentPrivilegeEscalation', 'KillChainIntentDefenseEvasion', 'KillChainIntentCredentialAccess', 'KillChainIntentDiscovery', 'KillChainIntentLateralMovement', 'KillChainIntentExecution', 'KillChainIntentCollection', 'KillChainIntentExfiltration', 'KillChainIntentCommandAndControl', 'KillChainIntentImpact' - Intent KillChainIntent `json:"intent,omitempty"` // ConfidenceScore - READ-ONLY; The confidence score of the alert. ConfidenceScore *float64 `json:"confidenceScore,omitempty"` - // AlertDisplayName - READ-ONLY; The display name of the alert. - AlertDisplayName *string `json:"alertDisplayName,omitempty"` + // ConfidenceScoreStatus - READ-ONLY; The confidence score calculation status, i.e. indicating if score calculation is pending for this alert, not applicable or final. Possible values include: 'NotApplicable', 'InProcess', 'NotFinal', 'Final' + ConfidenceScoreStatus ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` // Description - READ-ONLY; Alert description. Description *string `json:"description,omitempty"` - // RemediationSteps - READ-ONLY; Manual action items to take to remediate the alert. - RemediationSteps *[]string `json:"remediationSteps,omitempty"` - // ConfidenceLevel - READ-ONLY; The confidence level of this alert. Possible values include: 'ConfidenceLevelUnknown', 'ConfidenceLevelLow', 'ConfidenceLevelHigh' - ConfidenceLevel ConfidenceLevel `json:"confidenceLevel,omitempty"` - // Severity - The severity of the alert. Possible values include: 'High', 'Medium', 'Low', 'Informational' - Severity AlertSeverity `json:"severity,omitempty"` - // VendorName - READ-ONLY; The name of the vendor that raise the alert. - VendorName *string `json:"vendorName,omitempty"` - // ProductName - READ-ONLY; The name of the product which published this alert. - ProductName *string `json:"productName,omitempty"` + // EndTimeUtc - READ-ONLY; The impact end time of the alert (the time of the last event contributing to the alert). + EndTimeUtc *date.Time `json:"endTimeUtc,omitempty"` + // Intent - READ-ONLY; Holds the alert intent stage(s) mapping for this alert. Possible values include: 'KillChainIntentUnknown', 'KillChainIntentProbing', 'KillChainIntentExploitation', 'KillChainIntentPersistence', 'KillChainIntentPrivilegeEscalation', 'KillChainIntentDefenseEvasion', 'KillChainIntentCredentialAccess', 'KillChainIntentDiscovery', 'KillChainIntentLateralMovement', 'KillChainIntentExecution', 'KillChainIntentCollection', 'KillChainIntentExfiltration', 'KillChainIntentCommandAndControl', 'KillChainIntentImpact' + Intent KillChainIntent `json:"intent,omitempty"` + // ProcessingEndTime - READ-ONLY; The time the alert was made available for consumption. + ProcessingEndTime *date.Time `json:"processingEndTime,omitempty"` // ProductComponentName - READ-ONLY; The name of a component inside the product which generated the alert. ProductComponentName *string `json:"productComponentName,omitempty"` - // AlertType - READ-ONLY; The type name of the alert. - AlertType *string `json:"alertType,omitempty"` + // ProductName - READ-ONLY; The name of the product which published this alert. + ProductName *string `json:"productName,omitempty"` // ProductVersion - READ-ONLY; The version of the product generating the alert. ProductVersion *string `json:"productVersion,omitempty"` - // ProcessingEndTime - READ-ONLY; The time the alert was made available for consumption. - ProcessingEndTime *date.Time `json:"processingEndTime,omitempty"` - // Status - READ-ONLY; The lifecycle status of the alert. Possible values include: 'AlertStatusUnknown', 'AlertStatusNew', 'AlertStatusResolved', 'AlertStatusDismissed', 'AlertStatusInProgress' - Status AlertStatus `json:"status,omitempty"` - // EndTimeUtc - READ-ONLY; The impact end time of the alert (the time of the last event contributing to the alert). - EndTimeUtc *date.Time `json:"endTimeUtc,omitempty"` + // RemediationSteps - READ-ONLY; Manual action items to take to remediate the alert. + RemediationSteps *[]string `json:"remediationSteps,omitempty"` + // Severity - The severity of the alert. Possible values include: 'High', 'Medium', 'Low', 'Informational' + Severity AlertSeverity `json:"severity,omitempty"` // StartTimeUtc - READ-ONLY; The impact start time of the alert (the time of the first event contributing to the alert). StartTimeUtc *date.Time `json:"startTimeUtc,omitempty"` + // Status - READ-ONLY; The lifecycle status of the alert. Possible values include: 'AlertStatusUnknown', 'AlertStatusNew', 'AlertStatusResolved', 'AlertStatusDismissed', 'AlertStatusInProgress' + Status AlertStatus `json:"status,omitempty"` + // SystemAlertID - READ-ONLY; Holds the product identifier of the alert for the product. + SystemAlertID *string `json:"systemAlertId,omitempty"` // TimeGenerated - READ-ONLY; The time the alert was generated. TimeGenerated *date.Time `json:"timeGenerated,omitempty"` - // CompromisedEntity - READ-ONLY; Display name of the main entity being reported on. - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,omitempty"` + // VendorName - READ-ONLY; The name of the vendor that raise the alert. + VendorName *string `json:"vendorName,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for SecurityAlertProperties. @@ -8614,10 +9710,10 @@ func (sap SecurityAlertProperties) MarshalJSON() ([]byte, error) { // SecurityAlertPropertiesConfidenceReasonsItem confidence reason item type SecurityAlertPropertiesConfidenceReasonsItem struct { - // ReasonType - READ-ONLY; The type (category) of the reason - ReasonType *string `json:"reasonType,omitempty"` // Reason - READ-ONLY; The reason's description Reason *string `json:"reason,omitempty"` + // ReasonType - READ-ONLY; The type (category) of the reason + ReasonType *string `json:"reasonType,omitempty"` } // SecurityGroupEntity represents a security group entity. @@ -8626,11 +9722,11 @@ type SecurityGroupEntity struct { *SecurityGroupEntityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -8652,43 +9748,43 @@ func (sge SecurityGroupEntity) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for SecurityGroupEntity. -func (sge SecurityGroupEntity) AsHostEntity() (*HostEntity, bool) { +// AsAzureResourceEntity is the BasicEntity implementation for SecurityGroupEntity. +func (sge SecurityGroupEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { return nil, false } -// AsFileEntity is the BasicEntity implementation for SecurityGroupEntity. -func (sge SecurityGroupEntity) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for SecurityGroupEntity. +func (sge SecurityGroupEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for SecurityGroupEntity. -func (sge SecurityGroupEntity) AsSecurityAlert() (*SecurityAlert, bool) { +// AsDNSEntity is the BasicEntity implementation for SecurityGroupEntity. +func (sge SecurityGroupEntity) AsDNSEntity() (*DNSEntity, bool) { return nil, false } -// AsFileHashEntity is the BasicEntity implementation for SecurityGroupEntity. -func (sge SecurityGroupEntity) AsFileHashEntity() (*FileHashEntity, bool) { +// AsFileEntity is the BasicEntity implementation for SecurityGroupEntity. +func (sge SecurityGroupEntity) AsFileEntity() (*FileEntity, bool) { return nil, false } -// AsMalwareEntity is the BasicEntity implementation for SecurityGroupEntity. -func (sge SecurityGroupEntity) AsMalwareEntity() (*MalwareEntity, bool) { +// AsFileHashEntity is the BasicEntity implementation for SecurityGroupEntity. +func (sge SecurityGroupEntity) AsFileHashEntity() (*FileHashEntity, bool) { return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for SecurityGroupEntity. -func (sge SecurityGroupEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { - return &sge, true +// AsHostEntity is the BasicEntity implementation for SecurityGroupEntity. +func (sge SecurityGroupEntity) AsHostEntity() (*HostEntity, bool) { + return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for SecurityGroupEntity. -func (sge SecurityGroupEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { +// AsIPEntity is the BasicEntity implementation for SecurityGroupEntity. +func (sge SecurityGroupEntity) AsIPEntity() (*IPEntity, bool) { return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for SecurityGroupEntity. -func (sge SecurityGroupEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for SecurityGroupEntity. +func (sge SecurityGroupEntity) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } @@ -8697,16 +9793,6 @@ func (sge SecurityGroupEntity) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for SecurityGroupEntity. -func (sge SecurityGroupEntity) AsDNSEntity() (*DNSEntity, bool) { - return nil, false -} - -// AsIPEntity is the BasicEntity implementation for SecurityGroupEntity. -func (sge SecurityGroupEntity) AsIPEntity() (*IPEntity, bool) { - return nil, false -} - // AsRegistryKeyEntity is the BasicEntity implementation for SecurityGroupEntity. func (sge SecurityGroupEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return nil, false @@ -8717,6 +9803,16 @@ func (sge SecurityGroupEntity) AsRegistryValueEntity() (*RegistryValueEntity, bo return nil, false } +// AsSecurityAlert is the BasicEntity implementation for SecurityGroupEntity. +func (sge SecurityGroupEntity) AsSecurityAlert() (*SecurityAlert, bool) { + return nil, false +} + +// AsSecurityGroupEntity is the BasicEntity implementation for SecurityGroupEntity. +func (sge SecurityGroupEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { + return &sge, true +} + // AsURLEntity is the BasicEntity implementation for SecurityGroupEntity. func (sge SecurityGroupEntity) AsURLEntity() (*URLEntity, bool) { return nil, false @@ -8759,23 +9855,23 @@ func (sge *SecurityGroupEntity) UnmarshalJSON(body []byte) error { } sge.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - sge.Type = &typeVar + sge.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - sge.Name = &name + sge.Type = &typeVar } case "kind": if v != nil { @@ -8796,14 +9892,14 @@ func (sge *SecurityGroupEntity) UnmarshalJSON(body []byte) error { type SecurityGroupEntityProperties struct { // DistinguishedName - READ-ONLY; The group distinguished name DistinguishedName *string `json:"distinguishedName,omitempty"` - // Sid - READ-ONLY; The SID attribute is a single-value attribute that specifies the security identifier (SID) of the group - Sid *string `json:"sid,omitempty"` // ObjectGUID - READ-ONLY; A single-value attribute that is the unique identifier for the object, assigned by active directory. ObjectGUID *uuid.UUID `json:"objectGuid,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,omitempty"` + // Sid - READ-ONLY; The SID attribute is a single-value attribute that specifies the security identifier (SID) of the group + Sid *string `json:"sid,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for SecurityGroupEntityProperties. @@ -8814,8 +9910,8 @@ func (sgep SecurityGroupEntityProperties) MarshalJSON() ([]byte, error) { // BasicSettings the Setting. type BasicSettings interface { - AsUebaSettings() (*UebaSettings, bool) AsToggleSettings() (*ToggleSettings, bool) + AsUebaSettings() (*UebaSettings, bool) AsSettings() (*Settings, bool) } @@ -8824,13 +9920,13 @@ type Settings struct { autorest.Response `json:"-"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the alert rule. + // 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', 'KindUebaSettings', 'KindToggleSettings' + // Kind - Possible values include: 'KindSettings', 'KindToggleSettings', 'KindUebaSettings' Kind KindBasicSettings `json:"kind,omitempty"` } @@ -8842,14 +9938,14 @@ func unmarshalBasicSettings(body []byte) (BasicSettings, error) { } switch m["kind"] { - case string(KindUebaSettings): - var us UebaSettings - err := json.Unmarshal(body, &us) - return us, err 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 default: var s Settings err := json.Unmarshal(body, &s) @@ -8888,13 +9984,13 @@ func (s Settings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsUebaSettings is the BasicSettings implementation for Settings. -func (s Settings) AsUebaSettings() (*UebaSettings, bool) { +// AsToggleSettings is the BasicSettings implementation for Settings. +func (s Settings) AsToggleSettings() (*ToggleSettings, bool) { return nil, false } -// AsToggleSettings is the BasicSettings implementation for Settings. -func (s Settings) AsToggleSettings() (*ToggleSettings, bool) { +// AsUebaSettings is the BasicSettings implementation for Settings. +func (s Settings) AsUebaSettings() (*UebaSettings, bool) { return nil, false } @@ -8933,18 +10029,18 @@ func (sm *SettingsModel) UnmarshalJSON(body []byte) error { // ThreatIntelligence threatIntelligence property bag. type ThreatIntelligence struct { - // ProviderName - READ-ONLY; Name of the provider from whom this Threat Intelligence information was received - ProviderName *string `json:"providerName,omitempty"` - // ThreatType - READ-ONLY; Threat type (e.g. "Botnet") - ThreatType *string `json:"threatType,omitempty"` - // ThreatName - READ-ONLY; Threat name (e.g. "Jedobot malware") - ThreatName *string `json:"threatName,omitempty"` // Confidence - READ-ONLY; Confidence (must be between 0 and 1) Confidence *float64 `json:"confidence,omitempty"` + // ProviderName - READ-ONLY; Name of the provider from whom this Threat Intelligence information was received + ProviderName *string `json:"providerName,omitempty"` // ReportLink - READ-ONLY; Report link ReportLink *string `json:"reportLink,omitempty"` // ThreatDescription - READ-ONLY; Threat description (free text) ThreatDescription *string `json:"threatDescription,omitempty"` + // ThreatName - READ-ONLY; Threat name (e.g. "Jedobot malware") + ThreatName *string `json:"threatName,omitempty"` + // ThreatType - READ-ONLY; Threat type (e.g. "Botnet") + ThreatType *string `json:"threatType,omitempty"` } // TIDataConnector represents threat intelligence data connector. @@ -8953,13 +10049,13 @@ type TIDataConnector struct { *TIDataConnectorProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the data connector. + // 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: 'KindDataConnector', 'KindOffice365', 'KindThreatIntelligence', 'KindAmazonWebServicesCloudTrail', 'KindAzureActiveDirectory', 'KindAzureSecurityCenter', 'KindMicrosoftCloudAppSecurity', 'KindAzureAdvancedThreatProtection', 'KindMicrosoftDefenderAdvancedThreatProtection' + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' Kind KindBasicDataConnector `json:"kind,omitempty"` } @@ -8979,28 +10075,23 @@ func (tdc TIDataConnector) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsOfficeDataConnector is the BasicDataConnector implementation for TIDataConnector. -func (tdc TIDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { +// AsAADDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { return nil, false } -// AsTIDataConnector is the BasicDataConnector implementation for TIDataConnector. -func (tdc TIDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { - return &tdc, true -} - -// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for TIDataConnector. -func (tdc TIDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { +// AsAATPDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { return nil, false } -// AsAADDataConnector is the BasicDataConnector implementation for TIDataConnector. -func (tdc TIDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { +// AsASCDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { return nil, false } -// AsASCDataConnector is the BasicDataConnector implementation for TIDataConnector. -func (tdc TIDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { +// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { return nil, false } @@ -9009,16 +10100,21 @@ func (tdc TIDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { return nil, false } -// AsAATPDataConnector is the BasicDataConnector implementation for TIDataConnector. -func (tdc TIDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { +// AsMDATPDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { return nil, false } -// AsMDATPDataConnector is the BasicDataConnector implementation for TIDataConnector. -func (tdc TIDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { +// AsOfficeDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { return nil, false } +// AsTIDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { + return &tdc, true +} + // AsDataConnector is the BasicDataConnector implementation for TIDataConnector. func (tdc TIDataConnector) AsDataConnector() (*DataConnector, bool) { return nil, false @@ -9056,23 +10152,23 @@ func (tdc *TIDataConnector) UnmarshalJSON(body []byte) error { } tdc.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - tdc.Type = &typeVar + tdc.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - tdc.Name = &name + tdc.Type = &typeVar } case "etag": if v != nil { @@ -9124,13 +10220,13 @@ type ToggleSettings struct { *ToggleSettingsProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the alert rule. + // 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', 'KindUebaSettings', 'KindToggleSettings' + // Kind - Possible values include: 'KindSettings', 'KindToggleSettings', 'KindUebaSettings' Kind KindBasicSettings `json:"kind,omitempty"` } @@ -9150,16 +10246,16 @@ func (ts ToggleSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsUebaSettings is the BasicSettings implementation for ToggleSettings. -func (ts ToggleSettings) AsUebaSettings() (*UebaSettings, bool) { - return nil, false -} - // 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 @@ -9197,23 +10293,23 @@ func (ts *ToggleSettings) UnmarshalJSON(body []byte) error { } ts.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - ts.Type = &typeVar + ts.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - ts.Name = &name + ts.Type = &typeVar } case "etag": if v != nil { @@ -9251,13 +10347,13 @@ type UebaSettings struct { *UebaSettingsProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Etag - Etag of the alert rule. + // 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', 'KindUebaSettings', 'KindToggleSettings' + // Kind - Possible values include: 'KindSettings', 'KindToggleSettings', 'KindUebaSettings' Kind KindBasicSettings `json:"kind,omitempty"` } @@ -9277,16 +10373,16 @@ func (us UebaSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsUebaSettings is the BasicSettings implementation for UebaSettings. -func (us UebaSettings) AsUebaSettings() (*UebaSettings, bool) { - return &us, true -} - // 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 @@ -9324,23 +10420,23 @@ func (us *UebaSettings) UnmarshalJSON(body []byte) error { } us.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - us.Type = &typeVar + us.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - us.Name = &name + us.Type = &typeVar } case "etag": if v != nil { @@ -9368,12 +10464,12 @@ func (us *UebaSettings) UnmarshalJSON(body []byte) error { // 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"` - // AtpLicenseStatus - READ-ONLY; Determines whether the tenant has ATP (Advanced Threat Protection) license. Possible values include: 'LicenseStatusEnabled', 'LicenseStatusDisabled' - AtpLicenseStatus LicenseStatus `json:"atpLicenseStatus,omitempty"` } // URLEntity represents a url entity. @@ -9382,11 +10478,11 @@ type URLEntity struct { *URLEntityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Azure resource Id ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` // Name - READ-ONLY; Azure resource name Name *string `json:"name,omitempty"` - // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindHost', 'KindFile', 'KindSecurityAlert', 'KindFileHash', 'KindMalware', 'KindSecurityGroup', 'KindAzureResource', 'KindCloudApplication', 'KindProcess', 'KindDNSResolution', 'KindIP', 'KindRegistryKey', 'KindRegistryValue', 'KindURL' + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindEntity', 'KindAccount', 'KindAzureResource', 'KindCloudApplication', 'KindDNSResolution', 'KindFile', 'KindFileHash', 'KindHost', 'KindIP', 'KindMalware', 'KindProcess', 'KindRegistryKey', 'KindRegistryValue', 'KindSecurityAlert', 'KindSecurityGroup', 'KindURL' Kind KindBasicEntity `json:"kind,omitempty"` } @@ -9408,43 +10504,43 @@ func (ue URLEntity) AsAccountEntity() (*AccountEntity, bool) { return nil, false } -// AsHostEntity is the BasicEntity implementation for URLEntity. -func (ue URLEntity) AsHostEntity() (*HostEntity, bool) { +// AsAzureResourceEntity is the BasicEntity implementation for URLEntity. +func (ue URLEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { return nil, false } -// AsFileEntity is the BasicEntity implementation for URLEntity. -func (ue URLEntity) AsFileEntity() (*FileEntity, bool) { +// AsCloudApplicationEntity is the BasicEntity implementation for URLEntity. +func (ue URLEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { return nil, false } -// AsSecurityAlert is the BasicEntity implementation for URLEntity. -func (ue URLEntity) AsSecurityAlert() (*SecurityAlert, bool) { +// AsDNSEntity is the BasicEntity implementation for URLEntity. +func (ue URLEntity) AsDNSEntity() (*DNSEntity, bool) { return nil, false } -// AsFileHashEntity is the BasicEntity implementation for URLEntity. -func (ue URLEntity) AsFileHashEntity() (*FileHashEntity, bool) { +// AsFileEntity is the BasicEntity implementation for URLEntity. +func (ue URLEntity) AsFileEntity() (*FileEntity, bool) { return nil, false } -// AsMalwareEntity is the BasicEntity implementation for URLEntity. -func (ue URLEntity) AsMalwareEntity() (*MalwareEntity, bool) { +// AsFileHashEntity is the BasicEntity implementation for URLEntity. +func (ue URLEntity) AsFileHashEntity() (*FileHashEntity, bool) { return nil, false } -// AsSecurityGroupEntity is the BasicEntity implementation for URLEntity. -func (ue URLEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { +// AsHostEntity is the BasicEntity implementation for URLEntity. +func (ue URLEntity) AsHostEntity() (*HostEntity, bool) { return nil, false } -// AsAzureResourceEntity is the BasicEntity implementation for URLEntity. -func (ue URLEntity) AsAzureResourceEntity() (*AzureResourceEntity, bool) { +// AsIPEntity is the BasicEntity implementation for URLEntity. +func (ue URLEntity) AsIPEntity() (*IPEntity, bool) { return nil, false } -// AsCloudApplicationEntity is the BasicEntity implementation for URLEntity. -func (ue URLEntity) AsCloudApplicationEntity() (*CloudApplicationEntity, bool) { +// AsMalwareEntity is the BasicEntity implementation for URLEntity. +func (ue URLEntity) AsMalwareEntity() (*MalwareEntity, bool) { return nil, false } @@ -9453,23 +10549,23 @@ func (ue URLEntity) AsProcessEntity() (*ProcessEntity, bool) { return nil, false } -// AsDNSEntity is the BasicEntity implementation for URLEntity. -func (ue URLEntity) AsDNSEntity() (*DNSEntity, bool) { +// AsRegistryKeyEntity is the BasicEntity implementation for URLEntity. +func (ue URLEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { return nil, false } -// AsIPEntity is the BasicEntity implementation for URLEntity. -func (ue URLEntity) AsIPEntity() (*IPEntity, bool) { +// AsRegistryValueEntity is the BasicEntity implementation for URLEntity. +func (ue URLEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { return nil, false } -// AsRegistryKeyEntity is the BasicEntity implementation for URLEntity. -func (ue URLEntity) AsRegistryKeyEntity() (*RegistryKeyEntity, bool) { +// AsSecurityAlert is the BasicEntity implementation for URLEntity. +func (ue URLEntity) AsSecurityAlert() (*SecurityAlert, bool) { return nil, false } -// AsRegistryValueEntity is the BasicEntity implementation for URLEntity. -func (ue URLEntity) AsRegistryValueEntity() (*RegistryValueEntity, bool) { +// AsSecurityGroupEntity is the BasicEntity implementation for URLEntity. +func (ue URLEntity) AsSecurityGroupEntity() (*SecurityGroupEntity, bool) { return nil, false } @@ -9515,23 +10611,23 @@ func (ue *URLEntity) UnmarshalJSON(body []byte) error { } ue.ID = &ID } - case "type": + case "name": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - ue.Type = &typeVar + ue.Name = &name } - case "name": + case "type": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - ue.Name = &name + ue.Type = &typeVar } case "kind": if v != nil { @@ -9552,10 +10648,10 @@ func (ue *URLEntity) UnmarshalJSON(body []byte) error { type URLEntityProperties struct { // URL - READ-ONLY; A full URL the entity points to URL *string `json:"url,omitempty"` - // 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. - FriendlyName *string `json:"friendlyName,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. + FriendlyName *string `json:"friendlyName,omitempty"` } // MarshalJSON is the custom marshaler for URLEntityProperties. @@ -9566,10 +10662,10 @@ func (uep URLEntityProperties) MarshalJSON() ([]byte, error) { // UserInfo user information that made some action type UserInfo struct { - // ObjectID - The object id of the user. - ObjectID *uuid.UUID `json:"objectId,omitempty"` // Email - READ-ONLY; The email of the user. Email *string `json:"email,omitempty"` // Name - READ-ONLY; The name of the user. Name *string `json:"name,omitempty"` + // ObjectID - The object id of the user. + ObjectID *uuid.UUID `json:"objectId,omitempty"` } diff --git a/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/securityinsightapi/interfaces.go b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/securityinsightapi/interfaces.go index 854841ce503f..9eb55b18db40 100644 --- a/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/securityinsightapi/interfaces.go +++ b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/securityinsightapi/interfaces.go @@ -33,11 +33,11 @@ var _ OperationsClientAPI = (*securityinsight.OperationsClient)(nil) // AlertRulesClientAPI contains the set of methods on the AlertRulesClient type. type AlertRulesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, ruleID string, alertRule securityinsight.BasicAlertRule) (result securityinsight.AlertRuleModel, err error) - CreateOrUpdateAction(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, ruleID string, actionID string, action securityinsight.Action) (result securityinsight.Action, err error) + CreateOrUpdateAction(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, ruleID string, actionID string, action securityinsight.ActionRequest) (result securityinsight.ActionResponse, err error) Delete(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, ruleID string) (result autorest.Response, err error) DeleteAction(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, ruleID string, actionID string) (result autorest.Response, err error) Get(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, ruleID string) (result securityinsight.AlertRuleModel, err error) - GetAction(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, ruleID string, actionID string) (result securityinsight.Action, err error) + GetAction(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, ruleID string, actionID string) (result securityinsight.ActionResponse, err error) List(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string) (result securityinsight.AlertRulesListPage, err error) } @@ -93,6 +93,26 @@ type BookmarksClientAPI interface { var _ BookmarksClientAPI = (*securityinsight.BookmarksClient)(nil) +// CaseRelationsClientAPI contains the set of methods on the CaseRelationsClient type. +type CaseRelationsClientAPI interface { + CreateOrUpdateRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, caseID string, relationName string, relationInputModel securityinsight.RelationsModelInput) (result securityinsight.CaseRelation, err error) + DeleteRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, caseID string, relationName string) (result autorest.Response, err error) + GetRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, caseID string, relationName string) (result securityinsight.CaseRelation, err error) + List(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, caseID string, filter string, orderby string, top *int32, skipToken string) (result securityinsight.CaseRelationListPage, err error) +} + +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) + 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) +} + +var _ BookmarkRelationsClientAPI = (*securityinsight.BookmarkRelationsClient)(nil) + // DataConnectorsClientAPI contains the set of methods on the DataConnectorsClient type. type DataConnectorsClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, dataConnectorID string, dataConnector securityinsight.BasicDataConnector) (result securityinsight.DataConnectorModel, err error) diff --git a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/applications.go b/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/applications.go deleted file mode 100644 index 6fa4e1a8c9a5..000000000000 --- a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/applications.go +++ /dev/null @@ -1,441 +0,0 @@ -package servicefabric - -// 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" -) - -// ApplicationsClient is the service Fabric Management Client -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. -func NewApplicationsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationsClient { - return ApplicationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create or update a Service Fabric application resource with the specified name. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationName - the name of the application resource. -// parameters - the application resource. -func (client ApplicationsClient) Create(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResource) (result ApplicationsCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.Create") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, applicationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client ApplicationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationName": autorest.Encode("path", applicationName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}", 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 ApplicationsClient) CreateSender(req *http.Request) (future ApplicationsCreateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 ApplicationsClient) CreateResponder(resp *http.Response) (result ApplicationResource, 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 -} - -// Delete delete a Service Fabric application resource with the specified name. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationName - the name of the application resource. -func (client ApplicationsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (result ApplicationsDeleteFuture, 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) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, applicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ApplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationName": autorest.Encode("path", applicationName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/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) (future ApplicationsDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 ApplicationsClient) 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 a Service Fabric application resource created or in the process of being created in the Service Fabric -// cluster resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationName - the name of the application resource. -func (client ApplicationsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (result ApplicationResource, 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) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, applicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.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, "servicefabric.ApplicationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationName": autorest.Encode("path", applicationName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ApplicationsClient) GetResponder(resp *http.Response) (result ApplicationResource, 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 application resources created or in the process of being created in the Service Fabric cluster -// resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -func (client ApplicationsClient) List(ctx context.Context, resourceGroupName string, clusterName string) (result ApplicationResourceList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.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, clusterName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationsClient) ListPreparer(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 = "2019-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.ServiceFabric/clusters/{clusterName}/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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ApplicationsClient) ListResponder(resp *http.Response) (result ApplicationResourceList, 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 Service Fabric application resource with the specified name. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationName - the name of the application resource. -// parameters - the application resource for patch operations. -func (client ApplicationsClient) Update(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResourceUpdate) (result ApplicationsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, applicationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ApplicationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResourceUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationName": autorest.Encode("path", applicationName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}", 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 ApplicationsClient) UpdateSender(req *http.Request) (future ApplicationsUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 ApplicationsClient) UpdateResponder(resp *http.Response) (result ApplicationResource, 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/servicefabric/mgmt/2019-03-01/servicefabric/applicationtypes.go b/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/applicationtypes.go deleted file mode 100644 index 6e7d97a9a721..000000000000 --- a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/applicationtypes.go +++ /dev/null @@ -1,359 +0,0 @@ -package servicefabric - -// 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" -) - -// ApplicationTypesClient is the service Fabric Management Client -type ApplicationTypesClient struct { - BaseClient -} - -// NewApplicationTypesClient creates an instance of the ApplicationTypesClient client. -func NewApplicationTypesClient(subscriptionID string) ApplicationTypesClient { - return NewApplicationTypesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewApplicationTypesClientWithBaseURI creates an instance of the ApplicationTypesClient client. -func NewApplicationTypesClientWithBaseURI(baseURI string, subscriptionID string) ApplicationTypesClient { - return ApplicationTypesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create or update a Service Fabric application type name resource with the specified name. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationTypeName - the name of the application type name resource. -// parameters - the application type name resource. -func (client ApplicationTypesClient) Create(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, parameters ApplicationTypeResource) (result ApplicationTypeResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationTypesClient.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, clusterName, applicationTypeName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypesClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypesClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypesClient", "Create", resp, "Failure responding to request") - } - - return -} - -// CreatePreparer prepares the Create request. -func (client ApplicationTypesClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, parameters ApplicationTypeResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationTypeName": autorest.Encode("path", applicationTypeName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}", 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 ApplicationTypesClient) CreateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client ApplicationTypesClient) CreateResponder(resp *http.Response) (result ApplicationTypeResource, 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 delete a Service Fabric application type name resource with the specified name. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationTypeName - the name of the application type name resource. -func (client ApplicationTypesClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string) (result ApplicationTypesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationTypesClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, applicationTypeName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ApplicationTypesClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationTypeName": autorest.Encode("path", applicationTypeName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}", 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 ApplicationTypesClient) DeleteSender(req *http.Request) (future ApplicationTypesDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 ApplicationTypesClient) 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 a Service Fabric application type name resource created or in the process of being created in the Service -// Fabric cluster resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationTypeName - the name of the application type name resource. -func (client ApplicationTypesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string) (result ApplicationTypeResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationTypesClient.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, clusterName, applicationTypeName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationTypesClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationTypeName": autorest.Encode("path", applicationTypeName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}", 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 ApplicationTypesClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ApplicationTypesClient) GetResponder(resp *http.Response) (result ApplicationTypeResource, 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 application type name resources created or in the process of being created in the Service Fabric -// cluster resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -func (client ApplicationTypesClient) List(ctx context.Context, resourceGroupName string, clusterName string) (result ApplicationTypeResourceList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationTypesClient.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, clusterName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypesClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationTypesClient) ListPreparer(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 = "2019-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.ServiceFabric/clusters/{clusterName}/applicationTypes", 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 ApplicationTypesClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ApplicationTypesClient) ListResponder(resp *http.Response) (result ApplicationTypeResourceList, 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/servicefabric/mgmt/2019-03-01/servicefabric/applicationtypeversions.go b/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/applicationtypeversions.go deleted file mode 100644 index b9a1c3476dc9..000000000000 --- a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/applicationtypeversions.go +++ /dev/null @@ -1,375 +0,0 @@ -package servicefabric - -// 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" -) - -// ApplicationTypeVersionsClient is the service Fabric Management Client -type ApplicationTypeVersionsClient struct { - BaseClient -} - -// NewApplicationTypeVersionsClient creates an instance of the ApplicationTypeVersionsClient client. -func NewApplicationTypeVersionsClient(subscriptionID string) ApplicationTypeVersionsClient { - return NewApplicationTypeVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewApplicationTypeVersionsClientWithBaseURI creates an instance of the ApplicationTypeVersionsClient client. -func NewApplicationTypeVersionsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationTypeVersionsClient { - return ApplicationTypeVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create or update a Service Fabric application type version resource with the specified name. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationTypeName - the name of the application type name resource. -// version - the application type version. -// parameters - the application type version resource. -func (client ApplicationTypeVersionsClient) Create(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, parameters ApplicationTypeVersionResource) (result ApplicationTypeVersionsCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationTypeVersionsClient.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: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ApplicationTypeVersionResourceProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationTypeVersionResourceProperties.AppPackageURL", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("servicefabric.ApplicationTypeVersionsClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, applicationTypeName, version, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeVersionsClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeVersionsClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client ApplicationTypeVersionsClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, parameters ApplicationTypeVersionResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationTypeName": autorest.Encode("path", applicationTypeName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "version": autorest.Encode("path", version), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}", 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 ApplicationTypeVersionsClient) CreateSender(req *http.Request) (future ApplicationTypeVersionsCreateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 ApplicationTypeVersionsClient) CreateResponder(resp *http.Response) (result ApplicationTypeVersionResource, 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 -} - -// Delete delete a Service Fabric application type version resource with the specified name. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationTypeName - the name of the application type name resource. -// version - the application type version. -func (client ApplicationTypeVersionsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string) (result ApplicationTypeVersionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationTypeVersionsClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, applicationTypeName, version) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeVersionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeVersionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ApplicationTypeVersionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationTypeName": autorest.Encode("path", applicationTypeName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "version": autorest.Encode("path", version), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}", 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 ApplicationTypeVersionsClient) DeleteSender(req *http.Request) (future ApplicationTypeVersionsDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 ApplicationTypeVersionsClient) 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 a Service Fabric application type version resource created or in the process of being created in the Service -// Fabric application type name resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationTypeName - the name of the application type name resource. -// version - the application type version. -func (client ApplicationTypeVersionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string) (result ApplicationTypeVersionResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationTypeVersionsClient.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, clusterName, applicationTypeName, version) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeVersionsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationTypeVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationTypeName": autorest.Encode("path", applicationTypeName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "version": autorest.Encode("path", version), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}", 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 ApplicationTypeVersionsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ApplicationTypeVersionsClient) GetResponder(resp *http.Response) (result ApplicationTypeVersionResource, 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 application type version resources created or in the process of being created in the Service Fabric -// application type name resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationTypeName - the name of the application type name resource. -func (client ApplicationTypeVersionsClient) List(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string) (result ApplicationTypeVersionResourceList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationTypeVersionsClient.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, clusterName, applicationTypeName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeVersionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeVersionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeVersionsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationTypeVersionsClient) ListPreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationTypeName": autorest.Encode("path", applicationTypeName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions", 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 ApplicationTypeVersionsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ApplicationTypeVersionsClient) ListResponder(resp *http.Response) (result ApplicationTypeVersionResourceList, 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/servicefabric/mgmt/2019-03-01/servicefabric/client.go b/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/client.go deleted file mode 100644 index 0563316480f8..000000000000 --- a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/client.go +++ /dev/null @@ -1,51 +0,0 @@ -// Package servicefabric implements the Azure ARM Servicefabric service API version 2019-03-01-preview. -// -// Service Fabric Management Client -package servicefabric - -// 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 Servicefabric - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Servicefabric. -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. -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} diff --git a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/clusters.go b/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/clusters.go deleted file mode 100644 index 82e30df9d6d1..000000000000 --- a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/clusters.go +++ /dev/null @@ -1,557 +0,0 @@ -package servicefabric - -// 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 service Fabric Management 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. -func NewClustersClientWithBaseURI(baseURI string, subscriptionID string) ClustersClient { - return ClustersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create or update a Service Fabric cluster resource with the specified name. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// parameters - the cluster resource. -func (client ClustersClient) Create(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster) (result ClustersCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.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: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ClusterProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.Certificate", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.Certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.StorageAccountName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.ProtectedAccountKeyName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.BlobEndpoint", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.QueueEndpoint", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.TableEndpoint", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.ClusterProperties.ManagementEndpoint", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterProperties.NodeTypes", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterProperties.ReverseProxyCertificate", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.ReverseProxyCertificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.ClusterProperties.UpgradeDescription", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.UpgradeReplicaSetCheckTimeout", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterProperties.UpgradeDescription.HealthCheckWaitDuration", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterProperties.UpgradeDescription.HealthCheckStableDuration", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterProperties.UpgradeDescription.HealthCheckRetryTimeout", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterProperties.UpgradeDescription.UpgradeTimeout", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterProperties.UpgradeDescription.UpgradeDomainTimeout", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyNodes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}, - {Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyApplications", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyApplications", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyApplications", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}, - }}, - {Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}, - {Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}, - {Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyApplications", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyApplications", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyApplications", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("servicefabric.ClustersClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client ClustersClient) CreatePreparer(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 = "2019-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.ServiceFabric/clusters/{clusterName}", 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 ClustersClient) CreateSender(req *http.Request) (future ClustersCreateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 ClustersClient) CreateResponder(resp *http.Response) (result Cluster, 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 -} - -// Delete delete a Service Fabric cluster resource with the specified name. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -func (client ClustersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string) (result autorest.Response, 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) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Delete", resp, "Failure responding to request") - } - - 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 = "2019-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.ServiceFabric/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) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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 get a Service Fabric cluster resource created or in the process of being created in the specified resource -// group. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -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) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, clusterName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.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, "servicefabric.ClustersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.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 = "2019-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.ServiceFabric/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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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 all Service Fabric cluster resources created or in the process of being created in the subscription. -func (client ClustersClient) List(ctx context.Context) (result ClusterListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.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, "servicefabric.ClustersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.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 = "2019-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.ServiceFabric/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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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 -} - -// ListByResourceGroup gets all Service Fabric cluster resources created or in the process of being created in the -// resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ClusterListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.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 = "2019-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.ServiceFabric/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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// 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 -} - -// Update update the configuration of a Service Fabric cluster resource with the specified name. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// parameters - the parameters which contains the property value and property name which used to update the -// cluster configuration. -func (client ClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdateParameters) (result ClustersUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdateParameters) (*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 = "2019-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.ServiceFabric/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) (future ClustersUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 ClustersClient) UpdateResponder(resp *http.Response) (result Cluster, 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/servicefabric/mgmt/2019-03-01/servicefabric/clusterversions.go b/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/clusterversions.go deleted file mode 100644 index 4bf841f027bc..000000000000 --- a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/clusterversions.go +++ /dev/null @@ -1,349 +0,0 @@ -package servicefabric - -// 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" -) - -// ClusterVersionsClient is the service Fabric Management Client -type ClusterVersionsClient struct { - BaseClient -} - -// NewClusterVersionsClient creates an instance of the ClusterVersionsClient client. -func NewClusterVersionsClient(subscriptionID string) ClusterVersionsClient { - return NewClusterVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewClusterVersionsClientWithBaseURI creates an instance of the ClusterVersionsClient client. -func NewClusterVersionsClientWithBaseURI(baseURI string, subscriptionID string) ClusterVersionsClient { - return ClusterVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets information about an available Service Fabric cluster code version. -// Parameters: -// location - the location for the cluster code versions. This is different from cluster location. -// clusterVersion - the cluster code version. -func (client ClusterVersionsClient) Get(ctx context.Context, location string, clusterVersion string) (result ClusterCodeVersionsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClusterVersionsClient.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, clusterVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ClusterVersionsClient) GetPreparer(ctx context.Context, location string, clusterVersion string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "clusterVersion": autorest.Encode("path", clusterVersion), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}", 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 ClusterVersionsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ClusterVersionsClient) GetResponder(resp *http.Response) (result ClusterCodeVersionsListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetByEnvironment gets information about an available Service Fabric cluster code version by environment. -// Parameters: -// location - the location for the cluster code versions. This is different from cluster location. -// environment - the operating system of the cluster. The default means all. -// clusterVersion - the cluster code version. -func (client ClusterVersionsClient) GetByEnvironment(ctx context.Context, location string, environment string, clusterVersion string) (result ClusterCodeVersionsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClusterVersionsClient.GetByEnvironment") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetByEnvironmentPreparer(ctx, location, environment, clusterVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "GetByEnvironment", nil, "Failure preparing request") - return - } - - resp, err := client.GetByEnvironmentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "GetByEnvironment", resp, "Failure sending request") - return - } - - result, err = client.GetByEnvironmentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "GetByEnvironment", resp, "Failure responding to request") - } - - return -} - -// GetByEnvironmentPreparer prepares the GetByEnvironment request. -func (client ClusterVersionsClient) GetByEnvironmentPreparer(ctx context.Context, location string, environment string, clusterVersion string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "clusterVersion": autorest.Encode("path", clusterVersion), - "environment": autorest.Encode("path", environment), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetByEnvironmentSender sends the GetByEnvironment request. The method will close the -// http.Response Body if it receives an error. -func (client ClusterVersionsClient) GetByEnvironmentSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetByEnvironmentResponder handles the response to the GetByEnvironment request. The method always -// closes the http.Response Body. -func (client ClusterVersionsClient) GetByEnvironmentResponder(resp *http.Response) (result ClusterCodeVersionsListResult, 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 available code versions for Service Fabric cluster resources by location. -// Parameters: -// location - the location for the cluster code versions. This is different from cluster location. -func (client ClusterVersionsClient) List(ctx context.Context, location string) (result ClusterCodeVersionsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClusterVersionsClient.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, location) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ClusterVersionsClient) 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 = "2019-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.ServiceFabric/locations/{location}/clusterVersions", 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 ClusterVersionsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ClusterVersionsClient) ListResponder(resp *http.Response) (result ClusterCodeVersionsListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByEnvironment gets all available code versions for Service Fabric cluster resources by environment. -// Parameters: -// location - the location for the cluster code versions. This is different from cluster location. -// environment - the operating system of the cluster. The default means all. -func (client ClusterVersionsClient) ListByEnvironment(ctx context.Context, location string, environment string) (result ClusterCodeVersionsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClusterVersionsClient.ListByEnvironment") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListByEnvironmentPreparer(ctx, location, environment) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "ListByEnvironment", nil, "Failure preparing request") - return - } - - resp, err := client.ListByEnvironmentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "ListByEnvironment", resp, "Failure sending request") - return - } - - result, err = client.ListByEnvironmentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "ListByEnvironment", resp, "Failure responding to request") - } - - return -} - -// ListByEnvironmentPreparer prepares the ListByEnvironment request. -func (client ClusterVersionsClient) ListByEnvironmentPreparer(ctx context.Context, location string, environment string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "environment": autorest.Encode("path", environment), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByEnvironmentSender sends the ListByEnvironment request. The method will close the -// http.Response Body if it receives an error. -func (client ClusterVersionsClient) ListByEnvironmentSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByEnvironmentResponder handles the response to the ListByEnvironment request. The method always -// closes the http.Response Body. -func (client ClusterVersionsClient) ListByEnvironmentResponder(resp *http.Response) (result ClusterCodeVersionsListResult, 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/servicefabric/mgmt/2019-03-01/servicefabric/models.go b/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/models.go deleted file mode 100644 index 9543b19621a2..000000000000 --- a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/models.go +++ /dev/null @@ -1,4239 +0,0 @@ -package servicefabric - -// 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/servicefabric/mgmt/2019-03-01/servicefabric" - -// ArmServicePackageActivationMode enumerates the values for arm service package activation mode. -type ArmServicePackageActivationMode string - -const ( - // ExclusiveProcess Indicates the application package activation mode will use exclusive process. - ExclusiveProcess ArmServicePackageActivationMode = "ExclusiveProcess" - // SharedProcess Indicates the application package activation mode will use shared process. - SharedProcess ArmServicePackageActivationMode = "SharedProcess" -) - -// PossibleArmServicePackageActivationModeValues returns an array of possible values for the ArmServicePackageActivationMode const type. -func PossibleArmServicePackageActivationModeValues() []ArmServicePackageActivationMode { - return []ArmServicePackageActivationMode{ExclusiveProcess, SharedProcess} -} - -// ArmUpgradeFailureAction enumerates the values for arm upgrade failure action. -type ArmUpgradeFailureAction string - -const ( - // Manual Indicates that a manual repair will need to be performed by the administrator if the upgrade - // fails. Service Fabric will not proceed to the next upgrade domain automatically. - Manual ArmUpgradeFailureAction = "Manual" - // Rollback Indicates that a rollback of the upgrade will be performed by Service Fabric if the upgrade - // fails. - Rollback ArmUpgradeFailureAction = "Rollback" -) - -// PossibleArmUpgradeFailureActionValues returns an array of possible values for the ArmUpgradeFailureAction const type. -func PossibleArmUpgradeFailureActionValues() []ArmUpgradeFailureAction { - return []ArmUpgradeFailureAction{Manual, Rollback} -} - -// ClusterState enumerates the values for cluster state. -type ClusterState string - -const ( - // AutoScale ... - AutoScale ClusterState = "AutoScale" - // BaselineUpgrade ... - BaselineUpgrade ClusterState = "BaselineUpgrade" - // Deploying ... - Deploying ClusterState = "Deploying" - // EnforcingClusterVersion ... - EnforcingClusterVersion ClusterState = "EnforcingClusterVersion" - // Ready ... - Ready ClusterState = "Ready" - // UpdatingInfrastructure ... - UpdatingInfrastructure ClusterState = "UpdatingInfrastructure" - // UpdatingUserCertificate ... - UpdatingUserCertificate ClusterState = "UpdatingUserCertificate" - // UpdatingUserConfiguration ... - UpdatingUserConfiguration ClusterState = "UpdatingUserConfiguration" - // UpgradeServiceUnreachable ... - UpgradeServiceUnreachable ClusterState = "UpgradeServiceUnreachable" - // WaitingForNodes ... - WaitingForNodes ClusterState = "WaitingForNodes" -) - -// PossibleClusterStateValues returns an array of possible values for the ClusterState const type. -func PossibleClusterStateValues() []ClusterState { - return []ClusterState{AutoScale, BaselineUpgrade, Deploying, EnforcingClusterVersion, Ready, UpdatingInfrastructure, UpdatingUserCertificate, UpdatingUserConfiguration, UpgradeServiceUnreachable, WaitingForNodes} -} - -// DurabilityLevel enumerates the values for durability level. -type DurabilityLevel string - -const ( - // Bronze ... - Bronze DurabilityLevel = "Bronze" - // Gold ... - Gold DurabilityLevel = "Gold" - // Silver ... - Silver DurabilityLevel = "Silver" -) - -// PossibleDurabilityLevelValues returns an array of possible values for the DurabilityLevel const type. -func PossibleDurabilityLevelValues() []DurabilityLevel { - return []DurabilityLevel{Bronze, Gold, Silver} -} - -// Environment enumerates the values for environment. -type Environment string - -const ( - // Linux ... - Linux Environment = "Linux" - // Windows ... - Windows Environment = "Windows" -) - -// PossibleEnvironmentValues returns an array of possible values for the Environment const type. -func PossibleEnvironmentValues() []Environment { - return []Environment{Linux, Windows} -} - -// MoveCost enumerates the values for move cost. -type MoveCost string - -const ( - // High Specifies the move cost of the service as High. The value is 3. - High MoveCost = "High" - // Low Specifies the move cost of the service as Low. The value is 1. - Low MoveCost = "Low" - // Medium Specifies the move cost of the service as Medium. The value is 2. - Medium MoveCost = "Medium" - // Zero Zero move cost. This value is zero. - Zero MoveCost = "Zero" -) - -// PossibleMoveCostValues returns an array of possible values for the MoveCost const type. -func PossibleMoveCostValues() []MoveCost { - return []MoveCost{High, Low, Medium, Zero} -} - -// PartitionScheme enumerates the values for partition scheme. -type PartitionScheme string - -const ( - // Invalid Indicates the partition kind is invalid. All Service Fabric enumerations have the invalid type. - // The value is zero. - Invalid PartitionScheme = "Invalid" - // Named Indicates that the partition is based on string names, and is a NamedPartitionSchemeDescription - // object. The value is 3 - Named PartitionScheme = "Named" - // Singleton Indicates that the partition is based on string names, and is a - // SingletonPartitionSchemeDescription object, The value is 1. - Singleton PartitionScheme = "Singleton" - // UniformInt64Range Indicates that the partition is based on Int64 key ranges, and is a - // UniformInt64RangePartitionSchemeDescription object. The value is 2. - UniformInt64Range PartitionScheme = "UniformInt64Range" -) - -// PossiblePartitionSchemeValues returns an array of possible values for the PartitionScheme const type. -func PossiblePartitionSchemeValues() []PartitionScheme { - return []PartitionScheme{Invalid, Named, Singleton, UniformInt64Range} -} - -// PartitionSchemeBasicPartitionSchemeDescription enumerates the values for partition scheme basic partition -// scheme description. -type PartitionSchemeBasicPartitionSchemeDescription string - -const ( - // PartitionSchemeNamed ... - PartitionSchemeNamed PartitionSchemeBasicPartitionSchemeDescription = "Named" - // PartitionSchemePartitionSchemeDescription ... - PartitionSchemePartitionSchemeDescription PartitionSchemeBasicPartitionSchemeDescription = "PartitionSchemeDescription" - // PartitionSchemeSingleton ... - PartitionSchemeSingleton PartitionSchemeBasicPartitionSchemeDescription = "Singleton" - // PartitionSchemeUniformInt64Range ... - PartitionSchemeUniformInt64Range PartitionSchemeBasicPartitionSchemeDescription = "UniformInt64Range" -) - -// PossiblePartitionSchemeBasicPartitionSchemeDescriptionValues returns an array of possible values for the PartitionSchemeBasicPartitionSchemeDescription const type. -func PossiblePartitionSchemeBasicPartitionSchemeDescriptionValues() []PartitionSchemeBasicPartitionSchemeDescription { - return []PartitionSchemeBasicPartitionSchemeDescription{PartitionSchemeNamed, PartitionSchemePartitionSchemeDescription, PartitionSchemeSingleton, PartitionSchemeUniformInt64Range} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // Canceled ... - Canceled ProvisioningState = "Canceled" - // 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{Canceled, Failed, Succeeded, Updating} -} - -// ReliabilityLevel enumerates the values for reliability level. -type ReliabilityLevel string - -const ( - // ReliabilityLevelBronze ... - ReliabilityLevelBronze ReliabilityLevel = "Bronze" - // ReliabilityLevelGold ... - ReliabilityLevelGold ReliabilityLevel = "Gold" - // ReliabilityLevelNone ... - ReliabilityLevelNone ReliabilityLevel = "None" - // ReliabilityLevelPlatinum ... - ReliabilityLevelPlatinum ReliabilityLevel = "Platinum" - // ReliabilityLevelSilver ... - ReliabilityLevelSilver ReliabilityLevel = "Silver" -) - -// PossibleReliabilityLevelValues returns an array of possible values for the ReliabilityLevel const type. -func PossibleReliabilityLevelValues() []ReliabilityLevel { - return []ReliabilityLevel{ReliabilityLevelBronze, ReliabilityLevelGold, ReliabilityLevelNone, ReliabilityLevelPlatinum, ReliabilityLevelSilver} -} - -// ReliabilityLevel1 enumerates the values for reliability level 1. -type ReliabilityLevel1 string - -const ( - // ReliabilityLevel1Bronze ... - ReliabilityLevel1Bronze ReliabilityLevel1 = "Bronze" - // ReliabilityLevel1Gold ... - ReliabilityLevel1Gold ReliabilityLevel1 = "Gold" - // ReliabilityLevel1None ... - ReliabilityLevel1None ReliabilityLevel1 = "None" - // ReliabilityLevel1Platinum ... - ReliabilityLevel1Platinum ReliabilityLevel1 = "Platinum" - // ReliabilityLevel1Silver ... - ReliabilityLevel1Silver ReliabilityLevel1 = "Silver" -) - -// PossibleReliabilityLevel1Values returns an array of possible values for the ReliabilityLevel1 const type. -func PossibleReliabilityLevel1Values() []ReliabilityLevel1 { - return []ReliabilityLevel1{ReliabilityLevel1Bronze, ReliabilityLevel1Gold, ReliabilityLevel1None, ReliabilityLevel1Platinum, ReliabilityLevel1Silver} -} - -// ServiceCorrelationScheme enumerates the values for service correlation scheme. -type ServiceCorrelationScheme string - -const ( - // ServiceCorrelationSchemeAffinity Indicates that this service has an affinity relationship with another - // service. Provided for backwards compatibility, consider preferring the Aligned or NonAlignedAffinity - // options. The value is 1. - ServiceCorrelationSchemeAffinity ServiceCorrelationScheme = "Affinity" - // ServiceCorrelationSchemeAlignedAffinity Aligned affinity ensures that the primaries of the partitions of - // the affinitized services are collocated on the same nodes. This is the default and is the same as - // selecting the Affinity scheme. The value is 2. - ServiceCorrelationSchemeAlignedAffinity ServiceCorrelationScheme = "AlignedAffinity" - // ServiceCorrelationSchemeInvalid An invalid correlation scheme. Cannot be used. The value is zero. - ServiceCorrelationSchemeInvalid ServiceCorrelationScheme = "Invalid" - // ServiceCorrelationSchemeNonAlignedAffinity Non-Aligned affinity guarantees that all replicas of each - // service will be placed on the same nodes. Unlike Aligned Affinity, this does not guarantee that replicas - // of particular role will be collocated. The value is 3. - ServiceCorrelationSchemeNonAlignedAffinity ServiceCorrelationScheme = "NonAlignedAffinity" -) - -// PossibleServiceCorrelationSchemeValues returns an array of possible values for the ServiceCorrelationScheme const type. -func PossibleServiceCorrelationSchemeValues() []ServiceCorrelationScheme { - return []ServiceCorrelationScheme{ServiceCorrelationSchemeAffinity, ServiceCorrelationSchemeAlignedAffinity, ServiceCorrelationSchemeInvalid, ServiceCorrelationSchemeNonAlignedAffinity} -} - -// ServiceKind enumerates the values for service kind. -type ServiceKind string - -const ( - // ServiceKindInvalid Indicates the service kind is invalid. All Service Fabric enumerations have the - // invalid type. The value is zero. - ServiceKindInvalid ServiceKind = "Invalid" - // ServiceKindStateful Uses Service Fabric to make its state or part of its state highly available and - // reliable. The value is 2. - ServiceKindStateful ServiceKind = "Stateful" - // ServiceKindStateless Does not use Service Fabric to make its state highly available or reliable. The - // value is 1. - ServiceKindStateless ServiceKind = "Stateless" -) - -// PossibleServiceKindValues returns an array of possible values for the ServiceKind const type. -func PossibleServiceKindValues() []ServiceKind { - return []ServiceKind{ServiceKindInvalid, ServiceKindStateful, ServiceKindStateless} -} - -// ServiceKindBasicServiceResourceProperties enumerates the values for service kind basic service resource -// properties. -type ServiceKindBasicServiceResourceProperties string - -const ( - // ServiceKindServiceResourceProperties ... - ServiceKindServiceResourceProperties ServiceKindBasicServiceResourceProperties = "ServiceResourceProperties" - // ServiceKindStateful1 ... - ServiceKindStateful1 ServiceKindBasicServiceResourceProperties = "Stateful" - // ServiceKindStateless1 ... - ServiceKindStateless1 ServiceKindBasicServiceResourceProperties = "Stateless" -) - -// PossibleServiceKindBasicServiceResourcePropertiesValues returns an array of possible values for the ServiceKindBasicServiceResourceProperties const type. -func PossibleServiceKindBasicServiceResourcePropertiesValues() []ServiceKindBasicServiceResourceProperties { - return []ServiceKindBasicServiceResourceProperties{ServiceKindServiceResourceProperties, ServiceKindStateful1, ServiceKindStateless1} -} - -// ServiceKindBasicServiceResourceUpdateProperties enumerates the values for service kind basic service -// resource update properties. -type ServiceKindBasicServiceResourceUpdateProperties string - -const ( - // ServiceKindBasicServiceResourceUpdatePropertiesServiceKindServiceResourceUpdateProperties ... - ServiceKindBasicServiceResourceUpdatePropertiesServiceKindServiceResourceUpdateProperties ServiceKindBasicServiceResourceUpdateProperties = "ServiceResourceUpdateProperties" - // ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateful ... - ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateful ServiceKindBasicServiceResourceUpdateProperties = "Stateful" - // ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateless ... - ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateless ServiceKindBasicServiceResourceUpdateProperties = "Stateless" -) - -// PossibleServiceKindBasicServiceResourceUpdatePropertiesValues returns an array of possible values for the ServiceKindBasicServiceResourceUpdateProperties const type. -func PossibleServiceKindBasicServiceResourceUpdatePropertiesValues() []ServiceKindBasicServiceResourceUpdateProperties { - return []ServiceKindBasicServiceResourceUpdateProperties{ServiceKindBasicServiceResourceUpdatePropertiesServiceKindServiceResourceUpdateProperties, ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateful, ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateless} -} - -// ServiceLoadMetricWeight enumerates the values for service load metric weight. -type ServiceLoadMetricWeight string - -const ( - // ServiceLoadMetricWeightHigh Specifies the metric weight of the service load as High. The value is 3. - ServiceLoadMetricWeightHigh ServiceLoadMetricWeight = "High" - // ServiceLoadMetricWeightLow Specifies the metric weight of the service load as Low. The value is 1. - ServiceLoadMetricWeightLow ServiceLoadMetricWeight = "Low" - // ServiceLoadMetricWeightMedium Specifies the metric weight of the service load as Medium. The value is 2. - ServiceLoadMetricWeightMedium ServiceLoadMetricWeight = "Medium" - // ServiceLoadMetricWeightZero Disables resource balancing for this metric. This value is zero. - ServiceLoadMetricWeightZero ServiceLoadMetricWeight = "Zero" -) - -// PossibleServiceLoadMetricWeightValues returns an array of possible values for the ServiceLoadMetricWeight const type. -func PossibleServiceLoadMetricWeightValues() []ServiceLoadMetricWeight { - return []ServiceLoadMetricWeight{ServiceLoadMetricWeightHigh, ServiceLoadMetricWeightLow, ServiceLoadMetricWeightMedium, ServiceLoadMetricWeightZero} -} - -// ServicePlacementPolicyType enumerates the values for service placement policy type. -type ServicePlacementPolicyType string - -const ( - // ServicePlacementPolicyTypeInvalid Indicates the type of the placement policy is invalid. All Service - // Fabric enumerations have the invalid type. The value is zero. - ServicePlacementPolicyTypeInvalid ServicePlacementPolicyType = "Invalid" - // ServicePlacementPolicyTypeInvalidDomain Indicates that the ServicePlacementPolicyDescription is of type - // ServicePlacementInvalidDomainPolicyDescription, which indicates that a particular fault or upgrade - // domain cannot be used for placement of this service. The value is 1. - ServicePlacementPolicyTypeInvalidDomain ServicePlacementPolicyType = "InvalidDomain" - // ServicePlacementPolicyTypeNonPartiallyPlaceService Indicates that the ServicePlacementPolicyDescription - // is of type ServicePlacementNonPartiallyPlaceServicePolicyDescription, which indicates that if possible - // all replicas of a particular partition of the service should be placed atomically. The value is 5. - ServicePlacementPolicyTypeNonPartiallyPlaceService ServicePlacementPolicyType = "NonPartiallyPlaceService" - // ServicePlacementPolicyTypePreferredPrimaryDomain Indicates that the ServicePlacementPolicyDescription is - // of type ServicePlacementPreferPrimaryDomainPolicyDescription, which indicates that if possible the - // Primary replica for the partitions of the service should be located in a particular domain as an - // optimization. The value is 3. - ServicePlacementPolicyTypePreferredPrimaryDomain ServicePlacementPolicyType = "PreferredPrimaryDomain" - // ServicePlacementPolicyTypeRequiredDomain Indicates that the ServicePlacementPolicyDescription is of type - // ServicePlacementRequireDomainDistributionPolicyDescription indicating that the replicas of the service - // must be placed in a specific domain. The value is 2. - ServicePlacementPolicyTypeRequiredDomain ServicePlacementPolicyType = "RequiredDomain" - // ServicePlacementPolicyTypeRequiredDomainDistribution Indicates that the - // ServicePlacementPolicyDescription is of type ServicePlacementRequireDomainDistributionPolicyDescription, - // indicating that the system will disallow placement of any two replicas from the same partition in the - // same domain at any time. The value is 4. - ServicePlacementPolicyTypeRequiredDomainDistribution ServicePlacementPolicyType = "RequiredDomainDistribution" -) - -// PossibleServicePlacementPolicyTypeValues returns an array of possible values for the ServicePlacementPolicyType const type. -func PossibleServicePlacementPolicyTypeValues() []ServicePlacementPolicyType { - return []ServicePlacementPolicyType{ServicePlacementPolicyTypeInvalid, ServicePlacementPolicyTypeInvalidDomain, ServicePlacementPolicyTypeNonPartiallyPlaceService, ServicePlacementPolicyTypePreferredPrimaryDomain, ServicePlacementPolicyTypeRequiredDomain, ServicePlacementPolicyTypeRequiredDomainDistribution} -} - -// Type enumerates the values for type. -type Type string - -const ( - // TypeServicePlacementPolicyDescription ... - TypeServicePlacementPolicyDescription Type = "ServicePlacementPolicyDescription" -) - -// PossibleTypeValues returns an array of possible values for the Type const type. -func PossibleTypeValues() []Type { - return []Type{TypeServicePlacementPolicyDescription} -} - -// UpgradeMode enumerates the values for upgrade mode. -type UpgradeMode string - -const ( - // UpgradeModeAutomatic ... - UpgradeModeAutomatic UpgradeMode = "Automatic" - // UpgradeModeManual ... - UpgradeModeManual UpgradeMode = "Manual" -) - -// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type. -func PossibleUpgradeModeValues() []UpgradeMode { - return []UpgradeMode{UpgradeModeAutomatic, UpgradeModeManual} -} - -// UpgradeMode1 enumerates the values for upgrade mode 1. -type UpgradeMode1 string - -const ( - // UpgradeMode1Automatic ... - UpgradeMode1Automatic UpgradeMode1 = "Automatic" - // UpgradeMode1Manual ... - UpgradeMode1Manual UpgradeMode1 = "Manual" -) - -// PossibleUpgradeMode1Values returns an array of possible values for the UpgradeMode1 const type. -func PossibleUpgradeMode1Values() []UpgradeMode1 { - return []UpgradeMode1{UpgradeMode1Automatic, UpgradeMode1Manual} -} - -// X509StoreName enumerates the values for x509 store name. -type X509StoreName string - -const ( - // AddressBook ... - AddressBook X509StoreName = "AddressBook" - // AuthRoot ... - AuthRoot X509StoreName = "AuthRoot" - // CertificateAuthority ... - CertificateAuthority X509StoreName = "CertificateAuthority" - // Disallowed ... - Disallowed X509StoreName = "Disallowed" - // My ... - My X509StoreName = "My" - // Root ... - Root X509StoreName = "Root" - // TrustedPeople ... - TrustedPeople X509StoreName = "TrustedPeople" - // TrustedPublisher ... - TrustedPublisher X509StoreName = "TrustedPublisher" -) - -// PossibleX509StoreNameValues returns an array of possible values for the X509StoreName const type. -func PossibleX509StoreNameValues() []X509StoreName { - return []X509StoreName{AddressBook, AuthRoot, CertificateAuthority, Disallowed, My, Root, TrustedPeople, TrustedPublisher} -} - -// X509StoreName1 enumerates the values for x509 store name 1. -type X509StoreName1 string - -const ( - // X509StoreName1AddressBook ... - X509StoreName1AddressBook X509StoreName1 = "AddressBook" - // X509StoreName1AuthRoot ... - X509StoreName1AuthRoot X509StoreName1 = "AuthRoot" - // X509StoreName1CertificateAuthority ... - X509StoreName1CertificateAuthority X509StoreName1 = "CertificateAuthority" - // X509StoreName1Disallowed ... - X509StoreName1Disallowed X509StoreName1 = "Disallowed" - // X509StoreName1My ... - X509StoreName1My X509StoreName1 = "My" - // X509StoreName1Root ... - X509StoreName1Root X509StoreName1 = "Root" - // X509StoreName1TrustedPeople ... - X509StoreName1TrustedPeople X509StoreName1 = "TrustedPeople" - // X509StoreName1TrustedPublisher ... - X509StoreName1TrustedPublisher X509StoreName1 = "TrustedPublisher" -) - -// PossibleX509StoreName1Values returns an array of possible values for the X509StoreName1 const type. -func PossibleX509StoreName1Values() []X509StoreName1 { - return []X509StoreName1{X509StoreName1AddressBook, X509StoreName1AuthRoot, X509StoreName1CertificateAuthority, X509StoreName1Disallowed, X509StoreName1My, X509StoreName1Root, X509StoreName1TrustedPeople, X509StoreName1TrustedPublisher} -} - -// ApplicationDeltaHealthPolicy defines a delta health policy used to evaluate the health of an application -// or one of its child entities when upgrading the cluster. -type ApplicationDeltaHealthPolicy struct { - // DefaultServiceTypeDeltaHealthPolicy - The delta health policy used by default to evaluate the health of a service type when upgrading the cluster. - DefaultServiceTypeDeltaHealthPolicy *ServiceTypeDeltaHealthPolicy `json:"defaultServiceTypeDeltaHealthPolicy,omitempty"` - // ServiceTypeDeltaHealthPolicies - The map with service type delta health policy per service type name. The map is empty by default. - ServiceTypeDeltaHealthPolicies map[string]*ServiceTypeDeltaHealthPolicy `json:"serviceTypeDeltaHealthPolicies"` -} - -// MarshalJSON is the custom marshaler for ApplicationDeltaHealthPolicy. -func (adhp ApplicationDeltaHealthPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if adhp.DefaultServiceTypeDeltaHealthPolicy != nil { - objectMap["defaultServiceTypeDeltaHealthPolicy"] = adhp.DefaultServiceTypeDeltaHealthPolicy - } - if adhp.ServiceTypeDeltaHealthPolicies != nil { - objectMap["serviceTypeDeltaHealthPolicies"] = adhp.ServiceTypeDeltaHealthPolicies - } - return json.Marshal(objectMap) -} - -// ApplicationHealthPolicy defines a health policy used to evaluate the health of an application or one of -// its children entities. -type ApplicationHealthPolicy struct { - // DefaultServiceTypeHealthPolicy - The health policy used by default to evaluate the health of a service type. - DefaultServiceTypeHealthPolicy *ServiceTypeHealthPolicy `json:"defaultServiceTypeHealthPolicy,omitempty"` - // ServiceTypeHealthPolicies - The map with service type health policy per service type name. The map is empty by default. - ServiceTypeHealthPolicies map[string]*ServiceTypeHealthPolicy `json:"serviceTypeHealthPolicies"` -} - -// MarshalJSON is the custom marshaler for ApplicationHealthPolicy. -func (ahp ApplicationHealthPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ahp.DefaultServiceTypeHealthPolicy != nil { - objectMap["defaultServiceTypeHealthPolicy"] = ahp.DefaultServiceTypeHealthPolicy - } - if ahp.ServiceTypeHealthPolicies != nil { - objectMap["serviceTypeHealthPolicies"] = ahp.ServiceTypeHealthPolicies - } - return json.Marshal(objectMap) -} - -// ApplicationMetricDescription describes capacity information for a custom resource balancing metric. This -// can be used to limit the total consumption of this metric by the services of this application. -type ApplicationMetricDescription struct { - // Name - The name of the metric. - Name *string `json:"name,omitempty"` - // MaximumCapacity - The maximum node capacity for Service Fabric application. - // This is the maximum Load for an instance of this application on a single node. Even if the capacity of node is greater than this value, Service Fabric will limit the total load of services within the application on each node to this value. - // If set to zero, capacity for this metric is unlimited on each node. - // When creating a new application with application capacity defined, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. - // When updating existing application with application capacity, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. - MaximumCapacity *int64 `json:"maximumCapacity,omitempty"` - // ReservationCapacity - The node reservation capacity for Service Fabric application. - // This is the amount of load which is reserved on nodes which have instances of this application. - // If MinimumNodes is specified, then the product of these values will be the capacity reserved in the cluster for the application. - // If set to zero, no capacity is reserved for this metric. - // When setting application capacity or when updating application capacity; this value must be smaller than or equal to MaximumCapacity for each metric. - ReservationCapacity *int64 `json:"reservationCapacity,omitempty"` - // TotalApplicationCapacity - The total metric capacity for Service Fabric application. - // This is the total metric capacity for this application in the cluster. Service Fabric will try to limit the sum of loads of services within the application to this value. - // When creating a new application with application capacity defined, the product of MaximumNodes and MaximumCapacity must always be smaller than or equal to this value. - TotalApplicationCapacity *int64 `json:"totalApplicationCapacity,omitempty"` -} - -// ApplicationResource the application resource. -type ApplicationResource struct { - autorest.Response `json:"-"` - // ApplicationResourceProperties - The application resource properties. - *ApplicationResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Azure resource identifier. - 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"` - // Location - Azure resource location. - Location *string `json:"location,omitempty"` - // Tags - Azure resource tags. - Tags map[string]*string `json:"tags"` - // Etag - READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationResource. -func (ar ApplicationResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ar.ApplicationResourceProperties != nil { - objectMap["properties"] = ar.ApplicationResourceProperties - } - if ar.Location != nil { - objectMap["location"] = ar.Location - } - if ar.Tags != nil { - objectMap["tags"] = ar.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationResource struct. -func (ar *ApplicationResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationResourceProperties ApplicationResourceProperties - err = json.Unmarshal(*v, &applicationResourceProperties) - if err != nil { - return err - } - ar.ApplicationResourceProperties = &applicationResourceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ar.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ar.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ar.Tags = tags - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ar.Etag = &etag - } - } - } - - return nil -} - -// ApplicationResourceList the list of application resources. -type ApplicationResourceList struct { - autorest.Response `json:"-"` - Value *[]ApplicationResource `json:"value,omitempty"` - // NextLink - READ-ONLY; URL to get the next set of application list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ApplicationResourceProperties the application resource properties. -type ApplicationResourceProperties struct { - // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response - ProvisioningState *string `json:"provisioningState,omitempty"` - // TypeName - The application type name as defined in the application manifest. - TypeName *string `json:"typeName,omitempty"` - // TypeVersion - The version of the application type as defined in the application manifest. - TypeVersion *string `json:"typeVersion,omitempty"` - // Parameters - List of application parameters with overridden values from their default values specified in the application manifest. - Parameters map[string]*string `json:"parameters"` - // UpgradePolicy - Describes the policy for a monitored application upgrade. - UpgradePolicy *ApplicationUpgradePolicy `json:"upgradePolicy,omitempty"` - // MinimumNodes - The minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of the MaximumNodes property. - MinimumNodes *int64 `json:"minimumNodes,omitempty"` - // MaximumNodes - The maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. By default, the value of this property is zero and it means that the services can be placed on any node. - MaximumNodes *int64 `json:"maximumNodes,omitempty"` - // RemoveApplicationCapacity - Remove the current application capacity settings. - RemoveApplicationCapacity *bool `json:"removeApplicationCapacity,omitempty"` - // Metrics - List of application capacity metric description. - Metrics *[]ApplicationMetricDescription `json:"metrics,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationResourceProperties. -func (arp ApplicationResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if arp.TypeName != nil { - objectMap["typeName"] = arp.TypeName - } - if arp.TypeVersion != nil { - objectMap["typeVersion"] = arp.TypeVersion - } - if arp.Parameters != nil { - objectMap["parameters"] = arp.Parameters - } - if arp.UpgradePolicy != nil { - objectMap["upgradePolicy"] = arp.UpgradePolicy - } - if arp.MinimumNodes != nil { - objectMap["minimumNodes"] = arp.MinimumNodes - } - if arp.MaximumNodes != nil { - objectMap["maximumNodes"] = arp.MaximumNodes - } - if arp.RemoveApplicationCapacity != nil { - objectMap["removeApplicationCapacity"] = arp.RemoveApplicationCapacity - } - if arp.Metrics != nil { - objectMap["metrics"] = arp.Metrics - } - return json.Marshal(objectMap) -} - -// ApplicationResourceUpdate the application resource for patch operations. -type ApplicationResourceUpdate struct { - // ApplicationResourceUpdateProperties - The application resource properties for patch operations. - *ApplicationResourceUpdateProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Azure resource identifier. - 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"` - // Location - Azure resource location. - Location *string `json:"location,omitempty"` - // Tags - Azure resource tags. - Tags map[string]*string `json:"tags"` - // Etag - READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationResourceUpdate. -func (aru ApplicationResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aru.ApplicationResourceUpdateProperties != nil { - objectMap["properties"] = aru.ApplicationResourceUpdateProperties - } - if aru.Location != nil { - objectMap["location"] = aru.Location - } - if aru.Tags != nil { - objectMap["tags"] = aru.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationResourceUpdate struct. -func (aru *ApplicationResourceUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationResourceUpdateProperties ApplicationResourceUpdateProperties - err = json.Unmarshal(*v, &applicationResourceUpdateProperties) - if err != nil { - return err - } - aru.ApplicationResourceUpdateProperties = &applicationResourceUpdateProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - aru.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - aru.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - aru.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - aru.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - aru.Tags = tags - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - aru.Etag = &etag - } - } - } - - return nil -} - -// ApplicationResourceUpdateProperties the application resource properties for patch operations. -type ApplicationResourceUpdateProperties struct { - // TypeVersion - The version of the application type as defined in the application manifest. - TypeVersion *string `json:"typeVersion,omitempty"` - // Parameters - List of application parameters with overridden values from their default values specified in the application manifest. - Parameters map[string]*string `json:"parameters"` - // UpgradePolicy - Describes the policy for a monitored application upgrade. - UpgradePolicy *ApplicationUpgradePolicy `json:"upgradePolicy,omitempty"` - // MinimumNodes - The minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of the MaximumNodes property. - MinimumNodes *int64 `json:"minimumNodes,omitempty"` - // MaximumNodes - The maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. By default, the value of this property is zero and it means that the services can be placed on any node. - MaximumNodes *int64 `json:"maximumNodes,omitempty"` - // RemoveApplicationCapacity - Remove the current application capacity settings. - RemoveApplicationCapacity *bool `json:"removeApplicationCapacity,omitempty"` - // Metrics - List of application capacity metric description. - Metrics *[]ApplicationMetricDescription `json:"metrics,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationResourceUpdateProperties. -func (arup ApplicationResourceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if arup.TypeVersion != nil { - objectMap["typeVersion"] = arup.TypeVersion - } - if arup.Parameters != nil { - objectMap["parameters"] = arup.Parameters - } - if arup.UpgradePolicy != nil { - objectMap["upgradePolicy"] = arup.UpgradePolicy - } - if arup.MinimumNodes != nil { - objectMap["minimumNodes"] = arup.MinimumNodes - } - if arup.MaximumNodes != nil { - objectMap["maximumNodes"] = arup.MaximumNodes - } - if arup.RemoveApplicationCapacity != nil { - objectMap["removeApplicationCapacity"] = arup.RemoveApplicationCapacity - } - if arup.Metrics != nil { - objectMap["metrics"] = arup.Metrics - } - return json.Marshal(objectMap) -} - -// ApplicationsCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ApplicationsCreateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationsCreateFuture) Result(client ApplicationsClient) (ar ApplicationResource, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("servicefabric.ApplicationsCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ar.Response.Response, err = future.GetResult(sender); err == nil && ar.Response.Response.StatusCode != http.StatusNoContent { - ar, err = client.CreateResponder(ar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsCreateFuture", "Result", ar.Response.Response, "Failure responding to request") - } - } - return -} - -// ApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ApplicationsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationsDeleteFuture) Result(client ApplicationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("servicefabric.ApplicationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ApplicationsUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationsUpdateFuture) Result(client ApplicationsClient) (ar ApplicationResource, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("servicefabric.ApplicationsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ar.Response.Response, err = future.GetResult(sender); err == nil && ar.Response.Response.StatusCode != http.StatusNoContent { - ar, err = client.UpdateResponder(ar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationsUpdateFuture", "Result", ar.Response.Response, "Failure responding to request") - } - } - return -} - -// ApplicationTypeResource the application type name resource -type ApplicationTypeResource struct { - autorest.Response `json:"-"` - // ApplicationTypeResourceProperties - The application type name properties - *ApplicationTypeResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Azure resource identifier. - 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"` - // Location - Azure resource location. - Location *string `json:"location,omitempty"` - // Tags - Azure resource tags. - Tags map[string]*string `json:"tags"` - // Etag - READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationTypeResource. -func (atr ApplicationTypeResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if atr.ApplicationTypeResourceProperties != nil { - objectMap["properties"] = atr.ApplicationTypeResourceProperties - } - if atr.Location != nil { - objectMap["location"] = atr.Location - } - if atr.Tags != nil { - objectMap["tags"] = atr.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationTypeResource struct. -func (atr *ApplicationTypeResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationTypeResourceProperties ApplicationTypeResourceProperties - err = json.Unmarshal(*v, &applicationTypeResourceProperties) - if err != nil { - return err - } - atr.ApplicationTypeResourceProperties = &applicationTypeResourceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - atr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - atr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - atr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - atr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - atr.Tags = tags - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - atr.Etag = &etag - } - } - } - - return nil -} - -// ApplicationTypeResourceList the list of application type names. -type ApplicationTypeResourceList struct { - autorest.Response `json:"-"` - Value *[]ApplicationTypeResource `json:"value,omitempty"` - // NextLink - READ-ONLY; URL to get the next set of application type list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ApplicationTypeResourceProperties the application type name properties -type ApplicationTypeResourceProperties struct { - // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` -} - -// ApplicationTypesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ApplicationTypesDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationTypesDeleteFuture) Result(client ApplicationTypesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("servicefabric.ApplicationTypesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ApplicationTypeVersionResource an application type version resource for the specified application type -// name resource. -type ApplicationTypeVersionResource struct { - autorest.Response `json:"-"` - // ApplicationTypeVersionResourceProperties - The properties of the application type version resource. - *ApplicationTypeVersionResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Azure resource identifier. - 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"` - // Location - Azure resource location. - Location *string `json:"location,omitempty"` - // Tags - Azure resource tags. - Tags map[string]*string `json:"tags"` - // Etag - READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationTypeVersionResource. -func (atvr ApplicationTypeVersionResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if atvr.ApplicationTypeVersionResourceProperties != nil { - objectMap["properties"] = atvr.ApplicationTypeVersionResourceProperties - } - if atvr.Location != nil { - objectMap["location"] = atvr.Location - } - if atvr.Tags != nil { - objectMap["tags"] = atvr.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationTypeVersionResource struct. -func (atvr *ApplicationTypeVersionResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationTypeVersionResourceProperties ApplicationTypeVersionResourceProperties - err = json.Unmarshal(*v, &applicationTypeVersionResourceProperties) - if err != nil { - return err - } - atvr.ApplicationTypeVersionResourceProperties = &applicationTypeVersionResourceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - atvr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - atvr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - atvr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - atvr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - atvr.Tags = tags - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - atvr.Etag = &etag - } - } - } - - return nil -} - -// ApplicationTypeVersionResourceList the list of application type version resources for the specified -// application type name resource. -type ApplicationTypeVersionResourceList struct { - autorest.Response `json:"-"` - Value *[]ApplicationTypeVersionResource `json:"value,omitempty"` - // NextLink - READ-ONLY; URL to get the next set of application type version list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ApplicationTypeVersionResourceProperties the properties of the application type version resource. -type ApplicationTypeVersionResourceProperties struct { - // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response - ProvisioningState *string `json:"provisioningState,omitempty"` - // AppPackageURL - The URL to the application package - AppPackageURL *string `json:"appPackageUrl,omitempty"` - // DefaultParameterList - READ-ONLY; List of application type parameters that can be overridden when creating or updating the application. - DefaultParameterList map[string]*string `json:"defaultParameterList"` -} - -// MarshalJSON is the custom marshaler for ApplicationTypeVersionResourceProperties. -func (atvrp ApplicationTypeVersionResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if atvrp.AppPackageURL != nil { - objectMap["appPackageUrl"] = atvrp.AppPackageURL - } - return json.Marshal(objectMap) -} - -// ApplicationTypeVersionsCreateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ApplicationTypeVersionsCreateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationTypeVersionsCreateFuture) Result(client ApplicationTypeVersionsClient) (atvr ApplicationTypeVersionResource, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeVersionsCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("servicefabric.ApplicationTypeVersionsCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if atvr.Response.Response, err = future.GetResult(sender); err == nil && atvr.Response.Response.StatusCode != http.StatusNoContent { - atvr, err = client.CreateResponder(atvr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeVersionsCreateFuture", "Result", atvr.Response.Response, "Failure responding to request") - } - } - return -} - -// ApplicationTypeVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ApplicationTypeVersionsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationTypeVersionsDeleteFuture) Result(client ApplicationTypeVersionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeVersionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("servicefabric.ApplicationTypeVersionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ApplicationUpgradePolicy describes the policy for a monitored application upgrade. -type ApplicationUpgradePolicy struct { - // UpgradeReplicaSetCheckTimeout - The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. Valid values are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). - UpgradeReplicaSetCheckTimeout *string `json:"upgradeReplicaSetCheckTimeout,omitempty"` - // ForceRestart - If true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). - ForceRestart *bool `json:"forceRestart,omitempty"` - // RollingUpgradeMonitoringPolicy - The policy used for monitoring the application upgrade - RollingUpgradeMonitoringPolicy *ArmRollingUpgradeMonitoringPolicy `json:"rollingUpgradeMonitoringPolicy,omitempty"` - // ApplicationHealthPolicy - Defines a health policy used to evaluate the health of an application or one of its children entities. - ApplicationHealthPolicy *ArmApplicationHealthPolicy `json:"applicationHealthPolicy,omitempty"` -} - -// ArmApplicationHealthPolicy defines a health policy used to evaluate the health of an application or one -// of its children entities. -type ArmApplicationHealthPolicy struct { - // ConsiderWarningAsError - Indicates whether warnings are treated with the same severity as errors. - ConsiderWarningAsError *bool `json:"considerWarningAsError,omitempty"` - // MaxPercentUnhealthyDeployedApplications - The maximum allowed percentage of unhealthy deployed applications. Allowed values are Byte values from zero to 100. - // The percentage represents the maximum tolerated percentage of deployed applications that can be unhealthy before the application is considered in error. - // This is calculated by dividing the number of unhealthy deployed applications over the number of nodes where the application is currently deployed on in the cluster. - // The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. - MaxPercentUnhealthyDeployedApplications *int32 `json:"maxPercentUnhealthyDeployedApplications,omitempty"` - // DefaultServiceTypeHealthPolicy - The health policy used by default to evaluate the health of a service type. - DefaultServiceTypeHealthPolicy *ArmServiceTypeHealthPolicy `json:"defaultServiceTypeHealthPolicy,omitempty"` - // ServiceTypeHealthPolicyMap - The map with service type health policy per service type name. The map is empty by default. - ServiceTypeHealthPolicyMap map[string]*ArmServiceTypeHealthPolicy `json:"serviceTypeHealthPolicyMap"` -} - -// MarshalJSON is the custom marshaler for ArmApplicationHealthPolicy. -func (aahp ArmApplicationHealthPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aahp.ConsiderWarningAsError != nil { - objectMap["considerWarningAsError"] = aahp.ConsiderWarningAsError - } - if aahp.MaxPercentUnhealthyDeployedApplications != nil { - objectMap["maxPercentUnhealthyDeployedApplications"] = aahp.MaxPercentUnhealthyDeployedApplications - } - if aahp.DefaultServiceTypeHealthPolicy != nil { - objectMap["defaultServiceTypeHealthPolicy"] = aahp.DefaultServiceTypeHealthPolicy - } - if aahp.ServiceTypeHealthPolicyMap != nil { - objectMap["serviceTypeHealthPolicyMap"] = aahp.ServiceTypeHealthPolicyMap - } - return json.Marshal(objectMap) -} - -// ArmRollingUpgradeMonitoringPolicy the policy used for monitoring the application upgrade -type ArmRollingUpgradeMonitoringPolicy struct { - // FailureAction - The activation Mode of the service package. Possible values include: 'Rollback', 'Manual' - FailureAction ArmUpgradeFailureAction `json:"failureAction,omitempty"` - // HealthCheckWaitDuration - The amount of time to wait after completing an upgrade domain before applying health policies. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. - HealthCheckWaitDuration *string `json:"healthCheckWaitDuration,omitempty"` - // HealthCheckStableDuration - The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. - HealthCheckStableDuration *string `json:"healthCheckStableDuration,omitempty"` - // HealthCheckRetryTimeout - The amount of time to retry health evaluation when the application or cluster is unhealthy before FailureAction is executed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. - HealthCheckRetryTimeout *string `json:"healthCheckRetryTimeout,omitempty"` - // UpgradeTimeout - The amount of time the overall upgrade has to complete before FailureAction is executed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. - UpgradeTimeout *string `json:"upgradeTimeout,omitempty"` - // UpgradeDomainTimeout - The amount of time each upgrade domain has to complete before FailureAction is executed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. - UpgradeDomainTimeout *string `json:"upgradeDomainTimeout,omitempty"` -} - -// ArmServiceTypeHealthPolicy represents the health policy used to evaluate the health of services -// belonging to a service type. -type ArmServiceTypeHealthPolicy struct { - // MaxPercentUnhealthyServices - The maximum percentage of services allowed to be unhealthy before your application is considered in error. - MaxPercentUnhealthyServices *int32 `json:"maxPercentUnhealthyServices,omitempty"` - // MaxPercentUnhealthyPartitionsPerService - The maximum percentage of partitions per service allowed to be unhealthy before your application is considered in error. - MaxPercentUnhealthyPartitionsPerService *int32 `json:"maxPercentUnhealthyPartitionsPerService,omitempty"` - // MaxPercentUnhealthyReplicasPerPartition - The maximum percentage of replicas per partition allowed to be unhealthy before your application is considered in error. - MaxPercentUnhealthyReplicasPerPartition *int32 `json:"maxPercentUnhealthyReplicasPerPartition,omitempty"` -} - -// AvailableOperationDisplay operation supported by the Service Fabric resource provider -type AvailableOperationDisplay struct { - // Provider - The name of the provider. - Provider *string `json:"provider,omitempty"` - // Resource - The resource on which the operation is performed - Resource *string `json:"resource,omitempty"` - // Operation - The operation that can be performed. - Operation *string `json:"operation,omitempty"` - // Description - Operation description - Description *string `json:"description,omitempty"` -} - -// AzureActiveDirectory the settings to enable AAD authentication on the cluster. -type AzureActiveDirectory struct { - // TenantID - Azure active directory tenant id. - TenantID *string `json:"tenantId,omitempty"` - // ClusterApplication - Azure active directory cluster application id. - ClusterApplication *string `json:"clusterApplication,omitempty"` - // ClientApplication - Azure active directory client application id. - ClientApplication *string `json:"clientApplication,omitempty"` -} - -// CertificateDescription describes the certificate details. -type CertificateDescription struct { - // Thumbprint - Thumbprint of the primary certificate. - Thumbprint *string `json:"thumbprint,omitempty"` - // ThumbprintSecondary - Thumbprint of the secondary certificate. - ThumbprintSecondary *string `json:"thumbprintSecondary,omitempty"` - // X509StoreName - The local certificate store location. Possible values include: 'AddressBook', 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', 'TrustedPublisher' - X509StoreName X509StoreName `json:"x509StoreName,omitempty"` -} - -// ClientCertificateCommonName describes the client certificate details using common name. -type ClientCertificateCommonName struct { - // IsAdmin - Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. - IsAdmin *bool `json:"isAdmin,omitempty"` - // CertificateCommonName - The common name of the client certificate. - CertificateCommonName *string `json:"certificateCommonName,omitempty"` - // CertificateIssuerThumbprint - The issuer thumbprint of the client certificate. - CertificateIssuerThumbprint *string `json:"certificateIssuerThumbprint,omitempty"` -} - -// ClientCertificateThumbprint describes the client certificate details using thumbprint. -type ClientCertificateThumbprint struct { - // IsAdmin - Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. - IsAdmin *bool `json:"isAdmin,omitempty"` - // CertificateThumbprint - The thumbprint of the client certificate. - CertificateThumbprint *string `json:"certificateThumbprint,omitempty"` -} - -// Cluster the cluster resource -type Cluster struct { - autorest.Response `json:"-"` - // ClusterProperties - The cluster resource properties - *ClusterProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Azure resource identifier. - 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"` - // Location - Azure resource location. - Location *string `json:"location,omitempty"` - // Tags - Azure resource tags. - Tags map[string]*string `json:"tags"` - // Etag - READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for Cluster. -func (c Cluster) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ClusterProperties != nil { - objectMap["properties"] = c.ClusterProperties - } - if c.Location != nil { - objectMap["location"] = c.Location - } - if c.Tags != nil { - objectMap["tags"] = c.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for 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 "properties": - if v != nil { - var clusterProperties ClusterProperties - err = json.Unmarshal(*v, &clusterProperties) - if err != nil { - return err - } - c.ClusterProperties = &clusterProperties - } - 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 - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - c.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - c.Tags = tags - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - c.Etag = &etag - } - } - } - - return nil -} - -// ClusterCodeVersionsListResult the list results of the Service Fabric runtime versions. -type ClusterCodeVersionsListResult struct { - autorest.Response `json:"-"` - Value *[]ClusterCodeVersionsResult `json:"value,omitempty"` - // NextLink - The URL to use for getting the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ClusterCodeVersionsResult the result of the Service Fabric runtime versions -type ClusterCodeVersionsResult struct { - // ID - The identification of the result - ID *string `json:"id,omitempty"` - // Name - The name of the result - Name *string `json:"name,omitempty"` - // Type - The result resource type - Type *string `json:"type,omitempty"` - // ClusterVersionDetails - The detail of the Service Fabric runtime version result - *ClusterVersionDetails `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ClusterCodeVersionsResult. -func (ccvr ClusterCodeVersionsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ccvr.ID != nil { - objectMap["id"] = ccvr.ID - } - if ccvr.Name != nil { - objectMap["name"] = ccvr.Name - } - if ccvr.Type != nil { - objectMap["type"] = ccvr.Type - } - if ccvr.ClusterVersionDetails != nil { - objectMap["properties"] = ccvr.ClusterVersionDetails - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ClusterCodeVersionsResult struct. -func (ccvr *ClusterCodeVersionsResult) UnmarshalJSON(body []byte) error { - 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 - } - ccvr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ccvr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ccvr.Type = &typeVar - } - case "properties": - if v != nil { - var clusterVersionDetails ClusterVersionDetails - err = json.Unmarshal(*v, &clusterVersionDetails) - if err != nil { - return err - } - ccvr.ClusterVersionDetails = &clusterVersionDetails - } - } - } - - return nil -} - -// ClusterHealthPolicy defines a health policy used to evaluate the health of the cluster or of a cluster -// node. -type ClusterHealthPolicy struct { - // MaxPercentUnhealthyNodes - The maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes to be unhealthy, this value would be 10. - // The percentage represents the maximum tolerated percentage of nodes that can be unhealthy before the cluster is considered in error. - // If the percentage is respected but there is at least one unhealthy node, the health is evaluated as Warning. - // The percentage is calculated by dividing the number of unhealthy nodes over the total number of nodes in the cluster. - // The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. - // In large clusters, some nodes will always be down or out for repairs, so this percentage should be configured to tolerate that. - MaxPercentUnhealthyNodes *int32 `json:"maxPercentUnhealthyNodes,omitempty"` - // MaxPercentUnhealthyApplications - The maximum allowed percentage of unhealthy applications before reporting an error. For example, to allow 10% of applications to be unhealthy, this value would be 10. - // The percentage represents the maximum tolerated percentage of applications that can be unhealthy before the cluster is considered in error. - // If the percentage is respected but there is at least one unhealthy application, the health is evaluated as Warning. - // This is calculated by dividing the number of unhealthy applications over the total number of application instances in the cluster, excluding applications of application types that are included in the ApplicationTypeHealthPolicyMap. - // The computation rounds up to tolerate one failure on small numbers of applications. Default percentage is zero. - MaxPercentUnhealthyApplications *int32 `json:"maxPercentUnhealthyApplications,omitempty"` - // ApplicationHealthPolicies - Defines the application health policy map used to evaluate the health of an application or one of its children entities. - ApplicationHealthPolicies map[string]*ApplicationHealthPolicy `json:"applicationHealthPolicies"` -} - -// MarshalJSON is the custom marshaler for ClusterHealthPolicy. -func (chp ClusterHealthPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if chp.MaxPercentUnhealthyNodes != nil { - objectMap["maxPercentUnhealthyNodes"] = chp.MaxPercentUnhealthyNodes - } - if chp.MaxPercentUnhealthyApplications != nil { - objectMap["maxPercentUnhealthyApplications"] = chp.MaxPercentUnhealthyApplications - } - if chp.ApplicationHealthPolicies != nil { - objectMap["applicationHealthPolicies"] = chp.ApplicationHealthPolicies - } - return json.Marshal(objectMap) -} - -// ClusterListResult cluster list results -type ClusterListResult struct { - autorest.Response `json:"-"` - Value *[]Cluster `json:"value,omitempty"` - // NextLink - The URL to use for getting the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ClusterProperties describes the cluster resource properties. -type ClusterProperties struct { - // AddOnFeatures - The list of add-on features to enable in the cluster. - AddOnFeatures *[]string `json:"addOnFeatures,omitempty"` - // AvailableClusterVersions - READ-ONLY; The Service Fabric runtime versions available for this cluster. - AvailableClusterVersions *[]ClusterVersionDetails `json:"availableClusterVersions,omitempty"` - // AzureActiveDirectory - The AAD authentication settings of the cluster. - AzureActiveDirectory *AzureActiveDirectory `json:"azureActiveDirectory,omitempty"` - // Certificate - The certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. - Certificate *CertificateDescription `json:"certificate,omitempty"` - // CertificateCommonNames - Describes a list of server certificates referenced by common name that are used to secure the cluster. - CertificateCommonNames *ServerCertificateCommonNames `json:"certificateCommonNames,omitempty"` - // ClientCertificateCommonNames - The list of client certificates referenced by common name that are allowed to manage the cluster. - ClientCertificateCommonNames *[]ClientCertificateCommonName `json:"clientCertificateCommonNames,omitempty"` - // ClientCertificateThumbprints - The list of client certificates referenced by thumbprint that are allowed to manage the cluster. - ClientCertificateThumbprints *[]ClientCertificateThumbprint `json:"clientCertificateThumbprints,omitempty"` - // ClusterCodeVersion - The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. - ClusterCodeVersion *string `json:"clusterCodeVersion,omitempty"` - // ClusterEndpoint - READ-ONLY; The Azure Resource Provider endpoint. A system service in the cluster connects to this endpoint. - ClusterEndpoint *string `json:"clusterEndpoint,omitempty"` - // ClusterID - READ-ONLY; A service generated unique identifier for the cluster resource. - ClusterID *string `json:"clusterId,omitempty"` - // ClusterState - READ-ONLY; The current state of the cluster. - // - WaitingForNodes - Indicates that the cluster resource is created and the resource provider is waiting for Service Fabric VM extension to boot up and report to it. - // - Deploying - Indicates that the Service Fabric runtime is being installed on the VMs. Cluster resource will be in this state until the cluster boots up and system services are up. - // - BaselineUpgrade - Indicates that the cluster is upgrading to establishes the cluster version. This upgrade is automatically initiated when the cluster boots up for the first time. - // - UpdatingUserConfiguration - Indicates that the cluster is being upgraded with the user provided configuration. - // - UpdatingUserCertificate - Indicates that the cluster is being upgraded with the user provided certificate. - // - UpdatingInfrastructure - Indicates that the cluster is being upgraded with the latest Service Fabric runtime version. This happens only when the **upgradeMode** is set to 'Automatic'. - // - EnforcingClusterVersion - Indicates that cluster is on a different version than expected and the cluster is being upgraded to the expected version. - // - UpgradeServiceUnreachable - Indicates that the system service in the cluster is no longer polling the Resource Provider. Clusters in this state cannot be managed by the Resource Provider. - // - AutoScale - Indicates that the ReliabilityLevel of the cluster is being adjusted. - // - Ready - Indicates that the cluster is in a stable state. - // . Possible values include: 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', 'UpdatingUserConfiguration', 'UpdatingUserCertificate', 'UpdatingInfrastructure', 'EnforcingClusterVersion', 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' - ClusterState ClusterState `json:"clusterState,omitempty"` - // DiagnosticsStorageAccountConfig - The storage account information for storing Service Fabric diagnostic logs. - DiagnosticsStorageAccountConfig *DiagnosticsStorageAccountConfig `json:"diagnosticsStorageAccountConfig,omitempty"` - // EventStoreServiceEnabled - Indicates if the event store service is enabled. - EventStoreServiceEnabled *bool `json:"eventStoreServiceEnabled,omitempty"` - // FabricSettings - The list of custom fabric settings to configure the cluster. - FabricSettings *[]SettingsSectionDescription `json:"fabricSettings,omitempty"` - // ManagementEndpoint - The http management endpoint of the cluster. - ManagementEndpoint *string `json:"managementEndpoint,omitempty"` - // NodeTypes - The list of node types in the cluster. - NodeTypes *[]NodeTypeDescription `json:"nodeTypes,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the cluster resource. Possible values include: 'Updating', 'Succeeded', 'Failed', 'Canceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ReliabilityLevel - The reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - // - None - Run the System services with a target replica set count of 1. This should only be used for test clusters. - // - Bronze - Run the System services with a target replica set count of 3. This should only be used for test clusters. - // - Silver - Run the System services with a target replica set count of 5. - // - Gold - Run the System services with a target replica set count of 7. - // - Platinum - Run the System services with a target replica set count of 9. - // . Possible values include: 'ReliabilityLevelNone', 'ReliabilityLevelBronze', 'ReliabilityLevelSilver', 'ReliabilityLevelGold', 'ReliabilityLevelPlatinum' - ReliabilityLevel ReliabilityLevel `json:"reliabilityLevel,omitempty"` - // ReverseProxyCertificate - The server certificate used by reverse proxy. - ReverseProxyCertificate *CertificateDescription `json:"reverseProxyCertificate,omitempty"` - // ReverseProxyCertificateCommonNames - Describes a list of server certificates referenced by common name that are used to secure the cluster. - ReverseProxyCertificateCommonNames *ServerCertificateCommonNames `json:"reverseProxyCertificateCommonNames,omitempty"` - // UpgradeDescription - The policy to use when upgrading the cluster. - UpgradeDescription *ClusterUpgradePolicy `json:"upgradeDescription,omitempty"` - // UpgradeMode - The upgrade mode of the cluster when new Service Fabric runtime version is available. - // - Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version as soon as it is available. - // - Manual - The cluster will not be automatically upgraded to the latest Service Fabric runtime version. The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster resource. - // . Possible values include: 'UpgradeModeAutomatic', 'UpgradeModeManual' - UpgradeMode UpgradeMode `json:"upgradeMode,omitempty"` - // VMImage - The VM image VMSS has been configured with. Generic names such as Windows or Linux can be used. - VMImage *string `json:"vmImage,omitempty"` -} - -// ClusterPropertiesUpdateParameters describes the cluster resource properties that can be updated during -// PATCH operation. -type ClusterPropertiesUpdateParameters struct { - // AddOnFeatures - The list of add-on features to enable in the cluster. - AddOnFeatures *[]string `json:"addOnFeatures,omitempty"` - // Certificate - The certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. - Certificate *CertificateDescription `json:"certificate,omitempty"` - // CertificateCommonNames - Describes a list of server certificates referenced by common name that are used to secure the cluster. - CertificateCommonNames *ServerCertificateCommonNames `json:"certificateCommonNames,omitempty"` - // ClientCertificateCommonNames - The list of client certificates referenced by common name that are allowed to manage the cluster. This will overwrite the existing list. - ClientCertificateCommonNames *[]ClientCertificateCommonName `json:"clientCertificateCommonNames,omitempty"` - // ClientCertificateThumbprints - The list of client certificates referenced by thumbprint that are allowed to manage the cluster. This will overwrite the existing list. - ClientCertificateThumbprints *[]ClientCertificateThumbprint `json:"clientCertificateThumbprints,omitempty"` - // ClusterCodeVersion - The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. - ClusterCodeVersion *string `json:"clusterCodeVersion,omitempty"` - // EventStoreServiceEnabled - Indicates if the event store service is enabled. - EventStoreServiceEnabled *bool `json:"eventStoreServiceEnabled,omitempty"` - // FabricSettings - The list of custom fabric settings to configure the cluster. This will overwrite the existing list. - FabricSettings *[]SettingsSectionDescription `json:"fabricSettings,omitempty"` - // NodeTypes - The list of node types in the cluster. This will overwrite the existing list. - NodeTypes *[]NodeTypeDescription `json:"nodeTypes,omitempty"` - // ReliabilityLevel - The reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - // - None - Run the System services with a target replica set count of 1. This should only be used for test clusters. - // - Bronze - Run the System services with a target replica set count of 3. This should only be used for test clusters. - // - Silver - Run the System services with a target replica set count of 5. - // - Gold - Run the System services with a target replica set count of 7. - // - Platinum - Run the System services with a target replica set count of 9. - // . Possible values include: 'ReliabilityLevel1None', 'ReliabilityLevel1Bronze', 'ReliabilityLevel1Silver', 'ReliabilityLevel1Gold', 'ReliabilityLevel1Platinum' - ReliabilityLevel ReliabilityLevel1 `json:"reliabilityLevel,omitempty"` - // ReverseProxyCertificate - The server certificate used by reverse proxy. - ReverseProxyCertificate *CertificateDescription `json:"reverseProxyCertificate,omitempty"` - // UpgradeDescription - The policy to use when upgrading the cluster. - UpgradeDescription *ClusterUpgradePolicy `json:"upgradeDescription,omitempty"` - // UpgradeMode - The upgrade mode of the cluster when new Service Fabric runtime version is available. - // - Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version as soon as it is available. - // - Manual - The cluster will not be automatically upgraded to the latest Service Fabric runtime version. The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster resource. - // . Possible values include: 'UpgradeMode1Automatic', 'UpgradeMode1Manual' - UpgradeMode UpgradeMode1 `json:"upgradeMode,omitempty"` -} - -// ClustersCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ClustersCreateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ClustersCreateFuture) Result(client ClustersClient) (c Cluster, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClustersCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("servicefabric.ClustersCreateFuture") - 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.CreateResponder(c.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClustersCreateFuture", "Result", c.Response.Response, "Failure responding to request") - } - } - return -} - -// ClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ClustersUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ClustersUpdateFuture) Result(client ClustersClient) (c Cluster, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClustersUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("servicefabric.ClustersUpdateFuture") - 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.UpdateResponder(c.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ClustersUpdateFuture", "Result", c.Response.Response, "Failure responding to request") - } - } - return -} - -// ClusterUpdateParameters cluster update request -type ClusterUpdateParameters struct { - // ClusterPropertiesUpdateParameters - Describes the cluster resource properties that can be updated during PATCH operation. - *ClusterPropertiesUpdateParameters `json:"properties,omitempty"` - // Tags - Cluster update parameters - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ClusterUpdateParameters. -func (cup ClusterUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cup.ClusterPropertiesUpdateParameters != nil { - objectMap["properties"] = cup.ClusterPropertiesUpdateParameters - } - if cup.Tags != nil { - objectMap["tags"] = cup.Tags - } - 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 clusterPropertiesUpdateParameters ClusterPropertiesUpdateParameters - err = json.Unmarshal(*v, &clusterPropertiesUpdateParameters) - if err != nil { - return err - } - cup.ClusterPropertiesUpdateParameters = &clusterPropertiesUpdateParameters - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cup.Tags = tags - } - } - } - - return nil -} - -// ClusterUpgradeDeltaHealthPolicy describes the delta health policies for the cluster upgrade. -type ClusterUpgradeDeltaHealthPolicy struct { - // MaxPercentDeltaUnhealthyNodes - The maximum allowed percentage of nodes health degradation allowed during cluster upgrades. - // The delta is measured between the state of the nodes at the beginning of upgrade and the state of the nodes at the time of the health evaluation. - // The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. - MaxPercentDeltaUnhealthyNodes *int32 `json:"maxPercentDeltaUnhealthyNodes,omitempty"` - // MaxPercentUpgradeDomainDeltaUnhealthyNodes - The maximum allowed percentage of upgrade domain nodes health degradation allowed during cluster upgrades. - // The delta is measured between the state of the upgrade domain nodes at the beginning of upgrade and the state of the upgrade domain nodes at the time of the health evaluation. - // The check is performed after every upgrade domain upgrade completion for all completed upgrade domains to make sure the state of the upgrade domains is within tolerated limits. - MaxPercentUpgradeDomainDeltaUnhealthyNodes *int32 `json:"maxPercentUpgradeDomainDeltaUnhealthyNodes,omitempty"` - // MaxPercentDeltaUnhealthyApplications - The maximum allowed percentage of applications health degradation allowed during cluster upgrades. - // The delta is measured between the state of the applications at the beginning of upgrade and the state of the applications at the time of the health evaluation. - // The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. System services are not included in this. - MaxPercentDeltaUnhealthyApplications *int32 `json:"maxPercentDeltaUnhealthyApplications,omitempty"` - // ApplicationDeltaHealthPolicies - Defines the application delta health policy map used to evaluate the health of an application or one of its child entities when upgrading the cluster. - ApplicationDeltaHealthPolicies map[string]*ApplicationDeltaHealthPolicy `json:"applicationDeltaHealthPolicies"` -} - -// MarshalJSON is the custom marshaler for ClusterUpgradeDeltaHealthPolicy. -func (cudhp ClusterUpgradeDeltaHealthPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cudhp.MaxPercentDeltaUnhealthyNodes != nil { - objectMap["maxPercentDeltaUnhealthyNodes"] = cudhp.MaxPercentDeltaUnhealthyNodes - } - if cudhp.MaxPercentUpgradeDomainDeltaUnhealthyNodes != nil { - objectMap["maxPercentUpgradeDomainDeltaUnhealthyNodes"] = cudhp.MaxPercentUpgradeDomainDeltaUnhealthyNodes - } - if cudhp.MaxPercentDeltaUnhealthyApplications != nil { - objectMap["maxPercentDeltaUnhealthyApplications"] = cudhp.MaxPercentDeltaUnhealthyApplications - } - if cudhp.ApplicationDeltaHealthPolicies != nil { - objectMap["applicationDeltaHealthPolicies"] = cudhp.ApplicationDeltaHealthPolicies - } - return json.Marshal(objectMap) -} - -// ClusterUpgradePolicy describes the policy used when upgrading the cluster. -type ClusterUpgradePolicy struct { - // ForceRestart - If true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). - ForceRestart *bool `json:"forceRestart,omitempty"` - // UpgradeReplicaSetCheckTimeout - The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - UpgradeReplicaSetCheckTimeout *string `json:"upgradeReplicaSetCheckTimeout,omitempty"` - // HealthCheckWaitDuration - The length of time to wait after completing an upgrade domain before performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - HealthCheckWaitDuration *string `json:"healthCheckWaitDuration,omitempty"` - // HealthCheckStableDuration - The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - HealthCheckStableDuration *string `json:"healthCheckStableDuration,omitempty"` - // HealthCheckRetryTimeout - The amount of time to retry health evaluation when the application or cluster is unhealthy before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - HealthCheckRetryTimeout *string `json:"healthCheckRetryTimeout,omitempty"` - // UpgradeTimeout - The amount of time the overall upgrade has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - UpgradeTimeout *string `json:"upgradeTimeout,omitempty"` - // UpgradeDomainTimeout - The amount of time each upgrade domain has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - UpgradeDomainTimeout *string `json:"upgradeDomainTimeout,omitempty"` - // HealthPolicy - The cluster health policy used when upgrading the cluster. - HealthPolicy *ClusterHealthPolicy `json:"healthPolicy,omitempty"` - // DeltaHealthPolicy - The cluster delta health policy used when upgrading the cluster. - DeltaHealthPolicy *ClusterUpgradeDeltaHealthPolicy `json:"deltaHealthPolicy,omitempty"` -} - -// ClusterVersionDetails the detail of the Service Fabric runtime version result -type ClusterVersionDetails struct { - // CodeVersion - The Service Fabric runtime version of the cluster. - CodeVersion *string `json:"codeVersion,omitempty"` - // SupportExpiryUtc - The date of expiry of support of the version. - SupportExpiryUtc *string `json:"supportExpiryUtc,omitempty"` - // Environment - Indicates if this version is for Windows or Linux operating system. Possible values include: 'Windows', 'Linux' - Environment Environment `json:"environment,omitempty"` -} - -// DiagnosticsStorageAccountConfig the storage account information for storing Service Fabric diagnostic -// logs. -type DiagnosticsStorageAccountConfig struct { - // StorageAccountName - The Azure storage account name. - StorageAccountName *string `json:"storageAccountName,omitempty"` - // ProtectedAccountKeyName - The protected diagnostics storage key name. - ProtectedAccountKeyName *string `json:"protectedAccountKeyName,omitempty"` - // BlobEndpoint - The blob endpoint of the azure storage account. - BlobEndpoint *string `json:"blobEndpoint,omitempty"` - // QueueEndpoint - The queue endpoint of the azure storage account. - QueueEndpoint *string `json:"queueEndpoint,omitempty"` - // TableEndpoint - The table endpoint of the azure storage account. - TableEndpoint *string `json:"tableEndpoint,omitempty"` -} - -// EndpointRangeDescription port range details -type EndpointRangeDescription struct { - // StartPort - Starting port of a range of ports - StartPort *int32 `json:"startPort,omitempty"` - // EndPort - End port of a range of ports - EndPort *int32 `json:"endPort,omitempty"` -} - -// ErrorModel the structure of the error. -type ErrorModel struct { - // Error - The error details. - Error *ErrorModelError `json:"error,omitempty"` -} - -// ErrorModelError the error details. -type ErrorModelError struct { - // Code - The error code. - Code *string `json:"code,omitempty"` - // Message - The error message. - Message *string `json:"message,omitempty"` -} - -// NamedPartitionSchemeDescription describes the named partition scheme of the service. -type NamedPartitionSchemeDescription struct { - // Count - The number of partitions. - Count *int32 `json:"Count,omitempty"` - // Names - Array of size specified by the ‘Count’ parameter, for the names of the partitions. - Names *[]string `json:"Names,omitempty"` - // PartitionScheme - Possible values include: 'PartitionSchemePartitionSchemeDescription', 'PartitionSchemeNamed', 'PartitionSchemeSingleton', 'PartitionSchemeUniformInt64Range' - PartitionScheme PartitionSchemeBasicPartitionSchemeDescription `json:"partitionScheme,omitempty"` -} - -// MarshalJSON is the custom marshaler for NamedPartitionSchemeDescription. -func (npsd NamedPartitionSchemeDescription) MarshalJSON() ([]byte, error) { - npsd.PartitionScheme = PartitionSchemeNamed - objectMap := make(map[string]interface{}) - if npsd.Count != nil { - objectMap["Count"] = npsd.Count - } - if npsd.Names != nil { - objectMap["Names"] = npsd.Names - } - if npsd.PartitionScheme != "" { - objectMap["partitionScheme"] = npsd.PartitionScheme - } - return json.Marshal(objectMap) -} - -// AsNamedPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for NamedPartitionSchemeDescription. -func (npsd NamedPartitionSchemeDescription) AsNamedPartitionSchemeDescription() (*NamedPartitionSchemeDescription, bool) { - return &npsd, true -} - -// AsSingletonPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for NamedPartitionSchemeDescription. -func (npsd NamedPartitionSchemeDescription) AsSingletonPartitionSchemeDescription() (*SingletonPartitionSchemeDescription, bool) { - return nil, false -} - -// AsUniformInt64RangePartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for NamedPartitionSchemeDescription. -func (npsd NamedPartitionSchemeDescription) AsUniformInt64RangePartitionSchemeDescription() (*UniformInt64RangePartitionSchemeDescription, bool) { - return nil, false -} - -// AsPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for NamedPartitionSchemeDescription. -func (npsd NamedPartitionSchemeDescription) AsPartitionSchemeDescription() (*PartitionSchemeDescription, bool) { - return nil, false -} - -// AsBasicPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for NamedPartitionSchemeDescription. -func (npsd NamedPartitionSchemeDescription) AsBasicPartitionSchemeDescription() (BasicPartitionSchemeDescription, bool) { - return &npsd, true -} - -// NodeTypeDescription describes a node type in the cluster, each node type represents sub set of nodes in -// the cluster. -type NodeTypeDescription struct { - // Name - The name of the node type. - Name *string `json:"name,omitempty"` - // PlacementProperties - The placement tags applied to nodes in the node type, which can be used to indicate where certain services (workload) should run. - PlacementProperties map[string]*string `json:"placementProperties"` - // Capacities - The capacity tags applied to the nodes in the node type, the cluster resource manager uses these tags to understand how much resource a node has. - Capacities map[string]*string `json:"capacities"` - // ClientConnectionEndpointPort - The TCP cluster management endpoint port. - ClientConnectionEndpointPort *int32 `json:"clientConnectionEndpointPort,omitempty"` - // HTTPGatewayEndpointPort - The HTTP cluster management endpoint port. - HTTPGatewayEndpointPort *int32 `json:"httpGatewayEndpointPort,omitempty"` - // DurabilityLevel - The durability level of the node type. Learn about [DurabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - // - Bronze - No privileges. This is the default. - // - Silver - The infrastructure jobs can be paused for a duration of 10 minutes per UD. - // - Gold - The infrastructure jobs can be paused for a duration of 2 hours per UD. Gold durability can be enabled only on full node VM skus like D15_V2, G5 etc. - // . Possible values include: 'Bronze', 'Silver', 'Gold' - DurabilityLevel DurabilityLevel `json:"durabilityLevel,omitempty"` - // ApplicationPorts - The range of ports from which cluster assigned port to Service Fabric applications. - ApplicationPorts *EndpointRangeDescription `json:"applicationPorts,omitempty"` - // EphemeralPorts - The range of ephemeral ports that nodes in this node type should be configured with. - EphemeralPorts *EndpointRangeDescription `json:"ephemeralPorts,omitempty"` - // IsPrimary - The node type on which system services will run. Only one node type should be marked as primary. Primary node type cannot be deleted or changed for existing clusters. - IsPrimary *bool `json:"isPrimary,omitempty"` - // VMInstanceCount - The number of nodes in the node type. This count should match the capacity property in the corresponding VirtualMachineScaleSet resource. - VMInstanceCount *int32 `json:"vmInstanceCount,omitempty"` - // ReverseProxyEndpointPort - The endpoint used by reverse proxy. - ReverseProxyEndpointPort *int32 `json:"reverseProxyEndpointPort,omitempty"` -} - -// MarshalJSON is the custom marshaler for NodeTypeDescription. -func (ntd NodeTypeDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ntd.Name != nil { - objectMap["name"] = ntd.Name - } - if ntd.PlacementProperties != nil { - objectMap["placementProperties"] = ntd.PlacementProperties - } - if ntd.Capacities != nil { - objectMap["capacities"] = ntd.Capacities - } - if ntd.ClientConnectionEndpointPort != nil { - objectMap["clientConnectionEndpointPort"] = ntd.ClientConnectionEndpointPort - } - if ntd.HTTPGatewayEndpointPort != nil { - objectMap["httpGatewayEndpointPort"] = ntd.HTTPGatewayEndpointPort - } - if ntd.DurabilityLevel != "" { - objectMap["durabilityLevel"] = ntd.DurabilityLevel - } - if ntd.ApplicationPorts != nil { - objectMap["applicationPorts"] = ntd.ApplicationPorts - } - if ntd.EphemeralPorts != nil { - objectMap["ephemeralPorts"] = ntd.EphemeralPorts - } - if ntd.IsPrimary != nil { - objectMap["isPrimary"] = ntd.IsPrimary - } - if ntd.VMInstanceCount != nil { - objectMap["vmInstanceCount"] = ntd.VMInstanceCount - } - if ntd.ReverseProxyEndpointPort != nil { - objectMap["reverseProxyEndpointPort"] = ntd.ReverseProxyEndpointPort - } - return json.Marshal(objectMap) -} - -// OperationListResult describes the result of the request to list Service Fabric resource provider -// operations. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - List of operations supported by the Service Fabric resource provider. - Value *[]OperationResult `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 OperationResult 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() OperationResult { - if !iter.page.NotDone() { - return OperationResult{} - } - 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 OperationResult 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() []OperationResult { - 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} -} - -// OperationResult available operation list result -type OperationResult struct { - // Name - The name of the operation. - Name *string `json:"name,omitempty"` - // Display - The object that represents the operation. - Display *AvailableOperationDisplay `json:"display,omitempty"` - // Origin - Origin result - Origin *string `json:"origin,omitempty"` - // NextLink - The URL to use for getting the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// BasicPartitionSchemeDescription describes how the service is partitioned. -type BasicPartitionSchemeDescription interface { - AsNamedPartitionSchemeDescription() (*NamedPartitionSchemeDescription, bool) - AsSingletonPartitionSchemeDescription() (*SingletonPartitionSchemeDescription, bool) - AsUniformInt64RangePartitionSchemeDescription() (*UniformInt64RangePartitionSchemeDescription, bool) - AsPartitionSchemeDescription() (*PartitionSchemeDescription, bool) -} - -// PartitionSchemeDescription describes how the service is partitioned. -type PartitionSchemeDescription struct { - // PartitionScheme - Possible values include: 'PartitionSchemePartitionSchemeDescription', 'PartitionSchemeNamed', 'PartitionSchemeSingleton', 'PartitionSchemeUniformInt64Range' - PartitionScheme PartitionSchemeBasicPartitionSchemeDescription `json:"partitionScheme,omitempty"` -} - -func unmarshalBasicPartitionSchemeDescription(body []byte) (BasicPartitionSchemeDescription, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["partitionScheme"] { - case string(PartitionSchemeNamed): - var npsd NamedPartitionSchemeDescription - err := json.Unmarshal(body, &npsd) - return npsd, err - case string(PartitionSchemeSingleton): - var spsd SingletonPartitionSchemeDescription - err := json.Unmarshal(body, &spsd) - return spsd, err - case string(PartitionSchemeUniformInt64Range): - var ui6rpsd UniformInt64RangePartitionSchemeDescription - err := json.Unmarshal(body, &ui6rpsd) - return ui6rpsd, err - default: - var psd PartitionSchemeDescription - err := json.Unmarshal(body, &psd) - return psd, err - } -} -func unmarshalBasicPartitionSchemeDescriptionArray(body []byte) ([]BasicPartitionSchemeDescription, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - psdArray := make([]BasicPartitionSchemeDescription, len(rawMessages)) - - for index, rawMessage := range rawMessages { - psd, err := unmarshalBasicPartitionSchemeDescription(*rawMessage) - if err != nil { - return nil, err - } - psdArray[index] = psd - } - return psdArray, nil -} - -// MarshalJSON is the custom marshaler for PartitionSchemeDescription. -func (psd PartitionSchemeDescription) MarshalJSON() ([]byte, error) { - psd.PartitionScheme = PartitionSchemePartitionSchemeDescription - objectMap := make(map[string]interface{}) - if psd.PartitionScheme != "" { - objectMap["partitionScheme"] = psd.PartitionScheme - } - return json.Marshal(objectMap) -} - -// AsNamedPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for PartitionSchemeDescription. -func (psd PartitionSchemeDescription) AsNamedPartitionSchemeDescription() (*NamedPartitionSchemeDescription, bool) { - return nil, false -} - -// AsSingletonPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for PartitionSchemeDescription. -func (psd PartitionSchemeDescription) AsSingletonPartitionSchemeDescription() (*SingletonPartitionSchemeDescription, bool) { - return nil, false -} - -// AsUniformInt64RangePartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for PartitionSchemeDescription. -func (psd PartitionSchemeDescription) AsUniformInt64RangePartitionSchemeDescription() (*UniformInt64RangePartitionSchemeDescription, bool) { - return nil, false -} - -// AsPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for PartitionSchemeDescription. -func (psd PartitionSchemeDescription) AsPartitionSchemeDescription() (*PartitionSchemeDescription, bool) { - return &psd, true -} - -// AsBasicPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for PartitionSchemeDescription. -func (psd PartitionSchemeDescription) AsBasicPartitionSchemeDescription() (BasicPartitionSchemeDescription, bool) { - return &psd, true -} - -// ProxyResource the resource model definition for proxy-only resource. -type ProxyResource struct { - // ID - READ-ONLY; Azure resource identifier. - 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"` - // Location - Azure resource location. - Location *string `json:"location,omitempty"` - // Tags - Azure resource tags. - Tags map[string]*string `json:"tags"` - // Etag - READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProxyResource. -func (pr ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pr.Location != nil { - objectMap["location"] = pr.Location - } - if pr.Tags != nil { - objectMap["tags"] = pr.Tags - } - return json.Marshal(objectMap) -} - -// Resource the resource model definition. -type Resource struct { - // ID - READ-ONLY; Azure resource identifier. - 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"` - // Location - Azure resource location. - Location *string `json:"location,omitempty"` - // Tags - Azure resource tags. - Tags map[string]*string `json:"tags"` - // Etag - READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } - return json.Marshal(objectMap) -} - -// ServerCertificateCommonName describes the server certificate details using common name. -type ServerCertificateCommonName struct { - // CertificateCommonName - The common name of the server certificate. - CertificateCommonName *string `json:"certificateCommonName,omitempty"` - // CertificateIssuerThumbprint - The issuer thumbprint of the server certificate. - CertificateIssuerThumbprint *string `json:"certificateIssuerThumbprint,omitempty"` -} - -// ServerCertificateCommonNames describes a list of server certificates referenced by common name that are -// used to secure the cluster. -type ServerCertificateCommonNames struct { - // CommonNames - The list of server certificates referenced by common name that are used to secure the cluster. - CommonNames *[]ServerCertificateCommonName `json:"commonNames,omitempty"` - // X509StoreName - The local certificate store location. Possible values include: 'X509StoreName1AddressBook', 'X509StoreName1AuthRoot', 'X509StoreName1CertificateAuthority', 'X509StoreName1Disallowed', 'X509StoreName1My', 'X509StoreName1Root', 'X509StoreName1TrustedPeople', 'X509StoreName1TrustedPublisher' - X509StoreName X509StoreName1 `json:"x509StoreName,omitempty"` -} - -// ServiceCorrelationDescription creates a particular correlation between services. -type ServiceCorrelationDescription struct { - // Scheme - The ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. Possible values include: 'ServiceCorrelationSchemeInvalid', 'ServiceCorrelationSchemeAffinity', 'ServiceCorrelationSchemeAlignedAffinity', 'ServiceCorrelationSchemeNonAlignedAffinity' - Scheme ServiceCorrelationScheme `json:"scheme,omitempty"` - // ServiceName - The name of the service that the correlation relationship is established with. - ServiceName *string `json:"serviceName,omitempty"` -} - -// ServiceLoadMetricDescription specifies a metric to load balance a service during runtime. -type ServiceLoadMetricDescription struct { - // Name - The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive. - Name *string `json:"name,omitempty"` - // Weight - The service load metric relative weight, compared to other metrics configured for this service, as a number. Possible values include: 'ServiceLoadMetricWeightZero', 'ServiceLoadMetricWeightLow', 'ServiceLoadMetricWeightMedium', 'ServiceLoadMetricWeightHigh' - Weight ServiceLoadMetricWeight `json:"weight,omitempty"` - // PrimaryDefaultLoad - Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica. - PrimaryDefaultLoad *int32 `json:"primaryDefaultLoad,omitempty"` - // SecondaryDefaultLoad - Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica. - SecondaryDefaultLoad *int32 `json:"secondaryDefaultLoad,omitempty"` - // DefaultLoad - Used only for Stateless services. The default amount of load, as a number, that this service creates for this metric. - DefaultLoad *int32 `json:"defaultLoad,omitempty"` -} - -// BasicServicePlacementPolicyDescription describes the policy to be used for placement of a Service Fabric service. -type BasicServicePlacementPolicyDescription interface { - AsServicePlacementPolicyDescription() (*ServicePlacementPolicyDescription, bool) -} - -// ServicePlacementPolicyDescription describes the policy to be used for placement of a Service Fabric service. -type ServicePlacementPolicyDescription struct { - // Type - Possible values include: 'TypeServicePlacementPolicyDescription' - Type Type `json:"Type,omitempty"` -} - -func unmarshalBasicServicePlacementPolicyDescription(body []byte) (BasicServicePlacementPolicyDescription, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["Type"] { - default: - var sppd ServicePlacementPolicyDescription - err := json.Unmarshal(body, &sppd) - return sppd, err - } -} -func unmarshalBasicServicePlacementPolicyDescriptionArray(body []byte) ([]BasicServicePlacementPolicyDescription, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - sppdArray := make([]BasicServicePlacementPolicyDescription, len(rawMessages)) - - for index, rawMessage := range rawMessages { - sppd, err := unmarshalBasicServicePlacementPolicyDescription(*rawMessage) - if err != nil { - return nil, err - } - sppdArray[index] = sppd - } - return sppdArray, nil -} - -// MarshalJSON is the custom marshaler for ServicePlacementPolicyDescription. -func (sppd ServicePlacementPolicyDescription) MarshalJSON() ([]byte, error) { - sppd.Type = TypeServicePlacementPolicyDescription - objectMap := make(map[string]interface{}) - if sppd.Type != "" { - objectMap["Type"] = sppd.Type - } - return json.Marshal(objectMap) -} - -// AsServicePlacementPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPolicyDescription. -func (sppd ServicePlacementPolicyDescription) AsServicePlacementPolicyDescription() (*ServicePlacementPolicyDescription, bool) { - return &sppd, true -} - -// AsBasicServicePlacementPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPolicyDescription. -func (sppd ServicePlacementPolicyDescription) AsBasicServicePlacementPolicyDescription() (BasicServicePlacementPolicyDescription, bool) { - return &sppd, true -} - -// ServiceResource the service resource. -type ServiceResource struct { - autorest.Response `json:"-"` - // BasicServiceResourceProperties - The service resource properties. - BasicServiceResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Azure resource identifier. - 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"` - // Location - Azure resource location. - Location *string `json:"location,omitempty"` - // Tags - Azure resource tags. - Tags map[string]*string `json:"tags"` - // Etag - READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceResource. -func (sr ServiceResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = sr.BasicServiceResourceProperties - if sr.Location != nil { - objectMap["location"] = sr.Location - } - if sr.Tags != nil { - objectMap["tags"] = sr.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServiceResource struct. -func (sr *ServiceResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - basicServiceResourceProperties, err := unmarshalBasicServiceResourceProperties(*v) - if err != nil { - return err - } - sr.BasicServiceResourceProperties = basicServiceResourceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - sr.Tags = tags - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sr.Etag = &etag - } - } - } - - return nil -} - -// ServiceResourceList the list of service resources. -type ServiceResourceList struct { - autorest.Response `json:"-"` - Value *[]ServiceResource `json:"value,omitempty"` - // NextLink - READ-ONLY; URL to get the next set of service list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// BasicServiceResourceProperties the service resource properties. -type BasicServiceResourceProperties interface { - AsStatefulServiceProperties() (*StatefulServiceProperties, bool) - AsStatelessServiceProperties() (*StatelessServiceProperties, bool) - AsServiceResourceProperties() (*ServiceResourceProperties, bool) -} - -// ServiceResourceProperties the service resource properties. -type ServiceResourceProperties struct { - // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response - ProvisioningState *string `json:"provisioningState,omitempty"` - // ServiceTypeName - The name of the service type - ServiceTypeName *string `json:"serviceTypeName,omitempty"` - // PartitionDescription - Describes how the service is partitioned. - PartitionDescription BasicPartitionSchemeDescription `json:"partitionDescription,omitempty"` - // ServicePackageActivationMode - The activation Mode of the service package. Possible values include: 'SharedProcess', 'ExclusiveProcess' - ServicePackageActivationMode ArmServicePackageActivationMode `json:"servicePackageActivationMode,omitempty"` - // ServiceKind - Possible values include: 'ServiceKindServiceResourceProperties', 'ServiceKindStateful1', 'ServiceKindStateless1' - ServiceKind ServiceKindBasicServiceResourceProperties `json:"serviceKind,omitempty"` - // PlacementConstraints - The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - PlacementConstraints *string `json:"placementConstraints,omitempty"` - // CorrelationScheme - A list that describes the correlation of the service with other services. - CorrelationScheme *[]ServiceCorrelationDescription `json:"correlationScheme,omitempty"` - // ServiceLoadMetrics - The service load metrics is given as an array of ServiceLoadMetricDescription objects. - ServiceLoadMetrics *[]ServiceLoadMetricDescription `json:"serviceLoadMetrics,omitempty"` - // ServicePlacementPolicies - A list that describes the correlation of the service with other services. - ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"servicePlacementPolicies,omitempty"` - // DefaultMoveCost - Specifies the move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' - DefaultMoveCost MoveCost `json:"defaultMoveCost,omitempty"` -} - -func unmarshalBasicServiceResourceProperties(body []byte) (BasicServiceResourceProperties, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["serviceKind"] { - case string(ServiceKindStateful1): - var ssp StatefulServiceProperties - err := json.Unmarshal(body, &ssp) - return ssp, err - case string(ServiceKindStateless1): - var ssp StatelessServiceProperties - err := json.Unmarshal(body, &ssp) - return ssp, err - default: - var srp ServiceResourceProperties - err := json.Unmarshal(body, &srp) - return srp, err - } -} -func unmarshalBasicServiceResourcePropertiesArray(body []byte) ([]BasicServiceResourceProperties, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - srpArray := make([]BasicServiceResourceProperties, len(rawMessages)) - - for index, rawMessage := range rawMessages { - srp, err := unmarshalBasicServiceResourceProperties(*rawMessage) - if err != nil { - return nil, err - } - srpArray[index] = srp - } - return srpArray, nil -} - -// MarshalJSON is the custom marshaler for ServiceResourceProperties. -func (srp ServiceResourceProperties) MarshalJSON() ([]byte, error) { - srp.ServiceKind = ServiceKindServiceResourceProperties - objectMap := make(map[string]interface{}) - if srp.ServiceTypeName != nil { - objectMap["serviceTypeName"] = srp.ServiceTypeName - } - objectMap["partitionDescription"] = srp.PartitionDescription - if srp.ServicePackageActivationMode != "" { - objectMap["servicePackageActivationMode"] = srp.ServicePackageActivationMode - } - if srp.ServiceKind != "" { - objectMap["serviceKind"] = srp.ServiceKind - } - if srp.PlacementConstraints != nil { - objectMap["placementConstraints"] = srp.PlacementConstraints - } - if srp.CorrelationScheme != nil { - objectMap["correlationScheme"] = srp.CorrelationScheme - } - if srp.ServiceLoadMetrics != nil { - objectMap["serviceLoadMetrics"] = srp.ServiceLoadMetrics - } - if srp.ServicePlacementPolicies != nil { - objectMap["servicePlacementPolicies"] = srp.ServicePlacementPolicies - } - if srp.DefaultMoveCost != "" { - objectMap["defaultMoveCost"] = srp.DefaultMoveCost - } - return json.Marshal(objectMap) -} - -// AsStatefulServiceProperties is the BasicServiceResourceProperties implementation for ServiceResourceProperties. -func (srp ServiceResourceProperties) AsStatefulServiceProperties() (*StatefulServiceProperties, bool) { - return nil, false -} - -// AsStatelessServiceProperties is the BasicServiceResourceProperties implementation for ServiceResourceProperties. -func (srp ServiceResourceProperties) AsStatelessServiceProperties() (*StatelessServiceProperties, bool) { - return nil, false -} - -// AsServiceResourceProperties is the BasicServiceResourceProperties implementation for ServiceResourceProperties. -func (srp ServiceResourceProperties) AsServiceResourceProperties() (*ServiceResourceProperties, bool) { - return &srp, true -} - -// AsBasicServiceResourceProperties is the BasicServiceResourceProperties implementation for ServiceResourceProperties. -func (srp ServiceResourceProperties) AsBasicServiceResourceProperties() (BasicServiceResourceProperties, bool) { - return &srp, true -} - -// UnmarshalJSON is the custom unmarshaler for ServiceResourceProperties struct. -func (srp *ServiceResourceProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "provisioningState": - if v != nil { - var provisioningState string - err = json.Unmarshal(*v, &provisioningState) - if err != nil { - return err - } - srp.ProvisioningState = &provisioningState - } - case "serviceTypeName": - if v != nil { - var serviceTypeName string - err = json.Unmarshal(*v, &serviceTypeName) - if err != nil { - return err - } - srp.ServiceTypeName = &serviceTypeName - } - case "partitionDescription": - if v != nil { - partitionDescription, err := unmarshalBasicPartitionSchemeDescription(*v) - if err != nil { - return err - } - srp.PartitionDescription = partitionDescription - } - case "servicePackageActivationMode": - if v != nil { - var servicePackageActivationMode ArmServicePackageActivationMode - err = json.Unmarshal(*v, &servicePackageActivationMode) - if err != nil { - return err - } - srp.ServicePackageActivationMode = servicePackageActivationMode - } - case "serviceKind": - if v != nil { - var serviceKind ServiceKindBasicServiceResourceProperties - err = json.Unmarshal(*v, &serviceKind) - if err != nil { - return err - } - srp.ServiceKind = serviceKind - } - case "placementConstraints": - if v != nil { - var placementConstraints string - err = json.Unmarshal(*v, &placementConstraints) - if err != nil { - return err - } - srp.PlacementConstraints = &placementConstraints - } - case "correlationScheme": - if v != nil { - var correlationScheme []ServiceCorrelationDescription - err = json.Unmarshal(*v, &correlationScheme) - if err != nil { - return err - } - srp.CorrelationScheme = &correlationScheme - } - case "serviceLoadMetrics": - if v != nil { - var serviceLoadMetrics []ServiceLoadMetricDescription - err = json.Unmarshal(*v, &serviceLoadMetrics) - if err != nil { - return err - } - srp.ServiceLoadMetrics = &serviceLoadMetrics - } - case "servicePlacementPolicies": - if v != nil { - servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) - if err != nil { - return err - } - srp.ServicePlacementPolicies = &servicePlacementPolicies - } - case "defaultMoveCost": - if v != nil { - var defaultMoveCost MoveCost - err = json.Unmarshal(*v, &defaultMoveCost) - if err != nil { - return err - } - srp.DefaultMoveCost = defaultMoveCost - } - } - } - - return nil -} - -// ServiceResourcePropertiesBase the common service resource properties. -type ServiceResourcePropertiesBase struct { - // PlacementConstraints - The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - PlacementConstraints *string `json:"placementConstraints,omitempty"` - // CorrelationScheme - A list that describes the correlation of the service with other services. - CorrelationScheme *[]ServiceCorrelationDescription `json:"correlationScheme,omitempty"` - // ServiceLoadMetrics - The service load metrics is given as an array of ServiceLoadMetricDescription objects. - ServiceLoadMetrics *[]ServiceLoadMetricDescription `json:"serviceLoadMetrics,omitempty"` - // ServicePlacementPolicies - A list that describes the correlation of the service with other services. - ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"servicePlacementPolicies,omitempty"` - // DefaultMoveCost - Specifies the move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' - DefaultMoveCost MoveCost `json:"defaultMoveCost,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for ServiceResourcePropertiesBase struct. -func (srpb *ServiceResourcePropertiesBase) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "placementConstraints": - if v != nil { - var placementConstraints string - err = json.Unmarshal(*v, &placementConstraints) - if err != nil { - return err - } - srpb.PlacementConstraints = &placementConstraints - } - case "correlationScheme": - if v != nil { - var correlationScheme []ServiceCorrelationDescription - err = json.Unmarshal(*v, &correlationScheme) - if err != nil { - return err - } - srpb.CorrelationScheme = &correlationScheme - } - case "serviceLoadMetrics": - if v != nil { - var serviceLoadMetrics []ServiceLoadMetricDescription - err = json.Unmarshal(*v, &serviceLoadMetrics) - if err != nil { - return err - } - srpb.ServiceLoadMetrics = &serviceLoadMetrics - } - case "servicePlacementPolicies": - if v != nil { - servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) - if err != nil { - return err - } - srpb.ServicePlacementPolicies = &servicePlacementPolicies - } - case "defaultMoveCost": - if v != nil { - var defaultMoveCost MoveCost - err = json.Unmarshal(*v, &defaultMoveCost) - if err != nil { - return err - } - srpb.DefaultMoveCost = defaultMoveCost - } - } - } - - return nil -} - -// ServiceResourceUpdate the service resource for patch operations. -type ServiceResourceUpdate struct { - // BasicServiceResourceUpdateProperties - The service resource properties for patch operations. - BasicServiceResourceUpdateProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Azure resource identifier. - 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"` - // Location - Azure resource location. - Location *string `json:"location,omitempty"` - // Tags - Azure resource tags. - Tags map[string]*string `json:"tags"` - // Etag - READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceResourceUpdate. -func (sru ServiceResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = sru.BasicServiceResourceUpdateProperties - if sru.Location != nil { - objectMap["location"] = sru.Location - } - if sru.Tags != nil { - objectMap["tags"] = sru.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServiceResourceUpdate struct. -func (sru *ServiceResourceUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - basicServiceResourceUpdateProperties, err := unmarshalBasicServiceResourceUpdateProperties(*v) - if err != nil { - return err - } - sru.BasicServiceResourceUpdateProperties = basicServiceResourceUpdateProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sru.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sru.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sru.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sru.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - sru.Tags = tags - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sru.Etag = &etag - } - } - } - - return nil -} - -// BasicServiceResourceUpdateProperties the service resource properties for patch operations. -type BasicServiceResourceUpdateProperties interface { - AsStatefulServiceUpdateProperties() (*StatefulServiceUpdateProperties, bool) - AsStatelessServiceUpdateProperties() (*StatelessServiceUpdateProperties, bool) - AsServiceResourceUpdateProperties() (*ServiceResourceUpdateProperties, bool) -} - -// ServiceResourceUpdateProperties the service resource properties for patch operations. -type ServiceResourceUpdateProperties struct { - // ServiceKind - Possible values include: 'ServiceKindBasicServiceResourceUpdatePropertiesServiceKindServiceResourceUpdateProperties', 'ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateful', 'ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateless' - ServiceKind ServiceKindBasicServiceResourceUpdateProperties `json:"serviceKind,omitempty"` - // PlacementConstraints - The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - PlacementConstraints *string `json:"placementConstraints,omitempty"` - // CorrelationScheme - A list that describes the correlation of the service with other services. - CorrelationScheme *[]ServiceCorrelationDescription `json:"correlationScheme,omitempty"` - // ServiceLoadMetrics - The service load metrics is given as an array of ServiceLoadMetricDescription objects. - ServiceLoadMetrics *[]ServiceLoadMetricDescription `json:"serviceLoadMetrics,omitempty"` - // ServicePlacementPolicies - A list that describes the correlation of the service with other services. - ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"servicePlacementPolicies,omitempty"` - // DefaultMoveCost - Specifies the move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' - DefaultMoveCost MoveCost `json:"defaultMoveCost,omitempty"` -} - -func unmarshalBasicServiceResourceUpdateProperties(body []byte) (BasicServiceResourceUpdateProperties, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["serviceKind"] { - case string(ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateful): - var ssup StatefulServiceUpdateProperties - err := json.Unmarshal(body, &ssup) - return ssup, err - case string(ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateless): - var ssup StatelessServiceUpdateProperties - err := json.Unmarshal(body, &ssup) - return ssup, err - default: - var srup ServiceResourceUpdateProperties - err := json.Unmarshal(body, &srup) - return srup, err - } -} -func unmarshalBasicServiceResourceUpdatePropertiesArray(body []byte) ([]BasicServiceResourceUpdateProperties, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - srupArray := make([]BasicServiceResourceUpdateProperties, len(rawMessages)) - - for index, rawMessage := range rawMessages { - srup, err := unmarshalBasicServiceResourceUpdateProperties(*rawMessage) - if err != nil { - return nil, err - } - srupArray[index] = srup - } - return srupArray, nil -} - -// MarshalJSON is the custom marshaler for ServiceResourceUpdateProperties. -func (srup ServiceResourceUpdateProperties) MarshalJSON() ([]byte, error) { - srup.ServiceKind = ServiceKindBasicServiceResourceUpdatePropertiesServiceKindServiceResourceUpdateProperties - objectMap := make(map[string]interface{}) - if srup.ServiceKind != "" { - objectMap["serviceKind"] = srup.ServiceKind - } - if srup.PlacementConstraints != nil { - objectMap["placementConstraints"] = srup.PlacementConstraints - } - if srup.CorrelationScheme != nil { - objectMap["correlationScheme"] = srup.CorrelationScheme - } - if srup.ServiceLoadMetrics != nil { - objectMap["serviceLoadMetrics"] = srup.ServiceLoadMetrics - } - if srup.ServicePlacementPolicies != nil { - objectMap["servicePlacementPolicies"] = srup.ServicePlacementPolicies - } - if srup.DefaultMoveCost != "" { - objectMap["defaultMoveCost"] = srup.DefaultMoveCost - } - return json.Marshal(objectMap) -} - -// AsStatefulServiceUpdateProperties is the BasicServiceResourceUpdateProperties implementation for ServiceResourceUpdateProperties. -func (srup ServiceResourceUpdateProperties) AsStatefulServiceUpdateProperties() (*StatefulServiceUpdateProperties, bool) { - return nil, false -} - -// AsStatelessServiceUpdateProperties is the BasicServiceResourceUpdateProperties implementation for ServiceResourceUpdateProperties. -func (srup ServiceResourceUpdateProperties) AsStatelessServiceUpdateProperties() (*StatelessServiceUpdateProperties, bool) { - return nil, false -} - -// AsServiceResourceUpdateProperties is the BasicServiceResourceUpdateProperties implementation for ServiceResourceUpdateProperties. -func (srup ServiceResourceUpdateProperties) AsServiceResourceUpdateProperties() (*ServiceResourceUpdateProperties, bool) { - return &srup, true -} - -// AsBasicServiceResourceUpdateProperties is the BasicServiceResourceUpdateProperties implementation for ServiceResourceUpdateProperties. -func (srup ServiceResourceUpdateProperties) AsBasicServiceResourceUpdateProperties() (BasicServiceResourceUpdateProperties, bool) { - return &srup, true -} - -// UnmarshalJSON is the custom unmarshaler for ServiceResourceUpdateProperties struct. -func (srup *ServiceResourceUpdateProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "serviceKind": - if v != nil { - var serviceKind ServiceKindBasicServiceResourceUpdateProperties - err = json.Unmarshal(*v, &serviceKind) - if err != nil { - return err - } - srup.ServiceKind = serviceKind - } - case "placementConstraints": - if v != nil { - var placementConstraints string - err = json.Unmarshal(*v, &placementConstraints) - if err != nil { - return err - } - srup.PlacementConstraints = &placementConstraints - } - case "correlationScheme": - if v != nil { - var correlationScheme []ServiceCorrelationDescription - err = json.Unmarshal(*v, &correlationScheme) - if err != nil { - return err - } - srup.CorrelationScheme = &correlationScheme - } - case "serviceLoadMetrics": - if v != nil { - var serviceLoadMetrics []ServiceLoadMetricDescription - err = json.Unmarshal(*v, &serviceLoadMetrics) - if err != nil { - return err - } - srup.ServiceLoadMetrics = &serviceLoadMetrics - } - case "servicePlacementPolicies": - if v != nil { - servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) - if err != nil { - return err - } - srup.ServicePlacementPolicies = &servicePlacementPolicies - } - case "defaultMoveCost": - if v != nil { - var defaultMoveCost MoveCost - err = json.Unmarshal(*v, &defaultMoveCost) - if err != nil { - return err - } - srup.DefaultMoveCost = defaultMoveCost - } - } - } - - return nil -} - -// ServicesCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServicesCreateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServicesCreateFuture) Result(client ServicesClient) (sr ServiceResource, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ServicesCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("servicefabric.ServicesCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { - sr, err = client.CreateResponder(sr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ServicesCreateFuture", "Result", sr.Response.Response, "Failure responding to request") - } - } - return -} - -// ServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServicesDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServicesDeleteFuture) Result(client ServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ServicesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("servicefabric.ServicesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServicesUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServicesUpdateFuture) Result(client ServicesClient) (sr ServiceResource, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ServicesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("servicefabric.ServicesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { - sr, err = client.UpdateResponder(sr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ServicesUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") - } - } - return -} - -// ServiceTypeDeltaHealthPolicy represents the delta health policy used to evaluate the health of services -// belonging to a service type when upgrading the cluster. -type ServiceTypeDeltaHealthPolicy struct { - // MaxPercentDeltaUnhealthyServices - The maximum allowed percentage of services health degradation allowed during cluster upgrades. - // The delta is measured between the state of the services at the beginning of upgrade and the state of the services at the time of the health evaluation. - // The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. - MaxPercentDeltaUnhealthyServices *int32 `json:"maxPercentDeltaUnhealthyServices,omitempty"` -} - -// ServiceTypeHealthPolicy represents the health policy used to evaluate the health of services belonging -// to a service type. -type ServiceTypeHealthPolicy struct { - // MaxPercentUnhealthyServices - The maximum percentage of services allowed to be unhealthy before your application is considered in error. - MaxPercentUnhealthyServices *int32 `json:"maxPercentUnhealthyServices,omitempty"` -} - -// SettingsParameterDescription describes a parameter in fabric settings of the cluster. -type SettingsParameterDescription struct { - // Name - The parameter name of fabric setting. - Name *string `json:"name,omitempty"` - // Value - The parameter value of fabric setting. - Value *string `json:"value,omitempty"` -} - -// SettingsSectionDescription describes a section in the fabric settings of the cluster. -type SettingsSectionDescription struct { - // Name - The section name of the fabric settings. - Name *string `json:"name,omitempty"` - // Parameters - The collection of parameters in the section. - Parameters *[]SettingsParameterDescription `json:"parameters,omitempty"` -} - -// SingletonPartitionSchemeDescription describes the partition scheme of a singleton-partitioned, or -// non-partitioned service. -type SingletonPartitionSchemeDescription struct { - // PartitionScheme - Possible values include: 'PartitionSchemePartitionSchemeDescription', 'PartitionSchemeNamed', 'PartitionSchemeSingleton', 'PartitionSchemeUniformInt64Range' - PartitionScheme PartitionSchemeBasicPartitionSchemeDescription `json:"partitionScheme,omitempty"` -} - -// MarshalJSON is the custom marshaler for SingletonPartitionSchemeDescription. -func (spsd SingletonPartitionSchemeDescription) MarshalJSON() ([]byte, error) { - spsd.PartitionScheme = PartitionSchemeSingleton - objectMap := make(map[string]interface{}) - if spsd.PartitionScheme != "" { - objectMap["partitionScheme"] = spsd.PartitionScheme - } - return json.Marshal(objectMap) -} - -// AsNamedPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for SingletonPartitionSchemeDescription. -func (spsd SingletonPartitionSchemeDescription) AsNamedPartitionSchemeDescription() (*NamedPartitionSchemeDescription, bool) { - return nil, false -} - -// AsSingletonPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for SingletonPartitionSchemeDescription. -func (spsd SingletonPartitionSchemeDescription) AsSingletonPartitionSchemeDescription() (*SingletonPartitionSchemeDescription, bool) { - return &spsd, true -} - -// AsUniformInt64RangePartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for SingletonPartitionSchemeDescription. -func (spsd SingletonPartitionSchemeDescription) AsUniformInt64RangePartitionSchemeDescription() (*UniformInt64RangePartitionSchemeDescription, bool) { - return nil, false -} - -// AsPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for SingletonPartitionSchemeDescription. -func (spsd SingletonPartitionSchemeDescription) AsPartitionSchemeDescription() (*PartitionSchemeDescription, bool) { - return nil, false -} - -// AsBasicPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for SingletonPartitionSchemeDescription. -func (spsd SingletonPartitionSchemeDescription) AsBasicPartitionSchemeDescription() (BasicPartitionSchemeDescription, bool) { - return &spsd, true -} - -// StatefulServiceProperties the properties of a stateful service resource. -type StatefulServiceProperties struct { - // HasPersistedState - A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. - HasPersistedState *bool `json:"hasPersistedState,omitempty"` - // TargetReplicaSetSize - The target replica set size as a number. - TargetReplicaSetSize *int32 `json:"targetReplicaSetSize,omitempty"` - // MinReplicaSetSize - The minimum replica set size as a number. - MinReplicaSetSize *int32 `json:"minReplicaSetSize,omitempty"` - // ReplicaRestartWaitDuration - The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format (hh:mm:ss.s). - ReplicaRestartWaitDuration *date.Time `json:"replicaRestartWaitDuration,omitempty"` - // QuorumLossWaitDuration - The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). - QuorumLossWaitDuration *date.Time `json:"quorumLossWaitDuration,omitempty"` - // StandByReplicaKeepDuration - The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). - StandByReplicaKeepDuration *date.Time `json:"standByReplicaKeepDuration,omitempty"` - // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response - ProvisioningState *string `json:"provisioningState,omitempty"` - // ServiceTypeName - The name of the service type - ServiceTypeName *string `json:"serviceTypeName,omitempty"` - // PartitionDescription - Describes how the service is partitioned. - PartitionDescription BasicPartitionSchemeDescription `json:"partitionDescription,omitempty"` - // ServicePackageActivationMode - The activation Mode of the service package. Possible values include: 'SharedProcess', 'ExclusiveProcess' - ServicePackageActivationMode ArmServicePackageActivationMode `json:"servicePackageActivationMode,omitempty"` - // ServiceKind - Possible values include: 'ServiceKindServiceResourceProperties', 'ServiceKindStateful1', 'ServiceKindStateless1' - ServiceKind ServiceKindBasicServiceResourceProperties `json:"serviceKind,omitempty"` - // PlacementConstraints - The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - PlacementConstraints *string `json:"placementConstraints,omitempty"` - // CorrelationScheme - A list that describes the correlation of the service with other services. - CorrelationScheme *[]ServiceCorrelationDescription `json:"correlationScheme,omitempty"` - // ServiceLoadMetrics - The service load metrics is given as an array of ServiceLoadMetricDescription objects. - ServiceLoadMetrics *[]ServiceLoadMetricDescription `json:"serviceLoadMetrics,omitempty"` - // ServicePlacementPolicies - A list that describes the correlation of the service with other services. - ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"servicePlacementPolicies,omitempty"` - // DefaultMoveCost - Specifies the move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' - DefaultMoveCost MoveCost `json:"defaultMoveCost,omitempty"` -} - -// MarshalJSON is the custom marshaler for StatefulServiceProperties. -func (ssp StatefulServiceProperties) MarshalJSON() ([]byte, error) { - ssp.ServiceKind = ServiceKindStateful1 - objectMap := make(map[string]interface{}) - if ssp.HasPersistedState != nil { - objectMap["hasPersistedState"] = ssp.HasPersistedState - } - if ssp.TargetReplicaSetSize != nil { - objectMap["targetReplicaSetSize"] = ssp.TargetReplicaSetSize - } - if ssp.MinReplicaSetSize != nil { - objectMap["minReplicaSetSize"] = ssp.MinReplicaSetSize - } - if ssp.ReplicaRestartWaitDuration != nil { - objectMap["replicaRestartWaitDuration"] = ssp.ReplicaRestartWaitDuration - } - if ssp.QuorumLossWaitDuration != nil { - objectMap["quorumLossWaitDuration"] = ssp.QuorumLossWaitDuration - } - if ssp.StandByReplicaKeepDuration != nil { - objectMap["standByReplicaKeepDuration"] = ssp.StandByReplicaKeepDuration - } - if ssp.ServiceTypeName != nil { - objectMap["serviceTypeName"] = ssp.ServiceTypeName - } - objectMap["partitionDescription"] = ssp.PartitionDescription - if ssp.ServicePackageActivationMode != "" { - objectMap["servicePackageActivationMode"] = ssp.ServicePackageActivationMode - } - if ssp.ServiceKind != "" { - objectMap["serviceKind"] = ssp.ServiceKind - } - if ssp.PlacementConstraints != nil { - objectMap["placementConstraints"] = ssp.PlacementConstraints - } - if ssp.CorrelationScheme != nil { - objectMap["correlationScheme"] = ssp.CorrelationScheme - } - if ssp.ServiceLoadMetrics != nil { - objectMap["serviceLoadMetrics"] = ssp.ServiceLoadMetrics - } - if ssp.ServicePlacementPolicies != nil { - objectMap["servicePlacementPolicies"] = ssp.ServicePlacementPolicies - } - if ssp.DefaultMoveCost != "" { - objectMap["defaultMoveCost"] = ssp.DefaultMoveCost - } - return json.Marshal(objectMap) -} - -// AsStatefulServiceProperties is the BasicServiceResourceProperties implementation for StatefulServiceProperties. -func (ssp StatefulServiceProperties) AsStatefulServiceProperties() (*StatefulServiceProperties, bool) { - return &ssp, true -} - -// AsStatelessServiceProperties is the BasicServiceResourceProperties implementation for StatefulServiceProperties. -func (ssp StatefulServiceProperties) AsStatelessServiceProperties() (*StatelessServiceProperties, bool) { - return nil, false -} - -// AsServiceResourceProperties is the BasicServiceResourceProperties implementation for StatefulServiceProperties. -func (ssp StatefulServiceProperties) AsServiceResourceProperties() (*ServiceResourceProperties, bool) { - return nil, false -} - -// AsBasicServiceResourceProperties is the BasicServiceResourceProperties implementation for StatefulServiceProperties. -func (ssp StatefulServiceProperties) AsBasicServiceResourceProperties() (BasicServiceResourceProperties, bool) { - return &ssp, true -} - -// UnmarshalJSON is the custom unmarshaler for StatefulServiceProperties struct. -func (ssp *StatefulServiceProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "hasPersistedState": - if v != nil { - var hasPersistedState bool - err = json.Unmarshal(*v, &hasPersistedState) - if err != nil { - return err - } - ssp.HasPersistedState = &hasPersistedState - } - case "targetReplicaSetSize": - if v != nil { - var targetReplicaSetSize int32 - err = json.Unmarshal(*v, &targetReplicaSetSize) - if err != nil { - return err - } - ssp.TargetReplicaSetSize = &targetReplicaSetSize - } - case "minReplicaSetSize": - if v != nil { - var minReplicaSetSize int32 - err = json.Unmarshal(*v, &minReplicaSetSize) - if err != nil { - return err - } - ssp.MinReplicaSetSize = &minReplicaSetSize - } - case "replicaRestartWaitDuration": - if v != nil { - var replicaRestartWaitDuration date.Time - err = json.Unmarshal(*v, &replicaRestartWaitDuration) - if err != nil { - return err - } - ssp.ReplicaRestartWaitDuration = &replicaRestartWaitDuration - } - case "quorumLossWaitDuration": - if v != nil { - var quorumLossWaitDuration date.Time - err = json.Unmarshal(*v, &quorumLossWaitDuration) - if err != nil { - return err - } - ssp.QuorumLossWaitDuration = &quorumLossWaitDuration - } - case "standByReplicaKeepDuration": - if v != nil { - var standByReplicaKeepDuration date.Time - err = json.Unmarshal(*v, &standByReplicaKeepDuration) - if err != nil { - return err - } - ssp.StandByReplicaKeepDuration = &standByReplicaKeepDuration - } - case "provisioningState": - if v != nil { - var provisioningState string - err = json.Unmarshal(*v, &provisioningState) - if err != nil { - return err - } - ssp.ProvisioningState = &provisioningState - } - case "serviceTypeName": - if v != nil { - var serviceTypeName string - err = json.Unmarshal(*v, &serviceTypeName) - if err != nil { - return err - } - ssp.ServiceTypeName = &serviceTypeName - } - case "partitionDescription": - if v != nil { - partitionDescription, err := unmarshalBasicPartitionSchemeDescription(*v) - if err != nil { - return err - } - ssp.PartitionDescription = partitionDescription - } - case "servicePackageActivationMode": - if v != nil { - var servicePackageActivationMode ArmServicePackageActivationMode - err = json.Unmarshal(*v, &servicePackageActivationMode) - if err != nil { - return err - } - ssp.ServicePackageActivationMode = servicePackageActivationMode - } - case "serviceKind": - if v != nil { - var serviceKind ServiceKindBasicServiceResourceProperties - err = json.Unmarshal(*v, &serviceKind) - if err != nil { - return err - } - ssp.ServiceKind = serviceKind - } - case "placementConstraints": - if v != nil { - var placementConstraints string - err = json.Unmarshal(*v, &placementConstraints) - if err != nil { - return err - } - ssp.PlacementConstraints = &placementConstraints - } - case "correlationScheme": - if v != nil { - var correlationScheme []ServiceCorrelationDescription - err = json.Unmarshal(*v, &correlationScheme) - if err != nil { - return err - } - ssp.CorrelationScheme = &correlationScheme - } - case "serviceLoadMetrics": - if v != nil { - var serviceLoadMetrics []ServiceLoadMetricDescription - err = json.Unmarshal(*v, &serviceLoadMetrics) - if err != nil { - return err - } - ssp.ServiceLoadMetrics = &serviceLoadMetrics - } - case "servicePlacementPolicies": - if v != nil { - servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) - if err != nil { - return err - } - ssp.ServicePlacementPolicies = &servicePlacementPolicies - } - case "defaultMoveCost": - if v != nil { - var defaultMoveCost MoveCost - err = json.Unmarshal(*v, &defaultMoveCost) - if err != nil { - return err - } - ssp.DefaultMoveCost = defaultMoveCost - } - } - } - - return nil -} - -// StatefulServiceUpdateProperties the properties of a stateful service resource for patch operations. -type StatefulServiceUpdateProperties struct { - // TargetReplicaSetSize - The target replica set size as a number. - TargetReplicaSetSize *int32 `json:"targetReplicaSetSize,omitempty"` - // MinReplicaSetSize - The minimum replica set size as a number. - MinReplicaSetSize *int32 `json:"minReplicaSetSize,omitempty"` - // ReplicaRestartWaitDuration - The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format (hh:mm:ss.s). - ReplicaRestartWaitDuration *date.Time `json:"replicaRestartWaitDuration,omitempty"` - // QuorumLossWaitDuration - The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). - QuorumLossWaitDuration *date.Time `json:"quorumLossWaitDuration,omitempty"` - // StandByReplicaKeepDuration - The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). - StandByReplicaKeepDuration *date.Time `json:"standByReplicaKeepDuration,omitempty"` - // ServiceKind - Possible values include: 'ServiceKindBasicServiceResourceUpdatePropertiesServiceKindServiceResourceUpdateProperties', 'ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateful', 'ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateless' - ServiceKind ServiceKindBasicServiceResourceUpdateProperties `json:"serviceKind,omitempty"` - // PlacementConstraints - The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - PlacementConstraints *string `json:"placementConstraints,omitempty"` - // CorrelationScheme - A list that describes the correlation of the service with other services. - CorrelationScheme *[]ServiceCorrelationDescription `json:"correlationScheme,omitempty"` - // ServiceLoadMetrics - The service load metrics is given as an array of ServiceLoadMetricDescription objects. - ServiceLoadMetrics *[]ServiceLoadMetricDescription `json:"serviceLoadMetrics,omitempty"` - // ServicePlacementPolicies - A list that describes the correlation of the service with other services. - ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"servicePlacementPolicies,omitempty"` - // DefaultMoveCost - Specifies the move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' - DefaultMoveCost MoveCost `json:"defaultMoveCost,omitempty"` -} - -// MarshalJSON is the custom marshaler for StatefulServiceUpdateProperties. -func (ssup StatefulServiceUpdateProperties) MarshalJSON() ([]byte, error) { - ssup.ServiceKind = ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateful - objectMap := make(map[string]interface{}) - if ssup.TargetReplicaSetSize != nil { - objectMap["targetReplicaSetSize"] = ssup.TargetReplicaSetSize - } - if ssup.MinReplicaSetSize != nil { - objectMap["minReplicaSetSize"] = ssup.MinReplicaSetSize - } - if ssup.ReplicaRestartWaitDuration != nil { - objectMap["replicaRestartWaitDuration"] = ssup.ReplicaRestartWaitDuration - } - if ssup.QuorumLossWaitDuration != nil { - objectMap["quorumLossWaitDuration"] = ssup.QuorumLossWaitDuration - } - if ssup.StandByReplicaKeepDuration != nil { - objectMap["standByReplicaKeepDuration"] = ssup.StandByReplicaKeepDuration - } - if ssup.ServiceKind != "" { - objectMap["serviceKind"] = ssup.ServiceKind - } - if ssup.PlacementConstraints != nil { - objectMap["placementConstraints"] = ssup.PlacementConstraints - } - if ssup.CorrelationScheme != nil { - objectMap["correlationScheme"] = ssup.CorrelationScheme - } - if ssup.ServiceLoadMetrics != nil { - objectMap["serviceLoadMetrics"] = ssup.ServiceLoadMetrics - } - if ssup.ServicePlacementPolicies != nil { - objectMap["servicePlacementPolicies"] = ssup.ServicePlacementPolicies - } - if ssup.DefaultMoveCost != "" { - objectMap["defaultMoveCost"] = ssup.DefaultMoveCost - } - return json.Marshal(objectMap) -} - -// AsStatefulServiceUpdateProperties is the BasicServiceResourceUpdateProperties implementation for StatefulServiceUpdateProperties. -func (ssup StatefulServiceUpdateProperties) AsStatefulServiceUpdateProperties() (*StatefulServiceUpdateProperties, bool) { - return &ssup, true -} - -// AsStatelessServiceUpdateProperties is the BasicServiceResourceUpdateProperties implementation for StatefulServiceUpdateProperties. -func (ssup StatefulServiceUpdateProperties) AsStatelessServiceUpdateProperties() (*StatelessServiceUpdateProperties, bool) { - return nil, false -} - -// AsServiceResourceUpdateProperties is the BasicServiceResourceUpdateProperties implementation for StatefulServiceUpdateProperties. -func (ssup StatefulServiceUpdateProperties) AsServiceResourceUpdateProperties() (*ServiceResourceUpdateProperties, bool) { - return nil, false -} - -// AsBasicServiceResourceUpdateProperties is the BasicServiceResourceUpdateProperties implementation for StatefulServiceUpdateProperties. -func (ssup StatefulServiceUpdateProperties) AsBasicServiceResourceUpdateProperties() (BasicServiceResourceUpdateProperties, bool) { - return &ssup, true -} - -// UnmarshalJSON is the custom unmarshaler for StatefulServiceUpdateProperties struct. -func (ssup *StatefulServiceUpdateProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "targetReplicaSetSize": - if v != nil { - var targetReplicaSetSize int32 - err = json.Unmarshal(*v, &targetReplicaSetSize) - if err != nil { - return err - } - ssup.TargetReplicaSetSize = &targetReplicaSetSize - } - case "minReplicaSetSize": - if v != nil { - var minReplicaSetSize int32 - err = json.Unmarshal(*v, &minReplicaSetSize) - if err != nil { - return err - } - ssup.MinReplicaSetSize = &minReplicaSetSize - } - case "replicaRestartWaitDuration": - if v != nil { - var replicaRestartWaitDuration date.Time - err = json.Unmarshal(*v, &replicaRestartWaitDuration) - if err != nil { - return err - } - ssup.ReplicaRestartWaitDuration = &replicaRestartWaitDuration - } - case "quorumLossWaitDuration": - if v != nil { - var quorumLossWaitDuration date.Time - err = json.Unmarshal(*v, &quorumLossWaitDuration) - if err != nil { - return err - } - ssup.QuorumLossWaitDuration = &quorumLossWaitDuration - } - case "standByReplicaKeepDuration": - if v != nil { - var standByReplicaKeepDuration date.Time - err = json.Unmarshal(*v, &standByReplicaKeepDuration) - if err != nil { - return err - } - ssup.StandByReplicaKeepDuration = &standByReplicaKeepDuration - } - case "serviceKind": - if v != nil { - var serviceKind ServiceKindBasicServiceResourceUpdateProperties - err = json.Unmarshal(*v, &serviceKind) - if err != nil { - return err - } - ssup.ServiceKind = serviceKind - } - case "placementConstraints": - if v != nil { - var placementConstraints string - err = json.Unmarshal(*v, &placementConstraints) - if err != nil { - return err - } - ssup.PlacementConstraints = &placementConstraints - } - case "correlationScheme": - if v != nil { - var correlationScheme []ServiceCorrelationDescription - err = json.Unmarshal(*v, &correlationScheme) - if err != nil { - return err - } - ssup.CorrelationScheme = &correlationScheme - } - case "serviceLoadMetrics": - if v != nil { - var serviceLoadMetrics []ServiceLoadMetricDescription - err = json.Unmarshal(*v, &serviceLoadMetrics) - if err != nil { - return err - } - ssup.ServiceLoadMetrics = &serviceLoadMetrics - } - case "servicePlacementPolicies": - if v != nil { - servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) - if err != nil { - return err - } - ssup.ServicePlacementPolicies = &servicePlacementPolicies - } - case "defaultMoveCost": - if v != nil { - var defaultMoveCost MoveCost - err = json.Unmarshal(*v, &defaultMoveCost) - if err != nil { - return err - } - ssup.DefaultMoveCost = defaultMoveCost - } - } - } - - return nil -} - -// StatelessServiceProperties the properties of a stateless service resource. -type StatelessServiceProperties struct { - // InstanceCount - The instance count. - InstanceCount *int32 `json:"instanceCount,omitempty"` - // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response - ProvisioningState *string `json:"provisioningState,omitempty"` - // ServiceTypeName - The name of the service type - ServiceTypeName *string `json:"serviceTypeName,omitempty"` - // PartitionDescription - Describes how the service is partitioned. - PartitionDescription BasicPartitionSchemeDescription `json:"partitionDescription,omitempty"` - // ServicePackageActivationMode - The activation Mode of the service package. Possible values include: 'SharedProcess', 'ExclusiveProcess' - ServicePackageActivationMode ArmServicePackageActivationMode `json:"servicePackageActivationMode,omitempty"` - // ServiceKind - Possible values include: 'ServiceKindServiceResourceProperties', 'ServiceKindStateful1', 'ServiceKindStateless1' - ServiceKind ServiceKindBasicServiceResourceProperties `json:"serviceKind,omitempty"` - // PlacementConstraints - The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - PlacementConstraints *string `json:"placementConstraints,omitempty"` - // CorrelationScheme - A list that describes the correlation of the service with other services. - CorrelationScheme *[]ServiceCorrelationDescription `json:"correlationScheme,omitempty"` - // ServiceLoadMetrics - The service load metrics is given as an array of ServiceLoadMetricDescription objects. - ServiceLoadMetrics *[]ServiceLoadMetricDescription `json:"serviceLoadMetrics,omitempty"` - // ServicePlacementPolicies - A list that describes the correlation of the service with other services. - ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"servicePlacementPolicies,omitempty"` - // DefaultMoveCost - Specifies the move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' - DefaultMoveCost MoveCost `json:"defaultMoveCost,omitempty"` -} - -// MarshalJSON is the custom marshaler for StatelessServiceProperties. -func (ssp StatelessServiceProperties) MarshalJSON() ([]byte, error) { - ssp.ServiceKind = ServiceKindStateless1 - objectMap := make(map[string]interface{}) - if ssp.InstanceCount != nil { - objectMap["instanceCount"] = ssp.InstanceCount - } - if ssp.ServiceTypeName != nil { - objectMap["serviceTypeName"] = ssp.ServiceTypeName - } - objectMap["partitionDescription"] = ssp.PartitionDescription - if ssp.ServicePackageActivationMode != "" { - objectMap["servicePackageActivationMode"] = ssp.ServicePackageActivationMode - } - if ssp.ServiceKind != "" { - objectMap["serviceKind"] = ssp.ServiceKind - } - if ssp.PlacementConstraints != nil { - objectMap["placementConstraints"] = ssp.PlacementConstraints - } - if ssp.CorrelationScheme != nil { - objectMap["correlationScheme"] = ssp.CorrelationScheme - } - if ssp.ServiceLoadMetrics != nil { - objectMap["serviceLoadMetrics"] = ssp.ServiceLoadMetrics - } - if ssp.ServicePlacementPolicies != nil { - objectMap["servicePlacementPolicies"] = ssp.ServicePlacementPolicies - } - if ssp.DefaultMoveCost != "" { - objectMap["defaultMoveCost"] = ssp.DefaultMoveCost - } - return json.Marshal(objectMap) -} - -// AsStatefulServiceProperties is the BasicServiceResourceProperties implementation for StatelessServiceProperties. -func (ssp StatelessServiceProperties) AsStatefulServiceProperties() (*StatefulServiceProperties, bool) { - return nil, false -} - -// AsStatelessServiceProperties is the BasicServiceResourceProperties implementation for StatelessServiceProperties. -func (ssp StatelessServiceProperties) AsStatelessServiceProperties() (*StatelessServiceProperties, bool) { - return &ssp, true -} - -// AsServiceResourceProperties is the BasicServiceResourceProperties implementation for StatelessServiceProperties. -func (ssp StatelessServiceProperties) AsServiceResourceProperties() (*ServiceResourceProperties, bool) { - return nil, false -} - -// AsBasicServiceResourceProperties is the BasicServiceResourceProperties implementation for StatelessServiceProperties. -func (ssp StatelessServiceProperties) AsBasicServiceResourceProperties() (BasicServiceResourceProperties, bool) { - return &ssp, true -} - -// UnmarshalJSON is the custom unmarshaler for StatelessServiceProperties struct. -func (ssp *StatelessServiceProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "instanceCount": - if v != nil { - var instanceCount int32 - err = json.Unmarshal(*v, &instanceCount) - if err != nil { - return err - } - ssp.InstanceCount = &instanceCount - } - case "provisioningState": - if v != nil { - var provisioningState string - err = json.Unmarshal(*v, &provisioningState) - if err != nil { - return err - } - ssp.ProvisioningState = &provisioningState - } - case "serviceTypeName": - if v != nil { - var serviceTypeName string - err = json.Unmarshal(*v, &serviceTypeName) - if err != nil { - return err - } - ssp.ServiceTypeName = &serviceTypeName - } - case "partitionDescription": - if v != nil { - partitionDescription, err := unmarshalBasicPartitionSchemeDescription(*v) - if err != nil { - return err - } - ssp.PartitionDescription = partitionDescription - } - case "servicePackageActivationMode": - if v != nil { - var servicePackageActivationMode ArmServicePackageActivationMode - err = json.Unmarshal(*v, &servicePackageActivationMode) - if err != nil { - return err - } - ssp.ServicePackageActivationMode = servicePackageActivationMode - } - case "serviceKind": - if v != nil { - var serviceKind ServiceKindBasicServiceResourceProperties - err = json.Unmarshal(*v, &serviceKind) - if err != nil { - return err - } - ssp.ServiceKind = serviceKind - } - case "placementConstraints": - if v != nil { - var placementConstraints string - err = json.Unmarshal(*v, &placementConstraints) - if err != nil { - return err - } - ssp.PlacementConstraints = &placementConstraints - } - case "correlationScheme": - if v != nil { - var correlationScheme []ServiceCorrelationDescription - err = json.Unmarshal(*v, &correlationScheme) - if err != nil { - return err - } - ssp.CorrelationScheme = &correlationScheme - } - case "serviceLoadMetrics": - if v != nil { - var serviceLoadMetrics []ServiceLoadMetricDescription - err = json.Unmarshal(*v, &serviceLoadMetrics) - if err != nil { - return err - } - ssp.ServiceLoadMetrics = &serviceLoadMetrics - } - case "servicePlacementPolicies": - if v != nil { - servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) - if err != nil { - return err - } - ssp.ServicePlacementPolicies = &servicePlacementPolicies - } - case "defaultMoveCost": - if v != nil { - var defaultMoveCost MoveCost - err = json.Unmarshal(*v, &defaultMoveCost) - if err != nil { - return err - } - ssp.DefaultMoveCost = defaultMoveCost - } - } - } - - return nil -} - -// StatelessServiceUpdateProperties the properties of a stateless service resource for patch operations. -type StatelessServiceUpdateProperties struct { - // InstanceCount - The instance count. - InstanceCount *int32 `json:"instanceCount,omitempty"` - // ServiceKind - Possible values include: 'ServiceKindBasicServiceResourceUpdatePropertiesServiceKindServiceResourceUpdateProperties', 'ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateful', 'ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateless' - ServiceKind ServiceKindBasicServiceResourceUpdateProperties `json:"serviceKind,omitempty"` - // PlacementConstraints - The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - PlacementConstraints *string `json:"placementConstraints,omitempty"` - // CorrelationScheme - A list that describes the correlation of the service with other services. - CorrelationScheme *[]ServiceCorrelationDescription `json:"correlationScheme,omitempty"` - // ServiceLoadMetrics - The service load metrics is given as an array of ServiceLoadMetricDescription objects. - ServiceLoadMetrics *[]ServiceLoadMetricDescription `json:"serviceLoadMetrics,omitempty"` - // ServicePlacementPolicies - A list that describes the correlation of the service with other services. - ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"servicePlacementPolicies,omitempty"` - // DefaultMoveCost - Specifies the move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' - DefaultMoveCost MoveCost `json:"defaultMoveCost,omitempty"` -} - -// MarshalJSON is the custom marshaler for StatelessServiceUpdateProperties. -func (ssup StatelessServiceUpdateProperties) MarshalJSON() ([]byte, error) { - ssup.ServiceKind = ServiceKindBasicServiceResourceUpdatePropertiesServiceKindStateless - objectMap := make(map[string]interface{}) - if ssup.InstanceCount != nil { - objectMap["instanceCount"] = ssup.InstanceCount - } - if ssup.ServiceKind != "" { - objectMap["serviceKind"] = ssup.ServiceKind - } - if ssup.PlacementConstraints != nil { - objectMap["placementConstraints"] = ssup.PlacementConstraints - } - if ssup.CorrelationScheme != nil { - objectMap["correlationScheme"] = ssup.CorrelationScheme - } - if ssup.ServiceLoadMetrics != nil { - objectMap["serviceLoadMetrics"] = ssup.ServiceLoadMetrics - } - if ssup.ServicePlacementPolicies != nil { - objectMap["servicePlacementPolicies"] = ssup.ServicePlacementPolicies - } - if ssup.DefaultMoveCost != "" { - objectMap["defaultMoveCost"] = ssup.DefaultMoveCost - } - return json.Marshal(objectMap) -} - -// AsStatefulServiceUpdateProperties is the BasicServiceResourceUpdateProperties implementation for StatelessServiceUpdateProperties. -func (ssup StatelessServiceUpdateProperties) AsStatefulServiceUpdateProperties() (*StatefulServiceUpdateProperties, bool) { - return nil, false -} - -// AsStatelessServiceUpdateProperties is the BasicServiceResourceUpdateProperties implementation for StatelessServiceUpdateProperties. -func (ssup StatelessServiceUpdateProperties) AsStatelessServiceUpdateProperties() (*StatelessServiceUpdateProperties, bool) { - return &ssup, true -} - -// AsServiceResourceUpdateProperties is the BasicServiceResourceUpdateProperties implementation for StatelessServiceUpdateProperties. -func (ssup StatelessServiceUpdateProperties) AsServiceResourceUpdateProperties() (*ServiceResourceUpdateProperties, bool) { - return nil, false -} - -// AsBasicServiceResourceUpdateProperties is the BasicServiceResourceUpdateProperties implementation for StatelessServiceUpdateProperties. -func (ssup StatelessServiceUpdateProperties) AsBasicServiceResourceUpdateProperties() (BasicServiceResourceUpdateProperties, bool) { - return &ssup, true -} - -// UnmarshalJSON is the custom unmarshaler for StatelessServiceUpdateProperties struct. -func (ssup *StatelessServiceUpdateProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "instanceCount": - if v != nil { - var instanceCount int32 - err = json.Unmarshal(*v, &instanceCount) - if err != nil { - return err - } - ssup.InstanceCount = &instanceCount - } - case "serviceKind": - if v != nil { - var serviceKind ServiceKindBasicServiceResourceUpdateProperties - err = json.Unmarshal(*v, &serviceKind) - if err != nil { - return err - } - ssup.ServiceKind = serviceKind - } - case "placementConstraints": - if v != nil { - var placementConstraints string - err = json.Unmarshal(*v, &placementConstraints) - if err != nil { - return err - } - ssup.PlacementConstraints = &placementConstraints - } - case "correlationScheme": - if v != nil { - var correlationScheme []ServiceCorrelationDescription - err = json.Unmarshal(*v, &correlationScheme) - if err != nil { - return err - } - ssup.CorrelationScheme = &correlationScheme - } - case "serviceLoadMetrics": - if v != nil { - var serviceLoadMetrics []ServiceLoadMetricDescription - err = json.Unmarshal(*v, &serviceLoadMetrics) - if err != nil { - return err - } - ssup.ServiceLoadMetrics = &serviceLoadMetrics - } - case "servicePlacementPolicies": - if v != nil { - servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) - if err != nil { - return err - } - ssup.ServicePlacementPolicies = &servicePlacementPolicies - } - case "defaultMoveCost": - if v != nil { - var defaultMoveCost MoveCost - err = json.Unmarshal(*v, &defaultMoveCost) - if err != nil { - return err - } - ssup.DefaultMoveCost = defaultMoveCost - } - } - } - - return nil -} - -// UniformInt64RangePartitionSchemeDescription describes a partitioning scheme where an integer range is -// allocated evenly across a number of partitions. -type UniformInt64RangePartitionSchemeDescription struct { - // Count - The number of partitions. - Count *int32 `json:"Count,omitempty"` - // LowKey - String indicating the lower bound of the partition key range that - // should be split between the partition ‘Count’ - LowKey *string `json:"LowKey,omitempty"` - // HighKey - String indicating the upper bound of the partition key range that - // should be split between the partition ‘Count’ - HighKey *string `json:"HighKey,omitempty"` - // PartitionScheme - Possible values include: 'PartitionSchemePartitionSchemeDescription', 'PartitionSchemeNamed', 'PartitionSchemeSingleton', 'PartitionSchemeUniformInt64Range' - PartitionScheme PartitionSchemeBasicPartitionSchemeDescription `json:"partitionScheme,omitempty"` -} - -// MarshalJSON is the custom marshaler for UniformInt64RangePartitionSchemeDescription. -func (ui6rpsd UniformInt64RangePartitionSchemeDescription) MarshalJSON() ([]byte, error) { - ui6rpsd.PartitionScheme = PartitionSchemeUniformInt64Range - objectMap := make(map[string]interface{}) - if ui6rpsd.Count != nil { - objectMap["Count"] = ui6rpsd.Count - } - if ui6rpsd.LowKey != nil { - objectMap["LowKey"] = ui6rpsd.LowKey - } - if ui6rpsd.HighKey != nil { - objectMap["HighKey"] = ui6rpsd.HighKey - } - if ui6rpsd.PartitionScheme != "" { - objectMap["partitionScheme"] = ui6rpsd.PartitionScheme - } - return json.Marshal(objectMap) -} - -// AsNamedPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for UniformInt64RangePartitionSchemeDescription. -func (ui6rpsd UniformInt64RangePartitionSchemeDescription) AsNamedPartitionSchemeDescription() (*NamedPartitionSchemeDescription, bool) { - return nil, false -} - -// AsSingletonPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for UniformInt64RangePartitionSchemeDescription. -func (ui6rpsd UniformInt64RangePartitionSchemeDescription) AsSingletonPartitionSchemeDescription() (*SingletonPartitionSchemeDescription, bool) { - return nil, false -} - -// AsUniformInt64RangePartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for UniformInt64RangePartitionSchemeDescription. -func (ui6rpsd UniformInt64RangePartitionSchemeDescription) AsUniformInt64RangePartitionSchemeDescription() (*UniformInt64RangePartitionSchemeDescription, bool) { - return &ui6rpsd, true -} - -// AsPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for UniformInt64RangePartitionSchemeDescription. -func (ui6rpsd UniformInt64RangePartitionSchemeDescription) AsPartitionSchemeDescription() (*PartitionSchemeDescription, bool) { - return nil, false -} - -// AsBasicPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for UniformInt64RangePartitionSchemeDescription. -func (ui6rpsd UniformInt64RangePartitionSchemeDescription) AsBasicPartitionSchemeDescription() (BasicPartitionSchemeDescription, bool) { - return &ui6rpsd, true -} diff --git a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/servicefabricapi/interfaces.go b/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/servicefabricapi/interfaces.go deleted file mode 100644 index 37c053f1278a..000000000000 --- a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/servicefabricapi/interfaces.go +++ /dev/null @@ -1,95 +0,0 @@ -package servicefabricapi - -// 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/servicefabric/mgmt/2019-03-01/servicefabric" - "github.com/Azure/go-autorest/autorest" -) - -// ClustersClientAPI contains the set of methods on the ClustersClient type. -type ClustersClientAPI interface { - Create(ctx context.Context, resourceGroupName string, clusterName string, parameters servicefabric.Cluster) (result servicefabric.ClustersCreateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, clusterName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, clusterName string) (result servicefabric.Cluster, err error) - List(ctx context.Context) (result servicefabric.ClusterListResult, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string) (result servicefabric.ClusterListResult, err error) - Update(ctx context.Context, resourceGroupName string, clusterName string, parameters servicefabric.ClusterUpdateParameters) (result servicefabric.ClustersUpdateFuture, err error) -} - -var _ ClustersClientAPI = (*servicefabric.ClustersClient)(nil) - -// ClusterVersionsClientAPI contains the set of methods on the ClusterVersionsClient type. -type ClusterVersionsClientAPI interface { - Get(ctx context.Context, location string, clusterVersion string) (result servicefabric.ClusterCodeVersionsListResult, err error) - GetByEnvironment(ctx context.Context, location string, environment string, clusterVersion string) (result servicefabric.ClusterCodeVersionsListResult, err error) - List(ctx context.Context, location string) (result servicefabric.ClusterCodeVersionsListResult, err error) - ListByEnvironment(ctx context.Context, location string, environment string) (result servicefabric.ClusterCodeVersionsListResult, err error) -} - -var _ ClusterVersionsClientAPI = (*servicefabric.ClusterVersionsClient)(nil) - -// OperationsClientAPI contains the set of methods on the OperationsClient type. -type OperationsClientAPI interface { - List(ctx context.Context) (result servicefabric.OperationListResultPage, err error) -} - -var _ OperationsClientAPI = (*servicefabric.OperationsClient)(nil) - -// ApplicationTypesClientAPI contains the set of methods on the ApplicationTypesClient type. -type ApplicationTypesClientAPI interface { - Create(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, parameters servicefabric.ApplicationTypeResource) (result servicefabric.ApplicationTypeResource, err error) - Delete(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string) (result servicefabric.ApplicationTypesDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string) (result servicefabric.ApplicationTypeResource, err error) - List(ctx context.Context, resourceGroupName string, clusterName string) (result servicefabric.ApplicationTypeResourceList, err error) -} - -var _ ApplicationTypesClientAPI = (*servicefabric.ApplicationTypesClient)(nil) - -// ApplicationTypeVersionsClientAPI contains the set of methods on the ApplicationTypeVersionsClient type. -type ApplicationTypeVersionsClientAPI interface { - Create(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, parameters servicefabric.ApplicationTypeVersionResource) (result servicefabric.ApplicationTypeVersionsCreateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string) (result servicefabric.ApplicationTypeVersionsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string) (result servicefabric.ApplicationTypeVersionResource, err error) - List(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string) (result servicefabric.ApplicationTypeVersionResourceList, err error) -} - -var _ ApplicationTypeVersionsClientAPI = (*servicefabric.ApplicationTypeVersionsClient)(nil) - -// ApplicationsClientAPI contains the set of methods on the ApplicationsClient type. -type ApplicationsClientAPI interface { - Create(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters servicefabric.ApplicationResource) (result servicefabric.ApplicationsCreateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (result servicefabric.ApplicationsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (result servicefabric.ApplicationResource, err error) - List(ctx context.Context, resourceGroupName string, clusterName string) (result servicefabric.ApplicationResourceList, err error) - Update(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters servicefabric.ApplicationResourceUpdate) (result servicefabric.ApplicationsUpdateFuture, err error) -} - -var _ ApplicationsClientAPI = (*servicefabric.ApplicationsClient)(nil) - -// ServicesClientAPI contains the set of methods on the ServicesClient type. -type ServicesClientAPI interface { - Create(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters servicefabric.ServiceResource) (result servicefabric.ServicesCreateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string) (result servicefabric.ServicesDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string) (result servicefabric.ServiceResource, err error) - List(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (result servicefabric.ServiceResourceList, err error) - Update(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters servicefabric.ServiceResourceUpdate) (result servicefabric.ServicesUpdateFuture, err error) -} - -var _ ServicesClientAPI = (*servicefabric.ServicesClient)(nil) diff --git a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/services.go b/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/services.go deleted file mode 100644 index 7295ca94514c..000000000000 --- a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/services.go +++ /dev/null @@ -1,451 +0,0 @@ -package servicefabric - -// 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" -) - -// ServicesClient is the service Fabric Management 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. -func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { - return ServicesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create or update a Service Fabric service resource with the specified name. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationName - the name of the application resource. -// serviceName - the name of the service resource in the format of {applicationName}~{serviceName}. -// parameters - the service resource. -func (client ServicesClient) Create(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResource) (result ServicesCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Create") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, applicationName, serviceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ServicesClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ServicesClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client ServicesClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationName": autorest.Encode("path", applicationName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}", 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 ServicesClient) CreateSender(req *http.Request) (future ServicesCreateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 ServicesClient) CreateResponder(resp *http.Response) (result ServiceResource, 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 -} - -// Delete delete a Service Fabric service resource with the specified name. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationName - the name of the application resource. -// serviceName - the name of the service resource in the format of {applicationName}~{serviceName}. -func (client ServicesClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string) (result ServicesDeleteFuture, 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, clusterName, applicationName, serviceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ServicesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ServicesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationName": autorest.Encode("path", applicationName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}", 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) (future ServicesDeleteFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 ServicesClient) 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 a Service Fabric service resource created or in the process of being created in the Service Fabric -// application resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationName - the name of the application resource. -// serviceName - the name of the service resource in the format of {applicationName}~{serviceName}. -func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string) (result ServiceResource, 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, clusterName, applicationName, serviceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.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, "servicefabric.ServicesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ServicesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationName": autorest.Encode("path", applicationName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}", 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) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ServicesClient) GetResponder(resp *http.Response) (result ServiceResource, 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 service resources created or in the process of being created in the Service Fabric application -// resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationName - the name of the application resource. -func (client ServicesClient) List(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (result ServiceResourceList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.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, clusterName, applicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ServicesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabric.ServicesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ServicesClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ServicesClient) ListPreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationName": autorest.Encode("path", applicationName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services", 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 ServicesClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ServicesClient) ListResponder(resp *http.Response) (result ServiceResourceList, 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 Service Fabric service resource with the specified name. -// Parameters: -// resourceGroupName - the name of the resource group. -// clusterName - the name of the cluster resource. -// applicationName - the name of the application resource. -// serviceName - the name of the service resource in the format of {applicationName}~{serviceName}. -// parameters - the service resource for patch operations. -func (client ServicesClient) Update(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResourceUpdate) (result ServicesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, applicationName, serviceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ServicesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabric.ServicesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResourceUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationName": autorest.Encode("path", applicationName), - "clusterName": autorest.Encode("path", clusterName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}", 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 ServicesClient) UpdateSender(req *http.Request) (future ServicesUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) - 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 ServicesClient) UpdateResponder(resp *http.Response) (result ServiceResource, 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/servicefabric/mgmt/2019-03-01/servicefabric/version.go b/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/version.go deleted file mode 100644 index 74a7ddcbd499..000000000000 --- a/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/version.go +++ /dev/null @@ -1,30 +0,0 @@ -package servicefabric - -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.Number + " servicefabric/2019-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/sql/mgmt/2015-05-01-preview/sql/databaseblobauditingpolicies.go b/services/preview/sql/mgmt/2015-05-01-preview/sql/databaseblobauditingpolicies.go index 3861a1676c32..eced7d5753e0 100644 --- a/services/preview/sql/mgmt/2015-05-01-preview/sql/databaseblobauditingpolicies.go +++ b/services/preview/sql/mgmt/2015-05-01-preview/sql/databaseblobauditingpolicies.go @@ -208,3 +208,121 @@ func (client DatabaseBlobAuditingPoliciesClient) GetResponder(resp *http.Respons result.Response = autorest.Response{Response: resp} return } + +// ListByDatabase lists 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 DatabaseBlobAuditingPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseBlobAuditingPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPoliciesClient.ListByDatabase") + defer func() { + sc := -1 + if result.dbaplr.Response.Response != nil { + sc = result.dbaplr.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.DatabaseBlobAuditingPoliciesClient", "ListByDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.dbaplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "ListByDatabase", resp, "Failure sending request") + return + } + + result.dbaplr, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "ListByDatabase", resp, "Failure responding to request") + } + + return +} + +// ListByDatabasePreparer prepares the ListByDatabase request. +func (client DatabaseBlobAuditingPoliciesClient) 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 = "2015-05-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}/auditingSettings", 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 DatabaseBlobAuditingPoliciesClient) ListByDatabaseSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDatabaseResponder handles the response to the ListByDatabase request. The method always +// closes the http.Response Body. +func (client DatabaseBlobAuditingPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result DatabaseBlobAuditingPolicyListResult, 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 DatabaseBlobAuditingPoliciesClient) listByDatabaseNextResults(ctx context.Context, lastResults DatabaseBlobAuditingPolicyListResult) (result DatabaseBlobAuditingPolicyListResult, err error) { + req, err := lastResults.databaseBlobAuditingPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "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.DatabaseBlobAuditingPoliciesClient", "listByDatabaseNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. +func (client DatabaseBlobAuditingPoliciesClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseBlobAuditingPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPoliciesClient.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/2015-05-01-preview/sql/models.go b/services/preview/sql/mgmt/2015-05-01-preview/sql/models.go index 418447274f48..dfae755be82b 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 @@ -1567,6 +1567,153 @@ func (dbap *DatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error { return nil } +// DatabaseBlobAuditingPolicyListResult a list of database auditing settings. +type DatabaseBlobAuditingPolicyListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]DatabaseBlobAuditingPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// DatabaseBlobAuditingPolicyListResultIterator provides access to a complete listing of +// DatabaseBlobAuditingPolicy values. +type DatabaseBlobAuditingPolicyListResultIterator struct { + i int + page DatabaseBlobAuditingPolicyListResultPage +} + +// 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 *DatabaseBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPolicyListResultIterator.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 *DatabaseBlobAuditingPolicyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DatabaseBlobAuditingPolicyListResultIterator) 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 DatabaseBlobAuditingPolicyListResultIterator) Response() DatabaseBlobAuditingPolicyListResult { + 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 DatabaseBlobAuditingPolicyListResultIterator) Value() DatabaseBlobAuditingPolicy { + if !iter.page.NotDone() { + return DatabaseBlobAuditingPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DatabaseBlobAuditingPolicyListResultIterator type. +func NewDatabaseBlobAuditingPolicyListResultIterator(page DatabaseBlobAuditingPolicyListResultPage) DatabaseBlobAuditingPolicyListResultIterator { + return DatabaseBlobAuditingPolicyListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dbaplr DatabaseBlobAuditingPolicyListResult) IsEmpty() bool { + return dbaplr.Value == nil || len(*dbaplr.Value) == 0 +} + +// databaseBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dbaplr DatabaseBlobAuditingPolicyListResult) databaseBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if dbaplr.NextLink == nil || len(to.String(dbaplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dbaplr.NextLink))) +} + +// DatabaseBlobAuditingPolicyListResultPage contains a page of DatabaseBlobAuditingPolicy values. +type DatabaseBlobAuditingPolicyListResultPage struct { + fn func(context.Context, DatabaseBlobAuditingPolicyListResult) (DatabaseBlobAuditingPolicyListResult, error) + dbaplr DatabaseBlobAuditingPolicyListResult +} + +// 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 *DatabaseBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPolicyListResultPage.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.dbaplr) + if err != nil { + return err + } + page.dbaplr = 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 *DatabaseBlobAuditingPolicyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DatabaseBlobAuditingPolicyListResultPage) NotDone() bool { + return !page.dbaplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DatabaseBlobAuditingPolicyListResultPage) Response() DatabaseBlobAuditingPolicyListResult { + return page.dbaplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DatabaseBlobAuditingPolicyListResultPage) Values() []DatabaseBlobAuditingPolicy { + if page.dbaplr.IsEmpty() { + return nil + } + return *page.dbaplr.Value +} + +// Creates a new instance of the DatabaseBlobAuditingPolicyListResultPage type. +func NewDatabaseBlobAuditingPolicyListResultPage(getNextPage func(context.Context, DatabaseBlobAuditingPolicyListResult) (DatabaseBlobAuditingPolicyListResult, error)) DatabaseBlobAuditingPolicyListResultPage { + return DatabaseBlobAuditingPolicyListResultPage{fn: getNextPage} +} + // DatabaseBlobAuditingPolicyProperties properties of a database blob auditing policy. type DatabaseBlobAuditingPolicyProperties struct { // State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled' diff --git a/services/preview/sql/mgmt/2015-05-01-preview/sql/sqlapi/interfaces.go b/services/preview/sql/mgmt/2015-05-01-preview/sql/sqlapi/interfaces.go index f41524b79ca6..af86076ce67b 100644 --- a/services/preview/sql/mgmt/2015-05-01-preview/sql/sqlapi/interfaces.go +++ b/services/preview/sql/mgmt/2015-05-01-preview/sql/sqlapi/interfaces.go @@ -264,6 +264,7 @@ var _ CapabilitiesClientAPI = (*sql.CapabilitiesClient)(nil) type DatabaseBlobAuditingPoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseBlobAuditingPolicy) (result sql.DatabaseBlobAuditingPolicy, err error) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseBlobAuditingPolicy, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseBlobAuditingPolicyListResultPage, err error) } var _ DatabaseBlobAuditingPoliciesClientAPI = (*sql.DatabaseBlobAuditingPoliciesClient)(nil) diff --git a/services/preview/sql/mgmt/2017-03-01-preview/sql/databaseblobauditingpolicies.go b/services/preview/sql/mgmt/2017-03-01-preview/sql/databaseblobauditingpolicies.go index 56ee29dfc1bd..8e61953bbeae 100644 --- a/services/preview/sql/mgmt/2017-03-01-preview/sql/databaseblobauditingpolicies.go +++ b/services/preview/sql/mgmt/2017-03-01-preview/sql/databaseblobauditingpolicies.go @@ -208,3 +208,121 @@ func (client DatabaseBlobAuditingPoliciesClient) GetResponder(resp *http.Respons result.Response = autorest.Response{Response: resp} return } + +// ListByDatabase lists 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 DatabaseBlobAuditingPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseBlobAuditingPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPoliciesClient.ListByDatabase") + defer func() { + sc := -1 + if result.dbaplr.Response.Response != nil { + sc = result.dbaplr.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.DatabaseBlobAuditingPoliciesClient", "ListByDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.dbaplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "ListByDatabase", resp, "Failure sending request") + return + } + + result.dbaplr, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "ListByDatabase", resp, "Failure responding to request") + } + + return +} + +// ListByDatabasePreparer prepares the ListByDatabase request. +func (client DatabaseBlobAuditingPoliciesClient) 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}/auditingSettings", 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 DatabaseBlobAuditingPoliciesClient) ListByDatabaseSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDatabaseResponder handles the response to the ListByDatabase request. The method always +// closes the http.Response Body. +func (client DatabaseBlobAuditingPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result DatabaseBlobAuditingPolicyListResult, 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 DatabaseBlobAuditingPoliciesClient) listByDatabaseNextResults(ctx context.Context, lastResults DatabaseBlobAuditingPolicyListResult) (result DatabaseBlobAuditingPolicyListResult, err error) { + req, err := lastResults.databaseBlobAuditingPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "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.DatabaseBlobAuditingPoliciesClient", "listByDatabaseNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. +func (client DatabaseBlobAuditingPoliciesClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseBlobAuditingPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPoliciesClient.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/models.go b/services/preview/sql/mgmt/2017-03-01-preview/sql/models.go index d13476b207a7..e01108b3867f 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 @@ -2106,6 +2106,153 @@ func (dbap *DatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error { return nil } +// DatabaseBlobAuditingPolicyListResult a list of database auditing settings. +type DatabaseBlobAuditingPolicyListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]DatabaseBlobAuditingPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// DatabaseBlobAuditingPolicyListResultIterator provides access to a complete listing of +// DatabaseBlobAuditingPolicy values. +type DatabaseBlobAuditingPolicyListResultIterator struct { + i int + page DatabaseBlobAuditingPolicyListResultPage +} + +// 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 *DatabaseBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPolicyListResultIterator.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 *DatabaseBlobAuditingPolicyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DatabaseBlobAuditingPolicyListResultIterator) 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 DatabaseBlobAuditingPolicyListResultIterator) Response() DatabaseBlobAuditingPolicyListResult { + 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 DatabaseBlobAuditingPolicyListResultIterator) Value() DatabaseBlobAuditingPolicy { + if !iter.page.NotDone() { + return DatabaseBlobAuditingPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DatabaseBlobAuditingPolicyListResultIterator type. +func NewDatabaseBlobAuditingPolicyListResultIterator(page DatabaseBlobAuditingPolicyListResultPage) DatabaseBlobAuditingPolicyListResultIterator { + return DatabaseBlobAuditingPolicyListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dbaplr DatabaseBlobAuditingPolicyListResult) IsEmpty() bool { + return dbaplr.Value == nil || len(*dbaplr.Value) == 0 +} + +// databaseBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dbaplr DatabaseBlobAuditingPolicyListResult) databaseBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if dbaplr.NextLink == nil || len(to.String(dbaplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dbaplr.NextLink))) +} + +// DatabaseBlobAuditingPolicyListResultPage contains a page of DatabaseBlobAuditingPolicy values. +type DatabaseBlobAuditingPolicyListResultPage struct { + fn func(context.Context, DatabaseBlobAuditingPolicyListResult) (DatabaseBlobAuditingPolicyListResult, error) + dbaplr DatabaseBlobAuditingPolicyListResult +} + +// 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 *DatabaseBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPolicyListResultPage.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.dbaplr) + if err != nil { + return err + } + page.dbaplr = 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 *DatabaseBlobAuditingPolicyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DatabaseBlobAuditingPolicyListResultPage) NotDone() bool { + return !page.dbaplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DatabaseBlobAuditingPolicyListResultPage) Response() DatabaseBlobAuditingPolicyListResult { + return page.dbaplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DatabaseBlobAuditingPolicyListResultPage) Values() []DatabaseBlobAuditingPolicy { + if page.dbaplr.IsEmpty() { + return nil + } + return *page.dbaplr.Value +} + +// Creates a new instance of the DatabaseBlobAuditingPolicyListResultPage type. +func NewDatabaseBlobAuditingPolicyListResultPage(getNextPage func(context.Context, DatabaseBlobAuditingPolicyListResult) (DatabaseBlobAuditingPolicyListResult, error)) DatabaseBlobAuditingPolicyListResultPage { + return DatabaseBlobAuditingPolicyListResultPage{fn: getNextPage} +} + // DatabaseBlobAuditingPolicyProperties properties of a database blob auditing policy. type DatabaseBlobAuditingPolicyProperties struct { // State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled' @@ -11143,6 +11290,153 @@ func (sbap *ServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error { return nil } +// ServerBlobAuditingPolicyListResult a list of server auditing settings. +type ServerBlobAuditingPolicyListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]ServerBlobAuditingPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ServerBlobAuditingPolicyListResultIterator provides access to a complete listing of +// ServerBlobAuditingPolicy values. +type ServerBlobAuditingPolicyListResultIterator struct { + i int + page ServerBlobAuditingPolicyListResultPage +} + +// 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 *ServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPolicyListResultIterator.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 *ServerBlobAuditingPolicyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServerBlobAuditingPolicyListResultIterator) 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 ServerBlobAuditingPolicyListResultIterator) Response() ServerBlobAuditingPolicyListResult { + 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 ServerBlobAuditingPolicyListResultIterator) Value() ServerBlobAuditingPolicy { + if !iter.page.NotDone() { + return ServerBlobAuditingPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServerBlobAuditingPolicyListResultIterator type. +func NewServerBlobAuditingPolicyListResultIterator(page ServerBlobAuditingPolicyListResultPage) ServerBlobAuditingPolicyListResultIterator { + return ServerBlobAuditingPolicyListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sbaplr ServerBlobAuditingPolicyListResult) IsEmpty() bool { + return sbaplr.Value == nil || len(*sbaplr.Value) == 0 +} + +// serverBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sbaplr ServerBlobAuditingPolicyListResult) serverBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if sbaplr.NextLink == nil || len(to.String(sbaplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sbaplr.NextLink))) +} + +// ServerBlobAuditingPolicyListResultPage contains a page of ServerBlobAuditingPolicy values. +type ServerBlobAuditingPolicyListResultPage struct { + fn func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error) + sbaplr ServerBlobAuditingPolicyListResult +} + +// 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 *ServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPolicyListResultPage.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.sbaplr) + if err != nil { + return err + } + page.sbaplr = 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 *ServerBlobAuditingPolicyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServerBlobAuditingPolicyListResultPage) NotDone() bool { + return !page.sbaplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServerBlobAuditingPolicyListResultPage) Response() ServerBlobAuditingPolicyListResult { + return page.sbaplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServerBlobAuditingPolicyListResultPage) Values() []ServerBlobAuditingPolicy { + if page.sbaplr.IsEmpty() { + return nil + } + return *page.sbaplr.Value +} + +// Creates a new instance of the ServerBlobAuditingPolicyListResultPage type. +func NewServerBlobAuditingPolicyListResultPage(getNextPage func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error)) ServerBlobAuditingPolicyListResultPage { + return ServerBlobAuditingPolicyListResultPage{fn: getNextPage} +} + // ServerBlobAuditingPolicyProperties properties of a server blob auditing policy. type ServerBlobAuditingPolicyProperties struct { // State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled' diff --git a/services/preview/sql/mgmt/2017-03-01-preview/sql/serverblobauditingpolicies.go b/services/preview/sql/mgmt/2017-03-01-preview/sql/serverblobauditingpolicies.go index 9055582b80c4..48d2fde5ed0d 100644 --- a/services/preview/sql/mgmt/2017-03-01-preview/sql/serverblobauditingpolicies.go +++ b/services/preview/sql/mgmt/2017-03-01-preview/sql/serverblobauditingpolicies.go @@ -202,3 +202,119 @@ func (client ServerBlobAuditingPoliciesClient) GetResponder(resp *http.Response) result.Response = autorest.Response{Response: resp} return } + +// ListByServer lists 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 ServerBlobAuditingPoliciesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerBlobAuditingPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPoliciesClient.ListByServer") + defer func() { + sc := -1 + if result.sbaplr.Response.Response != nil { + sc = result.sbaplr.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.ServerBlobAuditingPoliciesClient", "ListByServer", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServerSender(req) + if err != nil { + result.sbaplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesClient", "ListByServer", resp, "Failure sending request") + return + } + + result.sbaplr, err = client.ListByServerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesClient", "ListByServer", resp, "Failure responding to request") + } + + return +} + +// ListByServerPreparer prepares the ListByServer request. +func (client ServerBlobAuditingPoliciesClient) 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}/auditingSettings", 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 ServerBlobAuditingPoliciesClient) ListByServerSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByServerResponder handles the response to the ListByServer request. The method always +// closes the http.Response Body. +func (client ServerBlobAuditingPoliciesClient) ListByServerResponder(resp *http.Response) (result ServerBlobAuditingPolicyListResult, 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 ServerBlobAuditingPoliciesClient) listByServerNextResults(ctx context.Context, lastResults ServerBlobAuditingPolicyListResult) (result ServerBlobAuditingPolicyListResult, err error) { + req, err := lastResults.serverBlobAuditingPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesClient", "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.ServerBlobAuditingPoliciesClient", "listByServerNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesClient", "listByServerNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServerBlobAuditingPoliciesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result ServerBlobAuditingPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPoliciesClient.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/sqlapi/interfaces.go b/services/preview/sql/mgmt/2017-03-01-preview/sql/sqlapi/interfaces.go index 5813776a86e3..2725b915863e 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 @@ -397,6 +397,7 @@ var _ ExtendedServerBlobAuditingPoliciesClientAPI = (*sql.ExtendedServerBlobAudi type ServerBlobAuditingPoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ServerBlobAuditingPolicy) (result sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture, err error) Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerBlobAuditingPolicy, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerBlobAuditingPolicyListResultPage, err error) } var _ ServerBlobAuditingPoliciesClientAPI = (*sql.ServerBlobAuditingPoliciesClient)(nil) @@ -405,6 +406,7 @@ var _ ServerBlobAuditingPoliciesClientAPI = (*sql.ServerBlobAuditingPoliciesClie type DatabaseBlobAuditingPoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseBlobAuditingPolicy) (result sql.DatabaseBlobAuditingPolicy, err error) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseBlobAuditingPolicy, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseBlobAuditingPolicyListResultPage, err error) } var _ DatabaseBlobAuditingPoliciesClientAPI = (*sql.DatabaseBlobAuditingPoliciesClient)(nil) diff --git a/services/resources/deployment.go b/services/resources/deployment.go deleted file mode 100644 index 4e5f882e6809..000000000000 --- a/services/resources/deployment.go +++ /dev/null @@ -1,63 +0,0 @@ -package deployment - -// Copyright 2017 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. - -import ( - "encoding/json" - "io/ioutil" - - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources" -) - -// Build is a helper that creates a resources.Deployment, which can -// be used as a parameter for a CreateOrUpdate deployment operation. -// templateFile is a local Azure template. -// See https://github.com/Azure-Samples/resource-manager-go-template-deployment -func Build(mode resources.DeploymentMode, templateFile string, parameters map[string]interface{}) (deployment resources.Deployment, err error) { - template, err := parseJSONFromFile(templateFile) - if err != nil { - return - } - - finalParameters := map[string]interface{}{} - for k, v := range parameters { - addElementToMap(&finalParameters, k, v) - } - - deployment.Properties = &resources.DeploymentProperties{ - Mode: mode, - Template: template, - Parameters: &finalParameters, - } - return -} - -func parseJSONFromFile(filePath string) (*map[string]interface{}, error) { - text, err := ioutil.ReadFile(filePath) - if err != nil { - return nil, err - } - fileMap := map[string]interface{}{} - if err = json.Unmarshal(text, &fileMap); err != nil { - return nil, err - } - return &fileMap, err -} - -func addElementToMap(parameter *map[string]interface{}, key string, value interface{}) { - (*parameter)[key] = map[string]interface{}{ - "value": value, - } -} diff --git a/services/batch/2015-12-01.2.2/batch/client.go b/services/resources/mgmt/2019-06-01/subscriptions/client.go similarity index 69% rename from services/batch/2015-12-01.2.2/batch/client.go rename to services/resources/mgmt/2019-06-01/subscriptions/client.go index 463de1712229..7e071c044763 100644 --- a/services/batch/2015-12-01.2.2/batch/client.go +++ b/services/resources/mgmt/2019-06-01/subscriptions/client.go @@ -1,7 +1,9 @@ -// Package batch implements the Azure ARM Batch service API version 2015-12-01.2.2. +// Package subscriptions implements the Azure ARM Subscriptions service API version 2019-06-01. // -// A client for issuing REST requests to the Azure Batch service. -package batch +// All resource groups and resources exist within subscriptions. These operation enable you get information about your +// subscriptions and tenants. A tenant is a dedicated instance of Azure Active Directory (Azure AD) for your +// organization. +package subscriptions // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,11 +27,11 @@ import ( ) const ( - // DefaultBaseURI is the default URI used for the service Batch - DefaultBaseURI = "https://batch.core.windows.net" + // DefaultBaseURI is the default URI used for the service Subscriptions + DefaultBaseURI = "https://management.azure.com" ) -// BaseClient is the base client for Batch. +// BaseClient is the base client for Subscriptions. type BaseClient struct { autorest.Client BaseURI string diff --git a/services/resources/mgmt/2019-06-01/subscriptions/models.go b/services/resources/mgmt/2019-06-01/subscriptions/models.go new file mode 100644 index 000000000000..fe0706d261a0 --- /dev/null +++ b/services/resources/mgmt/2019-06-01/subscriptions/models.go @@ -0,0 +1,594 @@ +package subscriptions + +// 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/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/resources/mgmt/2019-06-01/subscriptions" + +// SpendingLimit enumerates the values for spending limit. +type SpendingLimit string + +const ( + // CurrentPeriodOff ... + CurrentPeriodOff SpendingLimit = "CurrentPeriodOff" + // Off ... + Off SpendingLimit = "Off" + // On ... + On SpendingLimit = "On" +) + +// PossibleSpendingLimitValues returns an array of possible values for the SpendingLimit const type. +func PossibleSpendingLimitValues() []SpendingLimit { + return []SpendingLimit{CurrentPeriodOff, Off, On} +} + +// State enumerates the values for state. +type State string + +const ( + // Deleted ... + Deleted State = "Deleted" + // Disabled ... + Disabled State = "Disabled" + // Enabled ... + Enabled State = "Enabled" + // PastDue ... + PastDue State = "PastDue" + // Warned ... + Warned State = "Warned" +) + +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{Deleted, Disabled, Enabled, PastDue, Warned} +} + +// ListResult subscription list operation response. +type ListResult struct { + autorest.Response `json:"-"` + // Value - An array of subscriptions. + Value *[]Subscription `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListResultIterator provides access to a complete listing of Subscription 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() Subscription { + if !iter.page.NotDone() { + return Subscription{} + } + 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 Subscription 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() []Subscription { + 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 location information. +type Location struct { + // ID - READ-ONLY; The fully qualified ID of the location. For example, /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. + ID *string `json:"id,omitempty"` + // SubscriptionID - READ-ONLY; The subscription ID. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // Name - READ-ONLY; The location name. + Name *string `json:"name,omitempty"` + // DisplayName - READ-ONLY; The display name of the location. + DisplayName *string `json:"displayName,omitempty"` + // Latitude - READ-ONLY; The latitude of the location. + Latitude *string `json:"latitude,omitempty"` + // Longitude - READ-ONLY; The longitude of the location. + Longitude *string `json:"longitude,omitempty"` +} + +// LocationListResult location list operation response. +type LocationListResult struct { + autorest.Response `json:"-"` + // Value - An array of locations. + Value *[]Location `json:"value,omitempty"` +} + +// ManagedByTenant information about a tenant managing the subscription. +type ManagedByTenant struct { + // TenantID - READ-ONLY; The tenant ID of the managing tenant. This is a GUID. + TenantID *string `json:"tenantId,omitempty"` +} + +// Operation microsoft.Resources 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.Resources + 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 the operation. + Description *string `json:"description,omitempty"` +} + +// OperationListResult result of the request to list Microsoft.Resources 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 - List of Microsoft.Resources operations. + 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"` +} + +// 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} +} + +// Policies subscription policies. +type Policies struct { + // LocationPlacementID - READ-ONLY; The subscription location placement ID. The ID indicates which regions are visible for a subscription. For example, a subscription with a location placement Id of Public_2014-09-01 has access to Azure public regions. + LocationPlacementID *string `json:"locationPlacementId,omitempty"` + // QuotaID - READ-ONLY; The subscription quota ID. + QuotaID *string `json:"quotaId,omitempty"` + // SpendingLimit - READ-ONLY; The subscription spending limit. Possible values include: 'On', 'Off', 'CurrentPeriodOff' + SpendingLimit SpendingLimit `json:"spendingLimit,omitempty"` +} + +// Subscription subscription information. +type Subscription struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The fully qualified ID for the subscription. For example, /subscriptions/00000000-0000-0000-0000-000000000000. + ID *string `json:"id,omitempty"` + // SubscriptionID - READ-ONLY; The subscription ID. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // DisplayName - READ-ONLY; The subscription display name. + DisplayName *string `json:"displayName,omitempty"` + // TenantID - READ-ONLY; The subscription tenant ID. + TenantID *string `json:"tenantId,omitempty"` + // State - READ-ONLY; The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted. Possible values include: 'Enabled', 'Warned', 'PastDue', 'Disabled', 'Deleted' + State State `json:"state,omitempty"` + // SubscriptionPolicies - The subscription policies. + SubscriptionPolicies *Policies `json:"subscriptionPolicies,omitempty"` + // AuthorizationSource - The authorization source of the request. Valid values are one or more combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. + AuthorizationSource *string `json:"authorizationSource,omitempty"` + // ManagedByTenants - An array containing the tenants managing the subscription. + ManagedByTenants *[]ManagedByTenant `json:"managedByTenants,omitempty"` +} + +// TenantIDDescription tenant Id information. +type TenantIDDescription struct { + // ID - READ-ONLY; The fully qualified ID of the tenant. For example, /tenants/00000000-0000-0000-0000-000000000000. + ID *string `json:"id,omitempty"` + // TenantID - READ-ONLY; The tenant ID. For example, 00000000-0000-0000-0000-000000000000. + TenantID *string `json:"tenantId,omitempty"` +} + +// TenantListResult tenant Ids information. +type TenantListResult struct { + autorest.Response `json:"-"` + // Value - An array of tenants. + Value *[]TenantIDDescription `json:"value,omitempty"` + // NextLink - The URL to use for getting the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// TenantListResultIterator provides access to a complete listing of TenantIDDescription values. +type TenantListResultIterator struct { + i int + page TenantListResultPage +} + +// 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 *TenantListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TenantListResultIterator.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 *TenantListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TenantListResultIterator) 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 TenantListResultIterator) Response() TenantListResult { + 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 TenantListResultIterator) Value() TenantIDDescription { + if !iter.page.NotDone() { + return TenantIDDescription{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TenantListResultIterator type. +func NewTenantListResultIterator(page TenantListResultPage) TenantListResultIterator { + return TenantListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tlr TenantListResult) IsEmpty() bool { + return tlr.Value == nil || len(*tlr.Value) == 0 +} + +// tenantListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tlr TenantListResult) tenantListResultPreparer(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))) +} + +// TenantListResultPage contains a page of TenantIDDescription values. +type TenantListResultPage struct { + fn func(context.Context, TenantListResult) (TenantListResult, error) + tlr TenantListResult +} + +// 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 *TenantListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TenantListResultPage.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 *TenantListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TenantListResultPage) NotDone() bool { + return !page.tlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TenantListResultPage) Response() TenantListResult { + return page.tlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TenantListResultPage) Values() []TenantIDDescription { + if page.tlr.IsEmpty() { + return nil + } + return *page.tlr.Value +} + +// Creates a new instance of the TenantListResultPage type. +func NewTenantListResultPage(getNextPage func(context.Context, TenantListResult) (TenantListResult, error)) TenantListResultPage { + return TenantListResultPage{fn: getNextPage} +} diff --git a/services/resources/mgmt/2019-06-01/subscriptions/operations.go b/services/resources/mgmt/2019-06-01/subscriptions/operations.go new file mode 100644 index 000000000000..fe16bb7ecac7 --- /dev/null +++ b/services/resources/mgmt/2019-06-01/subscriptions/operations.go @@ -0,0 +1,149 @@ +package subscriptions + +// 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 all resource groups and resources exist within subscriptions. These operation enable you get +// information about your subscriptions and tenants. A tenant is a dedicated instance of Azure Active Directory (Azure +// AD) for your organization. +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. +func NewOperationsClientWithBaseURI(baseURI string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI)} +} + +// List lists all of the available Microsoft.Resources 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, "subscriptions.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, "subscriptions.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "subscriptions.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-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Resources/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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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, "subscriptions.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, "subscriptions.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "subscriptions.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/resources/mgmt/2019-06-01/subscriptions/subscriptions.go b/services/resources/mgmt/2019-06-01/subscriptions/subscriptions.go new file mode 100644 index 000000000000..d73b6ad4e3b7 --- /dev/null +++ b/services/resources/mgmt/2019-06-01/subscriptions/subscriptions.go @@ -0,0 +1,298 @@ +package subscriptions + +// 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" +) + +// Client is the all resource groups and resources exist within subscriptions. These operation enable you get +// information about your subscriptions and tenants. A tenant is a dedicated instance of Azure Active Directory (Azure +// AD) for your organization. +type Client struct { + BaseClient +} + +// NewClient creates an instance of the Client client. +func NewClient() Client { + return NewClientWithBaseURI(DefaultBaseURI) +} + +// NewClientWithBaseURI creates an instance of the Client client. +func NewClientWithBaseURI(baseURI string) Client { + return Client{NewWithBaseURI(baseURI)} +} + +// Get gets details about a specified subscription. +// Parameters: +// subscriptionID - the ID of the target subscription. +func (client Client) Get(ctx context.Context, subscriptionID string) (result Subscription, 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, subscriptionID) + if err != nil { + err = autorest.NewErrorWithError(err, "subscriptions.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, "subscriptions.Client", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "subscriptions.Client", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client Client) GetPreparer(ctx context.Context, subscriptionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", 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}", 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) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client Client) 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 +} + +// List gets all subscriptions for a tenant. +func (client Client) List(ctx context.Context) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.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, "subscriptions.Client", "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, "subscriptions.Client", "List", resp, "Failure sending request") + return + } + + result.lr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "subscriptions.Client", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client Client) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/subscriptions"), + 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 Client) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client Client) 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 Client) listNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "subscriptions.Client", "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, "subscriptions.Client", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "subscriptions.Client", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client Client) ListComplete(ctx context.Context) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.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 +} + +// ListLocations this operation provides all the locations that are available for resource providers; however, each +// resource provider may support a subset of this list. +// Parameters: +// subscriptionID - the ID of the target subscription. +func (client Client) ListLocations(ctx context.Context, subscriptionID string) (result LocationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListLocations") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListLocationsPreparer(ctx, subscriptionID) + if err != nil { + err = autorest.NewErrorWithError(err, "subscriptions.Client", "ListLocations", nil, "Failure preparing request") + return + } + + resp, err := client.ListLocationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "subscriptions.Client", "ListLocations", resp, "Failure sending request") + return + } + + result, err = client.ListLocationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "subscriptions.Client", "ListLocations", resp, "Failure responding to request") + } + + return +} + +// ListLocationsPreparer prepares the ListLocations request. +func (client Client) ListLocationsPreparer(ctx context.Context, subscriptionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", 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}/locations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListLocationsSender sends the ListLocations request. The method will close the +// http.Response Body if it receives an error. +func (client Client) ListLocationsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListLocationsResponder handles the response to the ListLocations request. The method always +// closes the http.Response Body. +func (client Client) ListLocationsResponder(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 +} diff --git a/services/resources/mgmt/2019-06-01/subscriptions/subscriptionsapi/interfaces.go b/services/resources/mgmt/2019-06-01/subscriptions/subscriptionsapi/interfaces.go new file mode 100644 index 000000000000..159b1a7d19ca --- /dev/null +++ b/services/resources/mgmt/2019-06-01/subscriptions/subscriptionsapi/interfaces.go @@ -0,0 +1,46 @@ +package subscriptionsapi + +// 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/resources/mgmt/2019-06-01/subscriptions" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result subscriptions.OperationListResultPage, err error) +} + +var _ OperationsClientAPI = (*subscriptions.OperationsClient)(nil) + +// ClientAPI contains the set of methods on the Client type. +type ClientAPI interface { + Get(ctx context.Context, subscriptionID string) (result subscriptions.Subscription, err error) + List(ctx context.Context) (result subscriptions.ListResultPage, err error) + ListLocations(ctx context.Context, subscriptionID string) (result subscriptions.LocationListResult, err error) +} + +var _ ClientAPI = (*subscriptions.Client)(nil) + +// TenantsClientAPI contains the set of methods on the TenantsClient type. +type TenantsClientAPI interface { + List(ctx context.Context) (result subscriptions.TenantListResultPage, err error) +} + +var _ TenantsClientAPI = (*subscriptions.TenantsClient)(nil) diff --git a/services/resources/mgmt/2019-06-01/subscriptions/tenants.go b/services/resources/mgmt/2019-06-01/subscriptions/tenants.go new file mode 100644 index 000000000000..16d24866e273 --- /dev/null +++ b/services/resources/mgmt/2019-06-01/subscriptions/tenants.go @@ -0,0 +1,149 @@ +package subscriptions + +// 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" +) + +// TenantsClient is the all resource groups and resources exist within subscriptions. These operation enable you get +// information about your subscriptions and tenants. A tenant is a dedicated instance of Azure Active Directory (Azure +// AD) for your organization. +type TenantsClient struct { + BaseClient +} + +// NewTenantsClient creates an instance of the TenantsClient client. +func NewTenantsClient() TenantsClient { + return NewTenantsClientWithBaseURI(DefaultBaseURI) +} + +// NewTenantsClientWithBaseURI creates an instance of the TenantsClient client. +func NewTenantsClientWithBaseURI(baseURI string) TenantsClient { + return TenantsClient{NewWithBaseURI(baseURI)} +} + +// List gets the tenants for your account. +func (client TenantsClient) List(ctx context.Context) (result TenantListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TenantsClient.List") + defer func() { + sc := -1 + if result.tlr.Response.Response != nil { + sc = result.tlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "subscriptions.TenantsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.tlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "subscriptions.TenantsClient", "List", resp, "Failure sending request") + return + } + + result.tlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "subscriptions.TenantsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client TenantsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/tenants"), + 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 TenantsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client TenantsClient) ListResponder(resp *http.Response) (result TenantListResult, 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 TenantsClient) listNextResults(ctx context.Context, lastResults TenantListResult) (result TenantListResult, err error) { + req, err := lastResults.tenantListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "subscriptions.TenantsClient", "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, "subscriptions.TenantsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "subscriptions.TenantsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client TenantsClient) ListComplete(ctx context.Context) (result TenantListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TenantsClient.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/resources/mgmt/2019-06-01/subscriptions/version.go b/services/resources/mgmt/2019-06-01/subscriptions/version.go new file mode 100644 index 000000000000..ab40d8825933 --- /dev/null +++ b/services/resources/mgmt/2019-06-01/subscriptions/version.go @@ -0,0 +1,30 @@ +package subscriptions + +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.Number + " subscriptions/2019-06-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/servicebus/mgmt/2017-04-01/servicebus/models.go b/services/servicebus/mgmt/2017-04-01/servicebus/models.go index 8af2acb1c652..d651f9ac1eb6 100644 --- a/services/servicebus/mgmt/2017-04-01/servicebus/models.go +++ b/services/servicebus/mgmt/2017-04-01/servicebus/models.go @@ -1544,6 +1544,152 @@ func (nrs *NetworkRuleSet) UnmarshalJSON(body []byte) error { return nil } +// NetworkRuleSetListResult the response of the List NetworkRuleSet operation. +type NetworkRuleSetListResult struct { + autorest.Response `json:"-"` + // Value - Result of the List NetworkRuleSet operation. + Value *[]NetworkRuleSet `json:"value,omitempty"` + // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of NetworkRuleSet. + NextLink *string `json:"nextLink,omitempty"` +} + +// NetworkRuleSetListResultIterator provides access to a complete listing of NetworkRuleSet values. +type NetworkRuleSetListResultIterator struct { + i int + page NetworkRuleSetListResultPage +} + +// 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 *NetworkRuleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkRuleSetListResultIterator.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 *NetworkRuleSetListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NetworkRuleSetListResultIterator) 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 NetworkRuleSetListResultIterator) Response() NetworkRuleSetListResult { + 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 NetworkRuleSetListResultIterator) Value() NetworkRuleSet { + if !iter.page.NotDone() { + return NetworkRuleSet{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NetworkRuleSetListResultIterator type. +func NewNetworkRuleSetListResultIterator(page NetworkRuleSetListResultPage) NetworkRuleSetListResultIterator { + return NetworkRuleSetListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nrslr NetworkRuleSetListResult) IsEmpty() bool { + return nrslr.Value == nil || len(*nrslr.Value) == 0 +} + +// networkRuleSetListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nrslr NetworkRuleSetListResult) networkRuleSetListResultPreparer(ctx context.Context) (*http.Request, error) { + if nrslr.NextLink == nil || len(to.String(nrslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nrslr.NextLink))) +} + +// NetworkRuleSetListResultPage contains a page of NetworkRuleSet values. +type NetworkRuleSetListResultPage struct { + fn func(context.Context, NetworkRuleSetListResult) (NetworkRuleSetListResult, error) + nrslr NetworkRuleSetListResult +} + +// 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 *NetworkRuleSetListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkRuleSetListResultPage.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.nrslr) + if err != nil { + return err + } + page.nrslr = 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 *NetworkRuleSetListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NetworkRuleSetListResultPage) NotDone() bool { + return !page.nrslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NetworkRuleSetListResultPage) Response() NetworkRuleSetListResult { + return page.nrslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NetworkRuleSetListResultPage) Values() []NetworkRuleSet { + if page.nrslr.IsEmpty() { + return nil + } + return *page.nrslr.Value +} + +// Creates a new instance of the NetworkRuleSetListResultPage type. +func NewNetworkRuleSetListResultPage(getNextPage func(context.Context, NetworkRuleSetListResult) (NetworkRuleSetListResult, error)) NetworkRuleSetListResultPage { + return NetworkRuleSetListResultPage{fn: getNextPage} +} + // NetworkRuleSetProperties networkRuleSet properties type NetworkRuleSetProperties struct { // DefaultAction - Default Action for Network Rule Set. Possible values include: 'Allow', 'Deny' @@ -3609,7 +3755,7 @@ type SBTopicProperties struct { type SQLFilter struct { // SQLExpression - The SQL expression. e.g. MyProperty='ABC' SQLExpression *string `json:"sqlExpression,omitempty"` - // CompatibilityLevel - READ-ONLY; This property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20. + // CompatibilityLevel - This property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20. CompatibilityLevel *int32 `json:"compatibilityLevel,omitempty"` // RequiresPreprocessing - Value that indicates whether the rule action requires preprocessing. RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` diff --git a/services/servicebus/mgmt/2017-04-01/servicebus/namespaces.go b/services/servicebus/mgmt/2017-04-01/servicebus/namespaces.go index 8f63d12121e8..e9034b3b14cb 100644 --- a/services/servicebus/mgmt/2017-04-01/servicebus/namespaces.go +++ b/services/servicebus/mgmt/2017-04-01/servicebus/namespaces.go @@ -1289,6 +1289,131 @@ func (client NamespacesClient) ListKeysResponder(resp *http.Response) (result Ac return } +// ListNetworkRuleSets gets list of NetworkRuleSet for a Namespace. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// namespaceName - the namespace name +func (client NamespacesClient) ListNetworkRuleSets(ctx context.Context, resourceGroupName string, namespaceName string) (result NetworkRuleSetListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamespacesClient.ListNetworkRuleSets") + defer func() { + sc := -1 + if result.nrslr.Response.Response != nil { + sc = result.nrslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: namespaceName, + Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { + return result, validation.NewError("servicebus.NamespacesClient", "ListNetworkRuleSets", err.Error()) + } + + result.fn = client.listNetworkRuleSetsNextResults + req, err := client.ListNetworkRuleSetsPreparer(ctx, resourceGroupName, namespaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListNetworkRuleSets", nil, "Failure preparing request") + return + } + + resp, err := client.ListNetworkRuleSetsSender(req) + if err != nil { + result.nrslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListNetworkRuleSets", resp, "Failure sending request") + return + } + + result.nrslr, err = client.ListNetworkRuleSetsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListNetworkRuleSets", resp, "Failure responding to request") + } + + return +} + +// ListNetworkRuleSetsPreparer prepares the ListNetworkRuleSets request. +func (client NamespacesClient) ListNetworkRuleSetsPreparer(ctx context.Context, resourceGroupName string, namespaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-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.ServiceBus/namespaces/{namespaceName}/networkRuleSets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListNetworkRuleSetsSender sends the ListNetworkRuleSets request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) ListNetworkRuleSetsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListNetworkRuleSetsResponder handles the response to the ListNetworkRuleSets request. The method always +// closes the http.Response Body. +func (client NamespacesClient) ListNetworkRuleSetsResponder(resp *http.Response) (result NetworkRuleSetListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNetworkRuleSetsNextResults retrieves the next set of results, if any. +func (client NamespacesClient) listNetworkRuleSetsNextResults(ctx context.Context, lastResults NetworkRuleSetListResult) (result NetworkRuleSetListResult, err error) { + req, err := lastResults.networkRuleSetListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "listNetworkRuleSetsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListNetworkRuleSetsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "listNetworkRuleSetsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListNetworkRuleSetsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "listNetworkRuleSetsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListNetworkRuleSetsComplete enumerates all values, automatically crossing page boundaries as required. +func (client NamespacesClient) ListNetworkRuleSetsComplete(ctx context.Context, resourceGroupName string, namespaceName string) (result NetworkRuleSetListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamespacesClient.ListNetworkRuleSets") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListNetworkRuleSets(ctx, resourceGroupName, namespaceName) + return +} + // Migrate this operation Migrate the given namespace to provided name type // Parameters: // resourceGroupName - name of the Resource group within the Azure subscription. diff --git a/services/servicebus/mgmt/2017-04-01/servicebus/rules.go b/services/servicebus/mgmt/2017-04-01/servicebus/rules.go index 0d3357e5b6fc..4b12b65da8fe 100644 --- a/services/servicebus/mgmt/2017-04-01/servicebus/rules.go +++ b/services/servicebus/mgmt/2017-04-01/servicebus/rules.go @@ -74,7 +74,16 @@ func (client RulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName {Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: ruleName, Constraints: []validation.Constraint{{Target: "ruleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "ruleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + {Target: "ruleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Ruleproperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Ruleproperties.SQLFilter", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Ruleproperties.SQLFilter.CompatibilityLevel", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Ruleproperties.SQLFilter.CompatibilityLevel", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "parameters.Ruleproperties.SQLFilter.CompatibilityLevel", Name: validation.InclusiveMinimum, Rule: 20, Chain: nil}, + }}, + }}, + }}}}}); err != nil { return result, validation.NewError("servicebus.RulesClient", "CreateOrUpdate", err.Error()) } diff --git a/services/servicebus/mgmt/2017-04-01/servicebus/servicebusapi/interfaces.go b/services/servicebus/mgmt/2017-04-01/servicebus/servicebusapi/interfaces.go index 0c6bbd6f5999..a5a9dcb0efe7 100644 --- a/services/servicebus/mgmt/2017-04-01/servicebus/servicebusapi/interfaces.go +++ b/services/servicebus/mgmt/2017-04-01/servicebus/servicebusapi/interfaces.go @@ -45,6 +45,7 @@ type NamespacesClientAPI interface { ListAuthorizationRules(ctx context.Context, resourceGroupName string, namespaceName string) (result servicebus.SBAuthorizationRuleListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result servicebus.SBNamespaceListResultPage, err error) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string) (result servicebus.AccessKeys, err error) + ListNetworkRuleSets(ctx context.Context, resourceGroupName string, namespaceName string) (result servicebus.NetworkRuleSetListResultPage, err error) Migrate(ctx context.Context, resourceGroupName string, namespaceName string, parameters servicebus.SBNamespaceMigrate) (result autorest.Response, err error) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters servicebus.RegenerateAccessKeyParameters) (result servicebus.AccessKeys, err error) Update(ctx context.Context, resourceGroupName string, namespaceName string, parameters servicebus.SBNamespaceUpdateParameters) (result servicebus.SBNamespace, err error) diff --git a/services/cognitiveservices/v2.0/luis/programmatic/client.go b/services/storage/datalake/2019-10-31/storagedatalake/client.go similarity index 59% rename from services/cognitiveservices/v2.0/luis/programmatic/client.go rename to services/storage/datalake/2019-10-31/storagedatalake/client.go index cc14e3405269..896ee3ceab29 100644 --- a/services/cognitiveservices/v2.0/luis/programmatic/client.go +++ b/services/storage/datalake/2019-10-31/storagedatalake/client.go @@ -1,7 +1,7 @@ -// Package programmatic implements the Azure ARM Programmatic service API version v2.0 preview. +// Package storagedatalake implements the Azure ARM Storagedatalake service API version 2019-10-31. // -// -package programmatic +// Azure Data Lake Storage provides storage for Hadoop and other big data workloads. +package storagedatalake // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -24,21 +24,30 @@ import ( "github.com/Azure/go-autorest/autorest" ) -// BaseClient is the base client for Programmatic. +const ( + // DefaultDNSSuffix is the default value for dns suffix + DefaultDNSSuffix = "dfs.core.windows.net" +) + +// BaseClient is the base client for Storagedatalake. type BaseClient struct { autorest.Client - AzureRegion AzureRegions + XMsVersion string + AccountName string + DNSSuffix string } // New creates an instance of the BaseClient client. -func New(azureRegion AzureRegions) BaseClient { - return NewWithoutDefaults(azureRegion) +func New(xMsVersion string, accountName string) BaseClient { + return NewWithoutDefaults(xMsVersion, accountName, DefaultDNSSuffix) } // NewWithoutDefaults creates an instance of the BaseClient client. -func NewWithoutDefaults(azureRegion AzureRegions) BaseClient { +func NewWithoutDefaults(xMsVersion string, accountName string, dNSSuffix string) BaseClient { return BaseClient{ Client: autorest.NewClientWithUserAgent(UserAgent()), - AzureRegion: azureRegion, + XMsVersion: xMsVersion, + AccountName: accountName, + DNSSuffix: dNSSuffix, } } diff --git a/services/storage/datalake/2019-10-31/storagedatalake/filesystem.go b/services/storage/datalake/2019-10-31/storagedatalake/filesystem.go new file mode 100644 index 000000000000..ccd1cc128156 --- /dev/null +++ b/services/storage/datalake/2019-10-31/storagedatalake/filesystem.go @@ -0,0 +1,658 @@ +package storagedatalake + +// 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" +) + +// FilesystemClient is the azure Data Lake Storage provides storage for Hadoop and other big data workloads. +type FilesystemClient struct { + BaseClient +} + +// NewFilesystemClient creates an instance of the FilesystemClient client. +func NewFilesystemClient(xMsVersion string, accountName string) FilesystemClient { + return FilesystemClient{New(xMsVersion, accountName)} +} + +// Create create a filesystem rooted at the specified location. If the filesystem already exists, the operation fails. +// This operation does not support conditional HTTP requests. +// Parameters: +// filesystem - the filesystem identifier. The value must start and end with a letter or number and must +// contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All +// letters must be lowercase. The value must have between 3 and 63 characters. +// xMsProperties - user-defined properties to be stored with the filesystem, in the format of a comma-separated +// list of name and value pairs "n1=v1, n2=v2, ...", where each value is a base64 encoded string. Note that the +// string may only contain ASCII characters in the ISO-8859-1 character set. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client FilesystemClient) Create(ctx context.Context, filesystem string, xMsProperties string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FilesystemClient.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: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.FilesystemClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, filesystem, xMsProperties, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client FilesystemClient) CreatePreparer(ctx context.Context, filesystem string, xMsProperties string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + } + + queryParameters := map[string]interface{}{ + "resource": autorest.Encode("query", "filesystem"), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(xMsProperties) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-properties", autorest.String(xMsProperties))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + 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 FilesystemClient) CreateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client FilesystemClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete marks the filesystem for deletion. When a filesystem is deleted, a filesystem with the same identifier +// cannot be created for at least 30 seconds. While the filesystem is being deleted, attempts to create a filesystem +// with the same identifier will fail with status code 409 (Conflict), with the service returning additional error +// information indicating that the filesystem is being deleted. All other operations, including operations on any files +// or directories within the filesystem, will fail with status code 404 (Not Found) while the filesystem is being +// deleted. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional +// Headers for Blob Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// Parameters: +// filesystem - the filesystem identifier. The value must start and end with a letter or number and must +// contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All +// letters must be lowercase. The value must have between 3 and 63 characters. +// ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the +// resource has been modified since the specified date and time. +// ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if +// the resource has not been modified since the specified date and time. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client FilesystemClient) Delete(ctx context.Context, filesystem string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FilesystemClient.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: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.FilesystemClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, filesystem, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client FilesystemClient) DeletePreparer(ctx context.Context, filesystem string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + } + + queryParameters := map[string]interface{}{ + "resource": autorest.Encode("query", "filesystem"), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + 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 FilesystemClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client FilesystemClient) 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 +} + +// GetProperties all system and user-defined filesystem properties are specified in the response headers. +// Parameters: +// filesystem - the filesystem identifier. The value must start and end with a letter or number and must +// contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All +// letters must be lowercase. The value must have between 3 and 63 characters. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client FilesystemClient) GetProperties(ctx context.Context, filesystem string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FilesystemClient.GetProperties") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.FilesystemClient", "GetProperties", err.Error()) + } + + req, err := client.GetPropertiesPreparer(ctx, filesystem, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "GetProperties", nil, "Failure preparing request") + return + } + + resp, err := client.GetPropertiesSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "GetProperties", resp, "Failure sending request") + return + } + + result, err = client.GetPropertiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "GetProperties", resp, "Failure responding to request") + } + + return +} + +// GetPropertiesPreparer prepares the GetProperties request. +func (client FilesystemClient) GetPropertiesPreparer(ctx context.Context, filesystem string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + } + + queryParameters := map[string]interface{}{ + "resource": autorest.Encode("query", "filesystem"), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPropertiesSender sends the GetProperties request. The method will close the +// http.Response Body if it receives an error. +func (client FilesystemClient) GetPropertiesSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetPropertiesResponder handles the response to the GetProperties request. The method always +// closes the http.Response Body. +func (client FilesystemClient) GetPropertiesResponder(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 list filesystems and their properties in given account. +// Parameters: +// prefix - filters results to filesystems within the specified prefix. +// continuation - the number of filesystems returned with each invocation is limited. If the number of +// filesystems to be returned exceeds this limit, a continuation token is returned in the response header +// x-ms-continuation. When a continuation token is returned in the response, it must be specified in a +// subsequent invocation of the list operation to continue listing the filesystems. +// maxResults - an optional value that specifies the maximum number of items to return. If omitted or greater +// than 5,000, the response will include up to 5,000 items. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client FilesystemClient) List(ctx context.Context, prefix string, continuation string, maxResults *int32, xMsClientRequestID string, timeout *int32, xMsDate string) (result FilesystemList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FilesystemClient.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: maxResults, + Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.FilesystemClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, prefix, continuation, maxResults, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client FilesystemClient) ListPreparer(ctx context.Context, prefix string, continuation string, maxResults *int32, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + queryParameters := map[string]interface{}{ + "resource": autorest.Encode("query", "account"), + } + if len(prefix) > 0 { + queryParameters["prefix"] = autorest.Encode("query", prefix) + } + if len(continuation) > 0 { + queryParameters["continuation"] = autorest.Encode("query", continuation) + } + if maxResults != nil { + queryParameters["maxResults"] = autorest.Encode("query", *maxResults) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPath("/"), + autorest.WithQueryParameters(queryParameters)) + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + 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 FilesystemClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client FilesystemClient) ListResponder(resp *http.Response) (result FilesystemList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SetProperties set properties for the filesystem. This operation supports conditional HTTP requests. For more +// information, see [Specifying Conditional Headers for Blob Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// Parameters: +// filesystem - the filesystem identifier. The value must start and end with a letter or number and must +// contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All +// letters must be lowercase. The value must have between 3 and 63 characters. +// xMsProperties - optional. User-defined properties to be stored with the filesystem, in the format of a +// comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is a base64 encoded +// string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set. If the +// filesystem exists, any properties not included in the list will be removed. All properties are removed if +// the header is omitted. To merge new and existing properties, first get all existing properties and the +// current E-Tag, then make a conditional request with the E-Tag and include values for all properties. +// ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the +// resource has been modified since the specified date and time. +// ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if +// the resource has not been modified since the specified date and time. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client FilesystemClient) SetProperties(ctx context.Context, filesystem string, xMsProperties string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FilesystemClient.SetProperties") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.FilesystemClient", "SetProperties", err.Error()) + } + + req, err := client.SetPropertiesPreparer(ctx, filesystem, xMsProperties, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "SetProperties", nil, "Failure preparing request") + return + } + + resp, err := client.SetPropertiesSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "SetProperties", resp, "Failure sending request") + return + } + + result, err = client.SetPropertiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "SetProperties", resp, "Failure responding to request") + } + + return +} + +// SetPropertiesPreparer prepares the SetProperties request. +func (client FilesystemClient) SetPropertiesPreparer(ctx context.Context, filesystem string, xMsProperties string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + } + + queryParameters := map[string]interface{}{ + "resource": autorest.Encode("query", "filesystem"), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsPatch(), + autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(xMsProperties) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-properties", autorest.String(xMsProperties))) + } + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SetPropertiesSender sends the SetProperties request. The method will close the +// http.Response Body if it receives an error. +func (client FilesystemClient) SetPropertiesSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// SetPropertiesResponder handles the response to the SetProperties request. The method always +// closes the http.Response Body. +func (client FilesystemClient) SetPropertiesResponder(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/storage/datalake/2019-10-31/storagedatalake/models.go b/services/storage/datalake/2019-10-31/storagedatalake/models.go new file mode 100644 index 000000000000..80a8c68744bb --- /dev/null +++ b/services/storage/datalake/2019-10-31/storagedatalake/models.go @@ -0,0 +1,164 @@ +package storagedatalake + +// 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" + "io" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2019-10-31/storagedatalake" + +// PathGetPropertiesAction enumerates the values for path get properties action. +type PathGetPropertiesAction string + +const ( + // CheckAccess ... + CheckAccess PathGetPropertiesAction = "checkAccess" + // GetAccessControl ... + GetAccessControl PathGetPropertiesAction = "getAccessControl" + // GetStatus ... + GetStatus PathGetPropertiesAction = "getStatus" +) + +// PossiblePathGetPropertiesActionValues returns an array of possible values for the PathGetPropertiesAction const type. +func PossiblePathGetPropertiesActionValues() []PathGetPropertiesAction { + return []PathGetPropertiesAction{CheckAccess, GetAccessControl, GetStatus} +} + +// PathLeaseAction enumerates the values for path lease action. +type PathLeaseAction string + +const ( + // Acquire ... + Acquire PathLeaseAction = "acquire" + // Break ... + Break PathLeaseAction = "break" + // Change ... + Change PathLeaseAction = "change" + // Release ... + Release PathLeaseAction = "release" + // Renew ... + Renew PathLeaseAction = "renew" +) + +// PossiblePathLeaseActionValues returns an array of possible values for the PathLeaseAction const type. +func PossiblePathLeaseActionValues() []PathLeaseAction { + return []PathLeaseAction{Acquire, Break, Change, Release, Renew} +} + +// PathRenameMode enumerates the values for path rename mode. +type PathRenameMode string + +const ( + // Legacy ... + Legacy PathRenameMode = "legacy" + // Posix ... + Posix PathRenameMode = "posix" +) + +// PossiblePathRenameModeValues returns an array of possible values for the PathRenameMode const type. +func PossiblePathRenameModeValues() []PathRenameMode { + return []PathRenameMode{Legacy, Posix} +} + +// PathResourceType enumerates the values for path resource type. +type PathResourceType string + +const ( + // Directory ... + Directory PathResourceType = "directory" + // File ... + File PathResourceType = "file" +) + +// PossiblePathResourceTypeValues returns an array of possible values for the PathResourceType const type. +func PossiblePathResourceTypeValues() []PathResourceType { + return []PathResourceType{Directory, File} +} + +// PathUpdateAction enumerates the values for path update action. +type PathUpdateAction string + +const ( + // Append ... + Append PathUpdateAction = "append" + // Flush ... + Flush PathUpdateAction = "flush" + // SetAccessControl ... + SetAccessControl PathUpdateAction = "setAccessControl" + // SetProperties ... + SetProperties PathUpdateAction = "setProperties" +) + +// PossiblePathUpdateActionValues returns an array of possible values for the PathUpdateAction const type. +func PossiblePathUpdateActionValues() []PathUpdateAction { + return []PathUpdateAction{Append, Flush, SetAccessControl, SetProperties} +} + +// DataLakeStorageError ... +type DataLakeStorageError struct { + // Error - The service error response object. + Error *DataLakeStorageErrorError `json:"error,omitempty"` +} + +// DataLakeStorageErrorError the service error response object. +type DataLakeStorageErrorError struct { + // Code - The service error code. + Code *string `json:"code,omitempty"` + // Message - The service error message. + Message *string `json:"message,omitempty"` +} + +// Filesystem ... +type Filesystem struct { + Name *string `json:"name,omitempty"` + LastModified *string `json:"lastModified,omitempty"` + ETag *string `json:"eTag,omitempty"` +} + +// FilesystemList ... +type FilesystemList struct { + autorest.Response `json:"-"` + Filesystems *[]Filesystem `json:"filesystems,omitempty"` +} + +// Path ... +type Path struct { + Name *string `json:"name,omitempty"` + IsDirectory *bool `json:"isDirectory,omitempty"` + LastModified *string `json:"lastModified,omitempty"` + ETag *string `json:"eTag,omitempty"` + ContentLength *int64 `json:"contentLength,omitempty"` + Owner *string `json:"owner,omitempty"` + Group *string `json:"group,omitempty"` + Permissions *string `json:"permissions,omitempty"` +} + +// PathList ... +type PathList struct { + autorest.Response `json:"-"` + Paths *[]Path `json:"paths,omitempty"` +} + +// ReadCloser ... +type ReadCloser struct { + autorest.Response `json:"-"` + Value *io.ReadCloser `json:"value,omitempty"` +} diff --git a/services/storage/datalake/2019-10-31/storagedatalake/path.go b/services/storage/datalake/2019-10-31/storagedatalake/path.go new file mode 100644 index 000000000000..bdda54bf03eb --- /dev/null +++ b/services/storage/datalake/2019-10-31/storagedatalake/path.go @@ -0,0 +1,1431 @@ +package storagedatalake + +// 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" + "io" + "net/http" +) + +// PathClient is the azure Data Lake Storage provides storage for Hadoop and other big data workloads. +type PathClient struct { + BaseClient +} + +// NewPathClient creates an instance of the PathClient client. +func NewPathClient(xMsVersion string, accountName string) PathClient { + return PathClient{New(xMsVersion, accountName)} +} + +// Create create or rename a file or directory. By default, the destination is overwritten and if the destination +// already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more +// information, see [Specifying Conditional Headers for Blob Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// To fail if the destination already exists, use a conditional request with If-None-Match: "*". +// Parameters: +// filesystem - the filesystem identifier. +// pathParameter - the file or directory path. +// resource - required only for Create File and Create Directory. The value must be "file" or "directory". +// continuation - optional. When renaming a directory, the number of paths that are renamed with each +// invocation is limited. If the number of paths to be renamed exceeds this limit, a continuation token is +// returned in this response header. When a continuation token is returned in the response, it must be +// specified in a subsequent invocation of the rename operation to continue renaming the directory. +// mode - optional. Valid only when namespace is enabled. This parameter determines the behavior of the rename +// operation. The value must be "legacy" or "posix", and the default value will be "posix". +// cacheControl - optional. The service stores this value and includes it in the "Cache-Control" response +// header for "Read File" operations for "Read File" operations. +// contentEncoding - optional. Specifies which content encodings have been applied to the file. This value is +// returned to the client when the "Read File" operation is performed. +// contentLanguage - optional. Specifies the natural language used by the intended audience for the file. +// contentDisposition - optional. The service stores this value and includes it in the "Content-Disposition" +// response header for "Read File" operations. +// xMsCacheControl - optional. The service stores this value and includes it in the "Cache-Control" response +// header for "Read File" operations. +// xMsContentType - optional. The service stores this value and includes it in the "Content-Type" response +// header for "Read File" operations. +// xMsContentEncoding - optional. The service stores this value and includes it in the "Content-Encoding" +// response header for "Read File" operations. +// xMsContentLanguage - optional. The service stores this value and includes it in the "Content-Language" +// response header for "Read File" operations. +// xMsContentDisposition - optional. The service stores this value and includes it in the +// "Content-Disposition" response header for "Read File" operations. +// xMsRenameSource - an optional file or directory to be renamed. The value must have the following format: +// "/{filesystem}/{path}". If "x-ms-properties" is specified, the properties will overwrite the existing +// properties; otherwise, the existing properties will be preserved. This value must be a URL percent-encoded +// string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set. +// xMsLeaseID - optional. A lease ID for the path specified in the URI. The path to be overwritten must have +// an active lease and the lease ID must match. +// xMsSourceLeaseID - optional for rename operations. A lease ID for the source path. The source path must +// have an active lease and the lease ID must match. +// xMsProperties - optional. User-defined properties to be stored with the file or directory, in the format of +// a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is a base64 encoded +// string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set. +// xMsPermissions - optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX +// access permissions for the file owner, the file owning group, and others. Each class may be granted read, +// write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit +// octal notation (e.g. 0766) are supported. +// xMsUmask - optional and only valid if Hierarchical Namespace is enabled for the account. When creating a +// file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of +// the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission +// and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The +// default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must +// be specified in 4-digit octal notation (e.g. 0766). +// ifMatch - optional. An ETag value. Specify this header to perform the operation only if the resource's ETag +// matches the value specified. The ETag must be specified in quotes. +// ifNoneMatch - optional. An ETag value or the special wildcard ("*") value. Specify this header to perform +// the operation only if the resource's ETag does not match the value specified. The ETag must be specified in +// quotes. +// ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the +// resource has been modified since the specified date and time. +// ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if +// the resource has not been modified since the specified date and time. +// xMsSourceIfMatch - optional. An ETag value. Specify this header to perform the rename operation only if the +// source's ETag matches the value specified. The ETag must be specified in quotes. +// xMsSourceIfNoneMatch - optional. An ETag value or the special wildcard ("*") value. Specify this header to +// perform the rename operation only if the source's ETag does not match the value specified. The ETag must be +// specified in quotes. +// xMsSourceIfModifiedSince - optional. A date and time value. Specify this header to perform the rename +// operation only if the source has been modified since the specified date and time. +// xMsSourceIfUnmodifiedSince - optional. A date and time value. Specify this header to perform the rename +// operation only if the source has not been modified since the specified date and time. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client PathClient) Create(ctx context.Context, filesystem string, pathParameter string, resource PathResourceType, continuation string, mode PathRenameMode, cacheControl string, contentEncoding string, contentLanguage string, contentDisposition string, xMsCacheControl string, xMsContentType string, xMsContentEncoding string, xMsContentLanguage string, xMsContentDisposition string, xMsRenameSource string, xMsLeaseID string, xMsSourceLeaseID string, xMsProperties string, xMsPermissions string, xMsUmask string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsSourceIfMatch string, xMsSourceIfNoneMatch string, xMsSourceIfModifiedSince string, xMsSourceIfUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PathClient.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: xMsLeaseID, + Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: xMsSourceLeaseID, + Constraints: []validation.Constraint{{Target: "xMsSourceLeaseID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsSourceLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.PathClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, filesystem, pathParameter, resource, continuation, mode, cacheControl, contentEncoding, contentLanguage, contentDisposition, xMsCacheControl, xMsContentType, xMsContentEncoding, xMsContentLanguage, xMsContentDisposition, xMsRenameSource, xMsLeaseID, xMsSourceLeaseID, xMsProperties, xMsPermissions, xMsUmask, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsSourceIfMatch, xMsSourceIfNoneMatch, xMsSourceIfModifiedSince, xMsSourceIfUnmodifiedSince, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client PathClient) CreatePreparer(ctx context.Context, filesystem string, pathParameter string, resource PathResourceType, continuation string, mode PathRenameMode, cacheControl string, contentEncoding string, contentLanguage string, contentDisposition string, xMsCacheControl string, xMsContentType string, xMsContentEncoding string, xMsContentLanguage string, xMsContentDisposition string, xMsRenameSource string, xMsLeaseID string, xMsSourceLeaseID string, xMsProperties string, xMsPermissions string, xMsUmask string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsSourceIfMatch string, xMsSourceIfNoneMatch string, xMsSourceIfModifiedSince string, xMsSourceIfUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + "path": autorest.Encode("path", pathParameter), + } + + queryParameters := map[string]interface{}{} + if len(string(resource)) > 0 { + queryParameters["resource"] = autorest.Encode("query", resource) + } + if len(continuation) > 0 { + queryParameters["continuation"] = autorest.Encode("query", continuation) + } + if len(string(mode)) > 0 { + queryParameters["mode"] = autorest.Encode("query", mode) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}/{path}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(cacheControl) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String(cacheControl))) + } + if len(contentEncoding) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Content-Encoding", autorest.String(contentEncoding))) + } + if len(contentLanguage) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Content-Language", autorest.String(contentLanguage))) + } + if len(contentDisposition) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Content-Disposition", autorest.String(contentDisposition))) + } + if len(xMsCacheControl) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-cache-control", autorest.String(xMsCacheControl))) + } + if len(xMsContentType) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-type", autorest.String(xMsContentType))) + } + if len(xMsContentEncoding) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-encoding", autorest.String(xMsContentEncoding))) + } + if len(xMsContentLanguage) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-language", autorest.String(xMsContentLanguage))) + } + if len(xMsContentDisposition) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-disposition", autorest.String(xMsContentDisposition))) + } + if len(xMsRenameSource) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-rename-source", autorest.String(xMsRenameSource))) + } + if len(xMsLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID))) + } + if len(xMsSourceLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-source-lease-id", autorest.String(xMsSourceLeaseID))) + } + if len(xMsProperties) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-properties", autorest.String(xMsProperties))) + } + if len(xMsPermissions) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-permissions", autorest.String(xMsPermissions))) + } + if len(xMsUmask) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-umask", autorest.String(xMsUmask))) + } + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsSourceIfMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-source-if-match", autorest.String(xMsSourceIfMatch))) + } + if len(xMsSourceIfNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-source-if-none-match", autorest.String(xMsSourceIfNoneMatch))) + } + if len(xMsSourceIfModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-source-if-modified-since", autorest.String(xMsSourceIfModifiedSince))) + } + if len(xMsSourceIfUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-source-if-unmodified-since", autorest.String(xMsSourceIfUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + 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 PathClient) CreateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client PathClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete delete the file or directory. This operation supports conditional HTTP requests. For more information, see +// [Specifying Conditional Headers for Blob Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// Parameters: +// filesystem - the filesystem identifier. +// pathParameter - the file or directory path. +// recursive - required and valid only when the resource is a directory. If "true", all paths beneath the +// directory will be deleted. If "false" and the directory is non-empty, an error occurs. +// continuation - optional. When deleting a directory, the number of paths that are deleted with each +// invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is +// returned in this response header. When a continuation token is returned in the response, it must be +// specified in a subsequent invocation of the delete operation to continue deleting the directory. +// xMsLeaseID - the lease ID must be specified if there is an active lease. +// ifMatch - optional. An ETag value. Specify this header to perform the operation only if the resource's ETag +// matches the value specified. The ETag must be specified in quotes. +// ifNoneMatch - optional. An ETag value or the special wildcard ("*") value. Specify this header to perform +// the operation only if the resource's ETag does not match the value specified. The ETag must be specified in +// quotes. +// ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the +// resource has been modified since the specified date and time. +// ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if +// the resource has not been modified since the specified date and time. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client PathClient) Delete(ctx context.Context, filesystem string, pathParameter string, recursive *bool, continuation string, xMsLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PathClient.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: xMsLeaseID, + Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.PathClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, filesystem, pathParameter, recursive, continuation, xMsLeaseID, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PathClient) DeletePreparer(ctx context.Context, filesystem string, pathParameter string, recursive *bool, continuation string, xMsLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + "path": autorest.Encode("path", pathParameter), + } + + queryParameters := map[string]interface{}{} + if recursive != nil { + queryParameters["recursive"] = autorest.Encode("query", *recursive) + } + if len(continuation) > 0 { + queryParameters["continuation"] = autorest.Encode("query", continuation) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}/{path}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(xMsLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID))) + } + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + 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 PathClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PathClient) 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 +} + +// GetProperties get Properties returns all system and user defined properties for a path. Get Status returns all +// system defined properties for a path. Get Access Control List returns the access control list for a path. This +// operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob +// Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// Parameters: +// filesystem - the filesystem identifier. +// pathParameter - the file or directory path. +// action - optional. If the value is "getStatus" only the system defined properties for the path are returned. +// If the value is "getAccessControl" the access control list is returned in the response headers (Hierarchical +// Namespace must be enabled for the account), otherwise the properties are returned. +// upn - optional. Valid only when Hierarchical Namespace is enabled for the account. If "true", the user +// identity values returned in the x-ms-owner, x-ms-group, and x-ms-acl response headers will be transformed +// from Azure Active Directory Object IDs to User Principal Names. If "false", the values will be returned as +// Azure Active Directory Object IDs. The default value is false. Note that group and application Object IDs +// are not translated because they do not have unique friendly names. +// fsAction - required only for check access action. Valid only when Hierarchical Namespace is enabled for the +// account. File system operation read/write/execute in string form, matching regex pattern '[rwx-]{3}' +// xMsLeaseID - optional. If this header is specified, the operation will be performed only if both of the +// following conditions are met: i) the path's lease is currently active and ii) the lease ID specified in the +// request matches that of the path. +// ifMatch - optional. An ETag value. Specify this header to perform the operation only if the resource's ETag +// matches the value specified. The ETag must be specified in quotes. +// ifNoneMatch - optional. An ETag value or the special wildcard ("*") value. Specify this header to perform +// the operation only if the resource's ETag does not match the value specified. The ETag must be specified in +// quotes. +// ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the +// resource has been modified since the specified date and time. +// ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if +// the resource has not been modified since the specified date and time. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client PathClient) GetProperties(ctx context.Context, filesystem string, pathParameter string, action PathGetPropertiesAction, upn *bool, fsAction string, xMsLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PathClient.GetProperties") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: xMsLeaseID, + Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.PathClient", "GetProperties", err.Error()) + } + + req, err := client.GetPropertiesPreparer(ctx, filesystem, pathParameter, action, upn, fsAction, xMsLeaseID, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "GetProperties", nil, "Failure preparing request") + return + } + + resp, err := client.GetPropertiesSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "GetProperties", resp, "Failure sending request") + return + } + + result, err = client.GetPropertiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "GetProperties", resp, "Failure responding to request") + } + + return +} + +// GetPropertiesPreparer prepares the GetProperties request. +func (client PathClient) GetPropertiesPreparer(ctx context.Context, filesystem string, pathParameter string, action PathGetPropertiesAction, upn *bool, fsAction string, xMsLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + "path": autorest.Encode("path", pathParameter), + } + + queryParameters := map[string]interface{}{} + if len(string(action)) > 0 { + queryParameters["action"] = autorest.Encode("query", action) + } + if upn != nil { + queryParameters["upn"] = autorest.Encode("query", *upn) + } + if len(fsAction) > 0 { + queryParameters["fsAction"] = autorest.Encode("query", fsAction) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}/{path}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(xMsLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID))) + } + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPropertiesSender sends the GetProperties request. The method will close the +// http.Response Body if it receives an error. +func (client PathClient) GetPropertiesSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetPropertiesResponder handles the response to the GetProperties request. The method always +// closes the http.Response Body. +func (client PathClient) GetPropertiesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Lease create and manage a lease to restrict write and delete access to the path. This operation supports conditional +// HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// Parameters: +// xMsLeaseAction - there are five lease actions: "acquire", "break", "change", "renew", and "release". Use +// "acquire" and specify the "x-ms-proposed-lease-id" and "x-ms-lease-duration" to acquire a new lease. Use +// "break" to break an existing lease. When a lease is broken, the lease break period is allowed to elapse, +// during which time no lease operation except break and release can be performed on the file. When a lease is +// successfully broken, the response indicates the interval in seconds until a new lease can be acquired. Use +// "change" and specify the current lease ID in "x-ms-lease-id" and the new lease ID in +// "x-ms-proposed-lease-id" to change the lease ID of an active lease. Use "renew" and specify the +// "x-ms-lease-id" to renew an existing lease. Use "release" and specify the "x-ms-lease-id" to release a +// lease. +// filesystem - the filesystem identifier. +// pathParameter - the file or directory path. +// xMsLeaseDuration - the lease duration is required to acquire a lease, and specifies the duration of the +// lease in seconds. The lease duration must be between 15 and 60 seconds or -1 for infinite lease. +// xMsLeaseBreakPeriod - the lease break period duration is optional to break a lease, and specifies the break +// period of the lease in seconds. The lease break duration must be between 0 and 60 seconds. +// xMsLeaseID - required when "x-ms-lease-action" is "renew", "change" or "release". For the renew and release +// actions, this must match the current lease ID. +// xMsProposedLeaseID - required when "x-ms-lease-action" is "acquire" or "change". A lease will be acquired +// with this lease ID if the operation is successful. +// ifMatch - optional. An ETag value. Specify this header to perform the operation only if the resource's ETag +// matches the value specified. The ETag must be specified in quotes. +// ifNoneMatch - optional. An ETag value or the special wildcard ("*") value. Specify this header to perform +// the operation only if the resource's ETag does not match the value specified. The ETag must be specified in +// quotes. +// ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the +// resource has been modified since the specified date and time. +// ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if +// the resource has not been modified since the specified date and time. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client PathClient) Lease(ctx context.Context, xMsLeaseAction PathLeaseAction, filesystem string, pathParameter string, xMsLeaseDuration *int32, xMsLeaseBreakPeriod *int32, xMsLeaseID string, xMsProposedLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PathClient.Lease") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: xMsLeaseID, + Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: xMsProposedLeaseID, + Constraints: []validation.Constraint{{Target: "xMsProposedLeaseID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsProposedLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.PathClient", "Lease", err.Error()) + } + + req, err := client.LeasePreparer(ctx, xMsLeaseAction, filesystem, pathParameter, xMsLeaseDuration, xMsLeaseBreakPeriod, xMsLeaseID, xMsProposedLeaseID, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Lease", nil, "Failure preparing request") + return + } + + resp, err := client.LeaseSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Lease", resp, "Failure sending request") + return + } + + result, err = client.LeaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Lease", resp, "Failure responding to request") + } + + return +} + +// LeasePreparer prepares the Lease request. +func (client PathClient) LeasePreparer(ctx context.Context, xMsLeaseAction PathLeaseAction, filesystem string, pathParameter string, xMsLeaseDuration *int32, xMsLeaseBreakPeriod *int32, xMsLeaseID string, xMsProposedLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + "path": autorest.Encode("path", pathParameter), + } + + queryParameters := map[string]interface{}{} + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}/{path}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("x-ms-lease-action", autorest.String(xMsLeaseAction))) + if xMsLeaseDuration != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-duration", autorest.String(*xMsLeaseDuration))) + } + if xMsLeaseBreakPeriod != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-break-period", autorest.String(*xMsLeaseBreakPeriod))) + } + if len(xMsLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID))) + } + if len(xMsProposedLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-proposed-lease-id", autorest.String(xMsProposedLeaseID))) + } + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// LeaseSender sends the Lease request. The method will close the +// http.Response Body if it receives an error. +func (client PathClient) LeaseSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// LeaseResponder handles the response to the Lease request. The method always +// closes the http.Response Body. +func (client PathClient) LeaseResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// List list filesystem paths and their properties. +// Parameters: +// recursive - if "true", all paths are listed; otherwise, only paths at the root of the filesystem are listed. +// If "directory" is specified, the list will only include paths that share the same root. +// filesystem - the filesystem identifier. The value must start and end with a letter or number and must +// contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All +// letters must be lowercase. The value must have between 3 and 63 characters. +// directory - filters results to paths within the specified directory. An error occurs if the directory does +// not exist. +// continuation - the number of paths returned with each invocation is limited. If the number of paths to be +// returned exceeds this limit, a continuation token is returned in the response header x-ms-continuation. When +// a continuation token is returned in the response, it must be specified in a subsequent invocation of the +// list operation to continue listing the paths. +// maxResults - an optional value that specifies the maximum number of items to return. If omitted or greater +// than 5,000, the response will include up to 5,000 items. +// upn - optional. Valid only when Hierarchical Namespace is enabled for the account. If "true", the user +// identity values returned in the owner and group fields of each list entry will be transformed from Azure +// Active Directory Object IDs to User Principal Names. If "false", the values will be returned as Azure +// Active Directory Object IDs. The default value is false. Note that group and application Object IDs are not +// translated because they do not have unique friendly names. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client PathClient) List(ctx context.Context, recursive bool, filesystem string, directory string, continuation string, maxResults *int32, upn *bool, xMsClientRequestID string, timeout *int32, xMsDate string) (result PathList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PathClient.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: maxResults, + Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.PathClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, recursive, filesystem, directory, continuation, maxResults, upn, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PathClient) ListPreparer(ctx context.Context, recursive bool, filesystem string, directory string, continuation string, maxResults *int32, upn *bool, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + } + + queryParameters := map[string]interface{}{ + "recursive": autorest.Encode("query", recursive), + "resource": autorest.Encode("query", "filesystem"), + } + if len(directory) > 0 { + queryParameters["directory"] = autorest.Encode("query", directory) + } + if len(continuation) > 0 { + queryParameters["continuation"] = autorest.Encode("query", continuation) + } + if maxResults != nil { + queryParameters["maxResults"] = autorest.Encode("query", *maxResults) + } + if upn != nil { + queryParameters["upn"] = autorest.Encode("query", *upn) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + 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 PathClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PathClient) ListResponder(resp *http.Response) (result PathList, 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 read the contents of a file. For read operations, range requests are supported. This operation supports +// conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// Parameters: +// filesystem - the filesystem identifier. +// pathParameter - the file or directory path. +// rangeParameter - the HTTP Range request header specifies one or more byte ranges of the resource to be +// retrieved. +// xMsLeaseID - optional. If this header is specified, the operation will be performed only if both of the +// following conditions are met: i) the path's lease is currently active and ii) the lease ID specified in the +// request matches that of the path. +// xMsRangeGetContentMd5 - optional. When this header is set to "true" and specified together with the Range +// header, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4MB in +// size. If this header is specified without the Range header, the service returns status code 400 (Bad +// Request). If this header is set to true when the range exceeds 4 MB in size, the service returns status code +// 400 (Bad Request). +// ifMatch - optional. An ETag value. Specify this header to perform the operation only if the resource's ETag +// matches the value specified. The ETag must be specified in quotes. +// ifNoneMatch - optional. An ETag value or the special wildcard ("*") value. Specify this header to perform +// the operation only if the resource's ETag does not match the value specified. The ETag must be specified in +// quotes. +// ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the +// resource has been modified since the specified date and time. +// ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if +// the resource has not been modified since the specified date and time. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client PathClient) Read(ctx context.Context, filesystem string, pathParameter string, rangeParameter string, xMsLeaseID string, xMsRangeGetContentMd5 *bool, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PathClient.Read") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: xMsLeaseID, + Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.PathClient", "Read", err.Error()) + } + + req, err := client.ReadPreparer(ctx, filesystem, pathParameter, rangeParameter, xMsLeaseID, xMsRangeGetContentMd5, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Read", nil, "Failure preparing request") + return + } + + resp, err := client.ReadSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Read", resp, "Failure sending request") + return + } + + result, err = client.ReadResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Read", resp, "Failure responding to request") + } + + return +} + +// ReadPreparer prepares the Read request. +func (client PathClient) ReadPreparer(ctx context.Context, filesystem string, pathParameter string, rangeParameter string, xMsLeaseID string, xMsRangeGetContentMd5 *bool, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + "path": autorest.Encode("path", pathParameter), + } + + queryParameters := map[string]interface{}{} + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}/{path}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(rangeParameter) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Range", autorest.String(rangeParameter))) + } + if len(xMsLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID))) + } + if xMsRangeGetContentMd5 != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-range-get-content-md5", autorest.String(xMsRangeGetContentMd5))) + } + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + 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 PathClient) ReadSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ReadResponder handles the response to the Read request. The method always +// closes the http.Response Body. +func (client PathClient) ReadResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusPartialContent)) + result.Response = autorest.Response{Response: resp} + return +} + +// Update uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties +// for a file or directory, or sets access control for a file or directory. Data can only be appended to a file. This +// operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob +// Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// Parameters: +// action - the action must be "append" to upload data to be appended to a file, "flush" to flush previously +// uploaded data to a file, "setProperties" to set the properties of a file or directory, or "setAccessControl" +// to set the owner, group, permissions, or access control list for a file or directory. Note that +// Hierarchical Namespace must be enabled for the account in order to use access control. Also note that the +// Access Control List (ACL) includes permissions for the owner, owning group, and others, so the +// x-ms-permissions and x-ms-acl request headers are mutually exclusive. +// filesystem - the filesystem identifier. +// pathParameter - the file or directory path. +// position - this parameter allows the caller to upload data in parallel and control the order in which it is +// appended to the file. It is required when uploading data to be appended to the file and when flushing +// previously uploaded data to the file. The value must be the position where the data is to be appended. +// Uploaded data is not immediately flushed, or written, to the file. To flush, the previously uploaded data +// must be contiguous, the position parameter must be specified and equal to the length of the file after all +// data has been written, and there must not be a request entity body included with the request. +// retainUncommittedData - valid only for flush operations. If "true", uncommitted data is retained after the +// flush operation completes; otherwise, the uncommitted data is deleted after the flush operation. The +// default is false. Data at offsets less than the specified position are written to the file when flush +// succeeds, but this optional parameter allows data after the flush position to be retained for a future flush +// operation. +// closeParameter - azure Storage Events allow applications to receive notifications when files change. When +// Azure Storage Events are enabled, a file changed event is raised. This event has a property indicating +// whether this is the final change to distinguish the difference between an intermediate flush to a file +// stream and the final close of a file stream. The close query parameter is valid only when the action is +// "flush" and change notifications are enabled. If the value of close is "true" and the flush operation +// completes successfully, the service raises a file change notification with a property indicating that this +// is the final update (the file stream has been closed). If "false" a change notification is raised indicating +// the file has changed. The default is false. This query parameter is set to true by the Hadoop ABFS driver to +// indicate that the file stream has been closed." +// contentLength - required for "Append Data" and "Flush Data". Must be 0 for "Flush Data". Must be the +// length of the request content in bytes for "Append Data". +// contentMD5 - optional. An MD5 hash of the request content. This header is valid on "Append" and "Flush" +// operations. This hash is used to verify the integrity of the request content during transport. When this +// header is specified, the storage service compares the hash of the content that has arrived with this header +// value. If the two hashes do not match, the operation will fail with error code 400 (Bad Request). Note that +// this MD5 hash is not stored with the file. This header is associated with the request content, and not with +// the stored content of the file itself. +// xMsLeaseID - the lease ID must be specified if there is an active lease. +// xMsCacheControl - optional and only valid for flush and set properties operations. The service stores this +// value and includes it in the "Cache-Control" response header for "Read File" operations. +// xMsContentType - optional and only valid for flush and set properties operations. The service stores this +// value and includes it in the "Content-Type" response header for "Read File" operations. +// xMsContentDisposition - optional and only valid for flush and set properties operations. The service stores +// this value and includes it in the "Content-Disposition" response header for "Read File" operations. +// xMsContentEncoding - optional and only valid for flush and set properties operations. The service stores +// this value and includes it in the "Content-Encoding" response header for "Read File" operations. +// xMsContentLanguage - optional and only valid for flush and set properties operations. The service stores +// this value and includes it in the "Content-Language" response header for "Read File" operations. +// xMsContentMd5 - optional and only valid for "Flush & Set Properties" operations. The service stores this +// value and includes it in the "Content-Md5" response header for "Read & Get Properties" operations. If this +// property is not specified on the request, then the property will be cleared for the file. Subsequent calls +// to "Read & Get Properties" will not return this property unless it is explicitly set on that file again. +// xMsProperties - optional. User-defined properties to be stored with the file or directory, in the format of +// a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is a base64 encoded +// string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set. Valid only +// for the setProperties operation. If the file or directory exists, any properties not included in the list +// will be removed. All properties are removed if the header is omitted. To merge new and existing +// properties, first get all existing properties and the current E-Tag, then make a conditional request with +// the E-Tag and include values for all properties. +// xMsOwner - optional and valid only for the setAccessControl operation. Sets the owner of the file or +// directory. +// xMsGroup - optional and valid only for the setAccessControl operation. Sets the owning group of the file or +// directory. +// xMsPermissions - optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX +// access permissions for the file owner, the file owning group, and others. Each class may be granted read, +// write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit +// octal notation (e.g. 0766) are supported. Invalid in conjunction with x-ms-acl. +// xMsACL - optional and valid only for the setAccessControl operation. Sets POSIX access control rights on +// files and directories. The value is a comma-separated list of access control entries that fully replaces the +// existing access control list (ACL). Each access control entry (ACE) consists of a scope, a type, a user or +// group identifier, and permissions in the format "[scope:][type]:[id]:[permissions]". The scope must be +// "default" to indicate the ACE belongs to the default ACL for a directory; otherwise scope is implicit and +// the ACE belongs to the access ACL. There are four ACE types: "user" grants rights to the owner or a named +// user, "group" grants rights to the owning group or a named group, "mask" restricts rights granted to named +// users and the members of groups, and "other" grants rights to all users not found in any of the other +// entries. The user or group identifier is omitted for entries of type "mask" and "other". The user or group +// identifier is also omitted for the owner and owning group. The permission field is a 3-character sequence +// where the first character is 'r' to grant read access, the second character is 'w' to grant write access, +// and the third character is 'x' to grant execute permission. If access is not granted, the '-' character is +// used to denote that the permission is denied. For example, the following ACL grants read, write, and execute +// rights to the file owner and john.doe@contoso, the read right to the owning group, and nothing to everyone +// else: "user::rwx,user:john.doe@contoso:rwx,group::r--,other::---,mask=rwx". Invalid in conjunction with +// x-ms-permissions. +// ifMatch - optional for Flush Data and Set Properties, but invalid for Append Data. An ETag value. Specify +// this header to perform the operation only if the resource's ETag matches the value specified. The ETag must +// be specified in quotes. +// ifNoneMatch - optional for Flush Data and Set Properties, but invalid for Append Data. An ETag value or the +// special wildcard ("*") value. Specify this header to perform the operation only if the resource's ETag does +// not match the value specified. The ETag must be specified in quotes. +// ifModifiedSince - optional for Flush Data and Set Properties, but invalid for Append Data. A date and time +// value. Specify this header to perform the operation only if the resource has been modified since the +// specified date and time. +// ifUnmodifiedSince - optional for Flush Data and Set Properties, but invalid for Append Data. A date and time +// value. Specify this header to perform the operation only if the resource has not been modified since the +// specified date and time. +// requestBody - valid only for append operations. The data to be uploaded and appended to the file. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client PathClient) Update(ctx context.Context, action PathUpdateAction, filesystem string, pathParameter string, position *int64, retainUncommittedData *bool, closeParameter *bool, contentLength *int64, contentMD5 string, xMsLeaseID string, xMsCacheControl string, xMsContentType string, xMsContentDisposition string, xMsContentEncoding string, xMsContentLanguage string, xMsContentMd5 string, xMsProperties string, xMsOwner string, xMsGroup string, xMsPermissions string, xMsACL string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, requestBody io.ReadCloser, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PathClient.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: contentLength, + Constraints: []validation.Constraint{{Target: "contentLength", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "contentLength", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, + {TargetValue: xMsLeaseID, + Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.PathClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, action, filesystem, pathParameter, position, retainUncommittedData, closeParameter, contentLength, contentMD5, xMsLeaseID, xMsCacheControl, xMsContentType, xMsContentDisposition, xMsContentEncoding, xMsContentLanguage, xMsContentMd5, xMsProperties, xMsOwner, xMsGroup, xMsPermissions, xMsACL, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, requestBody, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PathClient) UpdatePreparer(ctx context.Context, action PathUpdateAction, filesystem string, pathParameter string, position *int64, retainUncommittedData *bool, closeParameter *bool, contentLength *int64, contentMD5 string, xMsLeaseID string, xMsCacheControl string, xMsContentType string, xMsContentDisposition string, xMsContentEncoding string, xMsContentLanguage string, xMsContentMd5 string, xMsProperties string, xMsOwner string, xMsGroup string, xMsPermissions string, xMsACL string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, requestBody io.ReadCloser, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + "path": autorest.Encode("path", pathParameter), + } + + queryParameters := map[string]interface{}{ + "action": autorest.Encode("query", action), + } + if position != nil { + queryParameters["position"] = autorest.Encode("query", *position) + } + if retainUncommittedData != nil { + queryParameters["retainUncommittedData"] = autorest.Encode("query", *retainUncommittedData) + } + if closeParameter != nil { + queryParameters["close"] = autorest.Encode("query", *closeParameter) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPatch(), + autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}/{path}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if requestBody != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithFile(requestBody)) + } + if contentLength != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Content-Length", autorest.String(*contentLength))) + } + if len(contentMD5) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Content-MD5", autorest.String(contentMD5))) + } + if len(xMsLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID))) + } + if len(xMsCacheControl) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-cache-control", autorest.String(xMsCacheControl))) + } + if len(xMsContentType) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-type", autorest.String(xMsContentType))) + } + if len(xMsContentDisposition) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-disposition", autorest.String(xMsContentDisposition))) + } + if len(xMsContentEncoding) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-encoding", autorest.String(xMsContentEncoding))) + } + if len(xMsContentLanguage) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-language", autorest.String(xMsContentLanguage))) + } + if len(xMsContentMd5) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-md5", autorest.String(xMsContentMd5))) + } + if len(xMsProperties) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-properties", autorest.String(xMsProperties))) + } + if len(xMsOwner) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-owner", autorest.String(xMsOwner))) + } + if len(xMsGroup) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-group", autorest.String(xMsGroup))) + } + if len(xMsPermissions) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-permissions", autorest.String(xMsPermissions))) + } + if len(xMsACL) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-acl", autorest.String(xMsACL))) + } + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + 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 PathClient) UpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client PathClient) UpdateResponder(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/storage/datalake/2019-10-31/storagedatalake/storagedatalakeapi/interfaces.go b/services/storage/datalake/2019-10-31/storagedatalake/storagedatalakeapi/interfaces.go new file mode 100644 index 000000000000..6bd8834e7051 --- /dev/null +++ b/services/storage/datalake/2019-10-31/storagedatalake/storagedatalakeapi/interfaces.go @@ -0,0 +1,49 @@ +package storagedatalakeapi + +// 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/storage/datalake/2019-10-31/storagedatalake" + "github.com/Azure/go-autorest/autorest" + "io" +) + +// FilesystemClientAPI contains the set of methods on the FilesystemClient type. +type FilesystemClientAPI interface { + Create(ctx context.Context, filesystem string, xMsProperties string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) + Delete(ctx context.Context, filesystem string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) + GetProperties(ctx context.Context, filesystem string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) + List(ctx context.Context, prefix string, continuation string, maxResults *int32, xMsClientRequestID string, timeout *int32, xMsDate string) (result storagedatalake.FilesystemList, err error) + SetProperties(ctx context.Context, filesystem string, xMsProperties string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) +} + +var _ FilesystemClientAPI = (*storagedatalake.FilesystemClient)(nil) + +// PathClientAPI contains the set of methods on the PathClient type. +type PathClientAPI interface { + Create(ctx context.Context, filesystem string, pathParameter string, resource storagedatalake.PathResourceType, continuation string, mode storagedatalake.PathRenameMode, cacheControl string, contentEncoding string, contentLanguage string, contentDisposition string, xMsCacheControl string, xMsContentType string, xMsContentEncoding string, xMsContentLanguage string, xMsContentDisposition string, xMsRenameSource string, xMsLeaseID string, xMsSourceLeaseID string, xMsProperties string, xMsPermissions string, xMsUmask string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsSourceIfMatch string, xMsSourceIfNoneMatch string, xMsSourceIfModifiedSince string, xMsSourceIfUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) + Delete(ctx context.Context, filesystem string, pathParameter string, recursive *bool, continuation string, xMsLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) + GetProperties(ctx context.Context, filesystem string, pathParameter string, action storagedatalake.PathGetPropertiesAction, upn *bool, fsAction string, xMsLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) + Lease(ctx context.Context, xMsLeaseAction storagedatalake.PathLeaseAction, filesystem string, pathParameter string, xMsLeaseDuration *int32, xMsLeaseBreakPeriod *int32, xMsLeaseID string, xMsProposedLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) + List(ctx context.Context, recursive bool, filesystem string, directory string, continuation string, maxResults *int32, upn *bool, xMsClientRequestID string, timeout *int32, xMsDate string) (result storagedatalake.PathList, err error) + Read(ctx context.Context, filesystem string, pathParameter string, rangeParameter string, xMsLeaseID string, xMsRangeGetContentMd5 *bool, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result storagedatalake.ReadCloser, err error) + Update(ctx context.Context, action storagedatalake.PathUpdateAction, filesystem string, pathParameter string, position *int64, retainUncommittedData *bool, closeParameter *bool, contentLength *int64, contentMD5 string, xMsLeaseID string, xMsCacheControl string, xMsContentType string, xMsContentDisposition string, xMsContentEncoding string, xMsContentLanguage string, xMsContentMd5 string, xMsProperties string, xMsOwner string, xMsGroup string, xMsPermissions string, xMsACL string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, requestBody io.ReadCloser, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) +} + +var _ PathClientAPI = (*storagedatalake.PathClient)(nil) diff --git a/services/storage/datalake/2019-10-31/storagedatalake/version.go b/services/storage/datalake/2019-10-31/storagedatalake/version.go new file mode 100644 index 000000000000..78541e4015c5 --- /dev/null +++ b/services/storage/datalake/2019-10-31/storagedatalake/version.go @@ -0,0 +1,30 @@ +package storagedatalake + +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.Number + " storagedatalake/2019-10-31" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/storage/mgmt/2019-04-01/storage/accounts.go b/services/storage/mgmt/2019-04-01/storage/accounts.go index 86bb049aaec9..4ca8db150dec 100644 --- a/services/storage/mgmt/2019-04-01/storage/accounts.go +++ b/services/storage/mgmt/2019-04-01/storage/accounts.go @@ -518,13 +518,13 @@ func (client AccountsClient) GetPropertiesResponder(resp *http.Response) (result // List lists all the storage accounts available under the subscription. Note that storage keys are not returned; use // the ListKeys operation for this. -func (client AccountsClient) List(ctx context.Context) (result AccountListResult, err error) { +func (client AccountsClient) List(ctx context.Context) (result AccountListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.List") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.alr.Response.Response != nil { + sc = result.alr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -535,6 +535,7 @@ func (client AccountsClient) List(ctx context.Context) (result AccountListResult return result, validation.NewError("storage.AccountsClient", "List", err.Error()) } + result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "List", nil, "Failure preparing request") @@ -543,12 +544,12 @@ func (client AccountsClient) List(ctx context.Context) (result AccountListResult resp, err := client.ListSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.alr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "storage.AccountsClient", "List", resp, "Failure sending request") return } - result, err = client.ListResponder(resp) + result.alr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "List", resp, "Failure responding to request") } @@ -595,6 +596,43 @@ func (client AccountsClient) ListResponder(resp *http.Response) (result AccountL 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, "storage.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, "storage.AccountsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.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) (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) + return +} + // ListAccountSAS list SAS credentials of a storage account. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case diff --git a/services/storage/mgmt/2019-04-01/storage/models.go b/services/storage/mgmt/2019-04-01/storage/models.go index 4fed29dbe280..8cba20da6e24 100644 --- a/services/storage/mgmt/2019-04-01/storage/models.go +++ b/services/storage/mgmt/2019-04-01/storage/models.go @@ -272,6 +272,21 @@ func PossibleKindValues() []Kind { return []Kind{BlobStorage, BlockBlobStorage, FileStorage, Storage, StorageV2} } +// LargeFileSharesState enumerates the values for large file shares state. +type LargeFileSharesState string + +const ( + // Disabled ... + Disabled LargeFileSharesState = "Disabled" + // Enabled ... + Enabled LargeFileSharesState = "Enabled" +) + +// PossibleLargeFileSharesStateValues returns an array of possible values for the LargeFileSharesState const type. +func PossibleLargeFileSharesStateValues() []LargeFileSharesState { + return []LargeFileSharesState{Disabled, Enabled} +} + // LeaseDuration enumerates the values for lease duration. type LeaseDuration string @@ -832,6 +847,145 @@ type AccountListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; Gets the list of storage accounts and their properties. Value *[]Account `json:"value,omitempty"` + // NextLink - READ-ONLY; Request URL that can be used to query next page of storage accounts. Returned when total number of requested storage accounts exceed maximum page size. + 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 properties of the storage account. @@ -872,6 +1026,8 @@ type AccountProperties struct { GeoReplicationStats *GeoReplicationStats `json:"geoReplicationStats,omitempty"` // FailoverInProgress - READ-ONLY; If the failover is in progress, the value will be true, otherwise, it will be null. FailoverInProgress *bool `json:"failoverInProgress,omitempty"` + // LargeFileSharesState - Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. Possible values include: 'Disabled', 'Enabled' + LargeFileSharesState LargeFileSharesState `json:"largeFileSharesState,omitempty"` } // AccountPropertiesCreateParameters the parameters used to create the storage account. @@ -890,6 +1046,8 @@ type AccountPropertiesCreateParameters struct { EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` // IsHnsEnabled - Account HierarchicalNamespace enabled if sets to true. IsHnsEnabled *bool `json:"isHnsEnabled,omitempty"` + // LargeFileSharesState - Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. Possible values include: 'Disabled', 'Enabled' + LargeFileSharesState LargeFileSharesState `json:"largeFileSharesState,omitempty"` } // AccountPropertiesUpdateParameters the parameters used when updating a storage account. @@ -906,6 +1064,8 @@ type AccountPropertiesUpdateParameters struct { EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` // NetworkRuleSet - Network rule set NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` + // LargeFileSharesState - Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. Possible values include: 'Disabled', 'Enabled' + LargeFileSharesState LargeFileSharesState `json:"largeFileSharesState,omitempty"` } // AccountRegenerateKeyParameters the parameters used to regenerate the storage account key. @@ -1274,6 +1434,14 @@ type BlobServicePropertiesProperties struct { DeleteRetentionPolicy *DeleteRetentionPolicy `json:"deleteRetentionPolicy,omitempty"` // AutomaticSnapshotPolicyEnabled - Automatic Snapshot is enabled if set to true. AutomaticSnapshotPolicyEnabled *bool `json:"automaticSnapshotPolicyEnabled,omitempty"` + // ChangeFeed - The blob service properties for change feed events. + ChangeFeed *ChangeFeed `json:"changeFeed,omitempty"` +} + +// ChangeFeed the blob service properties for change feed events. +type ChangeFeed struct { + // Enabled - Indicates whether change feed event logging is enabled for the Blob service. + Enabled *bool `json:"enabled,omitempty"` } // CheckNameAvailabilityResult the CheckNameAvailability operation response. @@ -1287,6 +1455,23 @@ type CheckNameAvailabilityResult struct { Message *string `json:"message,omitempty"` } +// CloudError an error response from the Storage service. +type CloudError struct { + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the Storage 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"` +} + // ContainerProperties the properties of a container. type ContainerProperties struct { // PublicAccess - Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'PublicAccessContainer', 'PublicAccessBlob', 'PublicAccessNone' @@ -1426,23 +1611,6 @@ type Endpoints struct { Dfs *string `json:"dfs,omitempty"` } -// ErrorResponse an error response from the Storage service. -type ErrorResponse struct { - Error *ErrorResponseBody `json:"error,omitempty"` -} - -// ErrorResponseBody an error response from the Storage service. -type ErrorResponseBody 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 *[]ErrorResponseBody `json:"details,omitempty"` -} - // FileServiceItems ... type FileServiceItems struct { autorest.Response `json:"-"` diff --git a/services/storage/mgmt/2019-04-01/storage/storageapi/interfaces.go b/services/storage/mgmt/2019-04-01/storage/storageapi/interfaces.go index f4af674cd8bd..2b70fbf217e2 100644 --- a/services/storage/mgmt/2019-04-01/storage/storageapi/interfaces.go +++ b/services/storage/mgmt/2019-04-01/storage/storageapi/interfaces.go @@ -44,7 +44,7 @@ type AccountsClientAPI interface { Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) Failover(ctx context.Context, resourceGroupName string, accountName string) (result storage.AccountsFailoverFuture, err error) GetProperties(ctx context.Context, resourceGroupName string, accountName string, expand storage.AccountExpand) (result storage.Account, err error) - List(ctx context.Context) (result storage.AccountListResult, err error) + List(ctx context.Context) (result storage.AccountListResultPage, err error) ListAccountSAS(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountSasParameters) (result storage.ListAccountSasResponse, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result storage.AccountListResult, err error) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result storage.AccountListKeysResult, err error) diff --git a/storage/blockblob.go b/storage/blockblob.go index c9c62d799acf..bd19eccc41e7 100644 --- a/storage/blockblob.go +++ b/storage/blockblob.go @@ -197,6 +197,47 @@ func (b *Blob) PutBlockWithLength(blockID string, size uint64, blob io.Reader, o return b.respondCreation(resp, BlobTypeBlock) } +// PutBlockFromURLOptions includes the options for a put block from URL operation +type PutBlockFromURLOptions struct { + PutBlockOptions + + SourceContentMD5 string `header:"x-ms-source-content-md5"` + SourceContentCRC64 string `header:"x-ms-source-content-crc64"` +} + +// PutBlockFromURL copy data of exactly specified size from specified URL to +// the block blob with given ID. It is an alternative to PutBlocks where data +// comes from a remote URL and the offset and length is known in advance. +// +// The API rejects requests with size > 100 MiB (but this limit is not +// checked by the SDK). +// +// See https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url +func (b *Blob) PutBlockFromURL(blockID string, blobURL string, offset int64, size uint64, options *PutBlockFromURLOptions) error { + query := url.Values{ + "comp": {"block"}, + "blockid": {blockID}, + } + headers := b.Container.bsc.client.getStandardHeaders() + // The value of this header must be set to zero. + // When the length is not zero, the operation will fail with the status code 400 (Bad Request). + headers["Content-Length"] = "0" + headers["x-ms-copy-source"] = blobURL + headers["x-ms-source-range"] = fmt.Sprintf("bytes=%d-%d", offset, uint64(offset)+size-1) + + if options != nil { + query = addTimeout(query, options.Timeout) + headers = mergeHeaders(headers, headersFromStruct(*options)) + } + uri := b.Container.bsc.client.getEndpoint(blobServiceName, b.buildPath(), query) + + resp, err := b.Container.bsc.client.exec(http.MethodPut, uri, headers, nil, b.Container.bsc.auth) + if err != nil { + return err + } + return b.respondCreation(resp, BlobTypeBlock) +} + // PutBlockListOptions includes the options for a put block list operation type PutBlockListOptions struct { Timeout uint diff --git a/storage/blockblob_test.go b/storage/blockblob_test.go index d9f86e8aa335..78428083fc89 100644 --- a/storage/blockblob_test.go +++ b/storage/blockblob_test.go @@ -164,3 +164,18 @@ func (s *BlockBlobSuite) TestPutBlockWithLengthUsingLimitReader(c *chk.C) { lr := io.LimitReader(bytes.NewReader(data), 256) c.Assert(b.PutBlockWithLength("0000", 256, lr, nil), chk.IsNil) } + +func (s *BlockBlobSuite) TestPutBlockFromURL(c *chk.C) { + cli := getBlobClient(c) + rec := cli.client.appendRecorder(c) + defer rec.Stop() + + cnt := cli.GetContainerReference(containerName(c)) + c.Assert(cnt.Create(nil), chk.IsNil) + defer cnt.Delete(nil) + + srcBlob := cnt.GetBlobReference(blobName(c, "src")) + dstBlob := cnt.GetBlobReference(blobName(c, "dst")) + + c.Assert(dstBlob.PutBlockFromURL("00000", srcBlob.GetURL(), 0, 64, nil), chk.IsNil) +} diff --git a/storage/recordings/BlockBlobSuite/TestPutBlockFromURL.yaml b/storage/recordings/BlockBlobSuite/TestPutBlockFromURL.yaml new file mode 100644 index 000000000000..485906f18ddc --- /dev/null +++ b/storage/recordings/BlockBlobSuite/TestPutBlockFromURL.yaml @@ -0,0 +1,109 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Authorization: + - SharedKey golangrocksonazure:nsKCUorZjbd/ivMin+PQBvSOsc8D+0X0bCyH0dNXmzo= + User-Agent: + - Go/go1.12.4 (amd64-windows) azure-storage-go/latest api-version/2018-03-28 + blob + x-ms-date: + - Tue, 28 May 2019 22:35:39 GMT + x-ms-version: + - "2018-03-28" + url: https://golangrocksonazure.blob.core.windows.net/cnt-34blockblobsuitetestputblock?restype=container + method: PUT + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Tue, 28 May 2019 22:35:39 GMT + Etag: + - '"0x8D6E3BCCF55739C"' + Last-Modified: + - Tue, 28 May 2019 22:35:39 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 37814647-e01e-00b7-5ea5-15d5a7000000 + X-Ms-Version: + - "2018-03-28" + status: 201 Created + code: 201 + duration: "" +- request: + form: {} + headers: + Authorization: + - SharedKey golangrocksonazure:X50yEgeJDXbwNgJWmj0PfADqm/HUAXY24Q2afTFnRFM= + Content-Length: + - "0" + User-Agent: + - Go/go1.12.4 (amd64-windows) azure-storage-go/latest api-version/2018-03-28 + blob + x-ms-date: + - Tue, 28 May 2019 22:35:39 GMT + x-ms-version: + - "2018-03-28" + x-ms-copy-source: + - https://golangrocksonazure.blob.core.windows.net/cnt-34blockblobsuitetestputblock/blob/src34blockblobsuitetestputblockfromurl + x-ms-source-range: + - bytes=0-63 + url: https://golangrocksonazure.blob.core.windows.net/cnt-34blockblobsuitetestputblock/blob/dst34blockblobsuitetestputblockfromurl?blockid=00000&comp=block + method: PUT + response: + body: "" + headers: + Content-Length: + - "0" + Content-Md5: + - jaHQUBZ1PVeS/42MY6S64Q== + Date: + - Tue, 28 May 2019 22:35:39 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 37814660-e01e-00b7-75a5-15d5a7000000 + X-Ms-Request-Server-Encrypted: + - "true" + X-Ms-Version: + - "2018-03-28" + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Authorization: + - SharedKey golangrocksonazure:3YCnSCMqQKCADhrDjpS1vkI+BPfjqFVfh1gjAJM1ofc= + User-Agent: + - Go/go1.12.4 (amd64-windows) azure-storage-go/latest api-version/2018-03-28 + blob + x-ms-date: + - Tue, 28 May 2019 22:35:39 GMT + x-ms-version: + - "2018-03-28" + url: https://golangrocksonazure.blob.core.windows.net/cnt-53blockblobsuitetestputblock?restype=container + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Tue, 28 May 2019 22:35:39 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 37814672-e01e-00b7-04a5-15d5a7000000 + X-Ms-Version: + - "2018-03-28" + status: 202 Accepted + code: 202 + duration: "" diff --git a/swagger_to_sdk_config.json b/swagger_to_sdk_config.json index 572898ac481a..cb18404b1b0b 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.136", + "use": "@microsoft.azure/autorest.go@~2.1.137", "go": "", "verbose": "", "sdkrel:go-sdk-folder": ".", diff --git a/tools/major-updater/cmd/afterscripts.go b/tools/major-updater/cmd/afterscripts.go index 22983be96d5d..7aa2e9cf4c68 100644 --- a/tools/major-updater/cmd/afterscripts.go +++ b/tools/major-updater/cmd/afterscripts.go @@ -15,10 +15,13 @@ package cmd import ( + "encoding/json" "fmt" + "io/ioutil" + "os" "os/exec" - "path" "path/filepath" + "strings" "github.com/spf13/cobra" ) @@ -43,35 +46,48 @@ func init() { } func theAfterscriptsCommand(sdk string) error { - println("Generating profiles...") + println("Executing after scripts...") absolutePathOfSDK, err := filepath.Abs(sdk) if err != nil { return fmt.Errorf("failed to get the directory of SDK: %v", err) } - absolutePathOfProfiles := path.Join(absolutePathOfSDK, "profiles") - err = changeDir(absolutePathOfProfiles) + // read options from config file + file, err := os.Open(filepath.Join(absolutePathOfSDK, configFileName)) if err != nil { - return fmt.Errorf("failed to enter directory for profiles: %v", err) + return fmt.Errorf("failed to open config file %s: %v", configFileName, err) } - c := exec.Command("go", "generate", "./...") - err = c.Run() + afterscripts, err := expandAfterScripts(file) if err != nil { - return fmt.Errorf("Error occurs when generating profiles: %v", err) + return err } - vprintln("Formatting the whole SDK folder...") err = changeDir(absolutePathOfSDK) if err != nil { - return fmt.Errorf("failed to enter directory for SDK: %v", err) - } - c = exec.Command("gofmt", "-w", "./profiles/") - err = c.Run() - if err != nil { - return fmt.Errorf("Error occurs when formatting profiles: %v", err) + return fmt.Errorf("failed to enter directory for profiles: %v", err) } - c = exec.Command("gofmt", "-w", "./services/") - err = c.Run() - if err != nil { - return fmt.Errorf("Error occurs when formatting the SDK folder: %v", err) + for _, script := range afterscripts { + args := strings.Split(script, " ") + c := exec.Command(args[0], args[1:]...) + vprintf("Invoke after script %v\n", c.Args) + if output, err := c.CombinedOutput(); err != nil { + return fmt.Errorf("failed to execute after script %s, messages %s: %v", script, string(output), err) + } } return nil } + +func expandAfterScripts(file *os.File) ([]string, error) { + b, _ := ioutil.ReadAll(file) + var config map[string]*json.RawMessage + if err := json.Unmarshal(b, &config); err != nil { + return nil, fmt.Errorf("failed to resolve config file: %v", err) + } + var meta map[string]*json.RawMessage + if err := json.Unmarshal(*config["meta"], &meta); err != nil { + return nil, fmt.Errorf("failed to resolve config file: %v", err) + } + var afterscripts []string + if err := json.Unmarshal(*meta["after_scripts"], &afterscripts); err != nil { + return nil, fmt.Errorf("failed to resolve config file: %v", err) + } + return afterscripts, nil +} diff --git a/tools/major-updater/cmd/autorest.go b/tools/major-updater/cmd/autorest.go index 3926765660c9..ad4781d563e2 100644 --- a/tools/major-updater/cmd/autorest.go +++ b/tools/major-updater/cmd/autorest.go @@ -15,7 +15,9 @@ package cmd import ( + "encoding/json" "fmt" + "io/ioutil" "os" "path/filepath" @@ -38,6 +40,10 @@ var autorestCmd = &cobra.Command{ }, } +const ( + configFileName = "swagger_to_sdk_config.json" +) + func init() { rootCmd.AddCommand(autorestCmd) } @@ -57,6 +63,15 @@ func theAutorestCommand(sdk, spec string) error { if err != nil { return fmt.Errorf("failed to get the directory of specs: %v", err) } + // read options from config file + file, err := os.Open(filepath.Join(absolutePathOfSDK, configFileName)) + if err != nil { + return fmt.Errorf("failed to open config file %s: %v", configFileName, err) + } + options, err := expandAutorestOptions(file, absolutePathOfSDK) + if err != nil { + return err + } // get every single readme.md file in the directory files, err := selectFilesWithName(absolutePathOfSpec, readme) vprintf("Found %d readme.md files\n", len(files)) @@ -67,8 +82,8 @@ func theAutorestCommand(sdk, spec string) error { } for _, file := range files { w := work{ - filename: file, - sdkFolder: absolutePathOfSDK, + filename: file, + options: options, } jobs <- w } @@ -79,3 +94,38 @@ func theAutorestCommand(sdk, spec string) error { vprintln("autorest finished") return nil } + +const ( + optionPattern = "--%s=%s" + flagPattern = "--%s" +) + +func expandAutorestOptions(file *os.File, absolutePathOfSDK string) ([]string, error) { + b, _ := ioutil.ReadAll(file) + var config map[string]*json.RawMessage + if err := json.Unmarshal(b, &config); err != nil { + return nil, fmt.Errorf("failed to resolve config file: %v", err) + } + var meta map[string]*json.RawMessage + if err := json.Unmarshal(*config["meta"], &meta); err != nil { + return nil, fmt.Errorf("failed to resolve config file: %v", err) + } + var autorestOptions map[string]*json.RawMessage + if err := json.Unmarshal(*meta["autorest_options"], &autorestOptions); err != nil { + return nil, fmt.Errorf("failed to resolve config file: %v", err) + } + options := make([]string, 6) + for k, v := range autorestOptions { + if k == "sdkrel:go-sdk-folder" { + continue + } + v := string(*v) + if v == "\"\"" { + options = append(options, fmt.Sprintf(flagPattern, k)) + } else { + options = append(options, fmt.Sprintf(optionPattern, k, v)) + } + } + options = append(options, fmt.Sprintf(optionPattern, "go-sdk-folder", absolutePathOfSDK)) + return options, nil +} diff --git a/tools/major-updater/cmd/work.go b/tools/major-updater/cmd/work.go index 060f56fffb20..c60729c06744 100644 --- a/tools/major-updater/cmd/work.go +++ b/tools/major-updater/cmd/work.go @@ -20,29 +20,24 @@ import ( "os" "os/exec" "path/filepath" - "strings" "time" ) -const ( - autorestArgsPattern = "--use=@microsoft.azure/autorest.go@~2.1.99 %s --go --multiapi --go-sdk-folder=%s --use-onever" -) - type work struct { - filename string - sdkFolder string + filename string + options []string } -func autorestCommand(file string, sdk string) *exec.Cmd { - autorestArgs := fmt.Sprintf(autorestArgsPattern, file, sdk) - c := exec.Command("autorest", strings.Split(autorestArgs, " ")...) +func autorestCommand(file string, options []string) *exec.Cmd { + options = append(options, file) + c := exec.Command("autorest", options...) return c } func worker(id int, jobs <-chan work, results chan<- error) { for work := range jobs { start := time.Now() - c := autorestCommand(work.filename, work.sdkFolder) + c := autorestCommand(work.filename, work.options) vprintf("worker %d is starting on file %s\nparameters: %v\n", id, work.filename, c.Args) output, err := c.CombinedOutput() if err == nil { diff --git a/version/version.go b/version/version.go index 1b05a73a1c70..b94494e642c4 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 = "v33.4.0" +const Number = "v34.0.0"